Resource is added by the execution of a goal formula . For example, the following query adds a resource r(1) to the resource table, then executes a goal r(X) which consumes r(1) by letting .
?- r(1) -<> r(X).In the execution of the goal , all resources in R should be consumed up during the execution of G. For example, the following query fails since r(1) is not consumed.
?- r(1) -<> true.
Resource formula is used to represent a rule-type resource. The goal G is executed on resource consumption. The following query displays 1.
?- (write(X) -<> r(X)) -<> r(1).
Resource formula is used to add multiple resources. The following query adds resources r(1) and r(2), then consumes both of them by letting and , or and .
?- (r(1), r(2)) -<> (r(X), r(Y)).
Resource formulas and mean infinite resources, that is, they can be consumed arbitrary times (including zero times). The following query succeeds by letting or .
?- (!r(1), !r(2)) -<> (r(X), r(X)).
Resource formula is used to represent a selective resource. For example, when r(1)&r(2) is added as a resource, either r(1) or r(2) can be consumed, but not both of them. The following query succeeds by letting or .
?- (r(1) & r(2)) -<> r(X).