Next: Remark Up: Parallelism: Evolving Algebras Previous: Remark

Importing Elements

The recursive definition of rules in 5.3 can be extended by import commands and/or (qualified) choice commands. The adjustment of the semantic definition is straightforward. For the sake of definiteness, consider the extension by means of the import constructor. The most important novelty, in comparison to 3.2.4, is that reserve elements have to be chosen for all combinations of the values of explicitly declared variables u such that the scope of the declaration of u properly includes the given import or choose subrule. For example, the rule

var u ranges over U
import v
     Parent(v) := u
endimport

creates a new child for every element of U , and of course all these new children are different.

To reflect the novelty we redefine the domain of the global choice function. Suppose that D is a variable declaration, R is a rule covered by D , S is a state of an auxiliary vocabulary appropriate for R , and R is (D,S) -perspicuous. For every bound variable v of R , list all explicitly declared variables u such that either u occurs in D or u occurs in R and the scope of the declaration of u properly includes the scope of the declaration of v : u1, ..., ul . (The adverb properly is there to exclude v from the list.) Let U1, ... Ul be the ranges of u1, ... ul in S respectively, and [Uv] be the Cartesian product U1 * ... * Ul . The desired global function xi assigns different reserve elements to every pair (v, [a]) where v in
Bound(R) and [a] in [Uv] .

Here is a variant of the example from 3.2.5:

var u ranges over U
extend Nodes with v1, v2 
     if Leaf(u) then
          FirstChild(u) := v1
          SecondChild(u) := v2
     endif
endextend



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