]> matita.cs.unibo.it Git - helm.git/blob - helm/software/components/ng_refiner/esempio.ma
slow example
[helm.git] / helm / software / components / ng_refiner / esempio.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "nat/plus.ma".
16
17 definition hole : ∀A:Type.A → A ≝ λA.λx.x.
18 definition id : ∀A:Type.A → A ≝ λA.λx.x.
19
20 (* meta1 Vs meta2 with different contexts
21 axiom foo: 
22   ∀P:Type.∀f:P→P→Prop.∀x:P.
23    (λw. ((∀e:P.f x (w x)) = (∀y:P. f x (hole ? y)))) 
24    (λw:P.hole ? w). 
25 *)
26
27 (* meta1 Vs meta1 with different local contexts
28 axiom foo: 
29   ∀P:Type.∀f:P→P→P.∀x,y:P. 
30     (λw.(f x (w x) = f x (w y))) (λw:P.hole ? w).
31 *)
32
33 (* meta Vs term && term Vs meta with different local ctx
34 axiom foo: 
35   ∀P:Type.∀f:P→P→P.∀x,y:P.
36     (λw.(f (w x) (hole ? x) = f x (w y))) (λw:P.hole ? w).
37 *)
38
39 (* occur check
40 axiom foo: 
41   ∀P:Type.∀f:P→P→P.∀x,y:P.
42     (λw.(f x (f (w x) x) = f x (w y))) (λw:P.hole ? w).
43 *)
44
45 (* unifying the type of (y ?) with (Q x) we instantiate ? to x
46 axiom foo: 
47   ∀P:Type.∀Q:P→Type.∀f:∀x:P.Q x→P→P.∀x:P.∀y:∀x.Q x.
48     (λw.(f w (y w) x = (id ? f) x (hole ? (y x)) x)) (hole ? x).
49 *)  
50    
51 alias num (instance 0) = "natural number".
52 axiom foo: (12+12) = (12+11).
53
54
55     (id ?(id ?(id ?(id ? (100+100))))) =
56     (id ?(id ?(id ?(id ? (99+100))))).[3:
57     apply (refl_eq nat (id ?(id ?(id ?(id ? (98+102+?))))));
58
59 axiom foo: (λx,y.(λz. z (x+y) + z x) (λw:nat.hole ? w)) = λx,y.x. (* OK *)
60 axiom foo: (λx,y.(λz. z x + z (x+y)) (λw:nat.hole ? w)) = λx,y.x. (* KO, delift rels only *) 
61  
62
63
64 axiom foo: (λx,y.(λz. z x + z y) (λw:nat.hole ? w)) = λx,y.x. (* OK *) 
65