url
stringclasses
147 values
commit
stringclasses
147 values
file_path
stringlengths
7
101
full_name
stringlengths
1
94
start
stringlengths
6
10
end
stringlengths
6
11
tactic
stringlengths
1
11.2k
state_before
stringlengths
3
2.09M
state_after
stringlengths
6
2.09M
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_if_Iff
[316, 9]
[341, 25]
cases h with | intro hB hS => apply BigStep.if_true <;> assumption
case mpr.inl B : State β†’ Prop S T : Stmt s t : State h : B s ∧ (S, s) ⟹ t ⊒ (Stmt.ifThenElse B S T, s) ⟹ t
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_if_Iff
[316, 9]
[341, 25]
apply BigStep.if_true <;> assumption
case mpr.inl.intro B : State β†’ Prop S T : Stmt s t : State hB : B s hS : (S, s) ⟹ t ⊒ (Stmt.ifThenElse B S T, s) ⟹ t
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_if_Iff
[316, 9]
[341, 25]
cases h with | intro hB hT => apply BigStep.if_false <;> assumption
case mpr.inr B : State β†’ Prop S T : Stmt s t : State h : Β¬B s ∧ (T, s) ⟹ t ⊒ (Stmt.ifThenElse B S T, s) ⟹ t
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_if_Iff
[316, 9]
[341, 25]
apply BigStep.if_false <;> assumption
case mpr.inr.intro B : State β†’ Prop S T : Stmt s t : State hB : Β¬B s hT : (T, s) ⟹ t ⊒ (Stmt.ifThenElse B S T, s) ⟹ t
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
apply Iff.intro
B : State β†’ Prop S : Stmt s u : State ⊒ (Stmt.whileDo B S, s) ⟹ u ↔ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s
case mp B : State β†’ Prop S : Stmt s u : State ⊒ (Stmt.whileDo B S, s) ⟹ u β†’ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s case mpr B : State β†’ Prop S : Stmt s u : State ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s β†’ (Stmt.whileDo B S, s) ⟹ u
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
{ intro h cases h with | while_true _ _ _ t _ hB hS hw => apply Or.intro_left apply Exists.intro t aesop | while_false _ _ _ hB => apply Or.intro_right aesop }
case mp B : State β†’ Prop S : Stmt s u : State ⊒ (Stmt.whileDo B S, s) ⟹ u β†’ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s case mpr B : State β†’ Prop S : Stmt s u : State ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s β†’ (Stmt.whileDo B S, s) ⟹ u
case mpr B : State β†’ Prop S : Stmt s u : State ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s β†’ (Stmt.whileDo B S, s) ⟹ u
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
{ intro h cases h with | inl hex => cases hex with | intro t h => cases h with | intro hB h => cases h with | intro hS hwhile => apply BigStep.while_true <;> assumption | inr h => cases h with | intro hB hus => rw [hus] apply BigStep.while_false assumption}
case mpr B : State β†’ Prop S : Stmt s u : State ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s β†’ (Stmt.whileDo B S, s) ⟹ u
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
intro h
case mp B : State β†’ Prop S : Stmt s u : State ⊒ (Stmt.whileDo B S, s) ⟹ u β†’ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s
case mp B : State β†’ Prop S : Stmt s u : State h : (Stmt.whileDo B S, s) ⟹ u ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
cases h with | while_true _ _ _ t _ hB hS hw => apply Or.intro_left apply Exists.intro t aesop | while_false _ _ _ hB => apply Or.intro_right aesop
case mp B : State β†’ Prop S : Stmt s u : State h : (Stmt.whileDo B S, s) ⟹ u ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
apply Or.intro_left
case mp.while_true B : State β†’ Prop S : Stmt s u t : State hB : B s hS : (S, s) ⟹ t hw : (Stmt.whileDo B S, t) ⟹ u ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s
case mp.while_true.h B : State β†’ Prop S : Stmt s u t : State hB : B s hS : (S, s) ⟹ t hw : (Stmt.whileDo B S, t) ⟹ u ⊒ βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
apply Exists.intro t
case mp.while_true.h B : State β†’ Prop S : Stmt s u t : State hB : B s hS : (S, s) ⟹ t hw : (Stmt.whileDo B S, t) ⟹ u ⊒ βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u
case mp.while_true.h B : State β†’ Prop S : Stmt s u t : State hB : B s hS : (S, s) ⟹ t hw : (Stmt.whileDo B S, t) ⟹ u ⊒ B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
aesop
case mp.while_true.h B : State β†’ Prop S : Stmt s u t : State hB : B s hS : (S, s) ⟹ t hw : (Stmt.whileDo B S, t) ⟹ u ⊒ B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
apply Or.intro_right
case mp.while_false B : State β†’ Prop S : Stmt s : State hB : Β¬B s ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ s) ∨ Β¬B s ∧ s = s
case mp.while_false.h B : State β†’ Prop S : Stmt s : State hB : Β¬B s ⊒ Β¬B s ∧ s = s
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
aesop
case mp.while_false.h B : State β†’ Prop S : Stmt s : State hB : Β¬B s ⊒ Β¬B s ∧ s = s
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
intro h
case mpr B : State β†’ Prop S : Stmt s u : State ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s β†’ (Stmt.whileDo B S, s) ⟹ u
case mpr B : State β†’ Prop S : Stmt s u : State h : (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s ⊒ (Stmt.whileDo B S, s) ⟹ u
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
cases h with | inl hex => cases hex with | intro t h => cases h with | intro hB h => cases h with | intro hS hwhile => apply BigStep.while_true <;> assumption | inr h => cases h with | intro hB hus => rw [hus] apply BigStep.while_false assumption
case mpr B : State β†’ Prop S : Stmt s u : State h : (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s ⊒ (Stmt.whileDo B S, s) ⟹ u
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
cases hex with | intro t h => cases h with | intro hB h => cases h with | intro hS hwhile => apply BigStep.while_true <;> assumption
case mpr.inl B : State β†’ Prop S : Stmt s u : State hex : βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u ⊒ (Stmt.whileDo B S, s) ⟹ u
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
cases h with | intro hB h => cases h with | intro hS hwhile => apply BigStep.while_true <;> assumption
case mpr.inl.intro B : State β†’ Prop S : Stmt s u t : State h : B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u ⊒ (Stmt.whileDo B S, s) ⟹ u
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
cases h with | intro hS hwhile => apply BigStep.while_true <;> assumption
case mpr.inl.intro.intro B : State β†’ Prop S : Stmt s u t : State hB : B s h : (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u ⊒ (Stmt.whileDo B S, s) ⟹ u
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
apply BigStep.while_true <;> assumption
case mpr.inl.intro.intro.intro B : State β†’ Prop S : Stmt s u t : State hB : B s hS : (S, s) ⟹ t hwhile : (Stmt.whileDo B S, t) ⟹ u ⊒ (Stmt.whileDo B S, s) ⟹ u
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
cases h with | intro hB hus => rw [hus] apply BigStep.while_false assumption
case mpr.inr B : State β†’ Prop S : Stmt s u : State h : Β¬B s ∧ u = s ⊒ (Stmt.whileDo B S, s) ⟹ u
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
rw [hus]
case mpr.inr.intro B : State β†’ Prop S : Stmt s u : State hB : Β¬B s hus : u = s ⊒ (Stmt.whileDo B S, s) ⟹ u
case mpr.inr.intro B : State β†’ Prop S : Stmt s u : State hB : Β¬B s hus : u = s ⊒ (Stmt.whileDo B S, s) ⟹ s
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
apply BigStep.while_false
case mpr.inr.intro B : State β†’ Prop S : Stmt s u : State hB : Β¬B s hus : u = s ⊒ (Stmt.whileDo B S, s) ⟹ s
case mpr.inr.intro.hcond B : State β†’ Prop S : Stmt s u : State hB : Β¬B s hus : u = s ⊒ Β¬B s
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_Iff
[343, 1]
[375, 22]
assumption
case mpr.inr.intro.hcond B : State β†’ Prop S : Stmt s u : State hB : Β¬B s hus : u = s ⊒ Β¬B s
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_true_Iff
[377, 9]
[384, 17]
rw [BigStep_while_Iff]
B : State β†’ Prop S : Stmt s u : State hcond : B s ⊒ (Stmt.whileDo B S, s) ⟹ u ↔ βˆƒ t, (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u
B : State β†’ Prop S : Stmt s u : State hcond : B s ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s ↔ βˆƒ t, (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_true_Iff
[377, 9]
[384, 17]
simp [hcond]
B : State β†’ Prop S : Stmt s u : State hcond : B s ⊒ (βˆƒ t, B s ∧ (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u) ∨ Β¬B s ∧ u = s ↔ βˆƒ t, (S, s) ⟹ t ∧ (Stmt.whileDo B S, t) ⟹ u
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_false_Iff
[386, 9]
[392, 17]
rw [BigStep_while_Iff]
B : State β†’ Prop S : Stmt s t : State hcond : Β¬B s ⊒ (Stmt.whileDo B S, s) ⟹ t ↔ t = s
B : State β†’ Prop S : Stmt s t : State hcond : Β¬B s ⊒ (βˆƒ t_1, B s ∧ (S, s) ⟹ t_1 ∧ (Stmt.whileDo B S, t_1) ⟹ t) ∨ Β¬B s ∧ t = s ↔ t = s
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.BigStep_while_false_Iff
[386, 9]
[392, 17]
simp [hcond]
B : State β†’ Prop S : Stmt s t : State hcond : Β¬B s ⊒ (βˆƒ t_1, B s ∧ (S, s) ⟹ t_1 ∧ (Stmt.whileDo B S, t_1) ⟹ t) ∨ Β¬B s ∧ t = s ↔ t = s
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
rw [sillyLoop]
⊒ RTC SmallStep (sillyLoop, State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
⊒ RTC SmallStep (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply RTC.head
⊒ RTC SmallStep (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
case hab ⊒ (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) β‡’ ?b case hbc ⊒ RTC SmallStep ?b (Stmt.skip, fun x => 0) case b ⊒ Stmt Γ— State
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply SmallStep.whileDo }
case hab ⊒ (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) β‡’ ?b case hbc ⊒ RTC SmallStep ?b (Stmt.skip, fun x => 0) case b ⊒ Stmt Γ— State
case hbc ⊒ RTC SmallStep (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply RTC.head { apply SmallStep.if_true simp } { apply RTC.head { apply SmallStep.seq_step apply SmallStep.seq_skip } { apply RTC.head { apply SmallStep.seq_step apply SmallStep.assign } { apply RTC.head { apply SmallStep.seq_skip } { apply RTC.head { apply SmallStep.whileDo } { apply RTC.head { apply SmallStep.if_false simp } { simp apply RTC.refl } } } } } } }
case hbc ⊒ RTC SmallStep (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply SmallStep.whileDo
case hab ⊒ (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) β‡’ ?b
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply RTC.head
case hbc ⊒ RTC SmallStep (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
case hbc.hab ⊒ (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" 1 fun x => 0) β‡’ ?hbc.b case hbc.hbc ⊒ RTC SmallStep ?hbc.b (Stmt.skip, fun x => 0) case hbc.b ⊒ Stmt Γ— State
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply SmallStep.if_true simp }
case hbc.hab ⊒ (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" 1 fun x => 0) β‡’ ?hbc.b case hbc.hbc ⊒ RTC SmallStep ?hbc.b (Stmt.skip, fun x => 0) case hbc.b ⊒ Stmt Γ— State
case hbc.hbc ⊒ RTC SmallStep ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply RTC.head { apply SmallStep.seq_step apply SmallStep.seq_skip } { apply RTC.head { apply SmallStep.seq_step apply SmallStep.assign } { apply RTC.head { apply SmallStep.seq_skip } { apply RTC.head { apply SmallStep.whileDo } { apply RTC.head { apply SmallStep.if_false simp } { simp apply RTC.refl } } } } } }
case hbc.hbc ⊒ RTC SmallStep ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply SmallStep.if_true
case hbc.hab ⊒ (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" 1 fun x => 0) β‡’ ?hbc.b
case hbc.hab.hcond ⊒ State.update "x" 1 (fun x => 0) "x" > State.update "x" 1 (fun x => 0) "y"
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
simp
case hbc.hab.hcond ⊒ State.update "x" 1 (fun x => 0) "x" > State.update "x" 1 (fun x => 0) "y"
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply RTC.head
case hbc.hbc ⊒ RTC SmallStep ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
case hbc.hbc.hab ⊒ ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) β‡’ ?hbc.hbc.b case hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.b ⊒ Stmt Γ— State
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply SmallStep.seq_step apply SmallStep.seq_skip }
case hbc.hbc.hab ⊒ ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) β‡’ ?hbc.hbc.b case hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.b ⊒ Stmt Γ— State
case hbc.hbc.hbc ⊒ RTC SmallStep ((Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply RTC.head { apply SmallStep.seq_step apply SmallStep.assign } { apply RTC.head { apply SmallStep.seq_skip } { apply RTC.head { apply SmallStep.whileDo } { apply RTC.head { apply SmallStep.if_false simp } { simp apply RTC.refl } } } } }
case hbc.hbc.hbc ⊒ RTC SmallStep ((Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply SmallStep.seq_step
case hbc.hbc.hab ⊒ ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) β‡’ ?hbc.hbc.b
case hbc.hbc.hab.hS ⊒ (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1, State.update "x" 1 fun x => 0) β‡’ (?hbc.hbc.hab.S', ?hbc.hbc.hab.s') case hbc.hbc.hab.S' ⊒ Stmt case hbc.hbc.hab.s' ⊒ State
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply SmallStep.seq_skip
case hbc.hbc.hab.hS ⊒ (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1, State.update "x" 1 fun x => 0) β‡’ (?hbc.hbc.hab.S', ?hbc.hbc.hab.s') case hbc.hbc.hab.S' ⊒ Stmt case hbc.hbc.hab.s' ⊒ State
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply RTC.head
case hbc.hbc.hbc ⊒ RTC SmallStep ((Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) (Stmt.skip, fun x => 0)
case hbc.hbc.hbc.hab ⊒ ((Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) β‡’ ?hbc.hbc.hbc.b case hbc.hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.hbc.b ⊒ Stmt Γ— State
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply SmallStep.seq_step apply SmallStep.assign }
case hbc.hbc.hbc.hab ⊒ ((Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) β‡’ ?hbc.hbc.hbc.b case hbc.hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.hbc.b ⊒ Stmt Γ— State
case hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.skip; Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply RTC.head { apply SmallStep.seq_skip } { apply RTC.head { apply SmallStep.whileDo } { apply RTC.head { apply SmallStep.if_false simp } { simp apply RTC.refl } } } }
case hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.skip; Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply SmallStep.seq_step
case hbc.hbc.hbc.hab ⊒ ((Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" 1 fun x => 0) β‡’ ?hbc.hbc.hbc.b
case hbc.hbc.hbc.hab.hS ⊒ (Stmt.assign "x" fun s => s "x" - 1, State.update "x" 1 fun x => 0) β‡’ (?hbc.hbc.hbc.hab.S', ?hbc.hbc.hbc.hab.s') case hbc.hbc.hbc.hab.S' ⊒ Stmt case hbc.hbc.hbc.hab.s' ⊒ State
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply SmallStep.assign
case hbc.hbc.hbc.hab.hS ⊒ (Stmt.assign "x" fun s => s "x" - 1, State.update "x" 1 fun x => 0) β‡’ (?hbc.hbc.hbc.hab.S', ?hbc.hbc.hbc.hab.s') case hbc.hbc.hbc.hab.S' ⊒ Stmt case hbc.hbc.hbc.hab.s' ⊒ State
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply RTC.head
case hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.skip; Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
case hbc.hbc.hbc.hbc.hab ⊒ (Stmt.skip; Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) β‡’ ?hbc.hbc.hbc.hbc.b case hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.hbc.hbc.b ⊒ Stmt Γ— State
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply SmallStep.seq_skip }
case hbc.hbc.hbc.hbc.hab ⊒ (Stmt.skip; Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) β‡’ ?hbc.hbc.hbc.hbc.b case hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.hbc.hbc.b ⊒ Stmt Γ— State
case hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply RTC.head { apply SmallStep.whileDo } { apply RTC.head { apply SmallStep.if_false simp } { simp apply RTC.refl } } }
case hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply SmallStep.seq_skip
case hbc.hbc.hbc.hbc.hab ⊒ (Stmt.skip; Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) β‡’ ?hbc.hbc.hbc.hbc.b
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply RTC.head
case hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
case hbc.hbc.hbc.hbc.hbc.hab ⊒ (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) β‡’ ?hbc.hbc.hbc.hbc.hbc.b case hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.hbc.hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.hbc.hbc.hbc.b ⊒ Stmt Γ— State
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply SmallStep.whileDo }
case hbc.hbc.hbc.hbc.hbc.hab ⊒ (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) β‡’ ?hbc.hbc.hbc.hbc.hbc.b case hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.hbc.hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.hbc.hbc.hbc.b ⊒ Stmt Γ— State
case hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply RTC.head { apply SmallStep.if_false simp } { simp apply RTC.refl } }
case hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply SmallStep.whileDo
case hbc.hbc.hbc.hbc.hbc.hab ⊒ (Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1), State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) β‡’ ?hbc.hbc.hbc.hbc.hbc.b
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply RTC.head
case hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
case hbc.hbc.hbc.hbc.hbc.hbc.hab ⊒ (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) β‡’ ?hbc.hbc.hbc.hbc.hbc.hbc.b case hbc.hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.hbc.hbc.hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.hbc.hbc.hbc.hbc.b ⊒ Stmt Γ— State
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ apply SmallStep.if_false simp }
case hbc.hbc.hbc.hbc.hbc.hbc.hab ⊒ (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) β‡’ ?hbc.hbc.hbc.hbc.hbc.hbc.b case hbc.hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep ?hbc.hbc.hbc.hbc.hbc.hbc.b (Stmt.skip, fun x => 0) case hbc.hbc.hbc.hbc.hbc.hbc.b ⊒ Stmt Γ— State
case hbc.hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.skip, State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
{ simp apply RTC.refl }
case hbc.hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.skip, State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply SmallStep.if_false
case hbc.hbc.hbc.hbc.hbc.hbc.hab ⊒ (Stmt.ifThenElse (fun s => s "x" > s "y") ((Stmt.skip; Stmt.assign "x" fun s => s "x" - 1); Stmt.whileDo (fun s => s "x" > s "y") (Stmt.skip; Stmt.assign "x" fun s => s "x" - 1)) Stmt.skip, State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) β‡’ ?hbc.hbc.hbc.hbc.hbc.hbc.b
case hbc.hbc.hbc.hbc.hbc.hbc.hab.hcond ⊒ ¬State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0) "x" > State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0) "y"
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
simp
case hbc.hbc.hbc.hbc.hbc.hbc.hab.hcond ⊒ ¬State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0) "x" > State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0) "y"
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
simp
case hbc.hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.skip, State.update "x" (State.update "x" 1 (fun x => 0) "x" - 1) (State.update "x" 1 fun x => 0)) (Stmt.skip, fun x => 0)
case hbc.hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.skip, fun x => 0) (Stmt.skip, fun x => 0)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.sillyLoop_from_1_SmallStep
[464, 1]
[488, 47]
apply RTC.refl
case hbc.hbc.hbc.hbc.hbc.hbc.hbc ⊒ RTC SmallStep (Stmt.skip, fun x => 0) (Stmt.skip, fun x => 0)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
induction S with | skip => simp intros T t hstep cases hstep | assign x a => simp apply Exists.intro Stmt.skip apply Exists.intro (s[x ↦ a s]) apply SmallStep.assign | seq S T ihS ihT => simp cases Classical.em (S = Stmt.skip) with | inl h => rw [h] apply Exists.intro T apply Exists.intro s apply SmallStep.seq_skip | inr h => simp [h] at ihS cases ihS with | intro S' hSβ‚€ => cases hSβ‚€ with | intro s' hS => apply Exists.intro (S'; T) apply Exists.intro s' apply SmallStep.seq_step assumption | ifThenElse B S T ihS ihT => simp cases Classical.em (B s) with | inl h => apply Exists.intro S apply Exists.intro s apply SmallStep.if_true assumption | inr h => apply Exists.intro T apply Exists.intro s apply SmallStep.if_false assumption | whileDo B S ih => simp apply Exists.intro (Stmt.ifThenElse B (S; Stmt.whileDo B S) Stmt.skip) apply Exists.intro s apply SmallStep.whileDo
S : Stmt s : State ⊒ (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
simp
case skip s : State ⊒ (Β¬βˆƒ T t, (Stmt.skip, s) β‡’ (T, t)) ↔ Stmt.skip = Stmt.skip
case skip s : State ⊒ βˆ€ (x : Stmt) (x_1 : State), Β¬(Stmt.skip, s) β‡’ (x, x_1)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
intros T t hstep
case skip s : State ⊒ βˆ€ (x : Stmt) (x_1 : State), Β¬(Stmt.skip, s) β‡’ (x, x_1)
case skip s : State T : Stmt t : State hstep : (Stmt.skip, s) β‡’ (T, t) ⊒ False
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
cases hstep
case skip s : State T : Stmt t : State hstep : (Stmt.skip, s) β‡’ (T, t) ⊒ False
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
simp
case assign s : State x : String a : State β†’ β„• ⊒ (Β¬βˆƒ T t, (Stmt.assign x a, s) β‡’ (T, t)) ↔ Stmt.assign x a = Stmt.skip
case assign s : State x : String a : State β†’ β„• ⊒ βˆƒ T t, (Stmt.assign x a, s) β‡’ (T, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro Stmt.skip
case assign s : State x : String a : State β†’ β„• ⊒ βˆƒ T t, (Stmt.assign x a, s) β‡’ (T, t)
case assign s : State x : String a : State β†’ β„• ⊒ βˆƒ t, (Stmt.assign x a, s) β‡’ (Stmt.skip, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro (s[x ↦ a s])
case assign s : State x : String a : State β†’ β„• ⊒ βˆƒ t, (Stmt.assign x a, s) β‡’ (Stmt.skip, t)
case assign s : State x : String a : State β†’ β„• ⊒ (Stmt.assign x a, s) β‡’ (Stmt.skip, State.update x (a s) s)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply SmallStep.assign
case assign s : State x : String a : State β†’ β„• ⊒ (Stmt.assign x a, s) β‡’ (Stmt.skip, State.update x (a s) s)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
simp
case seq s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip ⊒ (Β¬βˆƒ T_1 t, (S; T, s) β‡’ (T_1, t)) ↔ S; T = Stmt.skip
case seq s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip ⊒ βˆƒ T_1 t, (S; T, s) β‡’ (T_1, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
cases Classical.em (S = Stmt.skip) with | inl h => rw [h] apply Exists.intro T apply Exists.intro s apply SmallStep.seq_skip | inr h => simp [h] at ihS cases ihS with | intro S' hSβ‚€ => cases hSβ‚€ with | intro s' hS => apply Exists.intro (S'; T) apply Exists.intro s' apply SmallStep.seq_step assumption
case seq s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip ⊒ βˆƒ T_1 t, (S; T, s) β‡’ (T_1, t)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
rw [h]
case seq.inl s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : S = Stmt.skip ⊒ βˆƒ T_1 t, (S; T, s) β‡’ (T_1, t)
case seq.inl s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : S = Stmt.skip ⊒ βˆƒ T_1 t, (Stmt.skip; T, s) β‡’ (T_1, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro T
case seq.inl s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : S = Stmt.skip ⊒ βˆƒ T_1 t, (Stmt.skip; T, s) β‡’ (T_1, t)
case seq.inl s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : S = Stmt.skip ⊒ βˆƒ t, (Stmt.skip; T, s) β‡’ (T, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro s
case seq.inl s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : S = Stmt.skip ⊒ βˆƒ t, (Stmt.skip; T, s) β‡’ (T, t)
case seq.inl s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : S = Stmt.skip ⊒ (Stmt.skip; T, s) β‡’ (T, s)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply SmallStep.seq_skip
case seq.inl s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : S = Stmt.skip ⊒ (Stmt.skip; T, s) β‡’ (T, s)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
simp [h] at ihS
case seq.inr s : State S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip ⊒ βˆƒ T_1 t, (S; T, s) β‡’ (T_1, t)
case seq.inr s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip ihS : βˆƒ T t, (S, s) β‡’ (T, t) ⊒ βˆƒ T_1 t, (S; T, s) β‡’ (T_1, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
cases ihS with | intro S' hSβ‚€ => cases hSβ‚€ with | intro s' hS => apply Exists.intro (S'; T) apply Exists.intro s' apply SmallStep.seq_step assumption
case seq.inr s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip ihS : βˆƒ T t, (S, s) β‡’ (T, t) ⊒ βˆƒ T_1 t, (S; T, s) β‡’ (T_1, t)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
cases hSβ‚€ with | intro s' hS => apply Exists.intro (S'; T) apply Exists.intro s' apply SmallStep.seq_step assumption
case seq.inr.intro s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip S' : Stmt hSβ‚€ : βˆƒ t, (S, s) β‡’ (S', t) ⊒ βˆƒ T_1 t, (S; T, s) β‡’ (T_1, t)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro (S'; T)
case seq.inr.intro.intro s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip S' : Stmt s' : State hS : (S, s) β‡’ (S', s') ⊒ βˆƒ T_1 t, (S; T, s) β‡’ (T_1, t)
case seq.inr.intro.intro s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip S' : Stmt s' : State hS : (S, s) β‡’ (S', s') ⊒ βˆƒ t, (S; T, s) β‡’ (S'; T, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro s'
case seq.inr.intro.intro s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip S' : Stmt s' : State hS : (S, s) β‡’ (S', s') ⊒ βˆƒ t, (S; T, s) β‡’ (S'; T, t)
case seq.inr.intro.intro s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip S' : Stmt s' : State hS : (S, s) β‡’ (S', s') ⊒ (S; T, s) β‡’ (S'; T, s')
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply SmallStep.seq_step
case seq.inr.intro.intro s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip S' : Stmt s' : State hS : (S, s) β‡’ (S', s') ⊒ (S; T, s) β‡’ (S'; T, s')
case seq.inr.intro.intro.hS s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip S' : Stmt s' : State hS : (S, s) β‡’ (S', s') ⊒ (S, s) β‡’ (S', s')
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
assumption
case seq.inr.intro.intro.hS s : State S T : Stmt ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬S = Stmt.skip S' : Stmt s' : State hS : (S, s) β‡’ (S', s') ⊒ (S, s) β‡’ (S', s')
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
simp
case ifThenElse s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip ⊒ (Β¬βˆƒ T_1 t, (Stmt.ifThenElse B S T, s) β‡’ (T_1, t)) ↔ Stmt.ifThenElse B S T = Stmt.skip
case ifThenElse s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip ⊒ βˆƒ T_1 t, (Stmt.ifThenElse B S T, s) β‡’ (T_1, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
cases Classical.em (B s) with | inl h => apply Exists.intro S apply Exists.intro s apply SmallStep.if_true assumption | inr h => apply Exists.intro T apply Exists.intro s apply SmallStep.if_false assumption
case ifThenElse s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip ⊒ βˆƒ T_1 t, (Stmt.ifThenElse B S T, s) β‡’ (T_1, t)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro S
case ifThenElse.inl s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : B s ⊒ βˆƒ T_1 t, (Stmt.ifThenElse B S T, s) β‡’ (T_1, t)
case ifThenElse.inl s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : B s ⊒ βˆƒ t, (Stmt.ifThenElse B S T, s) β‡’ (S, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro s
case ifThenElse.inl s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : B s ⊒ βˆƒ t, (Stmt.ifThenElse B S T, s) β‡’ (S, t)
case ifThenElse.inl s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : B s ⊒ (Stmt.ifThenElse B S T, s) β‡’ (S, s)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply SmallStep.if_true
case ifThenElse.inl s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : B s ⊒ (Stmt.ifThenElse B S T, s) β‡’ (S, s)
case ifThenElse.inl.hcond s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : B s ⊒ B s
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
assumption
case ifThenElse.inl.hcond s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : B s ⊒ B s
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro T
case ifThenElse.inr s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬B s ⊒ βˆƒ T_1 t, (Stmt.ifThenElse B S T, s) β‡’ (T_1, t)
case ifThenElse.inr s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬B s ⊒ βˆƒ t, (Stmt.ifThenElse B S T, s) β‡’ (T, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro s
case ifThenElse.inr s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬B s ⊒ βˆƒ t, (Stmt.ifThenElse B S T, s) β‡’ (T, t)
case ifThenElse.inr s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬B s ⊒ (Stmt.ifThenElse B S T, s) β‡’ (T, s)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply SmallStep.if_false
case ifThenElse.inr s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬B s ⊒ (Stmt.ifThenElse B S T, s) β‡’ (T, s)
case ifThenElse.inr.hcond s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬B s ⊒ Β¬B s
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
assumption
case ifThenElse.inr.hcond s : State B : State β†’ Prop S T : Stmt ihS : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ihT : (Β¬βˆƒ T_1 t, (T, s) β‡’ (T_1, t)) ↔ T = Stmt.skip h : Β¬B s ⊒ Β¬B s
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
simp
case whileDo s : State B : State β†’ Prop S : Stmt ih : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ⊒ (Β¬βˆƒ T t, (Stmt.whileDo B S, s) β‡’ (T, t)) ↔ Stmt.whileDo B S = Stmt.skip
case whileDo s : State B : State β†’ Prop S : Stmt ih : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ⊒ βˆƒ T t, (Stmt.whileDo B S, s) β‡’ (T, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro (Stmt.ifThenElse B (S; Stmt.whileDo B S) Stmt.skip)
case whileDo s : State B : State β†’ Prop S : Stmt ih : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ⊒ βˆƒ T t, (Stmt.whileDo B S, s) β‡’ (T, t)
case whileDo s : State B : State β†’ Prop S : Stmt ih : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ⊒ βˆƒ t, (Stmt.whileDo B S, s) β‡’ (Stmt.ifThenElse B (S; Stmt.whileDo B S) Stmt.skip, t)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply Exists.intro s
case whileDo s : State B : State β†’ Prop S : Stmt ih : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ⊒ βˆƒ t, (Stmt.whileDo B S, s) β‡’ (Stmt.ifThenElse B (S; Stmt.whileDo B S) Stmt.skip, t)
case whileDo s : State B : State β†’ Prop S : Stmt ih : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ⊒ (Stmt.whileDo B S, s) β‡’ (Stmt.ifThenElse B (S; Stmt.whileDo B S) Stmt.skip, s)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_final
[509, 1]
[560, 30]
apply SmallStep.whileDo
case whileDo s : State B : State β†’ Prop S : Stmt ih : (Β¬βˆƒ T t, (S, s) β‡’ (T, t)) ↔ S = Stmt.skip ⊒ (Stmt.whileDo B S, s) β‡’ (Stmt.ifThenElse B (S; Stmt.whileDo B S) Stmt.skip, s)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_deterministic
[562, 1]
[592, 23]
induction hl generalizing Rr with | assign x a s => cases hr with | assign _ _ _ => rfl | seq_step S S₁ T s s₁ hS₁ ih => cases hr with | seq_step S Sβ‚‚ _ _ sβ‚‚ hSβ‚‚ => have hSs₁₂ := ih hSβ‚‚ aesop | seq_skip => cases hS₁ | seq_skip T s => cases hr with | seq_step _ S _ _ s' hskip => cases hskip | seq_skip => rfl | if_true B S T s hB => cases hr with | if_true => rfl | if_false => aesop | if_false B S T s hB => cases hr with | if_true => aesop | if_false => rfl | whileDo B S s => cases hr with | whileDo => rfl
Ss Ll Rr : Stmt Γ— State hl : Ss β‡’ Ll hr : Ss β‡’ Rr ⊒ Ll = Rr
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe09_OperationalSemantics_Demo.lean
LoVe.SmallStep_deterministic
[562, 1]
[592, 23]
cases hr with | assign _ _ _ => rfl
case assign Ss Ll : Stmt Γ— State x : String a : State β†’ β„• s : State Rr : Stmt Γ— State hr : (Stmt.assign x a, s) β‡’ Rr ⊒ (Stmt.skip, State.update x (a s) s) = Rr
no goals