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.
Variables' lifetime, mode declarations and clause indexing in Prolog implementations
DOMENICI, ANDREA;LAZZERINI, BEATRICE
1988-01-01
Abstract
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.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.