Author: Uri Blass
Date: 01:22:27 09/15/03
Go up one level in this thread
On September 15, 2003 at 03:40:39, Omid David Tabibi wrote: >On September 15, 2003 at 00:04:21, Uri Blass wrote: > >>Can programmers write a program that take a code with recursive functions and >>translate it to a code without recursive functions that does the same thing? >> >>Do not answer me that the compiler does it by translating it to assembler >>because the translation should be done to a program in the same computer >>language so a C source should be translated to another C source. >> > >The problem has nothing do with C, since it is an algorithmic issue. Translating >a tail-recursion into an iterative version is usually easy (actually, in some >cases tail-recursions are already translated into iterative versions by the >compiler). But non-tail-recursions are quite hard to translate into iterative >versions. It is especially hard to find a non-recursive implementation for DFS. what is tail recursion and what is DFS? I thought about the option to translate my alphabeta to a non recursive version. I guess that it is done by the compiler but today I cannot call the value of a varaible from a previous iteration of alpha beta without saving it in a global array first and I think that it is a waste of space. Maybe it is an easy task but I did not think exactly how to do it and prefered to do other things in the program. I do it in my perft function but it is simpler because there is a fixed number of iterations. In my alpha beta I may extend more than 1 ply in some situations and I do not know if it can cause a problems in the translation to non recursive function. I guess that it can be done by a loop but I still did not think exactly how to do it so I have no idea how much time it takes to change it. Uri
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.