• Keine Ergebnisse gefunden

... end of background on: Complete Lattices Final Question:

N/A
N/A
Protected

Academic year: 2022

Aktie "... end of background on: Complete Lattices Final Question:"

Copied!
41
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

... end of background on: Complete Lattices

Final Question:

Why is a (or the least) solution of the constraint system useful ???

154

(2)

... end of background on: Complete Lattices

Final Question:

Why is a (or the least) solution of the constraint system useful ???

For a complete lattice D, consider systems:

I[start] ⊒ d0

I[v] ⊒ [[k]] (I[u]) k = (u, _,v) edge

where d0 ∈ D and all [[k]] : D → D are monotonic ...

(3)

... end of background on: Complete Lattices

Final Question:

Why is a (or the least) solution of the constraint system useful ???

For a complete lattice D, consider systems:

I[start] ⊒ d0

I[v] ⊒ [[k]] (I[u]) k = (u, _,v) edge

where d0 ∈ D and all [[k]] : D → D are monotonic ...

==⇒ Monotonic Analysis Framework

156

(4)

Wanted: MOP

(Merge Over all Paths)

I[v] = G

{[[π]] d0 | π : start → v}

(5)

Wanted: MOP

(Merge Over all Paths)

I[v] = G

{[[π]] d0 | π : start → v}

Theorem

Kam, Ullman 1975

Assume I is a solution of the constraint system. Then:

I[v] ⊒ I[v] for every v

158

(6)
(7)

Wanted: MOP

(Merge Over all Paths)

I[v] = G

{[[π]] d0 | π : start → v}

Theorem

Kam, Ullman 1975

Assume I is a solution of the constraint system. Then:

I[v] ⊒ I[v] for every v

In particular: I[v] ⊒ [[π]] d0 for every π : start → v

160

(8)

Proof:

Induction on the length of π.

(9)

Proof:

Induction on the length of π.

Foundation: π = ǫ (empty path)

162

(10)

Proof:

Induction on the length of π.

Foundation: π = ǫ (empty path) Then:

[[π]] d0 = [[ǫ]] d0 = d0 ⊑ I[start]

(11)

Proof:

Induction on the length of π.

Foundation: π = ǫ (empty path) Then:

[[π]] d0 = [[ǫ]] d0 = d0 ⊑ I[start] Step: π = πk for k = (u,_,v) edge.

164

(12)

Proof:

Induction on the length of π.

Foundation: π = ǫ (empty path) Then:

[[π]] d0 = [[ǫ]] d0 = d0 ⊑ I[start] Step: π = πk for k = (u,_,v) edge.

Then:

[[π]] d0 ⊑ I[u] by I.H. for π

==⇒ [[π]] d0 = [[k]] ([[π]]d0)

⊑ [[k]] (I[u]) since [[k]] monotonic

⊑ I[v] since I solution :-))

(13)

Disappointment:

Are solutions of the constraint system just upper bounds ???

166

(14)

Disappointment:

Are solutions of the constraint system just upper bounds ???

Answer:

In general: yes :-(

(15)

Disappointment:

Are solutions of the constraint system just upper bounds ???

Answer:

In general: yes :-(

With the notable exception when all functions [[k]] are distributive ...

:-)

168

(16)

The function f : D1 → D2 is called

• distributive, if f (F

X) = F

{f x | x ∈ X} for all ∅ 6= X ⊆ D;

• strict, if f ⊥ = ⊥.

• totally distributive, if f is distributive and strict.

(17)

The function f : D1 → D2 is called

• distributive, if f (F

X) = F

{f x | x ∈ X} for all ∅ 6= X ⊆ D;

• strict, if f ⊥ = ⊥.

• totally distributive, if f is distributive and strict.

Examples:

• f x = x ∩ a ∪ b for a, b ⊆ U .

170

(18)

The function f : D1 → D2 is called

• distributive, if f (F

X) = F

{f x | x ∈ X} for all ∅ 6= X ⊆ D;

• strict, if f ⊥ = ⊥.

• totally distributive, if f is distributive and strict.

Examples:

• f x = x ∩ a ∪ b for a, b ⊆ U .

Strictness: f ∅ = a ∩ ∅ ∪ b = b = ∅ whenever b = ∅ :-(

(19)

The function f : D1 → D2 is called

• distributive, if f (F

X) = F

{f x | x ∈ X} for all ∅ 6= X ⊆ D;

• strict, if f ⊥ = ⊥.

• totally distributive, if f is distributive and strict.

Examples:

• f x = x ∩ a ∪ b for a, b ⊆ U .

Strictness: f ∅ = a ∩ ∅ ∪ b = b = ∅ whenever b = ∅ :-(

Distributivity:

f (x1 ∪ x2) = a ∩ (x1 ∪ x2) ∪ b

= a ∩ x1 ∪ a ∩ x2 ∪ b

= f x1 ∪ f x2 :-)

172

(20)

• D1 = D2 = N ∪ {∞}, incx = x + 1

(21)

• D1 = D2 = N ∪ {∞}, incx = x + 1

Strictness: f ⊥ = inc 0 = 1 6= ⊥ :-(

174

(22)

• D1 = D2 = N ∪ {∞}, incx = x + 1

Strictness: f ⊥ = inc 0 = 1 6= ⊥ :-(

Distributivity: f (F

X) = F

{x + 1 | x ∈ X} for ∅ 6= X :-)

(23)

• D1 = D2 = N ∪ {∞}, incx = x + 1

Strictness: f ⊥ = inc 0 = 1 6= ⊥ :-(

Distributivity: f (F

X) = F

{x + 1 | x ∈ X} for ∅ 6= X :-)

• D1 = (N ∪ {∞})2, D2 = N ∪ {∞}, f(x1, x2) = x1 + x2

176

(24)

• D1 = D2 = N ∪ {∞}, incx = x + 1

Strictness: f ⊥ = inc 0 = 1 6= ⊥ :-(

Distributivity: f (F

X) = F

{x + 1 | x ∈ X} for ∅ 6= X :-)

• D1 = (N ∪ {∞})2, D2 = N ∪ {∞}, f(x1, x2) = x1 + x2 : Strictness: f ⊥ = 0 + 0 = 0 :-)

(25)

• D1 = D2 = N ∪ {∞}, incx = x + 1

Strictness: f ⊥ = inc 0 = 1 6= ⊥ :-(

Distributivity: f (F

X) = F

{x + 1 | x ∈ X} for ∅ 6= X :-)

• D1 = (N ∪ {∞})2, D2 = N ∪ {∞}, f(x1, x2) = x1 + x2 : Strictness: f ⊥ = 0 + 0 = 0 :-)

Distributivity:

f ((1, 4) ⊔ (4, 1)) = f (4, 4) = 8

6= 5 = f (1, 4) ⊔ f (4, 1) :-)

178

(26)

Remark:

If f : D1 → D2 is distributive, then also monotonic :-)

(27)

Remark:

If f : D1 → D2 is distributive, then also monotonic :-)

Obviously: a ⊑ b iff a ⊔ b = b.

180

(28)

Remark:

If f : D1 → D2 is distributive, then also monotonic :-)

Obviously: a ⊑ b iff a ⊔ b = b.

From that follows:

f b = f (a ⊔ b)

= f a ⊔ f b

==⇒ f a ⊑ f b :-)

(29)

Assumption:

all v are reachable from start .

182

(30)

Assumption:

all v are reachable from start . Then:

Theorem

Kildall 1972

If all effects of edges [[k]] are distributive, then: I[v] = I[v] for all v .

(31)

Gary A. Kildall (1942-1994).

Has developed the operating system CP/M and GUIs for PCs.

184

(32)

Assumption:

all v are reachable from start . Then:

Theorem

Kildall 1972

If all effects of edges [[k]] are distributive, then: I[v] = I[v] for all v .

(33)

Assumption:

all v are reachable from start . Then:

Theorem

Kildall 1972

If all effects of edges [[k]] are distributive, then: I[v] = I[v] for all v .

Proof:

It suffices to prove that I is a solution :-)

For this, we show that I satisfies all constraints :-))

186

(34)

(1) We prove for start : I[start] = G

{[[π]] d0 | π : start → start}

⊒ [[ǫ]] d0

⊒ d0 :-)

(35)

(1) We prove for start : I[start] = G

{[[π]] d0 | π : start → start}

⊒ [[ǫ]] d0

⊒ d0 :-)

(2) For every k = (u, _, v) we prove:

I[v] = F

{[[π]] d0 | π : start → v}

⊒ F

{[[πk]] d0 | π : start → u}

= F

{[[k]] ([[π]] d0) | π : start → u}

= [[k]] (F

{[[π]] d0 | π : start → u})

= [[k]] (I[u])

since {π | π : start → u} is non-empty :-)

188

(36)

Caveat:

• Reachability of all program points cannot be abandoned! Consider:

0 1 2

7 inc

where D = N ∪ {∞}

(37)

Caveat:

• Reachability of all program points cannot be abandoned! Consider:

0 1 2

7 inc

where D = N ∪ {∞}

Then:

I[2] = inc 0 = 1 I[2] = F

∅ = 0

190

(38)

Caveat:

• Reachability of all program points cannot be abandoned! Consider:

0 1 2

7 inc

where D = N ∪ {∞}

Then:

I[2] = inc 0 = 1 I[2] = F

∅ = 0

• Unreachable program points can always be thrown away :-)

(39)

Summary and Application:

→ The effects of edges of the analysis of availability of expressions are distributive:

(a ∪ (x1 ∩ x2))\b = ((a ∪ x1) ∩ (a ∪ x2))\b

= ((a ∪ x1)\b) ∩ ((a ∪ x2)\b)

192

(40)

Summary and Application:

→ The effects of edges of the analysis of availability of expressions are distributive:

(a ∪ (x1 ∩ x2))\b = ((a ∪ x1) ∩ (a ∪ x2))\b

= ((a ∪ x1)\b) ∩ ((a ∪ x2)\b)

→ If all effects of edges are distributive, then the MOP can be

computed by means of the constraint system and RR-iteration. :-)

(41)

Summary and Application:

→ The effects of edges of the analysis of availability of expressions are distributive:

(a ∪ (x1 ∩ x2))\b = ((a ∪ x1) ∩ (a ∪ x2))\b

= ((a ∪ x1)\b) ∩ ((a ∪ x2)\b)

→ If all effects of edges are distributive, then the MOP can be

computed by means of the constraint system and RR-iteration. :-)

→ If not all effects of edges are distributive, then RR-iteration for the constraint system at least returns a safe upper bound to the MOP :-)

194

Referenzen

ÄHNLICHE DOKUMENTE

The following theorem (also from Chapter 2 of slides) has an analogous formulation..

→ If not all effects of edges are distributive, then RR-iteration for the constraint system at least returns a safe upper bound.. Note:. → Assignments to dead variables can be

→ If not all effects of edges are distributive, then RR-iteration for the constraint system at least returns a safe upper bound to the MOP :-).. Note:. → Assignments to dead

In order to prove correctness, we first instrument the concrete semantics with extra information which records where a.. block has

• The effects of edges for truely live variables are more complicated than for live variables :-).. • Nonetheless, they are distributive

[r]

Studien der letzten Jahre haben jedoch verdeutlicht, dass Kolloid nicht gleich Kolloid ist, da jede Substanz durch ein spezifisches pharmakologisches Wirkprofil charakte- risiert

In case of a sequential logit model, this estimate is a weighted sum of effects (log- odds ratios) on passing transitions such that the effect receives more weight if more people are