Suspension and attributed variables

A suspension variable, or an attributed variable, is a variable to which suspended agents and attribute values are attached. Agents are registered onto suspension variables by action rules. Each attribute has a name, which must be ground, and a value. The built-in put_attr(Var,Attr,Value) is used to register attribute values, and the built-in get_attr(Var,Attr,Value) is used to retrieve attribute values.

Due to attributed variables, the unification procedure must be revisited. When a normal Prolog variable is unified with an attributed variable, the normal Prolog variable will be bound to the attributed variable. When two attributed variables Y and O are unified, supposing that Y is younger than O, the following operations will be performed:

Note that, because no attributes are copied, the younder variable will lose all of its attributes after unification. Also note that, because of garbage collection, the age ordering of variables is normally unpredicatable.



Subsections
Neng-Fa Zhou 2013-01-25