Abstract
The authors present an algorithm for transforming a linear recursive program with a list constructor in Prolog, whose rules are mutually exclusive to each other, into an iterative program using a while loop without backtracking and unification. In this algorithm the authors decide whether a given program is mutually exclusive or not by a procedure which uses functional dependencies supplied by the user. Once it is determined to be a mutually exclusive program, the authors compile the given program into Pascal-like code which executes in order n-squared rather than traversing a whole tree as the usual Prolog interpreter does. The unification process is transformed into a set of assignments and conditional statements by analyzing the variables of the rules in the program. Backtracking is completely removed from execution. >
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have