Merge branch 'janno/hoare-notation' into 'master'
Add triple notation for generalized post-condition This changeset defines notation for the Iris style of writing Hoare triples: `{{{ P }}} e {{{ v1 .. vn; T, Q }}} := P ★ (∀ v1 .. vn, Q → Φ T) ⊢ WP e {{ Φ }}` For no good reason the notation is parsing only, although I do not declare it as such. We might want to do that though, since it might be too hard to understand a Hoare triple goal without unfolding it. I have changed the barrier specifications to use the new notation in an attempt to demonstrate their usefulness (or, at a minimum, their applicability). The changes are rather minimal, as you can see. ## Changes First and foremost, the specifications change. (Duh!) Then, there are three kinds of changes to the proofs: 1. The first `iIntros` needs to take care of introducing `Φ`. No big deal, in my opinion. 2. Introducing the spatial assumptions needs one additional level of structure since we go from ```P1 ★ P2 ★ (∀ v, Q v -★ Φ v)``` to ```(P1 ★ P2) ★ (∀ v, Q v -★ Φ v)``` 3. A post-condition of `True` leads to the rather annoying hypothesis `True -★ Φ v`, which (as far as I can tell) cannot be made to behave the same as just (Φ v) in the context of `iFrame`. ## Applicability I have also looked at most other examples of specifications in heap_lang/lib. The notation seems to be applicable to almost all of them. The only place where I spotted an obvious mismatch is par.v, where the current lemmas have a later before the generalized post-condition, as in `... ★ (∀ .., ... -★ ▷ Φ ..) ⊢ WP ..`. We could always add another pair of notations for this special case, I suppose. ## Nomenclature I think "Texan triple" would be a good name, seeing how everything is bigger in Texas, including the number of curly braces. See merge request !9
Showing
- base_logic/primitive.v 4 additions, 2 deletionsbase_logic/primitive.v
- heap_lang/heap.v 19 additions, 19 deletionsheap_lang/heap.v
- heap_lang/lib/barrier/proof.v 12 additions, 11 deletionsheap_lang/lib/barrier/proof.v
- heap_lang/lib/barrier/specification.v 3 additions, 2 deletionsheap_lang/lib/barrier/specification.v
- heap_lang/lib/counter.v 29 additions, 31 deletionsheap_lang/lib/counter.v
- heap_lang/lib/lock.v 6 additions, 6 deletionsheap_lang/lib/lock.v
- heap_lang/lib/par.v 3 additions, 3 deletionsheap_lang/lib/par.v
- heap_lang/lib/spawn.v 7 additions, 8 deletionsheap_lang/lib/spawn.v
- heap_lang/lib/spin_lock.v 12 additions, 12 deletionsheap_lang/lib/spin_lock.v
- heap_lang/lib/ticket_lock.v 13 additions, 13 deletionsheap_lang/lib/ticket_lock.v
- heap_lang/proofmode.v 9 additions, 6 deletionsheap_lang/proofmode.v
- program_logic/weakestpre.v 39 additions, 0 deletionsprogram_logic/weakestpre.v
- tests/barrier_client.v 3 additions, 3 deletionstests/barrier_client.v
- tests/joining_existentials.v 3 additions, 3 deletionstests/joining_existentials.v
Loading
Please register or sign in to comment