| OCR Text |
Show Although the calculation of Fibonacci numbers is a toy example, it shows that the memoing may significantly improve the performance of programs. Optimizations using memoing are especially attractive in applicative functional environments [89]. 3.3.5 Backtracking Backtracking is an important programming technique. It is used to return a part of the process state to its state in the past. Backtracking is fundamental in search and in logic programming [8, 79]. Since it is not known in advance which part of the process will be changed in the future, the entire state relevant for backtracking is usually saved at each step of backtracking. This causes considerable waste in space and time, if only a small part of the process is changed. The history records exactly the information needed to backtrack. The history cache, described in Section 5.4, can compact the amount of backtracking information to the theoretical minimum. This can be significantly less than the entire state. The support for reverse execution in hardware can thus significantly speed up the execution of-all algorithms with extensive use of backtracking and programs using logic programming techniques. 3.3.6 The Competition of Algorithms For some problems, the most efficient algorithms to solve them do not depend only on the problem but also on input values. Different algorithms may perform with varying success on different inputs. For these problems, many algorithms for special cases are developed. Searching for the root of a polynomial is one such problem. Often it is not known in advance which algorithm is the best for a particular instance of the problem. Therefore, it seems plausible to apply to the same problem simultaneously several processes with different algorithms [77]. The 59 |