attr_unify_hook(+AttValue,
+VarValue)A hook that must be defined in the module to which an attributed
variable refers. It is called after the attributed variable has
been unified with a non-var term, possibly another attributed variable.
AttValue is the attribute that was associated to the variable
in this module and VarValue is the new value of the variable.
If this predicate fails, the unification fails. If VarValue
is another attributed variable the hook often combines the two
attributes and associates the combined attribute with VarValue
using
put_attr/3.
- To be done
- The way in which this hook currently works makes the implementation of
important classes of constraint solvers impossible or at least extremely
impractical. For increased generality and convenience, simultaneous
unifications as in
[X,Y]=[0,1]
should be processed
sequentially by the Prolog engine, or a more general hook should be
provided in the future. See Triska,
2016 for more information.