• Keine Ergebnisse gefunden

This section investigates abstractly the relation known as control dependence.

Definition 2.3.1. Let(G,f)be a flow graph.

(i) Letxandy be arbitrary vertices ofG. Theny is said to be dependent onx iffx 6<y and there exists an immediate successorzofxinGsuch thatz 6y.

(ii) We denote bydepthe relation in which verticesxandyare if and only ify is dependent onx.

Theorem 2.3.2. Letx andy be vertices in a flow graph. Thenx depy iffx 6<y and there exists a non-empty walkwfromxtoysuch thatw 6yfor every vertex w through whichwpasses.

Proof. Supposex depy. Thenx 6< y by Definition 2.3.1. Also, there exists an immediate successorz ofx such thatz 6 y. Letd be an arc going fromx toz.

Ifz = y then (x,d,y) is a walk satisfying the desired property. So assume that z <y. By Definition 2.2.1, there exists a walkw= (v0,e1,v1, . . . ,el,vl)fromz tof; it must pass throughy. Letibe the least number for whichvi =y. We show that the walk(x,d,z)(v0,e1,v1, . . . ,ei,vi)fromxtoy has the desired property.

Clearly it is non-empty. Furthermore, for every j < i, j > 0, Lemma 2.2.5(ii) impliesvj < y since(v0,e1,v1, . . . ,ej,vj) is a walk fromz tovj which does not pass throughyandz <y. This proves the “only if” part.

For the other part, suppose thatx 6< y and there exists a non-empty walk w = (v0,e1,v1, . . . ,el,vl)fromxtoysuch thatvi 6yfor everyi= 1, . . . , l. Aswis non-empty,v1exists and is an immediate successor ofxsatisfyingv16y. Thus

xdepy. ⊓⊔

The criterion for dependence provided by Theorem 2.3.2 is used as definition in [18].

Lemma 2.3.3. Letx,ybe vertices of a flow graph. Ifx depy then there exists a walk fromxtoywhich passes through no postdominator ofx.

Proof. Assume x dep y. By Theorem 2.3.2, x 6< y and there exists a walk w= (v0,e1,v1, . . . ,el,vl)fromx toy such thatvi 6yfor everyi= 1, . . . , l. If x <vifor somei= 1, . . . , l, the transitivity of6would give a contradiction. So

wis the desired walk. ⊓⊔

Theorem 2.3.4. Letw = (v0,e1,v1, . . . ,el,vl),l > 0, be a walk fromx toy in a flow graph. Ifwpasses through no vertex postdominatingxthen there exists an i < lsuch thatvi depyandvi+16y.

Proof. Letibe the least number such thatvi+16y. Ifi >0thenvi =v(i−1)+1 66 y implyingvi 6< y. Ifi = 0thenvi = x 6< y by assumption. As vi → vi+1, it

givesvi depy. ⊓⊔

We denote bydepthe reflexive transitive closure ofdepand bydep+ the tran-sitive closure ofdep, i.e.,

dep= S

n∈N

depn and dep+= S

n∈N n>0

depn

wheredepndenotes then-times composition ofdep.

Theorem 2.3.5. Letx andybe vertices in a flow graph. Thenx dep y iff there exists a walk fromx toy which passes through no postdominator ofx.

Proof. Assumex dep y. Then there exists a chainw0depw1 dep. . .depwk wherew0 =x,wk =y. Proceed by induction onk. In the casek = 0, the claim holds trivially (take the empty walk fromx tox). Assume the claim holding for kand consider a chain with length k+ 1. By induction hypothesis, there exists a walkwfromx towk which passes through no postdominator ofx. By Lemma 2.3.3, there exists a walkvfromwktoy which passes through no postdominator ofwk. Suppose the walk wv passes through some postdominator z of x. Then v passes throughz and so wk 6< z. Lemma 2.2.5(i) now states that every walk fromxtowkpasses throughz. This leads to a contradiction sincewdoes not pass throughz. Consequently, wvis a walk with the desired property.

For the other direction of the equivalence, assume that there exists a walkw = (v0,e1,v1, . . . ,el,vl)fromx toypassing through no postdominator ofx. Argue by induction onl. Ifl = 0thenx = y, sox dep0 y. Assume nowl >0and the claim holding for naturals less thanl. By Theorem 2.3.4, there exists ani < lsuch thatvi depy. By the induction hypothesis,x dep vi. Altogether,xdep+ y. ⊓⊔ Proposition 2.3.6.

(i) Any immediate successor of a vertexxin a flow graph either postdominates xor is dependent onx.

(ii) For any vertexxin a flow graph, at most one of the immediate successors of xis not dependent onx.

Proof.

(i) Letybe any immediate successor ofx. Supposeyis not dependent onx. By Definition 2.3.1, eitherx<yorz 6yfor no immediate successorzofx. Asyis an immediate successor ofx andy 6y, the latter is not the case. Consequently, x<y.

(ii) By Corollary 2.2.11, at most one of the immediate successors ofx postdom-inatesx. By Proposition 2.3.6(i), all the others are dependent onx. ⊓⊔ Definition 2.3.7. LetA = ((V,E,(s,t)),f) be a flow graph. Call a setS ⊆ V dependence system ofAiff both following conditions hold:

1. f ∈S;

2. for everyx,y ∈V, ify ∈S andx depythenx∈S.

Theorem 2.3.8. LetA = (G,f)be a flow graph. LetS be a dependence system ofA. Letwbe a walk fromxtoysuch thatx∈/ S and the only vertex ofS passed through bywisy. Thenx <y.

Proof. Letw= (v0,e1,v1, . . . ,el,vl)and letibe the least index for whichvi = y.

Suppose the contrary, i.e. x 6< y. As x ∈/ S and y ∈ S, we have x 6= y, so x 66y. Letj < ibe the largest index for whichx 6vj. By transitivity of6, the verticesvkforj < k6ido not postdominatevj. By Theorem 2.3.5,vj dep y.

By Definition 2.3.7, we getvj ∈ S which contradicts the choice ofi. Hence the

claim follows. ⊓⊔

CHAPTER 3

THEORY OF TRANSFINITE TRACE SEMANTICS

A trace semantics of a program expresses its execution behaviour step by step. It is basically a set of sequences of elements representing execution states. In stan-dard trace semantics, the sequences are finite lists or streams; their components therefore correspond to natural numbers. In the case of transfinite trace semantics, the sequences are transfinite, i.e. the components correspond to ordinal numbers.

We call them transfinite lists.

3.1 Ordinal numbers

In this section, we give a short introduction to ordinals. The definitions and facts listed here are generally those we need in this thesis. There are many books giv-ing profound introductions to ordinal theory; [8, 15] represent just two different approaches.

The notion of ordinal is obtained as a generalization of the notion of natural num-ber by adding infinite elements. So we have all the natural numnum-bers 0,1,2, . . ., as well as ωand a lot of greater elements, among ordinals. This notion differs from the notion of cardinal in that ordinals can be distinguished by the order of elements in set while cardinals express only the size.

Being precise, an ordinal is an isomorphism class of ordered sets. (A well-ordered set is an well-ordered set whose every non-empty subset has a least element.) As all the well-orders of a fixed finite set are isomorphic, there exists just one ordinal for any size of a finite set. For countable sets, for instance, there are many (actually uncountably many) in principle different well-orders. The standard order of natural numbers (representingω) is among them; one of the others is the order ofN∪ {∞}where∞is greater than any natural number.

There is a natural order6on ordinals:o6πiff, for any well-ordered setsAand Bcorresponding tooandπ, respectively,Ais isomorphic to a cut ofB. (A cut of a well-ordered setCis a subsetDof it containing all elements ofCbeing less than any given element of D. Cuts are also called downward closed subsets.) Every set of ordinals is well-ordered w.r.t.6. Clearly0 is less than any other ordinal.

The set of all ordinals less thanois denoted byOo; it turns out that(Oo; 6)is a representative ofo.

Any ordinalohas a unique immediate successor w.r.t.6; we denote ito. IfAis a well-ordered set representingo, a set representingois obtained by adding a new greatest element toA.

If an ordinal has an immediate predecessor, i.e. if it is a successor of some ordinal, it is called successor ordinal. Otherwise it is called limit ordinal. However,0is often considered as a neither successor nor limit ordinal.

For example, all naturals but0are successor ordinals whileω— the least infinite ordinal — is a limit ordinal (the least greater than0). Then there are countably many successor ordinalsω′′etc., followed by the next limit ordinal which of course is followed by countably many successor ordinals.

Leto,π be ordinals. LetA,B be some well-ordered sets representing oand π, respectively. An ordinal̺ is called sum ofoandπ iff it corresponds to the well-ordered set obtained fromAandBby finding their disjoint union and considering every element ofAless than every element ofB. The sum ofoand πis denoted byo+π. Obviouslyo = o+ 1for any ordinal o. The operation+is associative and, for anyo,o+ 0 = 0 +o=o. For ordinalsoandπ,o6πiffo+̺=πfor some ordinal̺. Ifo6oandπ6π then alwayso+π6o(addition is monotone w.r.t. both its arguments).

For example,ω+ 1corresponds to the well-order ofN∪ {∞}introduced before.

The ordinalω+ωcorresponds to the limit of the sequence ω,ω′′, . . ., be-ing the least limit ordinal greater thanω. We can construct the infinite sequence ω,ω+ω,ω+ω+ω, . . .of limit ordinals. There exists a limit of this sequence, followed by its successor etc. Ordinals form a “very infinite” biome in the sense that no set of ordinals can ever be complete.

Ifo+π =o+̺then alwaysπ =̺. This allows to define subtraction of ordinals.

Ifo6πthenπ−ois the ordinal̺such thato+̺=π.

In the following, we assume the reader having a solid knowledge on elementary ordinal theory.