Next: Remark Up: A Parallel Version Previous: Programs

Semantics of Rules

By induction on R , we define the update set beta = Updates(D, R, S) generated by a rule R at an appropriate state S under a declaration D that covers R . To fire R at S under D , fire beta .

We stipulate that an arbitrary rule R is equivalent, for given D and S , to a (D,S) -perspicuous rule R' obtained from R by renaming the bound variables. The equivalence means that Updates(D, R, S) = Updates(D, R', S).

It remains to define beta = Updates(D, R, S). in the case when R is (D,S) -perspicuous.

If D is not empty, then beta is the union of Updates(emptyset, R, S'), where S' ranges over expansions of S such that Fun(S') = Fun(S) union Var(D) and S' is consistent with D (so that the values of D variables are within their ranges in S' ). Notice that beta = emptyset if the range of any D variable is empty.

Suppose D = emptyset. If R is an update instruction then beta = Updates(R, S). If R is a sequence of rules R1, ..., Rk , then beta is the union of the update sets Updates(emptyset, Ri, S). Suppose that R is the conditional rule with clauses (g0,R0), ... , (gk,Rk). . Since R is covered by the empty declaration, the guards have no free variables. We have two cases as usual. If all guards fail in S , then beta is empty, and if is the first guard that holds in S then beta = NUpdates (emptyset, Ri, S). Finally, if R is a declaration rule with declaration d and body R' then beta = Updates(d, R', S).



huggins@acm.org
Thu Mar 23 17:30:35 EST 1995