Debian Codegraph @

test-suite/bugs/bug_2117.v

raw
1 (* Check pattern-unification on evars in apply unification *)
2
3 Axiom app : forall tau tau':Type, (tau -> tau') -> tau -> tau'.
4
5 Axiom copy : forall tau:Type, tau -> tau -> Prop.
6 Axiom copyr : forall tau:Type, tau -> tau -> Prop.
7 Axiom copyf : forall tau:Type, tau -> tau -> Prop.
8 Axiom eq : forall tau:Type, tau -> tau -> Prop.
9 Axiom subst : forall tau tau':Type, (tau -> tau') -> tau -> tau' -> Prop.
10
11 Axiom copy_atom : forall tau:Type, forall t t':tau, eq tau t t' -> copy tau t t'.
12 Axiom copy_fun: forall tau tau':Type, forall t t':(tau->tau'),
13 (forall x:tau, copyr tau x x->copy tau' (t x) (t' x))
14 ->copy (tau->tau') t t'.
15
16 Axiom copyr_atom : forall tau:Type, forall t t':tau, copyr tau t t' -> eq tau t t'.
17 Axiom copyr_fun: forall tau tau':Type, forall t t':(tau->tau'),
18 copyr (tau->tau') t t'
19 ->(forall x y:tau, copy tau x y->copyr tau' (t x) (t' y)).
20
21 Axiom copyf_atom : forall tau:Type, forall t t':tau, copyf tau t t' -> eq tau t t'.
22 Axiom copyf_fun: forall tau tau':Type, forall t t':(tau->tau'),
23 copyr (tau->tau') t t'
24 ->(forall x y:tau, forall z1 z2:tau',
25 (copy tau x y)->
26 (subst tau tau' t x z1)->
27 (subst tau tau' t' y z2)->
28 copyf tau' z1 z2).
29
30 Axiom eqappg: forall tau tau':Type, forall t:tau->tau', forall q:tau, forall r:tau',forall t':tau',
31 ( ((subst tau tau' t q t') /\ (eq tau' t' r))
32 ->eq tau' (app tau tau' t q) r).
33
34 Axiom eqappd: forall tau tau':Type, forall t:tau->tau', forall q:tau, forall r:tau',
35 forall t':tau', ((subst tau tau' t q t') /\ (eq tau' r t'))
36 ->eq tau' r (app tau tau' t q).
37
38 Axiom substcopy: forall tau tau':Type, forall t:tau->tau', forall q:tau, forall r:tau',
39 (forall x:tau, (copyf tau x q) -> (copy tau' (t x) r))
40 ->subst tau tau' t q r.
41
42 Ltac EtaLong := (apply copy_fun;intros;EtaLong)|| apply copy_atom.
43 Ltac Subst := apply substcopy;intros;EtaLong.
44 Ltac Rigid_aux := fun A => apply A|| Rigid_aux (copyr_fun _ _ _ _ A).
45 Ltac Rigid := fun A => apply copyr_atom; Rigid_aux A.
46
47 Theorem church0: forall i:Type, exists X:(i->i)->i->i,
48 copy ((i->i)->i->i) (fun f:i->i => fun x:i=>f (X f x)) (fun f:i->i=>fun x:i=>app i i (X f) (f x)).
49 intros.
50 esplit.
51 EtaLong.
52 eapply eqappd;split.
53 Subst.
54 apply copyf_atom.
55 Show Existentials.
56 apply H1.
57 Abort.