[not loaded]attvar.pl -- Attributed variable handling
Attributed variable and coroutining support based on attributed variables. This module is complemented with C-defined predicates defined in pl-attvar.c
- $wakeup(+List)
- Called from the kernel if assignments have been made to attributed variables.
- uhook(+AttributeName, +AttributeValue, +Value)[private]
- Run the unify hook for attributed named AttributeName after
assigning an attvar with attribute AttributeValue the value
Value.
This predicate deals with reserved attribute names to avoid the meta-call overhead.
- unfreeze(+ConjunctionOrGoal)[private]
- Handle unfreezing of conjunctions. As meta-calling control
structures is slower than meta-interpreting them we do this in
Prolog. Another advantage is that having unfreeze/1 in between
makes the stacktrace and profiling easier to intepret. Please
note that we cannot use a direct conjunction as this would break
freeze(X, (a, !, b))
. - freeze(@Var, :Goal)
- Suspend execution of Goal until Var is unbound.
- frozen(@Var, -Goals)
- Unify Goals with the goals frozen on Var or true if no goals are grozen on Var.
- portray_attvar(@Var)[private]
- Called from write_term/3 using the option
attributes(portray)
or when the prolog flag write_attributes equals portray. Its task is the write the attributes in a human readable format. - call_residue_vars(:Goal, -Vars)
- If Goal is true, Vars is the set of residual attributed variables created by Goal. Goal is called as in call/1. This predicate is for debugging constraint programs. Assume a constraint program that creates conflicting constraints on a variable that is not part of the result variables of Goal. If the solver is powerful enough it will detect the conflict and fail. If the solver is too weak however it will succeed and residual attributed variables holding the conflicting constraint form a witness of this problem.
- copy_term(+Term, -Copy, -Gs) is det
- Creates a regular term Copy as a copy of Term (without any attributes), and a list Gs of goals that when executed reinstate all attributes onto Copy. The nonterminal attribute_goals//1, as defined in the modules the attributes stem from, is used to convert attributes to lists of goals.
- frozen_residuals(+FreezeAttr, +Var)// is det[private]
- Instantiate a freeze goal for each member of the $and
conjunction. Note that we cannot map this into a conjunction
because
freeze(X, a)
,freeze(X, !)
would createfreeze(X, (a,!))
, which is fundamentally different. We could createfreeze(X, (call(a), call(!)))
or preform a more eleborate analysis to validate the semantics are not changed.