Abstract

The authors present an algorithm for transforming a linear recursive program in Prolog which contains the list data structure as a term of the predicate into an iterative program using a while loop in a procedural language like Pascal. This algorithm obtains the same result as Prolog without unification and backtracking. In this algorithm, the recursive programs are classified into two cases, the determined programs and the undetermined programs, according to the conditions of the variables in the program. The unification process is transformed into the set of assignment and conditional statements by analyzing the variables of the rules in the program. Backtracking is accomplished by a traversal of a tree whose nodes contain instantiated predicates. >

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call