Next: Duplication Up: Qualified Choose Construct Previous: Qualified Choose Construct

Qualified Choose Constructor

If U is a universe name different from Reserve, v is a variable, g(v) is a Boolean term and R0 is a rule, then the following expression is a rule with main existential variable v that ranges over U and body R0 :

choose v in U satisfying g(v)
     R0
endchoose

Replacing the choose constructor with the qualified choose constructor requires only a small and obvious change in the semantical definition of 4.1.2. We restrict attention to the global choice approach. Consider the case in the inductive definition of Updates(R', S', xi) where R' is a choose rule and the range U of the main existential variable v of R in S' is not empty. If g(xi(v)) fails in S, set Updates(R', S', xi) = undef.

It is easy to construct a rule to choose several elements v1, ..., vk subject to a condition g(v1, ..., vk) .

The qualified choose constructor may be too powerful. The decision problem whether there is any tuple (v1, ..., vk) in the universe U satisfying the condition g may be hard. If U is the set of natural numbers and g a polynomial, the decision problem may even be undecidable [Mt]. But the logical clarity of the constructor is attractive. It may be used in particular to reflect environmental forces that are not necessarily algorithmic.


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