(* Definition of String rewriting with finite types *)
(*  String Rewriting **)
Variable sig: Type.
Definition rule : Type := list sig * list sig.
Definition srs := list rule.
Implicit Types (a b c: sig) (x y z u v: list sig)
(r: list sig* list sig) (R S: srs).
Inductive rew' : srs -> list sig -> list sig -> Prop:=
|rewR R x u y v : (u,v) el R -> rew' R (x++u++y) (x++v++y).
Hint Constructors rew'.
Inductive rewt' (S: srs) (x: list sig) : list sig -> Prop :=
|rewt'Refl : rewt' S x x
|rewt'Rule y z : rew' S x y -> rewt' S y z -> rewt' S x z.
Hint Constructors rewt'.
Instance rewt'Trans R :
PreOrder (rewt' R).

Lemma rewrite_right R x y z :
rewt' R x y -> rew' R y z -> rewt' R x z.