Commit 9526453d authored by Amin Timany's avatar Amin Timany

Simplify coarse-grained pop

parent ab899eb7
...@@ -116,20 +116,17 @@ Section CG_Stack. ...@@ -116,20 +116,17 @@ Section CG_Stack.
(* Coarse-grained pop *) (* Coarse-grained pop *)
Definition CG_pop (st : expr) : expr := Definition CG_pop (st : expr) : expr :=
Lam (App (Lam (App (Lam Lam (App (Lam
( (
Case (Var 1) Case (Var 1)
(InjL Unit) (InjL Unit)
( (
App (Lam (InjR (Fst (Var 2)))) App (Lam (InjR (Fst (Var 2))))
(Store st.[ren (+ 7)] (Snd (Var 0))) (Store st.[ren (+ 5)] (Snd (Var 0)))
)
)
) )
(Unfold (Var 1)) )
)
) )
(Load st.[ren (+ 2)]) (Unfold (Load st.[ren (+ 2)]))
). ).
Lemma CG_pop_type st Γ τ : Lemma CG_pop_type st Γ τ :
...@@ -138,10 +135,9 @@ Section CG_Stack. ...@@ -138,10 +135,9 @@ Section CG_Stack.
Proof. Proof.
intros H1. intros H1.
do 2 econstructor; do 2 econstructor;
[|econstructor; eapply (context_weakening [_; _]); eauto]. [|do 2 econstructor; eapply (context_weakening [_; _]); eauto].
do 2 econstructor. 2: repeat constructor. asimpl. repeat econstructor; asimpl; eauto.
repeat econstructor. eapply (context_weakening [_; _; _; _; _]); eauto.
eapply (context_weakening [_; _; _; _; _; _; _]); eauto.
Qed. Qed.
Lemma CG_pop_closed (st : expr) : Lemma CG_pop_closed (st : expr) :
...@@ -161,13 +157,11 @@ Section CG_Stack. ...@@ -161,13 +157,11 @@ Section CG_Stack.
intros HNE. iIntros "[#Hspec [Hx Hj]]". unfold CG_pop. intros HNE. iIntros "[#Hspec [Hx Hj]]". unfold CG_pop.
iPvs (step_lam _ _ _ j K _ _ _ _ with "[Hj]") as "Hj"; eauto. iPvs (step_lam _ _ _ j K _ _ _ _ with "[Hj]") as "Hj"; eauto.
iFrame "Hspec Hj"; trivial. asimpl. iFrame "Hspec Hj"; trivial. asimpl.
iPvs (step_load _ _ _ j (K ++ [AppRCtx (LamV _)]) iPvs (step_load _ _ _ j (K ++ [AppRCtx (LamV _); UnfoldCtx])
_ _ _ with "[Hj Hx]") as "[Hj Hx]"; eauto. _ _ _ with "[Hj Hx]") as "[Hj Hx]"; eauto.
rewrite ?fill_app. simpl. rewrite ?fill_app. simpl.
iFrame "Hspec Hj"; trivial. iFrame "Hspec Hj"; trivial.
rewrite ?fill_app. simpl. rewrite ?fill_app. simpl.
iPvs (step_lam _ _ _ j K _ _ _ _ with "[Hj]") as "Hj"; eauto.
iFrame "Hspec Hj"; trivial. asimpl.
iPvs (step_Fold _ _ _ j (K ++ [AppRCtx (LamV _)]) iPvs (step_Fold _ _ _ j (K ++ [AppRCtx (LamV _)])
_ _ _ _ with "[Hj]") as "Hj"; eauto. _ _ _ _ with "[Hj]") as "Hj"; eauto.
rewrite ?fill_app. simpl. rewrite ?fill_app. simpl.
...@@ -208,13 +202,11 @@ Section CG_Stack. ...@@ -208,13 +202,11 @@ Section CG_Stack.
intros HNE. iIntros "[#Hspec [Hx Hj]]". unfold CG_pop. intros HNE. iIntros "[#Hspec [Hx Hj]]". unfold CG_pop.
iPvs (step_lam _ _ _ j K _ _ _ _ with "[Hj]") as "Hj"; eauto. iPvs (step_lam _ _ _ j K _ _ _ _ with "[Hj]") as "Hj"; eauto.
iFrame "Hspec Hj"; trivial. asimpl. iFrame "Hspec Hj"; trivial. asimpl.
iPvs (step_load _ _ _ j (K ++ [AppRCtx (LamV _)]) iPvs (step_load _ _ _ j (K ++ [AppRCtx (LamV _); UnfoldCtx])
_ _ _ with "[Hj Hx]") as "[Hj Hx]"; eauto. _ _ _ with "[Hj Hx]") as "[Hj Hx]"; eauto.
rewrite ?fill_app. simpl. rewrite ?fill_app. simpl.
iFrame "Hspec Hj"; trivial. iFrame "Hspec Hj"; trivial.
rewrite ?fill_app. simpl. rewrite ?fill_app. simpl.
iPvs (step_lam _ _ _ j K _ _ _ _ with "[Hj]") as "Hj"; eauto.
iFrame "Hspec Hj"; trivial. asimpl.
iPvs (step_Fold _ _ _ j (K ++ [AppRCtx (LamV _)]) iPvs (step_Fold _ _ _ j (K ++ [AppRCtx (LamV _)])
_ _ _ _ with "[Hj]") as "Hj"; eauto. _ _ _ _ with "[Hj]") as "Hj"; eauto.
rewrite ?fill_app. simpl. rewrite ?fill_app. simpl.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment