]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/tests/unifhint_simple.ma
Preparing for 0.5.9 release.
[helm.git] / helm / software / matita / tests / unifhint_simple.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 record group : Type β‰ {
16   gcarr :> Type;
17   gmult : gcarr β†’ gcarr β†’ gcarr; 
18   gopp  : gcarr β†’ gcarr;
19   gunit : gcarr
20 }.
21
22 interpretation "unif hints inverse" 'invert x = (gopp _ x).
23 interpretation "unif hing times" 'times x y = (gmult _ x y).
24 notation "πŸ™" non associative with precedence 90 for @{ 'unit }.
25 interpretation "unif hint unit" 'unit = (gunit _).
26
27 inductive Expr (g : group) : Type β‰
28   | Evar : gcarr g β†’ Expr g
29   | Eopp : Expr g β†’ Expr g
30   | Eunit : Expr g
31   | Emult : Expr g β†’ Expr g β†’ Expr g.
32   
33 let rec sem (g : group) (e : Expr g) on e : gcarr g β‰ 
34   match e with
35   [ Evar x β‡’ x
36   | Eopp x β‡’ (sem g x) ^ -1
37   | Eunit β‡’ πŸ™
38   | Emult x y β‡’ (sem g x) * (sem g y)].
39   
40 notation "γ€šxγ€›" non associative with precedence 90 for @{ 'sem $x }.
41 interpretation "unif hint sem" 'sem x = (sem _ x). 
42   
43 axiom P : βˆ€g:group. gcarr g β†’ Prop.
44 axiom tac : βˆ€g:group. Expr g β†’ Expr g.
45 axiom start : βˆ€g,x.P g γ€šxγ€› β†’ Prop.
46
47
48 include "logic/equality.ma".
49
50 notation "@ t" non associative with precedence 90 for @{ (Ξ»x.x) $t }.
51
52 unification hint (βˆ€g:group.βˆ€x:g. γ€šEvar ? xγ€› = x).
53 unification hint (βˆ€g:group.βˆ€x. γ€šEopp g xγ€› = (@γ€šxγ€›) ^-1).
54 unification hint (βˆ€g:group.βˆ€x,y. γ€šEmult g x yγ€› = (@γ€šxγ€›) * (@γ€šyγ€›)).
55
56 lemma test : βˆ€g:group.βˆ€x,y:g. βˆ€h:P ? (x * (x^-1 * y)). start g ? h.
57  
58
59
60 βˆ€x,Ξ“. [| B 0, x::Ξ“ |] = x
61 βˆ€n,y,Ξ“. [| B n, Ξ“ |] = [| B (S n), y::Ξ“ |] 
62 βˆ€e,f. [| Add e f, Ξ“ |] = [| e, Ξ“ |] + [| f, Ξ“ |]
63
64
65 x + x = [| ?1, ?2 |]
66
67 x = [| ?1,?2 |]
68 ?1 β‰ B 0
69 ?2 β‰ x::?3
70
71 x = [| ?4, y::x::?3 |]
72
73 [| ?4, x::?3 |] =?= [| B (S ?n), ?y::?Ξ“ |]
74 x =?= [| B ?n, ?Ξ“ |]
75
76
77 x  =?=   E
78
79 x  =?=  ?,   ? =?= E