relating static and dynamic semantics
DESCRIPTION
Relating Static and Dynamic Semantics. COS 441 Princeton University Fall 2004. Motivations. We want to know that when evaluating certain well-formed programs certain errors never occur Example - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/1.jpg)
Relating Static and Dynamic Semantics
COS 441
Princeton University
Fall 2004
![Page 2: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/2.jpg)
Motivations
• We want to know that when evaluating certain well-formed programs certain errors never occur
• Example– Transition semantics for -calculus is “stuck”
when applied to expressions with free variables in it
– So if {} ` E ok then E should never be “stuck”
![Page 3: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/3.jpg)
Formal Statement
isFinal(e) = e 2 F
steps(e) = 9 e’. e e’
stuck(e) = :(steps(e) or isFinal(e))
Soundness Theorem:
If {} ` E ok and E * E’ then :stuck(E’)
![Page 4: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/4.jpg)
Formal Statement
isFinal(e) = e 2 F
steps(e) = 9 e’. e e’
stuck(e) = :(steps(e) or isFinal(e))
Soundness Theorem:
If {} ` E ok and E * E’ then
(steps(E’) or isFinal(E’))
![Page 5: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/5.jpg)
Proof: Soundness Theorem
By induction on derivations of * with Preservation and Progress Lemmas
Preservation Lemma:
If {} ` E ok and E E’ then {} ` E’ ok
Progress Lemma:
If {} ` E ok then (steps(E) or isFinal(E))
![Page 6: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/6.jpg)
Warning!!
• The remainder of the lecture consists of a series of tedious proofs – Take that swig of coffee now– Slides will be on web-site
• Last set of tedious proofs in lecture– I’ll assign them as homework from now on! ;)– What we discuss today is a template for
Assignment 3
![Page 7: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/7.jpg)
Proof by Induction over *
To show 8 e,e’ P(e,e’) we must show
case Z*: IH(E,E)
case S*: If E E’ and IH(E’,E’’) then IH(E,E’’)
IH(e,e’) = If {} ` e ok and e * e’ then
(steps(e’) or isFinal(e’))
S * SZ*
S * S’’
S S’ S’ * S’’S*
![Page 8: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/8.jpg)
Proof: Soundness Theorem
case Z*: IH(E,E)
![Page 9: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/9.jpg)
Proof: Soundness Theorem
case Z*: If {} ` E ok and E * E then (steps(E) or isFinal(E))
![Page 10: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/10.jpg)
Proof: Soundness Theorem
case Z*: (steps(E) or isFinal(E))
1. {} ` E ok and E * E by assumption
![Page 11: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/11.jpg)
Proof: Soundness Theorem
case Z*:
1. {} ` E ok and E * E by assumption
2. (steps(E) or isFinal(E))
by ??
![Page 12: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/12.jpg)
Proof: Soundness Theorem
case Z*:
1. {} ` E ok and E * E by assumption
2. (steps(E) or isFinal(E))
by Progress Lemma with (1)
![Page 13: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/13.jpg)
Proof: Soundness Theorem
case S*: If E E’ and IH(E’,E’’) then IH(E,E’’)
![Page 14: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/14.jpg)
Proof: Soundness Theorem
case S*: IH(E,E’’)
1. E E’ and IH(E’,E’’) by assumption
![Page 15: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/15.jpg)
Proof: Soundness Theorem
case S*: If {} ` E ok and E * E’’ then
(steps(E’’) or isFinal(E’’))
1. E E’ and IH(E’,E’’) by assumption
![Page 16: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/16.jpg)
Proof: Soundness Theorem
case S*: (steps(E’’) or isFinal(E’’))
1. E E’ and IH(E’,E’’) by assumption
2. {} ` E ok and E * E’’ by assumption
3. ` E’ ok by Preservation with (2,1)
4. E’ * E’’ by inversion of S* and (2)
5. (steps(E) or isFinal(E’’))
by IH with (3, 4)
![Page 17: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/17.jpg)
Proof: Soundness Theorem
case S*: (steps(E’’) or isFinal(E’’))
1. E E’ and IH(E’,E’’) by assumption
2. {} ` E ok and E * E’’ by assumption
3. {} ` E’ ok by ?? E’ * E’’ by inversion of S* and (2)
4. (steps(E) or isFinal(E’’))
by IH with (3, 4)
![Page 18: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/18.jpg)
Proof: Soundness Theorem
case S*: (steps(E’’) or isFinal(E’’))
1. E E’ and IH(E’,E’’) by assumption
2. {} ` E ok and E * E’’ by assumption
3. {} ` E’ ok by Preservation with (2,1)
4. E’ * E’’ by inversion of S* and (2)
5. (steps(E) or isFinal(E’’))
by IH with (3, 4)
![Page 19: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/19.jpg)
Proof: Soundness Theorem
case S*: (steps(E’’) or isFinal(E’’))
1. E E’ and IH(E’,E’’) by assumption
2. {} ` E ok and E * E’’ by assumption
3. {} ` E’ ok by Preservation with (2,1)
4. E’ * E’’ by ??
5. (steps(E’’) or isFinal(E’’))
by IH with (3, 4)
![Page 20: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/20.jpg)
Proof: Soundness Theorem
case S*: (steps(E’’) or isFinal(E’’))
1. E E’ and IH(E’,E’’) by assumption
2. {} ` E ok and E * E’’ by assumption
3. {} ` E’ ok by Preservation with (2,1)
4. E’ * E’’ by inversion of S* and (2)
5. (steps(E’’) or isFinal(E’’))
by IH with (3, 4)
![Page 21: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/21.jpg)
Proof: Soundness Theorem
case S*:
1. E E’ and IH(E’,E’’) by assumption
2. {} ` E ok and E * E’’ by assumption
3. {} ` E’ ok by Preservation with (2,1)
4. E’ * E’’ by inversion of S* and (2)
5. (steps(E’’) or isFinal(E’’))
by ??
![Page 22: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/22.jpg)
Proof: Soundness Theorem
case S*:
1. E E’ and IH(E’,E’’) by assumption
2. {} ` E ok and E * E’’ by assumption
3. {} ` E’ ok by Preservation with (2,1)
4. E’ * E’’ by inversion of S* and (2)
5. (steps(E’’) or isFinal(E’’))
by IH(E’,E’’) with (3, 4)
![Page 23: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/23.jpg)
Notes About our Proof
• Note our Proof works for any single step relation ()
• Specific details of step function factored into Progress and Preservation lemmas
• Need to refer to the static and dynamic semantics of the step relation to prove Progress and Preservation Lemmas
![Page 24: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/24.jpg)
Static Semantics for -calculus
Names x 2 …Expressions e ::= lam(x.e) | apply(e1,e2)| x
` X okX 2
ok-V
` apply(E1,E2)ok
` E1 ok ` E2 okok-A
` lam(X.E)ok
[ {X} ` E ok X ok-L
![Page 25: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/25.jpg)
Dynamic Semantics for -calculus
((x.e1) e2) ((x.e1) e’2)
e2 e’2A2
((x.e1) (y.e2)) [xÃ(y.e2)] e1 A1
(e1 e2) (e’1 e2)
e1 e’1 A3
I = { E | {} ` E ok }
S = { E | 9. ` E ok }
F = { x.e | {} ` x.e ok }
![Page 26: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/26.jpg)
Proof: Preservation Lemma
Proof by induction on the derivations of E E’
case A1: IH(((X.E1) (Y.E2)),[X Ã (Y.E2)] E1)
case A2: If IH(E2,E’2) then
IH(((X.E1) E2)),((X.E1) E’2))
case A3: If IH(E1,E’1) then
IH((E1 E2)),(E’1 E2))
IH(e,e’) = If {} ` e ok and e e’ then {} ` e’ ok
![Page 27: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/27.jpg)
Proof: Preservation Lemma
case A1: If {} ` ((X.E1) (Y.E1)) ok and ((X.E1) (Y.E1)) [X Ã (Y.E2)] E1 then {} ` [X Ã (Y.E2)] E1 ok
![Page 28: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/28.jpg)
Proof: Preservation Lemma
case A1: {} ` [X Ã (Y.E2)] E1 ok
1. {} ` ((X.E1) (Y.E2)) ok and ((X.E1) (Y.E2)) [X Ã (Y.E2)] E1 by assumption
2. {} ` (X.E1) ok and {} ` (Y.E2) okby inversion of ok-A and (1)
3. {} [ {X} ` E1 ok by inversion of ok-L and (2)
4. {} ` [X Ã (Y.E2)] E1 ok by Substitution Lemma with (3) and (2)
![Page 29: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/29.jpg)
Proof: Preservation Lemma
case A1: {} ` [X Ã (Y.E2)] E1 ok
1. {} ` ((X.E1) (Y.E2)) ok and ((X.E1) (Y.E2)) [X Ã (Y.E2)] E1 by assumption
2. {} ` (X.E1) ok and {} ` (Y.E2) okby ??
3. {} [ {X} ` E1 ok by inversion of ok-L and (2)
4. {} ` [X Ã (Y.E2)] E1 ok by Substitution Lemma with (3) and (2)
![Page 30: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/30.jpg)
Proof: Preservation Lemma
case A1: {} ` [X Ã (Y.E2)] E1 ok
1. {} ` ((X.E1) (Y.E2)) ok and ((X.E1) (Y.E2)) [X Ã (Y.E2)] E1 by assumption
2. {} ` (X.E1) ok and {} ` (Y.E2) okby inversion of ok-A and (1)
3. {} [ {X} ` E1 ok by inversion of ok-L and (2)
4. {} ` [X Ã (Y.E2)] E1 ok by Substitution Lemma with (3) and (2)
![Page 31: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/31.jpg)
Proof: Preservation Lemma
case A1: {} ` [X Ã (Y.E2)] E1 ok
1. {} ` ((X.E1) (Y.E2)) ok and ((X.E1) (Y.E2)) [X Ã (Y.E2)] E1 by assumption
2. {} ` (X.E1) ok and {} ` (Y.E2) okby inversion of ok-A and (1)
3. {} [ {X} ` E1 ok by ??
4. {} ` [X Ã (Y.E2)] E1 ok by Substitution Lemma with (3) and (2)
![Page 32: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/32.jpg)
Proof: Preservation Lemma
case A1: {} ` [X Ã (Y.E2)] E1 ok
1. {} ` ((X.E1) (Y.E2)) ok and ((X.E1) (Y.E2)) [X Ã (Y.E2)] E1 by assumption
2. {} ` (X.E1) ok and {} ` (Y.E2) okby inversion of ok-A and (1)
3. {} [ {X} ` E1 ok by inversion of ok-L and (2)
4. {} ` [X Ã (Y.E2)] E1 ok by Substitution Lemma with (3) and (2)
![Page 33: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/33.jpg)
Proof: Preservation Lemma
case A1: {} ` [X Ã (Y.E2)] E1 ok
1. {} ` ((X.E1) (Y.E2)) ok and ((X.E1) (Y.E2)) [X Ã (Y.E2)] E1 by assumption
2. {} ` (X.E1) ok and {} ` (Y.E2) okby inversion of ok-A and (1)
3. {} [ {X} ` E1 ok by inversion of ok-L and (2)
4. {} ` [X Ã (Y.E2)] E1 ok by ??
![Page 34: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/34.jpg)
Proof: Preservation Lemma
case A1: {} ` [X Ã (Y.E2)] E1 ok
1. {} ` ((X.E1) (Y.E2)) ok and ((X.E1) (Y.E2)) [X Ã (Y.E2)] E1 by assumption
2. {} ` (X.E1) ok and {} ` (Y.E2) okby inversion of ok-A and (1)
3. {} [ {X} ` E1 ok by inversion of ok-L and (2)
4. {} ` [X Ã (Y.E2)] E1 ok by Substitution Lemma with (3) and (2)
![Page 35: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/35.jpg)
Substitution Lemma
Proof by induction on the derivations of ` E ok
If [ {X} ` E ok and {} ` E’ ok then
` [XÃE’]E ok
case ok-V: …
case ok-L: …
case ok-A: …
IH(env,e) = If env [ {X} ` e ok and {} ` E’ ok then env ` [XÃE’]e ok
![Page 36: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/36.jpg)
Substitution
Proof by induction on the derivations of ` E okIf [ {X} ` E ok and {} ` E’ ok then ` [XÃE’]E ok
case ok-V: If X 2 then IH(,X)case ok-L: If IH( [ {X}, E) and X then
IH(,(X.E))case ok-A: If IH(,E1) and IH(,E2) then
IH(,(E1 E2))
IH(env,e) = If env [ {X} ` e ok and {} ` E’ ok then env ` [XÃE’]e ok
![Page 37: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/37.jpg)
Proof: Substitution
case ok-V: 1. X 2 by assumption2.[ {Y} ` X ok and {} ` E’ ok by assumption3. ` [YÃE’]X ok by casescase X = Y:
3.1. [YÃE’]X = E’ by def of subst.3.2. ` E’ ok by (2)3.3. ` [YÃE’]X ok by (3.1) and (3.2)
case X Y:3.1. [YÃE’]X = X by def of subst.3.2. ` X ok by ok-V and (1)3.3. ` [YÃE’]X ok by (3.1) and (3.2)
![Page 38: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/38.jpg)
Proof: Substitution
case ok-L: If IH( [ {X}, E) and X then IH(,(X.E))
…
![Page 39: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/39.jpg)
Proof: Substitution
case ok-A: If IH(,E1) and IH(,E2) then IH(,(E1 E2))
…
![Page 40: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/40.jpg)
Proof: Preservation Lemma
case A2: If IH(E2,E’2) then
IH(((X.E1) E2)),((X.E1) E’2))
![Page 41: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/41.jpg)
Proof: Preservation Lemma
case A2: IH(((X.E1) E2)),((X.E1) E’2))
1. IH(E2,E’2) by assumption
![Page 42: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/42.jpg)
Proof: Preservation Lemma
case A2: If {} ` ((X.E1) E2)) ok and
((X.E1) E2)) ((X.E1) E’2) then
{} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
![Page 43: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/43.jpg)
Proof: Preservation Lemma
case A2: {} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
2. {} ` ((X.E1) E2)) ok and ((X.E1) E2)) ((X.E1) E’2) by assumption
3. {} ` (X.E1) ok and {} ` E2 ok by inversion of ok-A and (2)
4. E2 E’2 by inversion of A2
5. {} ` E’2 ok by IH(E2,E’2) with (3) and (4)
6. {} ` ((X.E1) E’2) okby ok-A with (3) and (5)
![Page 44: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/44.jpg)
Proof: Preservation Lemma
case A2: {} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
2. {} ` ((X.E1) E2)) ok and ((X.E1) E2)) ((X.E1) E’2) by assumption
3. {} ` (X.E1) ok and {} ` E2 ok by ??
4. E2 E’2 by inversion of A2
5. {} ` E’2 ok by IH(E2,E’2) with (3) and (4)
6. {} ` ((X.E1) E’2) okby ok-A with (3) and (5)
![Page 45: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/45.jpg)
Proof: Preservation Lemma
case A2: {} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
2. {} ` ((X.E1) E2)) ok and ((X.E1) E2)) ((X.E1) E’2) by assumption
3. {} ` (X.E1) ok and {} ` E2 ok by inversion of ok-A and (2)
4. E2 E’2 by inversion of A2
5. {} ` E’2 ok by IH(E2,E’2) with (3) and (4)
6. {} ` ((X.E1) E’2) okby ok-A with (3) and (5)
![Page 46: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/46.jpg)
Proof: Preservation Lemma
case A2: {} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
2. {} ` ((X.E1) E2)) ok and ((X.E1) E2)) ((X.E1) E’2) by assumption
3. {} ` (X.E1) ok and {} ` E2 ok by inversion of ok-A and (2)
4. E2 E’2 by ??
5. {} ` E’2 ok by IH(E2,E’2) with (3) and (4)
6. {} ` ((X.E1) E’2) okby ok-A with (3) and (5)
![Page 47: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/47.jpg)
Proof: Preservation Lemma
case A2: {} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
2. {} ` ((X.E1) E2)) ok and ((X.E1) E2)) ((X.E1) E’2) by assumption
3. {} ` (X.E1) ok and {} ` E2 ok by inversion of ok-A and (2)
4. E2 E’2 by inversion of A2 and (2)
5. {} ` E’2 ok by IH(E2,E’2) with (3) and (4)
6. {} ` ((X.E1) E’2) okby ok-A with (3) and (5)
![Page 48: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/48.jpg)
Proof: Preservation Lemma
case A2: {} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
2. {} ` ((X.E1) E2)) ok and ((X.E1) E2)) ((X.E1) E’2) by assumption
3. {} ` (X.E1) ok and {} ` E2 ok by inversion of ok-A and (2)
4. E2 E’2 by inversion of A2 and (2)
5. {} ` E’2 ok by ??
6. {} ` ((X.E1) E’2) okby ok-A with (3) and (5)
![Page 49: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/49.jpg)
Proof: Preservation Lemma
case A2: {} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
2. {} ` ((X.E1) E2)) ok and ((X.E1) E2)) ((X.E1) E’2) by assumption
3. {} ` (X.E1) ok and {} ` E2 ok by inversion of ok-A and (2)
4. E2 E’2 by inversion of A2 and (2)
5. {} ` E’2 ok by IH(E2,E’2) with (3) and (4)
6. {} ` ((X.E1) E’2) okby ok-A with (3) and (5)
![Page 50: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/50.jpg)
Proof: Preservation Lemma
case A2: {} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
2. {} ` ((X.E1) E2)) ok and ((X.E1) E2)) ((X.E1) E’2) by assumption
3. {} ` (X.E1) ok and {} ` E2 ok by inversion of ok-A and (2)
4. E2 E’2 by inversion of A2 and (2)
5. {} ` E’2 ok by IH(E2,E’2) with (3) and (4)
6. {} ` ((X.E1) E’2) okby ??
![Page 51: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/51.jpg)
Proof: Preservation Lemma
case A2: {} ` ((X.E1) E’2) ok
1. IH(E2,E’2) by assumption
2. {} ` ((X.E1) E2)) ok and ((X.E1) E2)) ((X.E1) E’2) by assumption
3. {} ` (X.E1) ok and {} ` E2 ok by inversion of ok-A and (2)
4. E2 E’2 by inversion of A2 and (2)
5. {} ` E’2 ok by IH(E2,E’2) with (3) and (4)
6. {} ` ((X.E1) E’2) okby ok-A with (3) and (5)
![Page 52: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/52.jpg)
Proof: Preservation Lemma
case A3: If IH(E1,E’1) then
IH(E1 E2)),(E’1 E2))
![Page 53: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/53.jpg)
Proof: Preservation Lemma
case A3: IH((E1 E2)),((E’1 E2))
1. IH(E1,E’1) by assumption
![Page 54: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/54.jpg)
Proof: Preservation Lemma
case A3: If {} ` (E1 E2) ok and
(E1 E2) (E’1 E2) then {} ` (E’1 E2) ok
1. IH(E1,E’1) by assumption
![Page 55: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/55.jpg)
Proof: Preservation Lemma
case A3: {} ` (E’1 E2) ok
1. IH(E1,E’1) by assumption
2. {} ` (E1 E2) ok and (E1 E2) (E’1 E’2)by assumption
3. {} ` E1 ok and {} ` E2 ok by inversion of ok-A and (2)
4. E1 E’1 by inversion of A3 and (2)
5. {} ` E’1 ok by IH(E1,E’1) with (3) and (4)
6. {} ` (E’1 E2) ok by ok-A with (5) and (3)
![Page 56: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/56.jpg)
Proof: Preservation Lemma
case A3: {} ` (E’1 E2) ok
1. IH(E1,E’1) by assumption
2. {} ` (E1 E2) ok and (E1 E2) (E’1 E’2)by assumption
3. {} ` E1 ok and {} ` E2 ok by inversion of ok-A and (2)
4. E1 E’1 by inversion of A3 and (2)
5. {} ` E’1 ok by IH(E1,E’1) with (3) and (4)
6. {} ` (E’1 E2) ok by ok-A with (5) and (3)
![Page 57: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/57.jpg)
Proof: Preservation Lemma
case A3: {} ` (E’1 E2) ok
1. IH(E1,E’1) by assumption
2. {} ` (E1 E2) ok and (E1 E2) (E’1 E’2)by assumption
3. {} ` E1 ok and {} ` E2 ok by inversion of ok-A and (2)
4. E1 E’1 by inversion of A3 and (2)
5. {} ` E’1 ok by IH(E1,E’1) with (3) and (4)
6. {} ` (E’1 E2) ok by ok-A with (5) and (3)
![Page 58: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/58.jpg)
Proof: Preservation Lemma
case A3: {} ` (E’1 E2) ok
1. IH(E1,E’1) by assumption
2. {} ` (E1 E2) ok and (E1 E2) (E’1 E’2)by assumption
3. {} ` E1 ok and {} ` E2 ok by inversion of ok-A and (2)
4. E1 E’1 by inversion of A3 and (2)
5. {} ` E’1 ok by IH(E1,E’1) with (3) and (4)
6. {} ` (E’1 E2) ok by ok-A with (5) and (3)
![Page 59: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/59.jpg)
Proof: Preservation Lemma
case A3: {} ` (E’1 E2) ok
1. IH(E1,E’1) by assumption
2. {} ` (E1 E2) ok and (E1 E2) (E’1 E’2)by assumption
3. {} ` E1 ok and {} ` E2 ok by inversion of ok-A and (2)
4. E1 E’1 by inversion of A3 and (2)
5. {} ` E’1 ok by IH(E1,E’1) with (3) and (4)
6. {} ` (E’1 E2) ok by ok-A with (5) and (3)
![Page 60: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/60.jpg)
Progress Lemma
Proof by induction on the derivations of ` E ok
case ok-V: If X 2 then IH(,X)case ok-L: If IH([ {X}, E) and X then
IH(,(X.E))
case ok-A: If IH(,E1) and IH(,E2) then IH(,(E1 E2))
IH(env,e) = If env = {} and env ` e ok then (steps(e) or isFinal(e))
![Page 61: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/61.jpg)
Proof: Progress Lemma
case ok-V: If X 2 then IH(,X)
![Page 62: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/62.jpg)
Proof: Progress Lemma
case ok-V: IH(,X)
1. X 2 by assumption
![Page 63: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/63.jpg)
Proof: Progress Lemma
case ok-V: If = {} and ` X ok then
(steps(X) or isFinal(X))
1. X 2 by assumption
![Page 64: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/64.jpg)
Proof: Progress Lemma
case ok-V: If = {} and {} ` X ok then
(steps(X) or isFinal(X))
1. X 2 by assumption
![Page 65: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/65.jpg)
Proof: Progress Lemma
case ok-V: steps(X) or isFinal(X)
1. X 2 by assumption
2. = {} and {} ` X ok by assumption
3. X 2 {} by (1) and (2)
4. (steps(X) or isFinal(X)) by contradiction implied by (3)
![Page 66: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/66.jpg)
Proof: Progress Lemma
case ok-V: steps(X) or isFinal(X)
1. X 2 by assumption
2. = {} and {} ` X ok by assumption
3. X 2 {} by ??
4. (steps(X) or isFinal(X)) by contradiction implied by (3)
![Page 67: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/67.jpg)
Proof: Progress Lemma
case ok-V: steps(X) or isFinal(X)
1. X 2 by assumption
2. = {} and {} ` X ok by assumption
3. X 2 {} by (1) and (2)
4. (steps(X) or isFinal(X)) by contradiction implied by (3)
![Page 68: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/68.jpg)
Proof: Progress Lemma
case ok-V: (steps(X) or isFinal(X))
1. X 2 by assumption
2. = {} and {} ` X ok by assumption
3. X 2 {} by (2) and invert-ok-V
4. steps(X) or isFinal(X) by ??
![Page 69: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/69.jpg)
Proof: Progress Lemma
case ok-V: (steps(X) or isFinal(X))
1. X 2 by assumption
2. = {} and {} ` X ok by assumption
3. X 2 {} by (2) and invert-ok-V
4. steps(X) or isFinal(X) by contradiction implied by (3)
![Page 70: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/70.jpg)
Proof: Progress Lemma
case ok-L: If IH([ {X}, E) and X then IH(,(X.E))
![Page 71: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/71.jpg)
Proof: Progress Lemma
case ok-L: IH(,(X.E))
1. IH([ {X}, E) and X by assumption
![Page 72: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/72.jpg)
Proof: Progress Lemma
case ok-L: If = {} and ` (X.E) ok then (steps((X.E)) or isFinal((X.E)))
1. IH([ {X}, E) and X by assumption
![Page 73: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/73.jpg)
Proof: Progress Lemma
case ok-L: steps((X.E)) or isFinal((X.E))
1. IH([ {X}, E) and X by assumption
2. = {} and ` (X.E) ok by assumption
3. {} ` (X.E) ok by (2)
4. (X.E) 2 F by definition of F and (3)
5. isFinal((X.E)) by definition of isFinal and (4)
6. steps((X.E)) or isFinal((X.E)) by (5)
![Page 74: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/74.jpg)
Proof: Progress Lemma
case ok-L: steps((X.E)) or isFinal((X.E))
1. IH([ {X}, E) and X by assumption
2. = {} and ` (X.E) ok by assumption
3. {} ` (X.E) ok by ??
4. (X.E) 2 F by definition of F and (3)
5. isFinal((X.E)) by definition of isFinal and (4)
6. steps((X.E)) or isFinal((X.E)) by (5)
![Page 75: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/75.jpg)
Proof: Progress Lemma
case ok-L: steps((X.E)) or isFinal((X.E))
1. IH([ {X}, E) and X by assumption
2. = {} and ` (X.E) ok by assumption
3. {} ` (X.E) ok by (2)
4. (X.E) 2 F by definition of F and (3)
5. isFinal((X.E)) by definition of isFinal and (4)
6. steps((X.E)) or isFinal((X.E)) by (5)
![Page 76: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/76.jpg)
Proof: Progress Lemma
case ok-L: steps((X.E)) or isFinal((X.E))
1. IH([ {X}, E) and X by assumption
2. = {} and ` (X.E) ok by assumption
3. {} ` (X.E) ok by (2)
4. (X.E) 2 F by ??
5. isFinal((X.E)) by definition of isFinal and (4)
6. steps((X.E)) or isFinal((X.E)) by (5)
![Page 77: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/77.jpg)
Proof: Progress Lemma
case ok-L: steps((X.E)) or isFinal((X.E))
1. IH([ {X}, E) and X by assumption
2. = {} and ` (X.E) ok by assumption
3. {} ` (X.E) ok by (2)
4. (X.E) 2 F by definition of F and (3)
5. isFinal((X.E)) by definition of isFinal and (4)
6. steps((X.E)) or isFinal((X.E)) by (5)
![Page 78: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/78.jpg)
Proof: Progress Lemma
case ok-L: steps((X.E)) or isFinal((X.E))
1. IH([ {X}, E) and X by assumption
2. = {} and ` (X.E) ok by assumption
3. {} ` (X.E) ok by (2)
4. (X.E) 2 F by definition of F and (3)
5. isFinal((X.E)) by ??
6. steps((X.E)) or isFinal((X.E)) by (5)
![Page 79: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/79.jpg)
Proof: Progress Lemma
case ok-L: steps((X.E)) or isFinal((X.E))
1. IH([ {X}, E) and X by assumption
2. = {} and ` (X.E) ok by assumption
3. {} ` (X.E) ok by (2)
4. (X.E) 2 F by definition of F and (3)
5. isFinal((X.E)) by definition of isFinal and (4)
6. steps((X.E)) or isFinal((X.E)) by (5)
![Page 80: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/80.jpg)
Proof: Progress Lemma
case ok-L: steps((X.E)) or isFinal((X.E))
1. IH([ {X}, E) and X by assumption
2. = {} and ` (X.E) ok by assumption
3. {} ` (X.E) ok by (2)
4. (X.E) 2 F by definition of F and (3)
5. isFinal((X.E)) by definition of isFinal and (4)
6. steps((X.E)) or isFinal((X.E)) by ??
![Page 81: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/81.jpg)
Proof: Progress Lemma
case ok-L: steps((X.E)) or isFinal((X.E))
1. IH([ {X}, E) and X by assumption
2. = {} and ` (X.E) ok by assumption
3. {} ` (X.E) ok by (2)
4. (X.E) 2 F by definition of F and (3)
5. isFinal((X.E)) by definition of isFinal and (4)
6. steps((X.E)) or isFinal((X.E)) by (5)
![Page 82: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/82.jpg)
Proof: Progress Lemma
case ok-A: If IH(,E1) and IH(,E2) then IH(,(E1 E2))
![Page 83: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/83.jpg)
Proof: Progress Lemma
case ok-A: IH(,(E1 E2))
1. IH(,E1) and IH(,E2)
![Page 84: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/84.jpg)
Proof: Progress Lemma
case ok-A: If = {} and ` (E1 E2) ok then (steps((E1 E2)) or isFinal((E1 E2)))
1. IH(,E1) and IH(,E2) by assumption
![Page 85: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/85.jpg)
Proof: Progress Lemma
case ok-A: steps((E1 E2)) or isFinal((E1 E2))
1. IH(,E1) and IH(,E2) by assumption
2. = {} and ` (E1 E2) ok by assumption
3. {} ` (E1 E2) ok by (2)
4. {} ` E1 ok and {} ` E2 ok by inversion of ok-A
5. 9 e. (E1 E2) e by induction on (E1 E2) e …
6. steps((E1 E2)) by definition of steps and (5)
7. steps((E1 E2)) or isFinal((E1 E2)) by (6)
![Page 86: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/86.jpg)
Proof: Progress Lemma
case ok-A: steps((E1 E2)) or isFinal((E1 E2))
1. IH(,E1) and IH(,E2) by assumption
2. = {} and ` (E1 E2) ok by assumption
3. {} ` (E1 E2) ok by (2)
4. {} ` E1 ok and {} ` E2 ok by inversion of ok-A
5. 9 e. (E1 E2) e by induction on (E1 E2) e …
6. steps((E1 E2)) by definition of steps and (5)
7. steps((E1 E2)) or isFinal((E1 E2)) by (6)
![Page 87: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/87.jpg)
Proof: Progress Lemma
case ok-A: steps((E1 E2)) or isFinal((E1 E2))
1. IH(,E1) and IH(,E2) by assumption
2. = {} and ` (E1 E2) ok by assumption
3. {} ` (E1 E2) ok by (2)
4. {} ` E1 ok and {} ` E2 ok by inversion of ok-A
5. 9 e. (E1 E2) e by induction on (E1 E2) e …
6. steps((E1 E2)) by definition of steps and (5)
7. steps((E1 E2)) or isFinal((E1 E2)) by (6)
![Page 88: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/88.jpg)
Proof: Progress Lemma
case ok-A: steps((E1 E2)) or isFinal((E1 E2))
1. IH(,E1) and IH(,E2) by assumption
2. = {} and ` (E1 E2) ok by assumption
3. {} ` (E1 E2) ok by (2)
4. {} ` E1 ok and {} ` E2 ok by inversion of ok-A
5. 9 e. (E1 E2) e by cases …
6. steps((E1 E2)) by definition of steps and (5)
7. steps((E1 E2)) or isFinal((E1 E2)) by (6)
![Page 89: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/89.jpg)
Proof: Progress Lemma
case ok-A: steps((E1 E2)) or isFinal((E1 E2))
1. IH(,E1) and IH(,E2) by assumption
2. = {} and ` (E1 E2) ok by assumption
3. {} ` (E1 E2) ok by (2)
4. {} ` E1 ok and {} ` E2 ok by inversion of ok-A
5. 9 e. (E1 E2) e by cases …
6. steps((E1 E2)) by definition of steps and (5)
7. steps((E1 E2)) or isFinal((E1 E2)) by (6)
![Page 90: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/90.jpg)
Proof: Progress Lemma
case ok-A: steps((E1 E2)) or isFinal((E1 E2))
1. IH(,E1) and IH(,E2) by assumption
2. = {} and ` (E1 E2) ok by assumption
3. {} ` (E1 E2) ok by (2)
4. {} ` E1 ok and {} ` E2 ok by inversion of ok-A
5. 9 e. (E1 E2) e by cases …
6. steps((E1 E2)) by definition of steps and (5)
7. steps((E1 E2)) or isFinal((E1 E2)) by (6)
![Page 91: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/91.jpg)
Proof: Progress Lemma
5. 9 e. (E1 E2) e by cases (E1 E2)
case E1 = (X’.E’) and E2 = (X’’.E’’):
5.1. (E1 E2) [X’ Ã(X’’.E’’) ] E’ by A1
case E1 = (X’.E’) and E2 F:
5.1. E2 E’2 by IH({},E2) with (4) and E2 F
5.2. (E1 E2) (E1 E’2) by A2 with (5.1)
case E1 F :
5.1. E1 E’1 by IH({},E1) with (4) and E1 F
5.2. (E’1 E2) (E’1 E2) by A3 with (5.1)
![Page 92: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/92.jpg)
Proof: Progress Lemma
5. 9 e. (E1 E2) e by cases (E1 E2)
case E1 = (X’.E’) and E2 = (X’’.E’’):
5.1. (E1 E2) [X’ Ã(X’’.E’’) ] E’ by ??
case E1 = (X’.E’) and E2 F:
5.1. E2 E’2 by IH({},E2) with (4) and E2 F
5.2. (E1 E2) (E1 E’2) by A2 with (5.1)
case E1 F :
5.1. E1 E’1 by IH({},E1) with (4) and E1 F
5.2. (E’1 E2) (E’1 E2) by A3 with (5.1)
![Page 93: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/93.jpg)
Proof: Progress Lemma
5. 9 e. (E1 E2) e by cases (E1 E2)
case E1 = (X’.E’) and E2 = (X’’.E’’):
5.1. (E1 E2) [X’ Ã(X’’.E’’) ] E’ by A1
case E1 = (X’.E’) and E2 F:
5.1. E2 E’2 by IH({},E2) with (4) and E2 F
5.2. (E1 E2) (E1 E’2) by A2 with (5.1)
case E1 F :
5.1. E1 E’1 by IH({},E1) with (4) and E1 F
5.2. (E’1 E2) (E’1 E2) by A3 with (5.1)
![Page 94: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/94.jpg)
Proof: Progress Lemma
5. 9 e. (E1 E2) e by cases (E1 E2)
case E1 = (X’.E’) and E2 = (X’’.E’’):
5.1. (E1 E2) [X’ Ã(X’’.E’’) ] E’ by A1
case E1 = (X’.E’) and E2 F:
5.1. E2 E’2 by ??
5.2. (E1 E2) (E1 E’2)
case E1 F :
5.1. E1 E’1 by IH({},E1) with (4) and E1 F
5.2. (E’1 E2) (E’1 E2) by A3 with (5.1)
![Page 95: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/95.jpg)
Proof: Progress Lemma
5. 9 e. (E1 E2) e by cases (E1 E2)
case E1 = (X’.E’) and E2 = (X’’.E’’):
5.1. (E1 E2) [X’ Ã(X’’.E’’) ] E’ by A1
case E1 = (X’.E’) and E2 F:
5.1. E2 E’2 by IH({},E2) with (4) and E2 F
5.2. (E1 E2) (E1 E’2) by ??
case E1 F :
5.1. E1 E’1 by IH({},E1) with (4) and E1 F
5.2. (E’1 E2) (E’1 E2) by A3 with (5.1)
![Page 96: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/96.jpg)
Proof: Progress Lemma
5. 9 e. (E1 E2) e by cases (E1 E2)
case E1 = (X’.E’) and E2 = (X’’.E’’):
5.1. (E1 E2) [X’ Ã(X’’.E’’) ] E’ by A1
case E1 = (X’.E’) and E2 F:
5.1. E2 E’2 by IH({},E2) with (4) and E2 F
5.2. (E1 E2) (E1 E’2) by A2 with (5.1)
case E1 F :
5.1. E1 E’1 by IH({},E1) with (4) and E1 F
5.2. (E’1 E2) (E’1 E2) by A3 with (5.1)
![Page 97: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/97.jpg)
Proof: Progress Lemma
5. 9 e. (E1 E2) e by cases (E1 E2)
case E1 = (X’.E’) and E2 = (X’’.E’’):
5.1. (E1 E2) [X’ Ã(X’’.E’’) ] E’ by A1
case E1 = (X’.E’) and E2 F:
5.1. E2 E’2 by IH({},E2) with (4) and E2 F
5.2. (E1 E2) (E1 E’2) by A2 with (5.1)
case E1 F :
5.1. E1 E’1 by ??
5.2. (E’1 E2) (E’1 E2)
![Page 98: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/98.jpg)
Proof: Progress Lemma
5. 9 e. (E1 E2) e by cases (E1 E2)
case E1 = (X’.E’) and E2 = (X’’.E’’):
5.1. (E1 E2) [X’ Ã(X’’.E’’) ] E’ by A1
case E1 = (X’.E’) and E2 F:
5.1. E2 E’2 by IH({},E2) with (4) and E2 F
5.2. (E1 E2) (E1 E’2) by A2 with (5.1)
case E1 F :
5.1. E1 E’1 by IH({},E1) with (4) and E1 F
5.2. (E’1 E2) (E’1 E2) by ??
![Page 99: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/99.jpg)
Proof: Progress Lemma
5. 9 e. (E1 E2) e by cases (E1 E2)
case E1 = (X’.E’) and E2 = (X’’.E’’):
5.1. (E1 E2) [X’ Ã(X’’.E’’) ] E’ by A1
case E1 = (X’.E’) and E2 F:
5.1. E2 E’2 by IH({},E2) with (4) and E2 F
5.2. (E1 E2) (E1 E’2) by A2 with (5.1)
case E1 F :
5.1. E1 E’1 by IH({},E1) with (4) and E1 F
5.2. (E’1 E2) (E’1 E2) by A3 with (5.1)
![Page 100: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/100.jpg)
Summary
Soundness Theorem:If {} ` E ok and E * E’ then :stuck(E’)
Preservation Lemma: If {} ` E ok and E E’ then {} ` E’ ok
Progress Lemma:If {} ` E ok then (steps(E) or isFinal(E))
Substitution Lemma:If [ {X} ` E ok and {} ` E’ ok then
` [XÃE’]E ok
![Page 101: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/101.jpg)
Summary
• Soundness follows from Preservation and Progress by induction on the ?? relation– Soundness means well formed programs
don’t get “stuck”
![Page 102: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/102.jpg)
Summary
• Soundness follows from Preservation and Progress by induction on the * relation– Soundness means well formed programs
don’t get “stuck”
![Page 103: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/103.jpg)
Summary
• Soundness follows from Preservation and Progress by induction on the * relation– Soundness means well formed programs
don’t get “stuck”
• Preservation follows by induction on the ?? relation
![Page 104: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/104.jpg)
Summary
• Soundness follows from Preservation and Progress by induction on the * relation– Soundness means well formed programs
don’t get “stuck”
• Preservation follows by induction on the relation
![Page 105: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/105.jpg)
Summary
• Soundness follows from Preservation and Progress by induction on the * relation– Soundness means well formed programs
don’t get “stuck”
• Preservation follows by induction on the relation
• Progress follows by induction on the wellformedness relation ??
![Page 106: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/106.jpg)
Summary
• Soundness follows from Preservation and Progress by induction on the * relation– Soundness means well formed programs
don’t get “stuck”
• Preservation follows by induction on the relation
• Progress follows by induction on the wellformedness relation ( ` E ok)
![Page 107: Relating Static and Dynamic Semantics](https://reader036.vdocument.in/reader036/viewer/2022062314/5681457e550346895db25642/html5/thumbnails/107.jpg)
Lesson Learned
• High-level structure of soundness proof– All soundness for SOS semantics proofs are
basically the same – The details vary in small but important ways
• Proofs are straightforward but tedious – Details easy to get confused if not organized
• Someone ought to automate these proofs or at least their checking – See Twelf, Coq, Isabella/HOL … etc.