Section "trailing"

The execution environment of Dogelog Player provides the state to drive a Prolog engine that is based on an iterative execution of either call ports of new goals, or if there was a failure redo ports of goals that were successful and left a choice point. The engine state responsible for this execution is the current continuation and the current choice point.

To deal with variable binding during unification the current trail is used. Choice points can keep pointers into the trail and allow to undo sections of variable binding. Because variables might become irrelevant during execution, the Prolog specific garbage collection called environment trimming aims at compacting the trail and thus saving memory.

The cross-compiler and runtime generate the following objects and calls:
new Choice(H, D, A, M): host language
Create a choice point with handler H, data D, index A and trail mark M.
get_cont(): host language
The function returns the current continuation.
cont(C): host language
The function sets the current continuation to C.
more(C): host language
The function sets the current choice point to C.
get_mark(): host language
The function returns the current trail.
unbind(M): host language
The function undoes variable binding up to the given trail mark.


Use Privacy (c) 2005-2026 XLOG Technologies AG