1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "nat/plus.ma".
17 definition hole : ∀A:Type.A → A ≝ λA.λx.x.
18 definition id : ∀A:Type.A → A ≝ λA.λx.x.
20 (* Common case in dama, reduction with metas
21 inductive list : Type := nil : list | cons : nat -> list -> list.
22 let rec len l := match l with [ nil => O | cons _ l => S (len l) ].
23 axiom lt : nat -> nat -> Prop.
24 axiom foo : ∀x. Not (lt (hole ? x) (hole ? O)) = (lt x (len nil) -> False).
27 (* meta1 Vs meta2 with different contexts
29 ∀P:Type.∀f:P→P→Prop.∀x:P.
30 (λw. ((∀e:P.f x (w x)) = (∀y:P. f x (hole ? y))))
34 (* meta1 Vs meta1 with different local contexts
36 ∀P:Type.∀f:P→P→P.∀x,y:P.
37 (λw.(f x (w x) = f x (w y))) (λw:P.hole ? w).
40 (* meta Vs term && term Vs meta with different local ctx
42 ∀P:Type.∀f:P→P→P.∀x,y:P.
43 (λw.(f (w x) (hole ? x) = f x (w y))) (λw:P.hole ? w).
48 ∀P:Type.∀f:P→P→P.∀x,y:P.
49 (λw.(f x (f (w x) x) = f x (w y))) (λw:P.hole ? w).
52 (* unifying the type of (y ?) with (Q x) we instantiate ? to x
54 ∀P:Type.∀Q:P→Type.∀f:∀x:P.Q x→P→P.∀x:P.∀y:∀x.Q x.
55 (λw.(f w (y w) x = (id ? f) x (hole ? (y x)) x)) (hole ? x).
58 alias num (instance 0) = "natural number".
59 axiom foo: (100+111) = (100+110).
62 (id ?(id ?(id ?(id ? (100+100))))) =
63 (id ?(id ?(id ?(id ? (99+100))))).[3:
64 apply (refl_eq nat (id ?(id ?(id ?(id ? (98+102+?))))));
66 axiom foo: (λx,y.(λz. z (x+y) + z x) (λw:nat.hole ? w)) = λx,y.x. (* OK *)
67 axiom foo: (λx,y.(λz. z x + z (x+y)) (λw:nat.hole ? w)) = λx,y.x. (* KO, delift rels only *)
71 axiom foo: (λx,y.(λz. z x + z y) (λw:nat.hole ? w)) = λx,y.x. (* OK *)