Debian Codegraph @

test-suite/success/primproj_ssreflect.v

raw
1 From Corelib Require Import ssreflect.
2
3 Module R.
4 #[local] Set Printing Unfolded Projections As Match.
5 Record seal {A : Type} (f : A) : Type := Build_seal { unseal : A; seal_eq : @eq A unseal f }.
6 Global Arguments unseal {_ _} _ : assert.
7 Global Arguments seal_eq {_ _} _ : assert.
8
9 #[projections(primitive=yes)]
10 Structure bi := Bi {
11 bi_car :> Type;
12 bi_forall : forall A : Type, (A -> bi_car) -> bi_car;
13 }.
14 Bind Scope bi_scope with bi_car.
15 Global Arguments bi_car : simpl never.
16 Global Arguments bi_forall {PROP _} _ : simpl never, rename.
17
18
19 Record heapProp := HeapProp { heapProp_holds :> Prop }.
20 Global Arguments heapProp_holds : simpl never.
21
22 Definition heapProp_forall_def {A} (Ψ : A -> heapProp) : heapProp :=
23 {| heapProp_holds := forall a, Ψ a |}.
24 Definition heapProp_forall_aux : seal (@heapProp_forall_def). Proof. by eexists. Qed.
25 Definition heapProp_forall {A} := unseal heapProp_forall_aux A.
26 Definition heapProp_forall_unseal :
27 @heapProp_forall = @heapProp_forall_def := seal_eq heapProp_forall_aux.
28
29 Definition heapPropI : bi := {| bi_car := heapProp; bi_forall := @heapProp_forall |}.
30
31 Axiom P : heapPropI.
32
33 Goal forall (A : Type) (φ : A -> Prop), (bi_forall (fun a : A => P)).
34 Proof.
35 intros A φ.
36 Succeed (progress unfold bi_forall); (progress simpl).
37 progress rewrite /bi_forall.
38 Abort.
39 End R.