YAP 7.1.0
Implementing Attributed Variables and Co-Routining


Detailed Description

Support for co-routining

Class Documentation

◆ attr_unify_hook/2

class attr_unify_hook/2

attr_unify_hook(+ AttValue,+ VarValue)

Hook that must be defined in the module an attributed variable refers to Is 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 Normally this predicate fails to veto binding the variable to VarValue, forcing backtracking to undo the binding If VarValue is another attributed variable the hook often combines the two attribute and associates the combined attribute with VarValue using put_attr/3

◆ freeze/2

class freeze/2

freeze(? X,: G)

Delay execution of goal G until the variable X is bound

◆ dif/2

class dif/2

dif( X, Y)

Succeed if the two arguments do not unify A call to dif/2 will suspend if unification may still succeed or fail, and will fail if they always unify

◆ when/2

class when/2

when(+ C,: G)

Delay execution of goal G until the conditions C are satisfied The conditions are of the following form:

  • C1, C2 Delay until both conditions C1 and C2 are satisfied
  • C1; C2 Delay until either condition C1 or condition C2 is satisfied
  • ?=( V1, C2) Delay until terms V1 and V1 have been unified
  • nonvar( V) Delay until variable V is bound
  • ground( V) Delay until variable V is ground

Note that when/2 will fail if the conditions fail

◆ frozen/2

class frozen/2

frozen( X, G)

Unify G with a conjunction of goals suspended on variable X, or true if no goal has suspended

Definition at line 1 of file corout.yap.