Improving Deterministic Computations in Lazy Functional Logic Languages.
Rafael Caballero, Francisco J. López-Fraguas · Journal of functional and logic programming · 2003
The detection of deterministic computations at run-time can be used to introduce dynamic cuts pruning the search space and thus increasing the efficiency of functional logic systems. This idea was introduced in an early work of R. Loogen and S. Winkler. However the proposal of these authors cannot be used in current implementations because it did not consider non-deterministic functions and was not oriented to the demand driven strategy. Our work adapts and extends the technique, showing both how to deal with non-deterministic computations, and how definitional trees can be employed to locate the places where the cuts will be introduced. An implementation based on a Prolog-translation is proposed, making the technique easy to implement in current systems generating Prolog code. Some experiments showing the effectiveness of the cut are presented.