Sol 2
Sol 2
Sol 2
2. For a totally ordered set S, (P(S), ⊆) is a complete lattice. Define another relation R
such that (P(S), R) is a complete lattice.
3. Is (R, ≤) a complete lattice? If not, how can you extend R such that it becomes a complete
lattice?
• (N, |)
• (N\{0}, |)
• (N\{0} ∪ {∞}, |)
a complete lattice?
Solution
1. Define a < b and b < c. Then (M, ≤) is a complete lattice where ≤ is the reflexive and
transitive hull of <.
2. An easy solution is (P(S), ⊇). Another relation can be constructed like this: Let < be a
total order on S. You can order all elements of a subset of S with <. Using this, you can
construct a monotonic sequence of the subset (Careful! This does not work in general!
For this to work, the subset must have a least element). If we take the lexicographical
order <l on these sequences, we get again a complete lattice for (P(S), <l ).
3. (R, ≤) is not a complete lattice. For example, tN does not exist. The extension (R ∪
{±∞}, ≤) with
∀x ∈ R : −∞ < x < +∞ (1)
is a complete lattice.
4. a | b is defined as ∃c : a · c = b.
• | is reflexive: ∀a ∃c : a · c = a. Choose c = 1.
• | is transitive: ∀a, b, c with ∃d : a · d = b and ∃d0 : b · d0 = c. Then ∃e : a · e = c.
Choose e = d · d0 .
• | is antisymmetric: ∀a, b with ∃c : a · c = b and ∃c0 : b · c0 = a ⇒ a · cc0 = a ⇒
cc0 = 1 ⇒ c = c0 = 1 ⇒ a = b.
Hence, (N, |) is a partially ordered set. Let M ⊆ N. We have to distinguish now two
cases:
[y := x]1 ;
[z := 1]2 ;
while [y > 0]3 do
[z := z ∗ y]4 ;
[y := y − 1]5 ;
[y := 0]6
Let F : (P(Var × Lab))12 → (P(Var × Lab))12 be the function defined by the data flow
equations (cf. slides on p. 31 ff.). Further, let (α, γ) be the Galois connection for the Reaching
Definitions analysis (cf. slides on p. 69 ff.)
holds for all j. Here, f~ denotes the application of function f to all entries of a tuple or
vector.
~ ◦ G ◦ ~γ .
2. Check whether F = α
α ◦ G ◦ ~γ )n (∅) v F n (∅).
3. Prove by induction over n that (~
~ (Gn (∅)) v (~
4. Prove that α α ◦ G ◦ ~γ )n (∅). You may use that α
~ (∅) = ∅ and G v G ◦ ~γ ◦ α
~.
where SRD(tr)(x) returns the label where the variable x has been set last in trace tr. DOM(tr)
is the set of variables for which SRD is defined.
Solution
1. There are three types of equations that correspond to each other:
(a) RDexit (l) = RDentry (l) and CSexit (l) = CSentry (l), RDentry (l) = RDexit (l − 1) and
CSentry (l) = CSexit (l − 1).
For the tuples we get: RDl = RDl−1 and CSl = CSl−1 .
(b) RDexit (l) = (RDentry (l)\{(x, l) | l ∈ Lab}) ∪ {(x, l)} and
CSexit (l) = {tr : (x, l) | tr ∈ CSentry (l)}
(c) RDentry (l) = RDexit (l − 1) ∪ RDexit (m) and
CSentry (l) = CSexit (l − 1) ∪ CSexit (m)
(a) We show as an example for l = 3 with RDexit (3) = RDentry (3) and CSexit (3) =
CSentry (3) that the assumption holds. All other cases of the same form are shown
analogously.
3. n = 0:
α ◦ G ◦ ~γ )0 (∅) v F 0 (∅) = ∅
(~
n − 1 → n:
α ◦ G ◦ ~γ )n (∅) = (~
(~ α ◦ G ◦ ~γ )n−1 (~
α ◦ G ◦ ~γ )(∅)
≤IH F n−1 (~
α ◦ G ◦ ~γ (∅))
≤ F n−1 (F (∅)) = F n (∅)
since F is monotone.
~ ◦ Gn (∅) v α
α ~ )n (∅)
~ ◦ (G ◦ ~γ ◦ α
α ◦ G ◦ ~γ )n ◦ α
= (~ ~ (∅)
n
α ◦ G ◦ ~γ ) (∅)
= (~