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 record group : Type β {
17 gmult : gcarr β gcarr β gcarr;
18 gopp : gcarr β gcarr;
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 _).
28 include "list/list.ma".
30 inductive Expr : Type β
32 | Eopp : Expr β Expr
34 | Emult : Expr β Expr β Expr.
36 let rec sem (g : group) (e : Expr) (gamma : list (gcarr g)) on e : gcarr g β
38 [ Evar n β nth ? gamma π n
39 | Eopp x β (sem g x gamma) ^ -1
41 | Emult x y β (sem g x gamma) * (sem g y gamma)].
43 notation "γterm 19 x, term 19 gγ" non associative with precedence 90
45 interpretation "unif hint sem" 'sem x g = (sem _ x g).
47 axiom P : βg:group. gcarr g β Prop.
48 axiom tac : Expr β Expr.
49 axiom start : βg,x,G.P g γx,Gγ β Prop.
51 notation > "ident a β term 90 b term 20 c"
52 non associative with precedence 90 for
53 @{ let ${ident a} β $b in $c }.
55 unification hint 0 (βg:group.βx:Expr.βG:list (gcarr g).
57 (* ------------------------------------ *)
58 γEopp x,Gγ = V^-1).
61 unification hint 0 (βg:group.βx,y.βG:list (gcarr g).
63 V1 β γx,Gγ V2 β γy,Gγ
64 (* ------------------------------------ *)
65 γEmult x y,Gγ = V1 * V2).
67 unification hint 0 (βg:group.βG:list (gcarr g).
69 (* ------------------------------------ *)
70 γEunit,Gγ = π).
72 unification hint 2 (βg:group.βG:list (gcarr g).βx:gcarr g.
75 (* ------------------------------------ *)
76 γ(Evar 0), (x :: G)γ = V).
78 unification hint 3 (βg:group.βG:list (gcarr g).βn.βx:gcarr g.
81 (* ------------------------------------ *)
82 γ(Evar (S n)), (x :: G)γ = V) .
84 (* Esempio banale di divergenza
85 unification hint 0 (βg:group.βG:list (gcarr g).βx.
87 ------------------------------------
91 include "nat/plus.ma".
92 unification hint 0 (βx,y.S x + y = S (x + y)).
94 axiom T : nat β Prop.
95 axiom F : βn,k.T (S (n + k)) β Prop.
96 lemma diverge: βk,k1.βh:T (? + k).F ? k1 h.
100 lemma test : βg:group.βx,y:gcarr g. βh:P ? ((π * x) * (x^-1 * y)).
103 lemma test : βg:group.βx,y:gcarr g. βh:P ? ((π * x) * (x^-1 * y)).
111 int: γ(Evar (S n)), (x :: G)γ = γEvar n, Gγ
112 nth (m) (G) = γEvar n, Gγ
115 βx,Ξ. [| B 0, x::Ξ |] = x
116 βn,y,Ξ. [| B n, Ξ |] = [| B (S n), y::Ξ |]
117 βe,f. [| Add e f, Ξ |] = [| e, Ξ |] + [| f, Ξ |]
126 x = [| ?4, y::x::?3 |]
128 [| ?4, x::?3 |] =?= [| B (S ?n), ?y::?Ξ |]
129 x =?= [| B ?n, ?Ξ |]