Variables' lifetime, mode declarations and clause indexing in Prolog implementations
Andrea Domenici, Beatrice Lazzerini · CINECA IRIS Institutial research information system (University of Pisa) · 1988
This paper analyzes some time- and space-critical characteristics of Prolog implementations. Clause selection and term unification are the most time-consuming operations in the execution of Prolog programs. The selection of clauses to match a goal can be speeded up by indexing clauses on a more detailed basis than only head predicate and arity. On the other hand, the time required to unify terms can be shortened if the mode (instantiated or not instantiated) in which the predicate arguments will be used at run-time is known. Memory requirements can be improved by reclaiming run-time data structures as early as possible. Finally, two representations of sructured terms, i.e., Structure Sharing and Non-Structure Sharing, are compared.