Skip to content

Commit 9556ffb

Browse files
committed
theories/ticket_lock.v: simplify proof of release_spec
It is not necessary to show that the first counters from the invariant and the `locked` precondition are the same, because `exclusive_local_update` allows arbitrary counters before the update.
1 parent 62eb294 commit 9556ffb

1 file changed

Lines changed: 4 additions & 30 deletions

File tree

theories/ticket_lock.v

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -271,46 +271,20 @@ Qed.
271271
Lemma release_spec γ l P :
272272
{{{ is_lock γ l P ∗ locked γ ∗ P }}} release l {{{ RET #(); True }}}.
273273
(* SOLUTION *) Proof.
274-
iIntros "%Φ ((%lo & %ln & -> & #I) & [%o Hexcl] & HP) HΦ".
274+
iIntros "%Φ ((%lo & %ln & -> & #I) & [%o0 Hexcl] & HP) HΦ".
275275
wp_lam.
276276
wp_pures.
277277
wp_bind (! _)%E.
278-
iInv "I" as "(%o' & %n & Hlo & Hln & [Hγ [[>Hexcl' _]|Ho]])".
279-
{
280-
iPoseProof (own_valid_2 with "Hexcl Hexcl'") as "%H".
281-
rewrite auth_frag_valid /= in H.
282-
rewrite pair_valid /= in H.
283-
by destruct H as [H _].
284-
}
278+
iInv "I" as "(%o & %n & Hlo & Hln & Hγ)".
285279
wp_load.
286-
iPoseProof (own_valid_2 with "Hγ Hexcl") as "%H".
287-
rewrite auth_both_valid_discrete /= in H.
288-
destruct H as [H _].
289-
rewrite pair_included in H.
290-
destruct H as [H _].
291-
rewrite Excl_included in H.
292-
destruct H.
293280
iModIntro.
294-
iSplitL "Hlo Hln Hγ Ho".
281+
iSplitL "Hlo Hln Hγ".
295282
{ iExists o, n. iFrame. }
296283
clear n.
297284
wp_pures.
298285
rewrite Z.add_comm -(Nat2Z.inj_add 1) /=.
299-
iInv "I" as "(%o' & %n & Hlo & Hln & [Hγ [[>Hexcl' _]|Ho]])".
300-
{
301-
iPoseProof (own_valid_2 with "Hexcl Hexcl'") as "%H".
302-
rewrite auth_frag_valid /= in H.
303-
rewrite pair_valid /= in H.
304-
by destruct H as [H _].
305-
}
286+
iInv "I" as "(%o2 & %n & Hlo & Hln & Hγ & _)".
306287
wp_store.
307-
iPoseProof (own_valid_2 with "Hγ Hexcl") as "%H".
308-
rewrite auth_both_valid_discrete /= in H.
309-
destruct H as [H _].
310-
rewrite pair_included in H.
311-
destruct H as [H _].
312-
rewrite Excl_included in H.
313-
destruct H.
314288
iCombine "Hγ Hexcl" as "Hγ".
315289
iMod (own_update _ _ (● (Excl' (S o), GSet (set_seq 0 n)) ⋅ ◯ (Excl' (S o), ε)) with "Hγ") as "[Hγ Hexcl]".
316290
{

0 commit comments

Comments
 (0)