Require Import ADPUnif. Require Import ADecomp. Require Import ADuplicateSymb. Require Import AGraph. Require Import APolyInt_MA. Require Import ATrs. Require Import List. Require Import LogicUtil. Require Import MonotonePolynom. Require Import Polynom. Require Import SN. Require Import VecUtil. Open Scope nat_scope. (* termination problem *) Module M. Inductive symb : Type := | U11 : symb | U12 : symb | _0_1 : symb | active : symb | mark : symb | plus : symb | s : symb | tt : symb. End M. Lemma eq_symb_dec : forall f g : M.symb, {f=g}+{~f=g}. Proof. decide equality. Defined. Open Scope nat_scope. Definition ar (s : M.symb) : nat := match s with | M.U11 => 3 | M.U12 => 3 | M._0_1 => 0 | M.active => 1 | M.mark => 1 | M.plus => 2 | M.s => 1 | M.tt => 0 end. Definition s0 := ASignature.mkSignature ar eq_symb_dec. Definition s0_p := s0. Definition V0 := @ATerm.Var s0. Definition F0 := @ATerm.Fun s0. Definition R0 := @ATrs.mkRule s0. Module S0. Definition U11 x3 x2 x1 := F0 M.U11 (Vcons x3 (Vcons x2 (Vcons x1 Vnil))). Definition U12 x3 x2 x1 := F0 M.U12 (Vcons x3 (Vcons x2 (Vcons x1 Vnil))). Definition _0_1 := F0 M._0_1 Vnil. Definition active x1 := F0 M.active (Vcons x1 Vnil). Definition mark x1 := F0 M.mark (Vcons x1 Vnil). Definition plus x2 x1 := F0 M.plus (Vcons x2 (Vcons x1 Vnil)). Definition s x1 := F0 M.s (Vcons x1 Vnil). Definition tt := F0 M.tt Vnil. End S0. Definition E := @nil (@ATrs.rule s0). Definition R := R0 (S0.active (S0.U11 S0.tt (V0 0) (V0 1))) (S0.mark (S0.U12 S0.tt (V0 0) (V0 1))) :: R0 (S0.active (S0.U12 S0.tt (V0 0) (V0 1))) (S0.mark (S0.s (S0.plus (V0 1) (V0 0)))) :: R0 (S0.active (S0.plus (V0 0) S0._0_1)) (S0.mark (V0 0)) :: R0 (S0.active (S0.plus (V0 0) (S0.s (V0 1)))) (S0.mark (S0.U11 S0.tt (V0 1) (V0 0))) :: R0 (S0.mark (S0.U11 (V0 0) (V0 1) (V0 2))) (S0.active (S0.U11 (S0.mark (V0 0)) (V0 1) (V0 2))) :: R0 (S0.mark S0.tt) (S0.active S0.tt) :: R0 (S0.mark (S0.U12 (V0 0) (V0 1) (V0 2))) (S0.active (S0.U12 (S0.mark (V0 0)) (V0 1) (V0 2))) :: R0 (S0.mark (S0.s (V0 0))) (S0.active (S0.s (S0.mark (V0 0)))) :: R0 (S0.mark (S0.plus (V0 0) (V0 1))) (S0.active (S0.plus (S0.mark (V0 0)) (S0.mark (V0 1)))) :: R0 (S0.mark S0._0_1) (S0.active S0._0_1) :: R0 (S0.U11 (S0.mark (V0 0)) (V0 1) (V0 2)) (S0.U11 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U11 (V0 0) (S0.mark (V0 1)) (V0 2)) (S0.U11 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U11 (V0 0) (V0 1) (S0.mark (V0 2))) (S0.U11 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U11 (S0.active (V0 0)) (V0 1) (V0 2)) (S0.U11 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U11 (V0 0) (S0.active (V0 1)) (V0 2)) (S0.U11 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U11 (V0 0) (V0 1) (S0.active (V0 2))) (S0.U11 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U12 (S0.mark (V0 0)) (V0 1) (V0 2)) (S0.U12 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U12 (V0 0) (S0.mark (V0 1)) (V0 2)) (S0.U12 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U12 (V0 0) (V0 1) (S0.mark (V0 2))) (S0.U12 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U12 (S0.active (V0 0)) (V0 1) (V0 2)) (S0.U12 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U12 (V0 0) (S0.active (V0 1)) (V0 2)) (S0.U12 (V0 0) (V0 1) (V0 2)) :: R0 (S0.U12 (V0 0) (V0 1) (S0.active (V0 2))) (S0.U12 (V0 0) (V0 1) (V0 2)) :: R0 (S0.s (S0.mark (V0 0))) (S0.s (V0 0)) :: R0 (S0.s (S0.active (V0 0))) (S0.s (V0 0)) :: R0 (S0.plus (S0.mark (V0 0)) (V0 1)) (S0.plus (V0 0) (V0 1)) :: R0 (S0.plus (V0 0) (S0.mark (V0 1))) (S0.plus (V0 0) (V0 1)) :: R0 (S0.plus (S0.active (V0 0)) (V0 1)) (S0.plus (V0 0) (V0 1)) :: R0 (S0.plus (V0 0) (S0.active (V0 1))) (S0.plus (V0 0) (V0 1)) :: @nil (@ATrs.rule s0). Definition rel := ATrs.red_mod E R. (* symbol marking *) Definition s1 := dup_sig s0. Definition s1_p := s0. Definition V1 := @ATerm.Var s1. Definition F1 := @ATerm.Fun s1. Definition R1 := @ATrs.mkRule s1. Module S1. Definition hU11 x3 x2 x1 := F1 (hd_symb s1_p M.U11) (Vcons x3 (Vcons x2 (Vcons x1 Vnil))). Definition U11 x3 x2 x1 := F1 (int_symb s1_p M.U11) (Vcons x3 (Vcons x2 (Vcons x1 Vnil))). Definition hU12 x3 x2 x1 := F1 (hd_symb s1_p M.U12) (Vcons x3 (Vcons x2 (Vcons x1 Vnil))). Definition U12 x3 x2 x1 := F1 (int_symb s1_p M.U12) (Vcons x3 (Vcons x2 (Vcons x1 Vnil))). Definition h_0_1 := F1 (hd_symb s1_p M._0_1) Vnil. Definition _0_1 := F1 (int_symb s1_p M._0_1) Vnil. Definition hactive x1 := F1 (hd_symb s1_p M.active) (Vcons x1 Vnil). Definition active x1 := F1 (int_symb s1_p M.active) (Vcons x1 Vnil). Definition hmark x1 := F1 (hd_symb s1_p M.mark) (Vcons x1 Vnil). Definition mark x1 := F1 (int_symb s1_p M.mark) (Vcons x1 Vnil). Definition hplus x2 x1 := F1 (hd_symb s1_p M.plus) (Vcons x2 (Vcons x1 Vnil)). Definition plus x2 x1 := F1 (int_symb s1_p M.plus) (Vcons x2 (Vcons x1 Vnil)). Definition hs x1 := F1 (hd_symb s1_p M.s) (Vcons x1 Vnil). Definition s x1 := F1 (int_symb s1_p M.s) (Vcons x1 Vnil). Definition htt := F1 (hd_symb s1_p M.tt) Vnil. Definition tt := F1 (int_symb s1_p M.tt) Vnil. End S1. (* graph decomposition 1 *) Definition cs1 : list (list (@ATrs.rule s1)) := ( R1 (S1.hplus (V1 0) (S1.mark (V1 1))) (S1.hplus (V1 0) (V1 1)) :: R1 (S1.hplus (S1.mark (V1 0)) (V1 1)) (S1.hplus (V1 0) (V1 1)) :: R1 (S1.hplus (S1.active (V1 0)) (V1 1)) (S1.hplus (V1 0) (V1 1)) :: R1 (S1.hplus (V1 0) (S1.active (V1 1))) (S1.hplus (V1 0) (V1 1)) :: nil) :: ( R1 (S1.hs (S1.active (V1 0))) (S1.hs (V1 0)) :: R1 (S1.hs (S1.mark (V1 0))) (S1.hs (V1 0)) :: nil) :: ( R1 (S1.hU12 (V1 0) (S1.mark (V1 1)) (V1 2)) (S1.hU12 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU12 (S1.mark (V1 0)) (V1 1) (V1 2)) (S1.hU12 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU12 (V1 0) (V1 1) (S1.mark (V1 2))) (S1.hU12 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU12 (S1.active (V1 0)) (V1 1) (V1 2)) (S1.hU12 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU12 (V1 0) (S1.active (V1 1)) (V1 2)) (S1.hU12 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU12 (V1 0) (V1 1) (S1.active (V1 2))) (S1.hU12 (V1 0) (V1 1) (V1 2)) :: nil) :: ( R1 (S1.hU11 (V1 0) (S1.mark (V1 1)) (V1 2)) (S1.hU11 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU11 (S1.mark (V1 0)) (V1 1) (V1 2)) (S1.hU11 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU11 (V1 0) (V1 1) (S1.mark (V1 2))) (S1.hU11 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU11 (S1.active (V1 0)) (V1 1) (V1 2)) (S1.hU11 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU11 (V1 0) (S1.active (V1 1)) (V1 2)) (S1.hU11 (V1 0) (V1 1) (V1 2)) :: R1 (S1.hU11 (V1 0) (V1 1) (S1.active (V1 2))) (S1.hU11 (V1 0) (V1 1) (V1 2)) :: nil) :: ( R1 (S1.hmark (S1.plus (V1 0) (V1 1))) (S1.hplus (S1.mark (V1 0)) (S1.mark (V1 1))) :: nil) :: ( R1 (S1.hmark (S1.s (V1 0))) (S1.hs (S1.mark (V1 0))) :: nil) :: ( R1 (S1.hmark (S1.U12 (V1 0) (V1 1) (V1 2))) (S1.hU12 (S1.mark (V1 0)) (V1 1) (V1 2)) :: nil) :: ( R1 (S1.hmark (S1.U11 (V1 0) (V1 1) (V1 2))) (S1.hU11 (S1.mark (V1 0)) (V1 1) (V1 2)) :: nil) :: ( R1 (S1.hactive (S1.plus (V1 0) (S1.s (V1 1)))) (S1.hU11 (S1.tt) (V1 1) (V1 0)) :: nil) :: ( R1 (S1.hactive (S1.U12 (S1.tt) (V1 0) (V1 1))) (S1.hplus (V1 1) (V1 0)) :: nil) :: ( R1 (S1.hactive (S1.U12 (S1.tt) (V1 0) (V1 1))) (S1.hs (S1.plus (V1 1) (V1 0))) :: nil) :: ( R1 (S1.hactive (S1.U11 (S1.tt) (V1 0) (V1 1))) (S1.hU12 (S1.tt) (V1 0) (V1 1)) :: nil) :: ( R1 (S1.hmark (S1._0_1)) (S1.hactive (S1._0_1)) :: nil) :: ( R1 (S1.hmark (S1.tt)) (S1.hactive (S1.tt)) :: nil) :: ( R1 (S1.hmark (S1.U11 (V1 0) (V1 1) (V1 2))) (S1.hactive (S1.U11 (S1.mark (V1 0)) (V1 1) (V1 2))) :: R1 (S1.hactive (S1.U11 (S1.tt) (V1 0) (V1 1))) (S1.hmark (S1.U12 (S1.tt) (V1 0) (V1 1))) :: R1 (S1.hmark (S1.U11 (V1 0) (V1 1) (V1 2))) (S1.hmark (V1 0)) :: R1 (S1.hmark (S1.U12 (V1 0) (V1 1) (V1 2))) (S1.hactive (S1.U12 (S1.mark (V1 0)) (V1 1) (V1 2))) :: R1 (S1.hactive (S1.U12 (S1.tt) (V1 0) (V1 1))) (S1.hmark (S1.s (S1.plus (V1 1) (V1 0)))) :: R1 (S1.hmark (S1.U12 (V1 0) (V1 1) (V1 2))) (S1.hmark (V1 0)) :: R1 (S1.hmark (S1.s (V1 0))) (S1.hactive (S1.s (S1.mark (V1 0)))) :: R1 (S1.hactive (S1.plus (V1 0) (S1._0_1))) (S1.hmark (V1 0)) :: R1 (S1.hmark (S1.s (V1 0))) (S1.hmark (V1 0)) :: R1 (S1.hmark (S1.plus (V1 0) (V1 1))) (S1.hactive (S1.plus (S1.mark (V1 0)) (S1.mark (V1 1)))) :: R1 (S1.hactive (S1.plus (V1 0) (S1.s (V1 1)))) (S1.hmark (S1.U11 (S1.tt) (V1 1) (V1 0))) :: R1 (S1.hmark (S1.plus (V1 0) (V1 1))) (S1.hmark (V1 0)) :: R1 (S1.hmark (S1.plus (V1 0) (V1 1))) (S1.hmark (V1 1)) :: nil) :: nil. (* polynomial interpretation 1 *) Module PIS1 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => (2%Z, Vnil) :: nil | (hd_symb M.mark) => nil | (int_symb M.mark) => (2%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => (1%Z, (Vcons 0 Vnil)) :: nil | (hd_symb M.plus) => (3%Z, (Vcons 0 (Vcons 1 Vnil))) :: nil | (int_symb M.plus) => (2%Z, (Vcons 0 (Vcons 0 Vnil))) :: (3%Z, (Vcons 1 (Vcons 0 Vnil))) :: (1%Z, (Vcons 0 (Vcons 1 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => (2%Z, Vnil) :: nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS1. Module PI1 := PolyInt PIS1. (* polynomial interpretation 2 *) Module PIS2 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: (2%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => (1%Z, Vnil) :: nil | (hd_symb M.mark) => nil | (int_symb M.mark) => (2%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => (2%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => (1%Z, (Vcons 0 Vnil)) :: nil | (hd_symb M.plus) => (3%Z, (Vcons 1 (Vcons 0 Vnil))) :: nil | (int_symb M.plus) => (3%Z, (Vcons 0 (Vcons 0 Vnil))) :: (2%Z, (Vcons 1 (Vcons 0 Vnil))) :: (2%Z, (Vcons 0 (Vcons 1 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => (2%Z, Vnil) :: nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS2. Module PI2 := PolyInt PIS2. (* polynomial interpretation 3 *) Module PIS3 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (1%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => (2%Z, Vnil) :: nil | (hd_symb M.mark) => nil | (int_symb M.mark) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => nil | (hd_symb M.plus) => (2%Z, (Vcons 1 (Vcons 0 Vnil))) :: nil | (int_symb M.plus) => (3%Z, (Vcons 0 (Vcons 0 Vnil))) :: (1%Z, (Vcons 1 (Vcons 0 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => (2%Z, Vnil) :: nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS3. Module PI3 := PolyInt PIS3. (* polynomial interpretation 4 *) Module PIS4 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => nil | (hd_symb M.tt) => nil | (int_symb M.tt) => nil | (hd_symb M.mark) => nil | (int_symb M.mark) => (1%Z, (Vcons 0 Vnil)) :: (2%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => nil | (hd_symb M.s) => nil | (int_symb M.s) => nil | (hd_symb M.plus) => (2%Z, (Vcons 0 (Vcons 1 Vnil))) :: nil | (int_symb M.plus) => (3%Z, (Vcons 0 (Vcons 0 Vnil))) :: (2%Z, (Vcons 1 (Vcons 0 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS4. Module PI4 := PolyInt PIS4. (* polynomial interpretation 5 *) Module PIS5 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => nil | (hd_symb M.mark) => nil | (int_symb M.mark) => (1%Z, (Vcons 0 Vnil)) :: (2%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => nil | (hd_symb M.s) => (1%Z, (Vcons 1 Vnil)) :: nil | (int_symb M.s) => nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (3%Z, (Vcons 0 (Vcons 0 Vnil))) :: (3%Z, (Vcons 1 (Vcons 0 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => (3%Z, Vnil) :: nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS5. Module PI5 := PolyInt PIS5. (* polynomial interpretation 6 *) Module PIS6 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => (2%Z, Vnil) :: nil | (hd_symb M.mark) => nil | (int_symb M.mark) => (2%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => (2%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (int_symb M.U12) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => (1%Z, (Vcons 0 Vnil)) :: nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (2%Z, (Vcons 0 (Vcons 0 Vnil))) :: (2%Z, (Vcons 1 (Vcons 0 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => (1%Z, Vnil) :: nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS6. Module PI6 := PolyInt PIS6. (* polynomial interpretation 7 *) Module PIS7 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => (1%Z, Vnil) :: nil | (hd_symb M.mark) => nil | (int_symb M.mark) => (1%Z, (Vcons 0 Vnil)) :: (2%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => (1%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 1 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (int_symb M.U12) => nil | (hd_symb M.s) => nil | (int_symb M.s) => nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (3%Z, (Vcons 0 (Vcons 0 Vnil))) :: (2%Z, (Vcons 1 (Vcons 0 Vnil))) :: (1%Z, (Vcons 0 (Vcons 1 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS7. Module PI7 := PolyInt PIS7. (* polynomial interpretation 8 *) Module PIS8 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => (2%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (int_symb M.U11) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => (2%Z, Vnil) :: nil | (hd_symb M.mark) => nil | (int_symb M.mark) => (2%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => (1%Z, (Vcons 0 Vnil)) :: nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (2%Z, (Vcons 0 (Vcons 0 Vnil))) :: (2%Z, (Vcons 1 (Vcons 0 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => (1%Z, Vnil) :: nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS8. Module PI8 := PolyInt PIS8. (* polynomial interpretation 9 *) Module PIS9 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => (1%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 1 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (int_symb M.U11) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => (1%Z, Vnil) :: nil | (hd_symb M.mark) => nil | (int_symb M.mark) => (1%Z, (Vcons 0 Vnil)) :: (2%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => nil | (hd_symb M.s) => nil | (int_symb M.s) => nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (3%Z, (Vcons 0 (Vcons 0 Vnil))) :: (2%Z, (Vcons 1 (Vcons 0 Vnil))) :: (1%Z, (Vcons 0 (Vcons 1 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS9. Module PI9 := PolyInt PIS9. (* polynomial interpretation 10 *) Module PIS10 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => (2%Z, (Vcons 1 Vnil)) :: nil | (int_symb M.active) => (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (2%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 1 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => nil | (hd_symb M.mark) => (2%Z, (Vcons 1 Vnil)) :: nil | (int_symb M.mark) => (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => (2%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 1 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (1%Z, (Vcons 1 (Vcons 0 Vnil))) :: (1%Z, (Vcons 0 (Vcons 1 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => (2%Z, Vnil) :: nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS10. Module PI10 := PolyInt PIS10. (* polynomial interpretation 11 *) Module PIS11 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => (1%Z, (Vcons 1 Vnil)) :: nil | (int_symb M.active) => nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => nil | (hd_symb M.mark) => (1%Z, (Vcons 0 Vnil)) :: nil | (int_symb M.mark) => nil | (hd_symb M.U12) => nil | (int_symb M.U12) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (1%Z, (Vcons 0 (Vcons 0 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS11. Module PI11 := PolyInt PIS11. (* polynomial interpretation 12 *) Module PIS12 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => (1%Z, (Vcons 1 Vnil)) :: nil | (int_symb M.active) => (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (2%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: (3%Z, (Vcons 0 (Vcons 1 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => (2%Z, Vnil) :: nil | (hd_symb M.mark) => (1%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (int_symb M.mark) => (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: (3%Z, (Vcons 0 (Vcons 1 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => (2%Z, (Vcons 0 Vnil)) :: (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (1%Z, (Vcons 1 (Vcons 0 Vnil))) :: (3%Z, (Vcons 0 (Vcons 1 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS12. Module PI12 := PolyInt PIS12. (* graph decomposition 2 *) Definition cs2 : list (list (@ATrs.rule s1)) := ( R1 (S1.hmark (S1.plus (V1 0) (V1 1))) (S1.hmark (V1 0)) :: R1 (S1.hmark (S1.U11 (V1 0) (V1 1) (V1 2))) (S1.hmark (V1 0)) :: R1 (S1.hmark (S1.plus (V1 0) (V1 1))) (S1.hmark (V1 1)) :: nil) :: ( R1 (S1.hactive (S1.U12 (S1.tt) (V1 0) (V1 1))) (S1.hmark (S1.s (S1.plus (V1 1) (V1 0)))) :: nil) :: ( R1 (S1.hactive (S1.U11 (S1.tt) (V1 0) (V1 1))) (S1.hmark (S1.U12 (S1.tt) (V1 0) (V1 1))) :: nil) :: nil. (* polynomial interpretation 13 *) Module PIS13 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (2%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => nil | (hd_symb M.mark) => (2%Z, (Vcons 1 Vnil)) :: nil | (int_symb M.mark) => (2%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => (2%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (2%Z, (Vcons 0 (Vcons 0 Vnil))) :: (2%Z, (Vcons 1 (Vcons 0 Vnil))) :: (2%Z, (Vcons 0 (Vcons 1 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS13. Module PI13 := PolyInt PIS13. (* polynomial interpretation 14 *) Module PIS14 (*<: TPolyInt*). Definition sig := s1. Definition trsInt f := match f as f return poly (@ASignature.arity s1 f) with | (hd_symb M.active) => nil | (int_symb M.active) => (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U11) => nil | (int_symb M.U11) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 1 (Vcons 0 (Vcons 0 Vnil)))) :: (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (hd_symb M.tt) => nil | (int_symb M.tt) => nil | (hd_symb M.mark) => (1%Z, (Vcons 1 Vnil)) :: nil | (int_symb M.mark) => (1%Z, (Vcons 1 Vnil)) :: nil | (hd_symb M.U12) => nil | (int_symb M.U12) => (1%Z, (Vcons 0 (Vcons 0 (Vcons 1 Vnil)))) :: nil | (hd_symb M.s) => nil | (int_symb M.s) => nil | (hd_symb M.plus) => nil | (int_symb M.plus) => (1%Z, (Vcons 0 (Vcons 0 Vnil))) :: (1%Z, (Vcons 1 (Vcons 0 Vnil))) :: nil | (hd_symb M._0_1) => nil | (int_symb M._0_1) => nil end. Lemma trsInt_wm : forall f, pweak_monotone (trsInt f). Proof. pmonotone. Qed. End PIS14. Module PI14 := PolyInt PIS14. (* termination proof *) Lemma termination : WF rel. Proof. unfold rel. dp_trans. mark. let D := fresh "D" in let R := fresh "R" in set_rules_to D; set_mod_rules_to R; graph_decomp (dpg_unif_N 100 R D) cs1; subst D; subst R. dpg_unif_N_correct. right. PI1.prove_termination. PI2.prove_termination. PI3.prove_termination. PI4.prove_termination. termination_trivial. right. PI5.prove_termination. termination_trivial. right. PI6.prove_termination. PI7.prove_termination. termination_trivial. right. PI8.prove_termination. PI9.prove_termination. termination_trivial. left. co_scc. left. co_scc. left. co_scc. left. co_scc. left. co_scc. left. co_scc. left. co_scc. left. co_scc. left. co_scc. left. co_scc. right. PI10.prove_termination. PI11.prove_termination. PI12.prove_termination. let D := fresh "D" in let R := fresh "R" in set_rules_to D; set_mod_rules_to R; graph_decomp (dpg_unif_N 100 R D) cs2; subst D; subst R. dpg_unif_N_correct. right. PI13.prove_termination. PI14.prove_termination. termination_trivial. left. co_scc. left. co_scc. Qed.