Section "instruction"
Depending whether an instruction is found in the head or in the
body, the behaviour of the in-struction is differently. In the
body, instructions do build a Prolog terms. In the head,
instructions try to unify Prolog terms and they might fall back
into the Prolog building mode. Instruction streams are represented
as host language objects.
In build mode, to allow clause sets inlining, the instructions
the functor of a callable is allowed to be an anonymous predicate.
The corresponding goal is solved by directly branching into the
clause set of the anonymous predicate. Further the functor can be
a cache node which speeds up the lookup of a predicate indicator.
The cross-compiler or runtime generate the following objects:
- new Place(W), W =-1: (host language)
- In building mode creates a fresh variable. In unify mode does
nothing.
- new Place(V), V < -1: (host language)
- In building mode creates a fresh variable for the display at
index W where W = (-V)-2. In unify assigns the unify argument to
the display at index W.
- new Place(W), W >= 0: (host language)
- In building mode reuses the display at index W. In unify mode
unifies the unify argument with the display at index W.
- new Skeleton(F, A): (host language)
- In building mode creates a new undefined compound with functor
F and arguments L, and opens a new arguments context. In unify
mode defers the creation and performs initial specialized
compound unification, with the unify argument.
- new Cache(F): (host language)
- The constructor creates a cache node for the functor F.
- otherwise C:
- In building mode gives the embedded constant C, which is
allowed to be a ground term and need not be atomic only. In
unify mode performs unification of the embedded con-stant C with
the unify argument.
Kommentare