--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+record group : Type β {
+ gcarr :> Type;
+ gmult : gcarr β gcarr β gcarr;
+ gopp : gcarr β gcarr;
+ gunit : gcarr
+}.
+
+interpretation "unif hints inverse" 'invert x = (gopp _ x).
+interpretation "unif hing times" 'times x y = (gmult _ x y).
+notation "π" non associative with precedence 90 for @{ 'unit }.
+interpretation "unif hint unit" 'unit = (gunit _).
+
+include "nat/nat.ma".
+include "list/list.ma".
+
+inductive Expr : Type β
+ | Evar : nat β Expr
+ | Eopp : Expr β Expr
+ | Eunit : Expr
+ | Emult : Expr β Expr β Expr.
+
+let rec sem (g : group) (e : Expr) (gamma : list (gcarr g)) on e : gcarr g β
+ match e with
+ [ Evar n β nth ? gamma π n
+ | Eopp x β (sem g x gamma) ^ -1
+ | Eunit β π
+ | Emult x y β (sem g x gamma) * (sem g y gamma)].
+
+notation "γterm 19 x, term 19 gγ" non associative with precedence 90
+for @{ 'sem $x $g}.
+interpretation "unif hint sem" 'sem x g = (sem _ x g).
+
+axiom P : βg:group. gcarr g β Prop.
+axiom tac : Expr β Expr.
+axiom start : βg,x,G.P g γx,Gγ β Prop.
+
+notation "@ t" non associative with precedence 90 for @{ (Ξ»x.x) $t }.
+
+
+unification hint 0 (βg:group.βx:Expr.βG:list (gcarr g). γEopp x,Gγ = (@γx,Gγ) ^-1).
+unification hint 0 (βg:group.βx,y.βG:list (gcarr g). γEmult x y,Gγ = (@γx,Gγ) * (@γy,Gγ)).
+unification hint 0 (βg:group.βG:list (gcarr g). γEunit,Gγ = π).
+unification hint 2 (βg:group.βG:list (gcarr g).βx:gcarr g. γ(Evar 0), (x :: G)γ = @x).
+unification hint 3 (βg:group.βG:list (gcarr g).βn.βx:gcarr g.(@γEvar n, Gγ)=
+ (γ(Evar (S n)), (x :: G)γ) ) .
+
+lemma test : βg:group.βx,y:gcarr g. βh:P ? ((π * x) * (x^-1 * y)).
+ start g ? ? h.
+
+ y == [| ?, x::? |]
+
+ γEvar n, Gγ
+
+
+ int: γ(Evar (S n)), (x :: G)γ = γEvar n, Gγ
+ nth (m) (G) = γEvar n, Gγ
+
+
+βx,Ξ. [| B 0, x::Ξ |] = x
+βn,y,Ξ. [| B n, Ξ |] = [| B (S n), y::Ξ |]
+βe,f. [| Add e f, Ξ |] = [| e, Ξ |] + [| f, Ξ |]
+
+
+x + x = [| ?1, ?2 |]
+
+x = [| ?1,?2 |]
+?1 β B 0
+?2 β x::?3
+
+x = [| ?4, y::x::?3 |]
+
+[| ?4, x::?3 |] =?= [| B (S ?n), ?y::?Ξ |]
+x =?= [| B ?n, ?Ξ |]
+
+
+x =?= E
+
+x =?= ?, ? =?= E
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+record group : Type β {
+ gcarr :> Type;
+ gmult : gcarr β gcarr β gcarr;
+ gopp : gcarr β gcarr;
+ gunit : gcarr
+}.
+
+interpretation "unif hints inverse" 'invert x = (gopp _ x).
+interpretation "unif hing times" 'times x y = (gmult _ x y).
+notation "π" non associative with precedence 90 for @{ 'unit }.
+interpretation "unif hint unit" 'unit = (gunit _).
+
+inductive Expr (g : group) : Type β
+ | Evar : gcarr g β Expr g
+ | Eopp : Expr g β Expr g
+ | Eunit : Expr g
+ | Emult : Expr g β Expr g β Expr g.
+
+let rec sem (g : group) (e : Expr g) on e : gcarr g β
+ match e with
+ [ Evar x β x
+ | Eopp x β (sem g x) ^ -1
+ | Eunit β π
+ | Emult x y β (sem g x) * (sem g y)].
+
+notation "γxγ" non associative with precedence 90 for @{ 'sem $x }.
+interpretation "unif hint sem" 'sem x = (sem _ x).
+
+axiom P : βg:group. gcarr g β Prop.
+axiom tac : βg:group. Expr g β Expr g.
+axiom start : βg,x.P g γxγ β Prop.
+
+
+include "logic/equality.ma".
+
+notation "@ t" non associative with precedence 90 for @{ (Ξ»x.x) $t }.
+
+unification hint (βg:group.βx:g. γEvar ? xγ = x).
+unification hint (βg:group.βx. γEopp g xγ = (@γxγ) ^-1).
+unification hint (βg:group.βx,y. γEmult g x yγ = (@γxγ) * (@γyγ)).
+
+lemma test : βg:group.βx,y:g. βh:P ? (x * (x^-1 * y)). start g ? h.
+
+
+
+βx,Ξ. [| B 0, x::Ξ |] = x
+βn,y,Ξ. [| B n, Ξ |] = [| B (S n), y::Ξ |]
+βe,f. [| Add e f, Ξ |] = [| e, Ξ |] + [| f, Ξ |]
+
+
+x + x = [| ?1, ?2 |]
+
+x = [| ?1,?2 |]
+?1 β B 0
+?2 β x::?3
+
+x = [| ?4, y::x::?3 |]
+
+[| ?4, x::?3 |] =?= [| B (S ?n), ?y::?Ξ |]
+x =?= [| B ?n, ?Ξ |]
+
+
+x =?= E
+
+x =?= ?, ? =?= E
\ No newline at end of file