Inductive rewt (S: cfg) (x: list sig) : list sig -> Prop :=
|rewtRefl : rewt S x x
|rewtRule y z : rewt S x y -> rew_cfg S y z -> rewt S x z.
Hint Constructors rewt.
Global Instance rewtTrans R :
PreOrder (rewt R).
Global Instance rewrite_proper R :
Proper (rewt R ==> rewt R ==> rewt R) (@app sig).
Global Instance subrel R :
subrelation (rew_cfg R) (rewt R).
Definition terminal G x := ~ exists y, rew_cfg G x y.

Lemma terminal_iff G x :
terminal G x <-> forall s y, s el x -> ~ (s, y) el rules G.