Suspension and attributed variables

A suspension variable, or an attributed variable, is a variable to which there are suspended agents and attribute values 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.

The unification procedure needs be revisited now that we have attributed variables. 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, suppose Y is younger than O, the following operations will be performed:

Notice that because no attribute is copied the younder variable will lose all of its attributes after unification. Notice also that because of garbage collection, the age ordering of variables is normally unpredicatable.



Subsections
Neng-Fa Zhou 2012-01-03