Commit 695e875f authored by Dan Frumin's avatar Dan Frumin

Simplify `denv_stack_interp`, per Robbert's suggestion

parent 61dde255
This diff is collapsed.
......@@ -262,7 +262,7 @@ Section vcg_spec.
vcg_sp E mIn mOut de = Some (mIn', mOut', mNew', dv)
(denv_interp E mIn -
denv_interp E mIn'
denv_stack_interp (reverse mOut) (reverse mOut') E
denv_stack_interp mOut mOut' E
(awp (dcexpr_interp E de) R (λ v, v = dval_interp E dv denv_interp E mNew'))).
revert mIn mOut mIn' mOut' mNew' dv. induction de;
......@@ -343,9 +343,7 @@ Section vcg_spec.
{ exists (λ: <>, dcexpr_interp E de2)%V. by unlock. }
unfold popstack in Hsp.
destruct mOut2 as [|t mOut2'] eqn:Houteq; simplify_eq/=.
iFrame "HmIn2". rewrite !reverse_cons.
rewrite -denv_stack_interp_snoc; last first.
{ rewrite !reverse_length. apply vcg_sp_length in Hsp2. eauto. }
iFrame "HmIn2".
iDestruct (denv_stack_interp_trans with "Hawp1 Hawp2") as "Hawp".
iApply (denv_stack_interp_mono with "Hawp"). iIntros "[Hawp1 Hawp2]".
iApply a_sequence_spec. iApply (awp_wand with "Hawp1").
......@@ -363,11 +361,11 @@ Section vcg_spec.
denv_interp E m -
denv_interp E mIn denv_interp E (denv_stack_merge mOut) awp (dcexpr_interp E de) R (λ v, v = dval_interp E dv denv_interp E mNew).
iIntros (?) "Hm".
iIntros (Hsp) "Hm".
iDestruct (vcg_sp_correct' with "Hm") as "[$ Hawp]"; first eassumption.
rewrite reverse_nil denv_stack_interp_nil_l.
iDestruct "Hawp" as "[HmOut $]". iApply denv_stack_merge_interp.
by iApply denv_stack_reverse.
pose (vcg_sp_length _ _ _ _ _ _ _ _ Hsp) as Hlen.
assert (mOut = []) as -> by (destruct mOut; eauto; inversion Hlen).
iFrame "Hawp". by rewrite /denv_interp //.
Lemma denv_wf_stack_merge ms E :
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment