0 Prolog
↳1 PrologToPiTRSProof (⇐)
↳2 PiTRS
↳3 DependencyPairsProof (⇔)
↳4 PiDP
↳5 DependencyGraphProof (⇔)
↳6 AND
↳7 PiDP
↳8 UsableRulesProof (⇔)
↳9 PiDP
↳10 PiDPToQDPProof (⇐)
↳11 QDP
↳12 QDPSizeChangeProof (⇔)
↳13 TRUE
↳14 PiDP
↳15 UsableRulesProof (⇔)
↳16 PiDP
↳17 PiDPToQDPProof (⇐)
↳18 QDP
↳19 QDPSizeChangeProof (⇔)
↳20 TRUE
↳21 PiDP
↳22 UsableRulesProof (⇔)
↳23 PiDP
↳24 PiDPToQDPProof (⇐)
↳25 QDP
↳26 NonTerminationProof (⇔)
↳27 FALSE
↳28 PiDP
↳29 UsableRulesProof (⇔)
↳30 PiDP
↳31 PiDPToQDPProof (⇐)
↳32 QDP
↳33 Narrowing (⇐)
↳34 QDP
↳35 Narrowing (⇐)
↳36 QDP
↳37 NonTerminationProof (⇔)
↳38 FALSE
↳39 PiDP
↳40 UsableRulesProof (⇔)
↳41 PiDP
↳42 PiDPToQDPProof (⇐)
↳43 QDP
↳44 NonTerminationProof (⇔)
↳45 FALSE
↳46 PiDP
↳47 UsableRulesProof (⇔)
↳48 PiDP
↳49 PiDPToQDPProof (⇐)
↳50 QDP
↳51 Narrowing (⇐)
↳52 QDP
↳53 Narrowing (⇐)
↳54 QDP
↳55 NonTerminationProof (⇔)
↳56 FALSE
↳57 PrologToPiTRSProof (⇐)
↳58 PiTRS
↳59 DependencyPairsProof (⇔)
↳60 PiDP
↳61 DependencyGraphProof (⇔)
↳62 AND
↳63 PiDP
↳64 UsableRulesProof (⇔)
↳65 PiDP
↳66 PiDPToQDPProof (⇐)
↳67 QDP
↳68 QDPSizeChangeProof (⇔)
↳69 TRUE
↳70 PiDP
↳71 UsableRulesProof (⇔)
↳72 PiDP
↳73 PiDPToQDPProof (⇐)
↳74 QDP
↳75 QDPSizeChangeProof (⇔)
↳76 TRUE
↳77 PiDP
↳78 UsableRulesProof (⇔)
↳79 PiDP
↳80 PiDPToQDPProof (⇐)
↳81 QDP
↳82 NonTerminationProof (⇔)
↳83 FALSE
↳84 PiDP
↳85 UsableRulesProof (⇔)
↳86 PiDP
↳87 PiDPToQDPProof (⇐)
↳88 QDP
↳89 Narrowing (⇐)
↳90 QDP
↳91 Narrowing (⇐)
↳92 QDP
↳93 NonTerminationProof (⇔)
↳94 FALSE
↳95 PiDP
↳96 UsableRulesProof (⇔)
↳97 PiDP
↳98 PiDPToQDPProof (⇐)
↳99 QDP
↳100 NonTerminationProof (⇔)
↳101 FALSE
↳102 PiDP
↳103 UsableRulesProof (⇔)
↳104 PiDP
↳105 PiDPToQDPProof (⇐)
↳106 QDP
↳107 Narrowing (⇐)
↳108 QDP
↳109 Narrowing (⇐)
↳110 QDP
↳111 NonTerminationProof (⇔)
↳112 FALSE
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
MS_IN_AG(.(X, .(Y, Xs)), Ys) → U1_AG(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
MS_IN_AG(.(X, .(Y, Xs)), Ys) → SPLIT_IN_AAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → U5_AAA(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_AAA(Xs, Zs, Ys)
U1_AG(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AG(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U1_AG(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
MS_IN_AA(.(X, .(Y, Xs)), Ys) → U1_AA(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
MS_IN_AA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_AAA(.(X, .(Y, Xs)), X1s, X2s)
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AA(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_AA(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U3_AA(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_AA(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
U3_AA(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → MERGE_IN_AAA(Y1s, Y2s, Ys)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAA(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → LESS_IN_AA(X, s(Y))
LESS_IN_AA(s(X), s(Y)) → U10_AA(X, Y, less_in_aa(X, Y))
LESS_IN_AA(s(X), s(Y)) → LESS_IN_AA(X, Y)
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_AAA(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → MERGE_IN_AAA(Xs, .(Y, Ys), Zs)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAA(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN_AA(Y, X)
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_AAA(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → MERGE_IN_AAA(.(X, Xs), Ys, Zs)
U2_AG(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_AG(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U2_AG(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U3_AG(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_AG(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
U3_AG(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → MERGE_IN_AAG(Y1s, Y2s, Ys)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAG(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → LESS_IN_GA(X, s(Y))
LESS_IN_GA(s(X), s(Y)) → U10_GA(X, Y, less_in_ga(X, Y))
LESS_IN_GA(s(X), s(Y)) → LESS_IN_GA(X, Y)
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_AAG(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → MERGE_IN_AAG(Xs, .(Y, Ys), Zs)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAG(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN_GA(Y, X)
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_AAG(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → MERGE_IN_AAG(.(X, Xs), Ys, Zs)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
MS_IN_AG(.(X, .(Y, Xs)), Ys) → U1_AG(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
MS_IN_AG(.(X, .(Y, Xs)), Ys) → SPLIT_IN_AAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → U5_AAA(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_AAA(Xs, Zs, Ys)
U1_AG(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AG(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U1_AG(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
MS_IN_AA(.(X, .(Y, Xs)), Ys) → U1_AA(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
MS_IN_AA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_AAA(.(X, .(Y, Xs)), X1s, X2s)
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AA(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_AA(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U3_AA(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_AA(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
U3_AA(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → MERGE_IN_AAA(Y1s, Y2s, Ys)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAA(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → LESS_IN_AA(X, s(Y))
LESS_IN_AA(s(X), s(Y)) → U10_AA(X, Y, less_in_aa(X, Y))
LESS_IN_AA(s(X), s(Y)) → LESS_IN_AA(X, Y)
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_AAA(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → MERGE_IN_AAA(Xs, .(Y, Ys), Zs)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAA(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN_AA(Y, X)
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_AAA(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → MERGE_IN_AAA(.(X, Xs), Ys, Zs)
U2_AG(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_AG(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U2_AG(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U3_AG(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_AG(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
U3_AG(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → MERGE_IN_AAG(Y1s, Y2s, Ys)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAG(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → LESS_IN_GA(X, s(Y))
LESS_IN_GA(s(X), s(Y)) → U10_GA(X, Y, less_in_ga(X, Y))
LESS_IN_GA(s(X), s(Y)) → LESS_IN_GA(X, Y)
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_AAG(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → MERGE_IN_AAG(Xs, .(Y, Ys), Zs)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAG(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN_GA(Y, X)
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_AAG(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → MERGE_IN_AAG(.(X, Xs), Ys, Zs)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
LESS_IN_GA(s(X), s(Y)) → LESS_IN_GA(X, Y)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
LESS_IN_GA(s(X), s(Y)) → LESS_IN_GA(X, Y)
LESS_IN_GA(s(X)) → LESS_IN_GA(X)
From the DPs we obtained the following set of size-change graphs:
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → MERGE_IN_AAG(Xs, .(Y, Ys), Zs)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAG(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAG(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → MERGE_IN_AAG(.(X, Xs), Ys, Zs)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → MERGE_IN_AAG(Xs, .(Y, Ys), Zs)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAG(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAG(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → MERGE_IN_AAG(.(X, Xs), Ys, Zs)
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_AAG(X, Zs, less_out_ga(X)) → MERGE_IN_AAG(Zs)
MERGE_IN_AAG(.(X, Zs)) → U6_AAG(X, Zs, less_in_ga(X))
MERGE_IN_AAG(.(Y, Zs)) → U8_AAG(Y, Zs, less_in_ga(Y))
U8_AAG(Y, Zs, less_out_ga(Y)) → MERGE_IN_AAG(Zs)
less_in_ga(0) → less_out_ga(0)
less_in_ga(s(X)) → U10_ga(X, less_in_ga(X))
U10_ga(X, less_out_ga(X)) → less_out_ga(s(X))
less_in_ga(x0)
U10_ga(x0, x1)
From the DPs we obtained the following set of size-change graphs:
LESS_IN_AA(s(X), s(Y)) → LESS_IN_AA(X, Y)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
LESS_IN_AA(s(X), s(Y)) → LESS_IN_AA(X, Y)
LESS_IN_AA → LESS_IN_AA
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → MERGE_IN_AAA(Xs, .(Y, Ys), Zs)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAA(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAA(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → MERGE_IN_AAA(.(X, Xs), Ys, Zs)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → MERGE_IN_AAA(Xs, .(Y, Ys), Zs)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAA(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAA(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → MERGE_IN_AAA(.(X, Xs), Ys, Zs)
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_AAA(less_out_aa(X)) → MERGE_IN_AAA
MERGE_IN_AAA → U6_AAA(less_in_aa)
MERGE_IN_AAA → U8_AAA(less_in_aa)
U8_AAA(less_out_aa(Y)) → MERGE_IN_AAA
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
less_in_aa
U10_aa(x0)
MERGE_IN_AAA → U6_AAA(less_out_aa(0))
MERGE_IN_AAA → U6_AAA(U10_aa(less_in_aa))
U6_AAA(less_out_aa(X)) → MERGE_IN_AAA
MERGE_IN_AAA → U8_AAA(less_in_aa)
U8_AAA(less_out_aa(Y)) → MERGE_IN_AAA
MERGE_IN_AAA → U6_AAA(less_out_aa(0))
MERGE_IN_AAA → U6_AAA(U10_aa(less_in_aa))
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
less_in_aa
U10_aa(x0)
MERGE_IN_AAA → U8_AAA(less_out_aa(0))
MERGE_IN_AAA → U8_AAA(U10_aa(less_in_aa))
U6_AAA(less_out_aa(X)) → MERGE_IN_AAA
U8_AAA(less_out_aa(Y)) → MERGE_IN_AAA
MERGE_IN_AAA → U6_AAA(less_out_aa(0))
MERGE_IN_AAA → U6_AAA(U10_aa(less_in_aa))
MERGE_IN_AAA → U8_AAA(less_out_aa(0))
MERGE_IN_AAA → U8_AAA(U10_aa(less_in_aa))
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
less_in_aa
U10_aa(x0)
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_AAA(Xs, Zs, Ys)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_AAA(Xs, Zs, Ys)
SPLIT_IN_AAA → SPLIT_IN_AAA
MS_IN_AA(.(X, .(Y, Xs)), Ys) → U1_AA(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AA(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
MS_IN_AA(.(X, .(Y, Xs)), Ys) → U1_AA(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AA(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
MS_IN_AA → U1_AA(split_in_aaa)
U1_AA(split_out_aaa) → U2_AA(ms_in_aa)
U2_AA(ms_out_aa) → MS_IN_AA
U1_AA(split_out_aaa) → MS_IN_AA
split_in_aaa → U5_aaa(split_in_aaa)
ms_in_aa → ms_out_aa
ms_in_aa → U1_aa(split_in_aaa)
U5_aaa(split_out_aaa) → split_out_aaa
U1_aa(split_out_aaa) → U2_aa(ms_in_aa)
split_in_aaa → split_out_aaa
U2_aa(ms_out_aa) → U3_aa(ms_in_aa)
U3_aa(ms_out_aa) → U4_aa(merge_in_aaa)
U4_aa(merge_out_aaa) → ms_out_aa
merge_in_aaa → merge_out_aaa
merge_in_aaa → U6_aaa(less_in_aa)
merge_in_aaa → U8_aaa(less_in_aa)
U6_aaa(less_out_aa(X)) → U7_aaa(merge_in_aaa)
U8_aaa(less_out_aa(Y)) → U9_aaa(merge_in_aaa)
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U7_aaa(merge_out_aaa) → merge_out_aaa
U9_aaa(merge_out_aaa) → merge_out_aaa
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
split_in_aaa
ms_in_aa
U5_aaa(x0)
U1_aa(x0)
U2_aa(x0)
U3_aa(x0)
U4_aa(x0)
merge_in_aaa
U6_aaa(x0)
U8_aaa(x0)
less_in_aa
U7_aaa(x0)
U9_aaa(x0)
U10_aa(x0)
MS_IN_AA → U1_AA(U5_aaa(split_in_aaa))
MS_IN_AA → U1_AA(split_out_aaa)
U1_AA(split_out_aaa) → U2_AA(ms_in_aa)
U2_AA(ms_out_aa) → MS_IN_AA
U1_AA(split_out_aaa) → MS_IN_AA
MS_IN_AA → U1_AA(U5_aaa(split_in_aaa))
MS_IN_AA → U1_AA(split_out_aaa)
split_in_aaa → U5_aaa(split_in_aaa)
ms_in_aa → ms_out_aa
ms_in_aa → U1_aa(split_in_aaa)
U5_aaa(split_out_aaa) → split_out_aaa
U1_aa(split_out_aaa) → U2_aa(ms_in_aa)
split_in_aaa → split_out_aaa
U2_aa(ms_out_aa) → U3_aa(ms_in_aa)
U3_aa(ms_out_aa) → U4_aa(merge_in_aaa)
U4_aa(merge_out_aaa) → ms_out_aa
merge_in_aaa → merge_out_aaa
merge_in_aaa → U6_aaa(less_in_aa)
merge_in_aaa → U8_aaa(less_in_aa)
U6_aaa(less_out_aa(X)) → U7_aaa(merge_in_aaa)
U8_aaa(less_out_aa(Y)) → U9_aaa(merge_in_aaa)
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U7_aaa(merge_out_aaa) → merge_out_aaa
U9_aaa(merge_out_aaa) → merge_out_aaa
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
split_in_aaa
ms_in_aa
U5_aaa(x0)
U1_aa(x0)
U2_aa(x0)
U3_aa(x0)
U4_aa(x0)
merge_in_aaa
U6_aaa(x0)
U8_aaa(x0)
less_in_aa
U7_aaa(x0)
U9_aaa(x0)
U10_aa(x0)
U1_AA(split_out_aaa) → U2_AA(ms_out_aa)
U1_AA(split_out_aaa) → U2_AA(U1_aa(split_in_aaa))
U2_AA(ms_out_aa) → MS_IN_AA
U1_AA(split_out_aaa) → MS_IN_AA
MS_IN_AA → U1_AA(U5_aaa(split_in_aaa))
MS_IN_AA → U1_AA(split_out_aaa)
U1_AA(split_out_aaa) → U2_AA(ms_out_aa)
U1_AA(split_out_aaa) → U2_AA(U1_aa(split_in_aaa))
split_in_aaa → U5_aaa(split_in_aaa)
ms_in_aa → ms_out_aa
ms_in_aa → U1_aa(split_in_aaa)
U5_aaa(split_out_aaa) → split_out_aaa
U1_aa(split_out_aaa) → U2_aa(ms_in_aa)
split_in_aaa → split_out_aaa
U2_aa(ms_out_aa) → U3_aa(ms_in_aa)
U3_aa(ms_out_aa) → U4_aa(merge_in_aaa)
U4_aa(merge_out_aaa) → ms_out_aa
merge_in_aaa → merge_out_aaa
merge_in_aaa → U6_aaa(less_in_aa)
merge_in_aaa → U8_aaa(less_in_aa)
U6_aaa(less_out_aa(X)) → U7_aaa(merge_in_aaa)
U8_aaa(less_out_aa(Y)) → U9_aaa(merge_in_aaa)
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U7_aaa(merge_out_aaa) → merge_out_aaa
U9_aaa(merge_out_aaa) → merge_out_aaa
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
split_in_aaa
ms_in_aa
U5_aaa(x0)
U1_aa(x0)
U2_aa(x0)
U3_aa(x0)
U4_aa(x0)
merge_in_aaa
U6_aaa(x0)
U8_aaa(x0)
less_in_aa
U7_aaa(x0)
U9_aaa(x0)
U10_aa(x0)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
MS_IN_AG(.(X, .(Y, Xs)), Ys) → U1_AG(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
MS_IN_AG(.(X, .(Y, Xs)), Ys) → SPLIT_IN_AAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → U5_AAA(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_AAA(Xs, Zs, Ys)
U1_AG(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AG(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U1_AG(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
MS_IN_AA(.(X, .(Y, Xs)), Ys) → U1_AA(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
MS_IN_AA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_AAA(.(X, .(Y, Xs)), X1s, X2s)
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AA(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_AA(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U3_AA(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_AA(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
U3_AA(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → MERGE_IN_AAA(Y1s, Y2s, Ys)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAA(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → LESS_IN_AA(X, s(Y))
LESS_IN_AA(s(X), s(Y)) → U10_AA(X, Y, less_in_aa(X, Y))
LESS_IN_AA(s(X), s(Y)) → LESS_IN_AA(X, Y)
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_AAA(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → MERGE_IN_AAA(Xs, .(Y, Ys), Zs)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAA(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN_AA(Y, X)
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_AAA(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → MERGE_IN_AAA(.(X, Xs), Ys, Zs)
U2_AG(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_AG(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U2_AG(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U3_AG(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_AG(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
U3_AG(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → MERGE_IN_AAG(Y1s, Y2s, Ys)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAG(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → LESS_IN_GA(X, s(Y))
LESS_IN_GA(s(X), s(Y)) → U10_GA(X, Y, less_in_ga(X, Y))
LESS_IN_GA(s(X), s(Y)) → LESS_IN_GA(X, Y)
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_AAG(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → MERGE_IN_AAG(Xs, .(Y, Ys), Zs)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAG(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN_GA(Y, X)
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_AAG(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → MERGE_IN_AAG(.(X, Xs), Ys, Zs)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
MS_IN_AG(.(X, .(Y, Xs)), Ys) → U1_AG(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
MS_IN_AG(.(X, .(Y, Xs)), Ys) → SPLIT_IN_AAA(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → U5_AAA(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_AAA(Xs, Zs, Ys)
U1_AG(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AG(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U1_AG(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
MS_IN_AA(.(X, .(Y, Xs)), Ys) → U1_AA(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
MS_IN_AA(.(X, .(Y, Xs)), Ys) → SPLIT_IN_AAA(.(X, .(Y, Xs)), X1s, X2s)
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AA(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_AA(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U3_AA(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_AA(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
U3_AA(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → MERGE_IN_AAA(Y1s, Y2s, Ys)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAA(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → LESS_IN_AA(X, s(Y))
LESS_IN_AA(s(X), s(Y)) → U10_AA(X, Y, less_in_aa(X, Y))
LESS_IN_AA(s(X), s(Y)) → LESS_IN_AA(X, Y)
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_AAA(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → MERGE_IN_AAA(Xs, .(Y, Ys), Zs)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAA(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN_AA(Y, X)
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_AAA(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → MERGE_IN_AAA(.(X, Xs), Ys, Zs)
U2_AG(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_AG(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U2_AG(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U3_AG(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_AG(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
U3_AG(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → MERGE_IN_AAG(Y1s, Y2s, Ys)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAG(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → LESS_IN_GA(X, s(Y))
LESS_IN_GA(s(X), s(Y)) → U10_GA(X, Y, less_in_ga(X, Y))
LESS_IN_GA(s(X), s(Y)) → LESS_IN_GA(X, Y)
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_AAG(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → MERGE_IN_AAG(Xs, .(Y, Ys), Zs)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAG(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN_GA(Y, X)
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_AAG(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → MERGE_IN_AAG(.(X, Xs), Ys, Zs)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
LESS_IN_GA(s(X), s(Y)) → LESS_IN_GA(X, Y)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
LESS_IN_GA(s(X), s(Y)) → LESS_IN_GA(X, Y)
LESS_IN_GA(s(X)) → LESS_IN_GA(X)
From the DPs we obtained the following set of size-change graphs:
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → MERGE_IN_AAG(Xs, .(Y, Ys), Zs)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAG(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAG(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → MERGE_IN_AAG(.(X, Xs), Ys, Zs)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
U6_AAG(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → MERGE_IN_AAG(Xs, .(Y, Ys), Zs)
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAG(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
MERGE_IN_AAG(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAG(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_AAG(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → MERGE_IN_AAG(.(X, Xs), Ys, Zs)
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_AAG(X, Zs, less_out_ga) → MERGE_IN_AAG(Zs)
MERGE_IN_AAG(.(X, Zs)) → U6_AAG(X, Zs, less_in_ga(X))
MERGE_IN_AAG(.(Y, Zs)) → U8_AAG(Y, Zs, less_in_ga(Y))
U8_AAG(Y, Zs, less_out_ga) → MERGE_IN_AAG(Zs)
less_in_ga(0) → less_out_ga
less_in_ga(s(X)) → U10_ga(less_in_ga(X))
U10_ga(less_out_ga) → less_out_ga
less_in_ga(x0)
U10_ga(x0)
From the DPs we obtained the following set of size-change graphs:
LESS_IN_AA(s(X), s(Y)) → LESS_IN_AA(X, Y)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
LESS_IN_AA(s(X), s(Y)) → LESS_IN_AA(X, Y)
LESS_IN_AA → LESS_IN_AA
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → MERGE_IN_AAA(Xs, .(Y, Ys), Zs)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAA(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAA(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → MERGE_IN_AAA(.(X, Xs), Ys, Zs)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
U6_AAA(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → MERGE_IN_AAA(Xs, .(Y, Ys), Zs)
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_AAA(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
MERGE_IN_AAA(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_AAA(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_AAA(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → MERGE_IN_AAA(.(X, Xs), Ys, Zs)
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_AAA(less_out_aa(X)) → MERGE_IN_AAA
MERGE_IN_AAA → U6_AAA(less_in_aa)
MERGE_IN_AAA → U8_AAA(less_in_aa)
U8_AAA(less_out_aa(Y)) → MERGE_IN_AAA
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
less_in_aa
U10_aa(x0)
MERGE_IN_AAA → U6_AAA(less_out_aa(0))
MERGE_IN_AAA → U6_AAA(U10_aa(less_in_aa))
U6_AAA(less_out_aa(X)) → MERGE_IN_AAA
MERGE_IN_AAA → U8_AAA(less_in_aa)
U8_AAA(less_out_aa(Y)) → MERGE_IN_AAA
MERGE_IN_AAA → U6_AAA(less_out_aa(0))
MERGE_IN_AAA → U6_AAA(U10_aa(less_in_aa))
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
less_in_aa
U10_aa(x0)
MERGE_IN_AAA → U8_AAA(less_out_aa(0))
MERGE_IN_AAA → U8_AAA(U10_aa(less_in_aa))
U6_AAA(less_out_aa(X)) → MERGE_IN_AAA
U8_AAA(less_out_aa(Y)) → MERGE_IN_AAA
MERGE_IN_AAA → U6_AAA(less_out_aa(0))
MERGE_IN_AAA → U6_AAA(U10_aa(less_in_aa))
MERGE_IN_AAA → U8_AAA(less_out_aa(0))
MERGE_IN_AAA → U8_AAA(U10_aa(less_in_aa))
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
less_in_aa
U10_aa(x0)
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_AAA(Xs, Zs, Ys)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
SPLIT_IN_AAA(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN_AAA(Xs, Zs, Ys)
SPLIT_IN_AAA → SPLIT_IN_AAA
MS_IN_AA(.(X, .(Y, Xs)), Ys) → U1_AA(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AA(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
ms_in_ag([], []) → ms_out_ag([], [])
ms_in_ag(.(X, []), .(X, [])) → ms_out_ag(.(X, []), .(X, []))
ms_in_ag(.(X, .(Y, Xs)), Ys) → U1_ag(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_ag(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_ag(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
U2_ag(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_ag(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_ag(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_ag(X, Y, Xs, Ys, merge_in_aag(Y1s, Y2s, Ys))
merge_in_aag([], Xs, Xs) → merge_out_aag([], Xs, Xs)
merge_in_aag(Xs, [], Xs) → merge_out_aag(Xs, [], Xs)
merge_in_aag(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aag(X, Xs, Y, Ys, Zs, less_in_ga(X, s(Y)))
less_in_ga(0, s(X1)) → less_out_ga(0, s(X1))
less_in_ga(s(X), s(Y)) → U10_ga(X, Y, less_in_ga(X, Y))
U10_ga(X, Y, less_out_ga(X, Y)) → less_out_ga(s(X), s(Y))
U6_aag(X, Xs, Y, Ys, Zs, less_out_ga(X, s(Y))) → U7_aag(X, Xs, Y, Ys, Zs, merge_in_aag(Xs, .(Y, Ys), Zs))
merge_in_aag(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aag(X, Xs, Y, Ys, Zs, less_in_ga(Y, X))
U8_aag(X, Xs, Y, Ys, Zs, less_out_ga(Y, X)) → U9_aag(X, Xs, Y, Ys, Zs, merge_in_aag(.(X, Xs), Ys, Zs))
U9_aag(X, Xs, Y, Ys, Zs, merge_out_aag(.(X, Xs), Ys, Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_aag(X, Xs, Y, Ys, Zs, merge_out_aag(Xs, .(Y, Ys), Zs)) → merge_out_aag(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_ag(X, Y, Xs, Ys, merge_out_aag(Y1s, Y2s, Ys)) → ms_out_ag(.(X, .(Y, Xs)), Ys)
MS_IN_AA(.(X, .(Y, Xs)), Ys) → U1_AA(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_AA(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
U2_AA(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → MS_IN_AA(X2s, Y2s)
U1_AA(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → MS_IN_AA(X1s, Y1s)
split_in_aaa(.(X, Xs), .(X, Ys), Zs) → U5_aaa(X, Xs, Ys, Zs, split_in_aaa(Xs, Zs, Ys))
ms_in_aa([], []) → ms_out_aa([], [])
ms_in_aa(.(X, []), .(X, [])) → ms_out_aa(.(X, []), .(X, []))
ms_in_aa(.(X, .(Y, Xs)), Ys) → U1_aa(X, Y, Xs, Ys, split_in_aaa(.(X, .(Y, Xs)), X1s, X2s))
U5_aaa(X, Xs, Ys, Zs, split_out_aaa(Xs, Zs, Ys)) → split_out_aaa(.(X, Xs), .(X, Ys), Zs)
U1_aa(X, Y, Xs, Ys, split_out_aaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_aa(X, Y, Xs, Ys, X2s, ms_in_aa(X1s, Y1s))
split_in_aaa([], [], []) → split_out_aaa([], [], [])
U2_aa(X, Y, Xs, Ys, X2s, ms_out_aa(X1s, Y1s)) → U3_aa(X, Y, Xs, Ys, Y1s, ms_in_aa(X2s, Y2s))
U3_aa(X, Y, Xs, Ys, Y1s, ms_out_aa(X2s, Y2s)) → U4_aa(X, Y, Xs, Ys, merge_in_aaa(Y1s, Y2s, Ys))
U4_aa(X, Y, Xs, Ys, merge_out_aaa(Y1s, Y2s, Ys)) → ms_out_aa(.(X, .(Y, Xs)), Ys)
merge_in_aaa([], Xs, Xs) → merge_out_aaa([], Xs, Xs)
merge_in_aaa(Xs, [], Xs) → merge_out_aaa(Xs, [], Xs)
merge_in_aaa(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6_aaa(X, Xs, Y, Ys, Zs, less_in_aa(X, s(Y)))
merge_in_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U8_aaa(X, Xs, Y, Ys, Zs, less_in_aa(Y, X))
U6_aaa(X, Xs, Y, Ys, Zs, less_out_aa(X, s(Y))) → U7_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(Xs, .(Y, Ys), Zs))
U8_aaa(X, Xs, Y, Ys, Zs, less_out_aa(Y, X)) → U9_aaa(X, Xs, Y, Ys, Zs, merge_in_aaa(.(X, Xs), Ys, Zs))
less_in_aa(0, s(X1)) → less_out_aa(0, s(X1))
less_in_aa(s(X), s(Y)) → U10_aa(X, Y, less_in_aa(X, Y))
U7_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(Xs, .(Y, Ys), Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U9_aaa(X, Xs, Y, Ys, Zs, merge_out_aaa(.(X, Xs), Ys, Zs)) → merge_out_aaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U10_aa(X, Y, less_out_aa(X, Y)) → less_out_aa(s(X), s(Y))
MS_IN_AA → U1_AA(split_in_aaa)
U1_AA(split_out_aaa) → U2_AA(ms_in_aa)
U2_AA(ms_out_aa) → MS_IN_AA
U1_AA(split_out_aaa) → MS_IN_AA
split_in_aaa → U5_aaa(split_in_aaa)
ms_in_aa → ms_out_aa
ms_in_aa → U1_aa(split_in_aaa)
U5_aaa(split_out_aaa) → split_out_aaa
U1_aa(split_out_aaa) → U2_aa(ms_in_aa)
split_in_aaa → split_out_aaa
U2_aa(ms_out_aa) → U3_aa(ms_in_aa)
U3_aa(ms_out_aa) → U4_aa(merge_in_aaa)
U4_aa(merge_out_aaa) → ms_out_aa
merge_in_aaa → merge_out_aaa
merge_in_aaa → U6_aaa(less_in_aa)
merge_in_aaa → U8_aaa(less_in_aa)
U6_aaa(less_out_aa(X)) → U7_aaa(merge_in_aaa)
U8_aaa(less_out_aa(Y)) → U9_aaa(merge_in_aaa)
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U7_aaa(merge_out_aaa) → merge_out_aaa
U9_aaa(merge_out_aaa) → merge_out_aaa
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
split_in_aaa
ms_in_aa
U5_aaa(x0)
U1_aa(x0)
U2_aa(x0)
U3_aa(x0)
U4_aa(x0)
merge_in_aaa
U6_aaa(x0)
U8_aaa(x0)
less_in_aa
U7_aaa(x0)
U9_aaa(x0)
U10_aa(x0)
MS_IN_AA → U1_AA(U5_aaa(split_in_aaa))
MS_IN_AA → U1_AA(split_out_aaa)
U1_AA(split_out_aaa) → U2_AA(ms_in_aa)
U2_AA(ms_out_aa) → MS_IN_AA
U1_AA(split_out_aaa) → MS_IN_AA
MS_IN_AA → U1_AA(U5_aaa(split_in_aaa))
MS_IN_AA → U1_AA(split_out_aaa)
split_in_aaa → U5_aaa(split_in_aaa)
ms_in_aa → ms_out_aa
ms_in_aa → U1_aa(split_in_aaa)
U5_aaa(split_out_aaa) → split_out_aaa
U1_aa(split_out_aaa) → U2_aa(ms_in_aa)
split_in_aaa → split_out_aaa
U2_aa(ms_out_aa) → U3_aa(ms_in_aa)
U3_aa(ms_out_aa) → U4_aa(merge_in_aaa)
U4_aa(merge_out_aaa) → ms_out_aa
merge_in_aaa → merge_out_aaa
merge_in_aaa → U6_aaa(less_in_aa)
merge_in_aaa → U8_aaa(less_in_aa)
U6_aaa(less_out_aa(X)) → U7_aaa(merge_in_aaa)
U8_aaa(less_out_aa(Y)) → U9_aaa(merge_in_aaa)
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U7_aaa(merge_out_aaa) → merge_out_aaa
U9_aaa(merge_out_aaa) → merge_out_aaa
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
split_in_aaa
ms_in_aa
U5_aaa(x0)
U1_aa(x0)
U2_aa(x0)
U3_aa(x0)
U4_aa(x0)
merge_in_aaa
U6_aaa(x0)
U8_aaa(x0)
less_in_aa
U7_aaa(x0)
U9_aaa(x0)
U10_aa(x0)
U1_AA(split_out_aaa) → U2_AA(ms_out_aa)
U1_AA(split_out_aaa) → U2_AA(U1_aa(split_in_aaa))
U2_AA(ms_out_aa) → MS_IN_AA
U1_AA(split_out_aaa) → MS_IN_AA
MS_IN_AA → U1_AA(U5_aaa(split_in_aaa))
MS_IN_AA → U1_AA(split_out_aaa)
U1_AA(split_out_aaa) → U2_AA(ms_out_aa)
U1_AA(split_out_aaa) → U2_AA(U1_aa(split_in_aaa))
split_in_aaa → U5_aaa(split_in_aaa)
ms_in_aa → ms_out_aa
ms_in_aa → U1_aa(split_in_aaa)
U5_aaa(split_out_aaa) → split_out_aaa
U1_aa(split_out_aaa) → U2_aa(ms_in_aa)
split_in_aaa → split_out_aaa
U2_aa(ms_out_aa) → U3_aa(ms_in_aa)
U3_aa(ms_out_aa) → U4_aa(merge_in_aaa)
U4_aa(merge_out_aaa) → ms_out_aa
merge_in_aaa → merge_out_aaa
merge_in_aaa → U6_aaa(less_in_aa)
merge_in_aaa → U8_aaa(less_in_aa)
U6_aaa(less_out_aa(X)) → U7_aaa(merge_in_aaa)
U8_aaa(less_out_aa(Y)) → U9_aaa(merge_in_aaa)
less_in_aa → less_out_aa(0)
less_in_aa → U10_aa(less_in_aa)
U7_aaa(merge_out_aaa) → merge_out_aaa
U9_aaa(merge_out_aaa) → merge_out_aaa
U10_aa(less_out_aa(X)) → less_out_aa(s(X))
split_in_aaa
ms_in_aa
U5_aaa(x0)
U1_aa(x0)
U2_aa(x0)
U3_aa(x0)
U4_aa(x0)
merge_in_aaa
U6_aaa(x0)
U8_aaa(x0)
less_in_aa
U7_aaa(x0)
U9_aaa(x0)
U10_aa(x0)