diff options
author | charguer <arthur@chargueraud.org> | 2017-12-19 16:13:35 +0100 |
---|---|---|
committer | Maxime Dénès <mail@maximedenes.fr> | 2018-03-09 13:31:09 +0100 |
commit | 22bf4efd61b916abc81e41bbe70428e534dd0013 (patch) | |
tree | 803601e880aab218321c8c101bb12e2c6d78e3dc /test-suite/success | |
parent | 2069c0aec44a50031e33bcb9f7d86c1535ef6b84 (diff) |
allow Prop as source for coercions
Diffstat (limited to 'test-suite/success')
-rw-r--r-- | test-suite/success/coercions.v | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test-suite/success/coercions.v b/test-suite/success/coercions.v index 9b11bc011..d4fa132d1 100644 --- a/test-suite/success/coercions.v +++ b/test-suite/success/coercions.v @@ -131,3 +131,28 @@ Local Coercion l2v2 : list >-> vect. Fail Check (fun l : list (T1 * T1) => (l : vect _ _)). Check (fun l : list (T1 * T1) => (l2v2 l : vect _ _)). Section what_we_could_do. + + +(** Unit test for Prop as source class *) + +Module TestPropAsSourceCoercion. + + Parameter heap : Prop. + + Parameter heap_empty : heap. + + Definition hprop := heap -> Prop. + + Coercion hpure (P:Prop) : hprop := fun h => h = heap_empty /\ P. + + Parameter heap_single : nat -> nat -> hprop. + + Parameter hstar : hprop -> hprop -> hprop. + + Notation "H1 \* H2" := (hstar H1 H2) (at level 69). + + Definition test := heap_single 4 5 \* (5 <> 4) \* heap_single 2 4 \* (True). + + (* Print test. -- reveals [hpure] coercions *) + +End TestPropAsSourceCoercion.
\ No newline at end of file |