Section "internals"

The Dogelog player keeps the number of Albufeira instructions low. It provides low-level control flow instructions via built-ins. The Dogelog player allows to register deterministic and non-deterministic built-ins in the form of host language functions. A non-deterministic built-in creates a choice point as a side effect, registering another host language function.

The below built-ins are internal only and do not check their arguments. The redo argument should be a variable. The sequence goal list is just a Prolog list of Prolog terms each representing a goal. The alternative variant list consists of variant/1 pairs, the first component of the pair a redo option and the component a sequence goal list.

The following built-ins belong to the Albufeira instructions:

'$CUT'(R): internal only
The built-in removes the choice points up to R and succeeds.
'$MARK'(R): Internal only
The built-in binds R the top choice point.
'$SEQ'(O, L): internal only
If the Prolog term O has the form just(R) bind R the top choice point. Otherwise, do nothing. The built-in then sequentially adds the goals L to the continuation.
'$ALT'(L): internal only
The built-in alternatively adds the variants L to the continuation and succeeds.
'$YIELD'(R): Internal only
The built-in stops the interpreter loop with return value R.

Kommentare