...prompts
There is one additional prompt, ``ll;SPMgt; '', for LISP light (see [Sin95])
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...others
defun to define COMMON LISP functions used by macro, proto-class and indi-class for defining ORF classes, ll and llp to define LISP light functions and predicates accessible by RELFUN, and mode and dfmode for mode declarations currently used for the transformation of RELFUN operators into LISP light functions.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...types
In addition to types, untype also handles ORF clauses which are not described in this paper.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...type/type1
type1(tterm) is the short form of type(_, tterm) and is expanded by unmacro.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...untype:
In our current implementation, RELFUN does not handle ``,''-expressions (see section 3.1.7) when using PROLOG syntax. In this paper, expressions like `(s _x ,(p _y)) and (hn (q _x ,(p _y))) are shown as s[X, p(Y)] and q(X, p(Y)). in PROLOG-like syntax.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...version
The name new-once is used for historical reasons, as well as its transformation into another new-once and not into a new-once*.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...inline
Inline expandable lambda expressions are transformed by uncomma (see section 3.1.7).
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...rule:
If performed indiscriminately, footening prevents the last-call optimization in the WAM (here, parental cannot just jump to, or execute, cares since it still has to put_constant true). In order to avoid this, footening should, in practice, only be performed on Hornish rules for which it cannot be assured that the last premise (here, cares) on success will itself return true. If, however, this `true-return' property can be established for a Hornish rule, it should be `foot-optimized', i.e. transformed into a footed rule reusing the last (relational) premise as its (functional) foot (here obtaining parental(P) :-& cares(P,child[P,Q])). While in general this requires global analysis, for the important special case of tail-recursion optimization the analysis can be confined to individual procedures. Benchmark results for the latter case can be found in [Hei91].
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...(db
The db tag is omitted in the current implementation
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...GAMA
This chapter is completely adopted from chapter 7, ``Integrating Abstract Machines: The GAMA'' in [Sin95].
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...functions
The GAMA is implemented in COMMON LISP; in order to avoid name conflicts, function names are preceded by a prefix `mod.' indicating that a function belongs to module mod, here gmem (we did not use the COMMON LISP package system).
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...arguments
The available types are: NAT for natural numbers, CONST for constants, FUNCTOR for WAM functor specifications of the form (name arity), FUNCTION for COMMON LISP functions (e.g. used for builtins), LABEL for labels, VARIABLE for global variables, HASHTABLE for hash tables (used in the WAM switch instructions), and X for arbitrary arguments. Additional types can be defined with gasm.deftype.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...nil.
In the interpreter a false is produced, which generates a failure if used as a body premise.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...calls.
X1 will not be changed.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Harold Boley (boley@informatik.uni-kl.de)