Published online by Cambridge University Press: 03 September 2009
As mentioned before, by inserting a constraint into a program, we shrink the domain for which it is defined. To reverse this process, we need to be able to speak of, and make use of, a set of subprograms. To this end, a new programming construct called a program set is now introduced. The meaning of a program set, or a set of programs, is identical to the conventional notion of a set of other objects. As usual, a set of n programs is denoted by {P1, P2, …, Pn}. When used as a programming construct, it describes the computation prescribed by its elements. Formally, the semantics of such a set is defined in Axiom 4.1.
Axiom 4.1
wp({P1, P2, …, Pn}, R) ≡ wp(P1, R) ⋁ wp(P2, R) ⋁ … ⋁ wp(Pn, R).
The choice of this particular semantics is explained in detail at the end of this chapter. A program set so defined has all properties commonly found in an ordinary set. For instance, because the logical operation of disjunction is commutative, a direct consequence of Axiom 4.1 is Corollary 4.2.
Corollary 4.2
The ordering of elements in a program set is immaterial, i.e.,
{P1, P2} ⇔ {P2, P1}.
Furthermore, because every proposition is an idempotent under the operation of disjunction, we have Corollary 4.3.
Corollary 4.3
P ⇔ {P} ⇔ {P, P} for any program P.
In words, a set is unchanged by listing any of its elements more than once.
To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.