Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N...

13
Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N x := y op z in out F x := y op z (in) = in – { x ! * } [ { x ! N | ( y ! N 1 ) ∊ in Æ ( z ! N 2 ) ∊ in Æ N = N 1 op N 2 }
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    222
  • download

    3

Transcript of Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N...

Page 1: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Another example: constant prop

• Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z }

x := N

in

outFx := N(in) = in – { x ! * } [ { x ! N }

x := y op z

in

outFx := y op z(in) = in – { x ! * } [ { x ! N | ( y ! N1 ) ∊ in Æ ( z ! N2 ) ∊ in Æ N = N1 op N2 }

Page 2: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Another example: constant prop

*x := y

in

out

F*x := y(in) =

x := *y

in

out

Fx := *y(in) =

Page 3: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Another example: constant prop

*x := y

in

out

F*x := y(in) = in – { z ! * | z ∊ may-point(x) } [ { z ! N | z ∊ must-point-to(x) Æ y ! N ∊ in } [ { z ! N | (y ! N) ∊ in Æ (z ! N) ∊ in }

x := *y

in

out

Fx := *y(in) = in – { x ! * } [ { x ! N | 8 z ∊ may-point-to(x) . (z ! N) ∊ in }

Page 4: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Another example: constant prop

x := f(...)

in

outFx := f(...)(in) =

*x := *y + *z

in

out

F*x := *y + *z(in) =

Page 5: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Another example: constant prop

x := f(...)

in

outFx := f(...)(in) = ;

*x := *y + *z

in

out

F*x := *y + *z(in) = Fa := *y;b := *z;c := a + b; *x := c(in)

Page 6: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Another example: constant prop

s: if (...)

in

out[0] out[1]

merge

out

in[0] in[1]

Page 7: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Lattice

• (D, ⊑, ⊥, ⊤, ⊔, ⊓) =

Page 8: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Lattice

• (D, ⊑, ⊥, ⊤, ⊔, ⊓) = (2 A , ¶, A, ;, Å, [)where A = { x ! N | x ∊ Vars Æ N ∊ Z }

Page 9: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Example

x := 5

v := 2

x := x + 1

w := v + 1

w := 3

y := x * 2

z := y + 5

w := w * v

Page 10: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Back to lattice

• (D, ⊑, ⊥, ⊤, ⊔, ⊓) = (2 A , ¶, A, ;, Å, [)where A = { x ! N | x ∊ Vars Æ N ∊ Z }

• What’s the problem with this lattice?

Page 11: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Back to lattice

• (D, ⊑, ⊥, ⊤, ⊔, ⊓) = (2 A , ¶, A, ;, Å, [)where A = { x ! N | x ∊ Vars Æ N ∊ Z }

• What’s the problem with this lattice?

• Lattice is infinitely high, which means we can’t guarantee termination

Page 12: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Better lattice

• Suppose we only had one variable

Page 13: Another example: constant prop Set D = 2 { x ! N | x ∊ Vars Æ N ∊ Z } x := N in out F x := N (in) = in – { x ! * } [ { x ! N } x := y op z in out F x :=

Better lattice

• Suppose we only had one variable

• D = {⊥, ⊤ } [ Z

• 8 i ∊ Z . ⊥ ⊑ i Æ i ⊑ ⊤

• height = 3