From Undecidability.StackMachines.Util Require Import Nat_facts List_facts.
Local Definition rt_rt1n := @clos_rt_rt1n_iff Config.
Definition terminal (M: SMN) (X: Config) : Prop :=
forall (Y: Config), not (step M X Y).
(* reachability in at most n steps *)
Inductive reachable_n (M: SMN) : nat -> Config -> Config -> Prop :=
| rn_refl n X : reachable_n M n X X
| rn_step n X Y Z: step M X Y -> reachable_n M n Y Z -> reachable_n M (1+n) X Z.

(* confluence is preserved under rule reordering / duplication *)
Lemma confluent_incl {M1 M2} : incl M1 M2 -> incl M2 M1 -> confluent M1 -> confluent M2.