Availability:built-in
- alternative
- Value is unified with an integer reference to the local stack frame in which execution is resumed if the goal associated with Frame fails. Fails if the frame has no alternative frame.
- has_alternatives
- Value is unified with
true
if Frame still is a candidate for backtracking;false
otherwise. - goal
- Value is unified with the goal associated with Frame.
If the definition module of the active predicate is not the calling
context, the goal is represented as
<module>:<goal>
. Do not instantiate variables in this goal unless you know what you are doing! Note that the returned term may contain references to the frame and should be discarded before the frame terminates.248The returned term is actually an illegal Prolog term that may hold references from the global to the local stack to preserve the variable names. - parent_goal
- parent_goal(-Parent)
- If Value is instantiated to a callable term, find a frame
executing the predicate described by Value and unify the
arguments of Value to the goal arguments associated with the
frame. This is intended to check the current execution context. The user
must ensure the checked parent goal is not removed from the stack due to
last-call optimisation and be aware of the slow operation on deeply
nested calls.
The variant
parent_goal(-Parent)
unifies the frame reference of the parent of the found frame with Parent. That allows for finding frames higher up in the stack running the same goal. - predicate_indicator
- Similar to
goal
, but only returning the [<module>:]<name>/<arity> term describing the term, not the actual arguments. It avoids creating an illegal term asgoal
and is used by the librarylibrary(prolog_stack)
. - clause
- Value is unified with a reference to the currently running clause. Fails if the current goal is associated with a foreign (C) defined predicate. See also nth_clause/3 and clause_property/2.
- level
- Value is unified with the recursion level of Frame. The top level frame is at level‘0’.
- parent
- Value is unified with an integer reference to the parent local stack frame of Frame. Fails if Frame is the top frame.
- context_module
- Value is unified with the name of the context module of the environment.
- top
- Value is unified with
true
if Frame is the top Prolog goal from a recursive call back from the foreign language;false
otherwise. - hidden
- Value is unified with
true
if the frame is hidden from the user, either because a parent has the hide-childs attribute (all system predicates), or the system has no trace-me attribute. - skipped
- Value is
true
if this frame was skipped in the debugger. - pc
- Value is unified with the program pointer saved on behalf of the parent goal if the parent goal is not owned by a foreign predicate or belongs to a compound meta-call (e.g., call((a,b))).
- argument(N)
- Value is unified with the N-th slot of the frame. Argument 1 is the first argument of the goal. Arguments above the arity refer to local variables. Fails silently if N is out of range.