Finalizing ConcurrentSeparationLogic

This commit is contained in:
Adam Chlipala 2016-05-01 19:45:51 -04:00
parent 035bfa57ee
commit daac5734b0
5 changed files with 1578 additions and 20 deletions

View file

@ -662,10 +662,10 @@ Proof.
fork (emp%sep) (emp%sep); ht.
loop_inv (fun o => [| isEven (valueOf o) = true |]%sep).
erewrite (linkedList_nonnull _ H0).
erewrite (linkedList_nonnull _ f).
cancel.
simp.
rewrite H1, H4.
rewrite e, e0.
simp.
simp.
cancel.
@ -684,7 +684,7 @@ Proof.
cancel.
cancel.
simp.
rewrite Heq in H2.
rewrite Heq in H0.
simp.
equality.
cancel.
@ -768,10 +768,10 @@ Proof.
fork (emp%sep) (emp%sep); ht.
loop_inv (fun o => [| isEven (valueOf o) = true |]%sep).
erewrite (linkedList_nonnull _ H0).
erewrite (linkedList_nonnull _ f).
cancel.
simp.
rewrite H1, H4.
rewrite e, e0.
simp.
simp.
cancel.
@ -787,10 +787,10 @@ Proof.
ht.
apply andb_true_iff in H.
simp.
erewrite (linkedList_nonnull _ H1).
erewrite (linkedList_nonnull _ n).
cancel.
simp.
apply andb_true_iff in H0.
apply andb_true_iff in H1.
apply andb_true_iff.
simp.
cancel.
@ -811,7 +811,7 @@ Proof.
cancel.
cancel.
simp.
rewrite Heq in H2.
rewrite Heq in H0.
simp.
equality.
cancel.

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
This is an in-progress, open-source book by [Adam Chlipala](http://adam.chlipala.net/) simultaneously introducing [the Coq proof assistant](http://coq.inria.fr/) and techniques for proving correctness of programs. That is, the game is doing completely rigorous, machine-checked mathematical proofs, showing that programs meet their specifications.
Just run `make` here to build everything, including the book `frap.pdf` and the accompanying Coq source modules.
Just run `make` here to build everything, including the book `frap.pdf` and the accompanying Coq source modules. Alternatively, run `make lib' to build just the book library, not the chapter example files or PDF.
# Code associated with the different chapters
@ -18,3 +18,4 @@ Just run `make` here to build everything, including the book `frap.pdf` and the
* Chapter 11: `DeepAndShallowEmbeddings.v`
* Chapter 12: `SeparationLogic.v`
* Chapter 13: `SharedMemory.v`
* Chapter 14: `ConcurrentSeparationLogic.v`

View file

@ -430,13 +430,18 @@ Module Make(Import S : SEP).
normalize; repeat cancel1; repeat match goal with
| [ H : _ /\ _ |- _ ] => destruct H
| [ |- _ /\ _ ] => split
end; eassumption.
end; eassumption || apply I.
Ltac cancel := hide_evars; normalize; repeat cancel1; restore_evars;
repeat match goal with
| [ H : True |- _ ] => clear H
| [ H : ?P, H' : ?P |- _ ] => clear H'
end;
Ltac beautify := repeat match goal with
| [ H : True |- _ ] => clear H
| [ H : ?P, H' : ?P |- _ ] =>
match type of P with
| Prop => clear H'
end
| [ H : _ /\ _ |- _ ] => destruct H
end.
Ltac cancel := hide_evars; normalize; repeat cancel1; restore_evars; beautify;
try match goal with
| [ |- _ ===> ?p * ?q ] =>
((is_evar p; fail 1) || apply star_cancel'')
@ -478,9 +483,5 @@ Module Make(Import S : SEP).
basic_cancel
end)
| [ |- _ ===> _ ] => intuition (try congruence)
end; intuition idtac;
repeat match goal with
| [ H : True |- _ ] => clear H
| [ H : ?P, H' : ?P |- _ ] => clear H'
end.
end; intuition idtac; beautify.
End Make.

View file

@ -28,3 +28,5 @@ SepCancel.v
SeparationLogic_template.v
SeparationLogic.v
SharedMemory.v
ConcurrentSeparationLogic_template.v
ConcurrentSeparationLogic.v