Skip to content
Snippets Groups Projects
Commit b9c66be3 authored by Zhen Zhang's avatar Zhen Zhang
Browse files

stronger empty casE

parent 445187e9
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,8 @@ Section proof. ...@@ -87,7 +87,8 @@ Section proof.
Definition pop_triple (s: loc) := Definition pop_triple (s: loc) :=
atomic_triple (fun xs => is_stack s xs)%I atomic_triple (fun xs => is_stack s xs)%I
(fun xs ret => ret = NONEV ( x, ret = SOMEV x R x))%I (* FIXME: we can give a stronger one *) (fun xs ret => (ret = NONEV xs = [] is_stack s [])
( x, ret = SOMEV x R x))%I (* FIXME: we can give a stronger one *)
(nclose heapN) (nclose heapN)
(pop #s). (pop #s).
...@@ -104,9 +105,11 @@ Section proof. ...@@ -104,9 +105,11 @@ Section proof.
destruct xs as [|y' xs']. destruct xs as [|y' xs'].
- simpl. iDestruct "Hxs" as (hd) "[Hs Hhd]". - simpl. iDestruct "Hxs" as (hd) "[Hs Hhd]".
wp_load. iDestruct "Hvs'" as "[_ Hvs']". wp_load. iDestruct "Hvs'" as "[_ Hvs']".
iVs ("Hvs'" $! NONEV with "[]") as "HQ"; first by iLeft. iDestruct "Hhd" as (q) "[Hhd Hhd']".
iVsIntro. wp_let. iDestruct "Hhd" as (q) "Hhd". iVs ("Hvs'" $! NONEV with "[-Hhd]") as "HQ".
wp_load. wp_match. { iLeft. iSplit=>//. iSplit=>//.
iExists hd. iFrame. rewrite /is_stack'. eauto. }
iVsIntro. wp_let. wp_load. wp_match.
iVsIntro. by iExists []. iVsIntro. by iExists [].
- simpl. iDestruct "Hxs" as (hd) "[Hs Hhd]". - simpl. iDestruct "Hxs" as (hd) "[Hs Hhd]".
simpl. iDestruct "Hhd" as (hd' q) "([Hhd Hhd'] & #Hy' & Hxs')". simpl. iDestruct "Hhd" as (hd' q) "([Hhd Hhd'] & #Hy' & Hxs')".
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment