Attributed variable and coroutining support based on attributed variables. This module is complemented with C-defined predicates defined in pl-attvar.c
This predicate deals with reserved attribute names to avoid the meta-call overhead.
freeze(X, (a, !, b))
.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.
processed
. We do not rebind such variables as
that would trigger constraints. These variables should not appear in
the produced goal anyway. If both are attvars, unifying may also
re-trigger. Therefore, we remove the variables from the copy before
rebinding. This should be ok as all variable identifies are properly
restored.attributes(portray)
or
when the prolog flag write_attributes equals portray. Its task
is the write the attributes in a human readable format.freeze(X, a)
, freeze(X, !)
would create freeze(X,
(a,!))
, which is fundamentally different. We could create
freeze(X, (call(a), call(!)))
or preform a more eleborate
analysis to validate the semantics are not changed.