[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.
- freeze(@Var, :Goal)
- Suspend execution of Goal until Var is unbound.
- frozen(@Term, -Goal)
- Unify Goals with the goals frozen on Var or true if no goals are
frozen on Var.
Note that attribute_goals//1 may destructively update attributes, often used to simplify the produced attributes. For frozen/2 however we must keep the original variables. Ideally we would demand attribute_goals//1 to not modify any attributes. As that is hard given where we are we now copy the result and fail, restoring the bindings. This is a simplified version of bagof/3.
- portray_attvar(@Var)
- 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.