| 1 |
Require Import TestSuite.admit. |
| 2 |
(* File reduced by coq-bug-finder from original input, then from 270 lines to |
| 3 |
198 lines, then from 178 lines to 82 lines, then from 88 lines to 59 lines *) |
| 4 |
(* coqc version trunk (August 2014) compiled on Aug 19 2014 14:40:15 with OCaml |
| 5 |
4.01.0 |
| 6 |
coqtop version cagnode17:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk |
| 7 |
(56ece74efc25af1b0e09265f3c7fcf74323abcaf) *) |
| 8 |
Require Import TestSuite.list. |
| 9 |
Set Implicit Arguments. |
| 10 |
Definition mem := nat -> option nat. |
| 11 |
Definition pred := mem -> Prop. |
| 12 |
Delimit Scope pred_scope with pred. |
| 13 |
Definition exis A (p : A -> pred) : pred := fun m => exists x, p x m. |
| 14 |
Notation "'exists' x .. y , p" := (exis (fun x => .. (exis (fun y => p)) ..)) : |
| 15 |
pred_scope. |
| 16 |
Definition emp : pred := fun m => forall a, m a = None. |
| 17 |
Definition lift_empty (P : Prop) : pred := fun m => P /\ forall a, m a = None. |
| 18 |
Notation "[[ P ]]" := (lift_empty P) : pred_scope. |
| 19 |
Definition pimpl (p q : pred) := forall m, p m -> q m. |
| 20 |
Notation "p ==> q" := (pimpl p%pred q%pred) (right associativity, at level 90). |
| 21 |
Definition piff (p q : pred) : Prop := (p ==> q) /\ (q ==> p). |
| 22 |
Notation "p <==> q" := (piff p%pred q%pred) (at level 90). |
| 23 |
Parameter sep_star : pred -> pred -> pred. |
| 24 |
Infix "*" := sep_star : pred_scope. |
| 25 |
Definition memis (m : mem) : pred := eq m. |
| 26 |
Definition mptsto (m : mem) (a : nat) (v : nat) := m a = Some v. |
| 27 |
Notation "m @ a |-> v" := (mptsto m a v) (a at level 34, at level 35). |
| 28 |
Lemma piff_trans: forall a b c, (a <==> b) -> (b <==> c) -> (a <==> c). |
| 29 |
Admitted. |
| 30 |
Lemma piff_refl: forall a, (a <==> a). |
| 31 |
Admitted. |
| 32 |
Definition stars (ps : list pred) := fold_left sep_star ps emp. |
| 33 |
Lemma flatten_exists: forall T PT p ps P, |
| 34 |
(forall (a:T), (p a <==> exists (x:PT), stars (ps a x) * [[P a x]])) |
| 35 |
-> (exists (a:T), p a) <==> |
| 36 |
(exists (x:(T*PT)), stars (ps (fst x) (snd x)) * [[P (fst x) (snd x)]]). |
| 37 |
Admitted. |
| 38 |
Goal forall b, (exists e1 e2 e3, |
| 39 |
(exists (m : mem) (v : nat) (F : pred), b) |
| 40 |
<==> (exists x : e1, stars (e2 x) * [[e3 x]])). |
| 41 |
intros. |
| 42 |
Set Printing Universes. |
| 43 |
Show Universes. |
| 44 |
do 3 eapply ex_intro. |
| 45 |
eapply piff_trans; [ apply flatten_exists | apply piff_refl ]; intros. |
| 46 |
eapply piff_trans; [ apply flatten_exists | apply piff_refl ]; intros. |
| 47 |
eapply piff_trans; [ apply flatten_exists | apply piff_refl ]; intros. |
| 48 |
assert (H : False) by (clear; admit); destruct H. |
| 49 |
Unshelve. |
| 50 |
admit. |
| 51 |
admit. |
| 52 |
admit. |
| 53 |
Show Universes. |
| 54 |
Time Qed. |