On generating efficient procedural codes from Prolog linear recursive programs with a list structure

Young Kwang Nam, Lawrence J. Henschen · 2002

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.>

Read the paper · More papers on PaperTik