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 QDPOrderProof (⇔)
↳27 QDP
↳28 DependencyGraphProof (⇔)
↳29 QDP
↳30 UsableRulesProof (⇔)
↳31 QDP
↳32 QReductionProof (⇔)
↳33 QDP
↳34 QDPSizeChangeProof (⇔)
↳35 TRUE
↳36 PiDP
↳37 UsableRulesProof (⇔)
↳38 PiDP
↳39 PiDPToQDPProof (⇐)
↳40 QDP
↳41 QDPSizeChangeProof (⇔)
↳42 TRUE
↳43 PiDP
↳44 UsableRulesProof (⇔)
↳45 PiDP
↳46 PiDPToQDPProof (⇐)
↳47 QDP
↳48 QDPOrderProof (⇔)
↳49 QDP
↳50 DependencyGraphProof (⇔)
↳51 TRUE
↳52 PrologToPiTRSProof (⇐)
↳53 PiTRS
↳54 DependencyPairsProof (⇔)
↳55 PiDP
↳56 DependencyGraphProof (⇔)
↳57 AND
↳58 PiDP
↳59 UsableRulesProof (⇔)
↳60 PiDP
↳61 PiDPToQDPProof (⇔)
↳62 QDP
↳63 QDPSizeChangeProof (⇔)
↳64 TRUE
↳65 PiDP
↳66 UsableRulesProof (⇔)
↳67 PiDP
↳68 PiDPToQDPProof (⇔)
↳69 QDP
↳70 QDPSizeChangeProof (⇔)
↳71 TRUE
↳72 PiDP
↳73 UsableRulesProof (⇔)
↳74 PiDP
↳75 PiDPToQDPProof (⇐)
↳76 QDP
↳77 MRRProof (⇔)
↳78 QDP
↳79 DependencyGraphProof (⇔)
↳80 QDP
↳81 UsableRulesProof (⇔)
↳82 QDP
↳83 QReductionProof (⇔)
↳84 QDP
↳85 QDPSizeChangeProof (⇔)
↳86 TRUE
↳87 PiDP
↳88 UsableRulesProof (⇔)
↳89 PiDP
↳90 PiDPToQDPProof (⇐)
↳91 QDP
↳92 QDPSizeChangeProof (⇔)
↳93 TRUE
↳94 PiDP
↳95 UsableRulesProof (⇔)
↳96 PiDP
↳97 PiDPToQDPProof (⇐)
↳98 QDP
↳99 QDPOrderProof (⇔)
↳100 QDP
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
MERGESORT_IN_GA(.(E, .(F, U)), V) → U1_GA(E, F, U, V, split_in_gaa(U, L2, L1))
MERGESORT_IN_GA(.(E, .(F, U)), V) → SPLIT_IN_GAA(U, L2, L1)
SPLIT_IN_GAA(.(E, U), .(E, V), W) → U9_GAA(E, U, V, W, split_in_gaa(U, W, V))
SPLIT_IN_GAA(.(E, U), .(E, V), W) → SPLIT_IN_GAA(U, W, V)
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2), X)
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_GA(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1), Z)
U3_GA(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_GA(E, F, U, V, merge_in_gga(X, Z, V))
U3_GA(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → MERGE_IN_GGA(X, Z, V)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U5_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → LE_IN_GG(A, B)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → U6_GGA(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U7_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → GT_IN_GG(A, B)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_GGA(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
MERGESORT_IN_GA(.(E, .(F, U)), V) → U1_GA(E, F, U, V, split_in_gaa(U, L2, L1))
MERGESORT_IN_GA(.(E, .(F, U)), V) → SPLIT_IN_GAA(U, L2, L1)
SPLIT_IN_GAA(.(E, U), .(E, V), W) → U9_GAA(E, U, V, W, split_in_gaa(U, W, V))
SPLIT_IN_GAA(.(E, U), .(E, V), W) → SPLIT_IN_GAA(U, W, V)
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2), X)
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_GA(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1), Z)
U3_GA(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_GA(E, F, U, V, merge_in_gga(X, Z, V))
U3_GA(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → MERGE_IN_GGA(X, Z, V)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U5_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → LE_IN_GG(A, B)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → U6_GGA(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U7_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → GT_IN_GG(A, B)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_GGA(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
From the DPs we obtained the following set of size-change graphs:
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
From the DPs we obtained the following set of size-change graphs:
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U5_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U7_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U5_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U7_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U5_GGA(A, X, B, Y, le_out_gg) → MERGE_IN_GGA(X, .(B, Y))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U5_GGA(A, X, B, Y, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U7_GGA(A, X, B, Y, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_gg(gt_out_gg) → gt_out_gg
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0)
U10_gg(x0)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
U5_GGA(A, X, B, Y, le_out_gg) → MERGE_IN_GGA(X, .(B, Y))
POL(.(x1, x2)) = x1 + x2
POL(0) = 1
POL(MERGE_IN_GGA(x1, x2)) = x1
POL(U10_gg(x1)) = 0
POL(U11_gg(x1)) = 1
POL(U5_GGA(x1, x2, x3, x4, x5)) = x2 + x5
POL(U7_GGA(x1, x2, x3, x4, x5)) = x1 + x2
POL(gt_in_gg(x1, x2)) = 0
POL(gt_out_gg) = 0
POL(le_in_gg(x1, x2)) = x1
POL(le_out_gg) = 1
POL(s(x1)) = 1
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
MERGE_IN_GGA(.(A, X), .(B, Y)) → U5_GGA(A, X, B, Y, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U7_GGA(A, X, B, Y, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_gg(gt_out_gg) → gt_out_gg
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0)
U10_gg(x0)
MERGE_IN_GGA(.(A, X), .(B, Y)) → U7_GGA(A, X, B, Y, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_gg(gt_out_gg) → gt_out_gg
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0)
U10_gg(x0)
MERGE_IN_GGA(.(A, X), .(B, Y)) → U7_GGA(A, X, B, Y, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0)
U10_gg(x0)
le_in_gg(x0, x1)
U11_gg(x0)
MERGE_IN_GGA(.(A, X), .(B, Y)) → U7_GGA(A, X, B, Y, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, gt_out_gg) → MERGE_IN_GGA(.(A, X), Y)
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
gt_in_gg(x0, x1)
U10_gg(x0)
From the DPs we obtained the following set of size-change graphs:
SPLIT_IN_GAA(.(E, U), .(E, V), W) → SPLIT_IN_GAA(U, W, V)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
SPLIT_IN_GAA(.(E, U), .(E, V), W) → SPLIT_IN_GAA(U, W, V)
SPLIT_IN_GAA(.(E, U)) → SPLIT_IN_GAA(U)
From the DPs we obtained the following set of size-change graphs:
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1), Z)
MERGESORT_IN_GA(.(E, .(F, U)), V) → U1_GA(E, F, U, V, split_in_gaa(U, L2, L1))
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2), X)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1), Z)
MERGESORT_IN_GA(.(E, .(F, U)), V) → U1_GA(E, F, U, V, split_in_gaa(U, L2, L1))
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2), X)
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U1_GA(E, F, split_out_gaa(L2, L1)) → U2_GA(F, L1, mergesort_in_ga(.(E, L2)))
U2_GA(F, L1, mergesort_out_ga(X)) → MERGESORT_IN_GA(.(F, L1))
MERGESORT_IN_GA(.(E, .(F, U))) → U1_GA(E, F, split_in_gaa(U))
U1_GA(E, F, split_out_gaa(L2, L1)) → MERGESORT_IN_GA(.(E, L2))
mergesort_in_ga(.(E, [])) → mergesort_out_ga(.(E, []))
mergesort_in_ga(.(E, .(F, U))) → U1_ga(E, F, split_in_gaa(U))
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(E, U)) → U9_gaa(E, split_in_gaa(U))
U1_ga(E, F, split_out_gaa(L2, L1)) → U2_ga(F, L1, mergesort_in_ga(.(E, L2)))
U9_gaa(E, split_out_gaa(W, V)) → split_out_gaa(.(E, V), W)
U2_ga(F, L1, mergesort_out_ga(X)) → U3_ga(X, mergesort_in_ga(.(F, L1)))
U3_ga(X, mergesort_out_ga(Z)) → U4_ga(merge_in_gga(X, Z))
U4_ga(merge_out_gga(V)) → mergesort_out_ga(V)
merge_in_gga(X, []) → merge_out_gga(X)
merge_in_gga([], X) → merge_out_gga(X)
merge_in_gga(.(A, X), .(B, Y)) → U5_gga(A, X, B, Y, le_in_gg(A, B))
merge_in_gga(.(A, X), .(B, Y)) → U7_gga(A, X, B, Y, gt_in_gg(A, B))
U5_gga(A, X, B, Y, le_out_gg) → U6_gga(A, merge_in_gga(X, .(B, Y)))
U7_gga(A, X, B, Y, gt_out_gg) → U8_gga(B, merge_in_gga(.(A, X), Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U6_gga(A, merge_out_gga(Z)) → merge_out_gga(.(A, Z))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U8_gga(B, merge_out_gga(Z)) → merge_out_gga(.(B, Z))
U11_gg(le_out_gg) → le_out_gg
U10_gg(gt_out_gg) → gt_out_gg
mergesort_in_ga(x0)
split_in_gaa(x0)
U1_ga(x0, x1, x2)
U9_gaa(x0, x1)
U2_ga(x0, x1, x2)
U3_ga(x0, x1)
U4_ga(x0)
merge_in_gga(x0, x1)
U5_gga(x0, x1, x2, x3, x4)
U7_gga(x0, x1, x2, x3, x4)
le_in_gg(x0, x1)
U6_gga(x0, x1)
gt_in_gg(x0, x1)
U8_gga(x0, x1)
U11_gg(x0)
U10_gg(x0)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
MERGESORT_IN_GA(.(E, .(F, U))) → U1_GA(E, F, split_in_gaa(U))
POL(.(x1, x2)) = 1 + x2
POL(0) = 1
POL(MERGESORT_IN_GA(x1)) = x1
POL(U10_gg(x1)) = 0
POL(U11_gg(x1)) = 1 + x1
POL(U1_GA(x1, x2, x3)) = x3
POL(U1_ga(x1, x2, x3)) = 0
POL(U2_GA(x1, x2, x3)) = 1 + x2
POL(U2_ga(x1, x2, x3)) = 0
POL(U3_ga(x1, x2)) = 0
POL(U4_ga(x1)) = 0
POL(U5_gga(x1, x2, x3, x4, x5)) = 0
POL(U6_gga(x1, x2)) = 0
POL(U7_gga(x1, x2, x3, x4, x5)) = 0
POL(U8_gga(x1, x2)) = 0
POL(U9_gaa(x1, x2)) = 1 + x2
POL([]) = 0
POL(gt_in_gg(x1, x2)) = 0
POL(gt_out_gg) = 0
POL(le_in_gg(x1, x2)) = x1 + x2
POL(le_out_gg) = 1
POL(merge_in_gga(x1, x2)) = 0
POL(merge_out_gga(x1)) = 0
POL(mergesort_in_ga(x1)) = 0
POL(mergesort_out_ga(x1)) = 0
POL(s(x1)) = 1 + x1
POL(split_in_gaa(x1)) = 1 + x1
POL(split_out_gaa(x1, x2)) = 1 + x1 + x2
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(E, U)) → U9_gaa(E, split_in_gaa(U))
U9_gaa(E, split_out_gaa(W, V)) → split_out_gaa(.(E, V), W)
U1_GA(E, F, split_out_gaa(L2, L1)) → U2_GA(F, L1, mergesort_in_ga(.(E, L2)))
U2_GA(F, L1, mergesort_out_ga(X)) → MERGESORT_IN_GA(.(F, L1))
U1_GA(E, F, split_out_gaa(L2, L1)) → MERGESORT_IN_GA(.(E, L2))
mergesort_in_ga(.(E, [])) → mergesort_out_ga(.(E, []))
mergesort_in_ga(.(E, .(F, U))) → U1_ga(E, F, split_in_gaa(U))
split_in_gaa([]) → split_out_gaa([], [])
split_in_gaa(.(E, U)) → U9_gaa(E, split_in_gaa(U))
U1_ga(E, F, split_out_gaa(L2, L1)) → U2_ga(F, L1, mergesort_in_ga(.(E, L2)))
U9_gaa(E, split_out_gaa(W, V)) → split_out_gaa(.(E, V), W)
U2_ga(F, L1, mergesort_out_ga(X)) → U3_ga(X, mergesort_in_ga(.(F, L1)))
U3_ga(X, mergesort_out_ga(Z)) → U4_ga(merge_in_gga(X, Z))
U4_ga(merge_out_gga(V)) → mergesort_out_ga(V)
merge_in_gga(X, []) → merge_out_gga(X)
merge_in_gga([], X) → merge_out_gga(X)
merge_in_gga(.(A, X), .(B, Y)) → U5_gga(A, X, B, Y, le_in_gg(A, B))
merge_in_gga(.(A, X), .(B, Y)) → U7_gga(A, X, B, Y, gt_in_gg(A, B))
U5_gga(A, X, B, Y, le_out_gg) → U6_gga(A, merge_in_gga(X, .(B, Y)))
U7_gga(A, X, B, Y, gt_out_gg) → U8_gga(B, merge_in_gga(.(A, X), Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U6_gga(A, merge_out_gga(Z)) → merge_out_gga(.(A, Z))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg
U8_gga(B, merge_out_gga(Z)) → merge_out_gga(.(B, Z))
U11_gg(le_out_gg) → le_out_gg
U10_gg(gt_out_gg) → gt_out_gg
mergesort_in_ga(x0)
split_in_gaa(x0)
U1_ga(x0, x1, x2)
U9_gaa(x0, x1)
U2_ga(x0, x1, x2)
U3_ga(x0, x1)
U4_ga(x0)
merge_in_gga(x0, x1)
U5_gga(x0, x1, x2, x3, x4)
U7_gga(x0, x1, x2, x3, x4)
le_in_gg(x0, x1)
U6_gga(x0, x1)
gt_in_gg(x0, x1)
U8_gga(x0, x1)
U11_gg(x0)
U10_gg(x0)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
MERGESORT_IN_GA(.(E, .(F, U)), V) → U1_GA(E, F, U, V, split_in_gaa(U, L2, L1))
MERGESORT_IN_GA(.(E, .(F, U)), V) → SPLIT_IN_GAA(U, L2, L1)
SPLIT_IN_GAA(.(E, U), .(E, V), W) → U9_GAA(E, U, V, W, split_in_gaa(U, W, V))
SPLIT_IN_GAA(.(E, U), .(E, V), W) → SPLIT_IN_GAA(U, W, V)
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2), X)
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_GA(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1), Z)
U3_GA(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_GA(E, F, U, V, merge_in_gga(X, Z, V))
U3_GA(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → MERGE_IN_GGA(X, Z, V)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U5_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → LE_IN_GG(A, B)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → U6_GGA(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U7_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → GT_IN_GG(A, B)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_GGA(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
MERGESORT_IN_GA(.(E, .(F, U)), V) → U1_GA(E, F, U, V, split_in_gaa(U, L2, L1))
MERGESORT_IN_GA(.(E, .(F, U)), V) → SPLIT_IN_GAA(U, L2, L1)
SPLIT_IN_GAA(.(E, U), .(E, V), W) → U9_GAA(E, U, V, W, split_in_gaa(U, W, V))
SPLIT_IN_GAA(.(E, U), .(E, V), W) → SPLIT_IN_GAA(U, W, V)
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2), X)
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_GA(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1), Z)
U3_GA(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_GA(E, F, U, V, merge_in_gga(X, Z, V))
U3_GA(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → MERGE_IN_GGA(X, Z, V)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U5_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → LE_IN_GG(A, B)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → U6_GGA(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U7_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → GT_IN_GG(A, B)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_GGA(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
From the DPs we obtained the following set of size-change graphs:
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
From the DPs we obtained the following set of size-change graphs:
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U5_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U7_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
U5_GGA(A, X, B, Y, Z, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y), Z)
MERGE_IN_GGA(.(A, X), .(B, Y), .(A, Z)) → U5_GGA(A, X, B, Y, Z, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y), .(B, Z)) → U7_GGA(A, X, B, Y, Z, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, Z, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y, Z)
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U5_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U5_GGA(A, X, B, Y, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U7_GGA(A, X, B, Y, gt_in_gg(A, B))
U7_GGA(A, X, B, Y, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y)
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)
U7_GGA(A, X, B, Y, gt_out_gg(A, B)) → MERGE_IN_GGA(.(A, X), Y)
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
POL(.(x1, x2)) = 2·x1 + x2
POL(0) = 2
POL(MERGE_IN_GGA(x1, x2)) = 2·x1 + 2·x2
POL(U10_gg(x1, x2, x3)) = 2·x1 + 2·x2 + x3
POL(U11_gg(x1, x2, x3)) = x1 + x2 + x3
POL(U5_GGA(x1, x2, x3, x4, x5)) = x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5
POL(U7_GGA(x1, x2, x3, x4, x5)) = 2·x1 + 2·x2 + 2·x3 + 2·x4 + x5
POL(gt_in_gg(x1, x2)) = 2·x1 + 2·x2
POL(gt_out_gg(x1, x2)) = 1 + 2·x1 + x2
POL(le_in_gg(x1, x2)) = x1 + x2
POL(le_out_gg(x1, x2)) = x1 + x2
POL(s(x1)) = 2·x1
U5_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U5_GGA(A, X, B, Y, le_in_gg(A, B))
MERGE_IN_GGA(.(A, X), .(B, Y)) → U7_GGA(A, X, B, Y, gt_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)
MERGE_IN_GGA(.(A, X), .(B, Y)) → U5_GGA(A, X, B, Y, le_in_gg(A, B))
U5_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)
MERGE_IN_GGA(.(A, X), .(B, Y)) → U5_GGA(A, X, B, Y, le_in_gg(A, B))
U5_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)
gt_in_gg(x0, x1)
U10_gg(x0, x1, x2)
MERGE_IN_GGA(.(A, X), .(B, Y)) → U5_GGA(A, X, B, Y, le_in_gg(A, B))
U5_GGA(A, X, B, Y, le_out_gg(A, B)) → MERGE_IN_GGA(X, .(B, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
le_in_gg(x0, x1)
U11_gg(x0, x1, x2)
From the DPs we obtained the following set of size-change graphs:
SPLIT_IN_GAA(.(E, U), .(E, V), W) → SPLIT_IN_GAA(U, W, V)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
SPLIT_IN_GAA(.(E, U), .(E, V), W) → SPLIT_IN_GAA(U, W, V)
SPLIT_IN_GAA(.(E, U)) → SPLIT_IN_GAA(U)
From the DPs we obtained the following set of size-change graphs:
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1), Z)
MERGESORT_IN_GA(.(E, .(F, U)), V) → U1_GA(E, F, U, V, split_in_gaa(U, L2, L1))
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2), X)
mergesort_in_ga([], []) → mergesort_out_ga([], [])
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U2_GA(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1), Z)
MERGESORT_IN_GA(.(E, .(F, U)), V) → U1_GA(E, F, U, V, split_in_gaa(U, L2, L1))
U1_GA(E, F, U, V, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2), X)
mergesort_in_ga(.(E, []), .(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U)), V) → U1_ga(E, F, U, V, split_in_gaa(U, L2, L1))
split_in_gaa([], [], []) → split_out_gaa([], [], [])
split_in_gaa(.(E, U), .(E, V), W) → U9_gaa(E, U, V, W, split_in_gaa(U, W, V))
U1_ga(E, F, U, V, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, V, L1, mergesort_in_ga(.(E, L2), X))
U9_gaa(E, U, V, W, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U2_ga(E, F, U, V, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, V, X, mergesort_in_ga(.(F, L1), Z))
U3_ga(E, F, U, V, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, V, merge_in_gga(X, Z, V))
U4_ga(E, F, U, V, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
merge_in_gga(X, [], X) → merge_out_gga(X, [], X)
merge_in_gga([], X, X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y), .(A, Z)) → U5_gga(A, X, B, Y, Z, le_in_gg(A, B))
merge_in_gga(.(A, X), .(B, Y), .(B, Z)) → U7_gga(A, X, B, Y, Z, gt_in_gg(A, B))
U5_gga(A, X, B, Y, Z, le_out_gg(A, B)) → U6_gga(A, X, B, Y, Z, merge_in_gga(X, .(B, Y), Z))
U7_gga(A, X, B, Y, Z, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, Z, merge_in_gga(.(A, X), Y, Z))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U6_gga(A, X, B, Y, Z, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U8_gga(A, X, B, Y, Z, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U1_GA(E, F, U, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, L1, mergesort_in_ga(.(E, L2)))
U2_GA(E, F, U, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1))
MERGESORT_IN_GA(.(E, .(F, U))) → U1_GA(E, F, U, split_in_gaa(U))
U1_GA(E, F, U, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2))
mergesort_in_ga(.(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U))) → U1_ga(E, F, U, split_in_gaa(U))
split_in_gaa([]) → split_out_gaa([], [], [])
split_in_gaa(.(E, U)) → U9_gaa(E, U, split_in_gaa(U))
U1_ga(E, F, U, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, L1, mergesort_in_ga(.(E, L2)))
U9_gaa(E, U, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U2_ga(E, F, U, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, X, mergesort_in_ga(.(F, L1)))
U3_ga(E, F, U, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, merge_in_gga(X, Z))
U4_ga(E, F, U, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
merge_in_gga(X, []) → merge_out_gga(X, [], X)
merge_in_gga([], X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y)) → U5_gga(A, X, B, Y, le_in_gg(A, B))
merge_in_gga(.(A, X), .(B, Y)) → U7_gga(A, X, B, Y, gt_in_gg(A, B))
U5_gga(A, X, B, Y, le_out_gg(A, B)) → U6_gga(A, X, B, Y, merge_in_gga(X, .(B, Y)))
U7_gga(A, X, B, Y, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, merge_in_gga(.(A, X), Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U6_gga(A, X, B, Y, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U8_gga(A, X, B, Y, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
mergesort_in_ga(x0)
split_in_gaa(x0)
U1_ga(x0, x1, x2, x3)
U9_gaa(x0, x1, x2)
U2_ga(x0, x1, x2, x3, x4)
U3_ga(x0, x1, x2, x3, x4)
U4_ga(x0, x1, x2, x3)
merge_in_gga(x0, x1)
U5_gga(x0, x1, x2, x3, x4)
U7_gga(x0, x1, x2, x3, x4)
le_in_gg(x0, x1)
U6_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U8_gga(x0, x1, x2, x3, x4)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
U1_GA(E, F, U, split_out_gaa(U, L2, L1)) → U2_GA(E, F, U, L1, mergesort_in_ga(.(E, L2)))
U1_GA(E, F, U, split_out_gaa(U, L2, L1)) → MERGESORT_IN_GA(.(E, L2))
POL(.(x1, x2)) = 1 + x2
POL(0) = 0
POL(MERGESORT_IN_GA(x1)) = x1
POL(U10_gg(x1, x2, x3)) = 0
POL(U11_gg(x1, x2, x3)) = 0
POL(U1_GA(x1, x2, x3, x4)) = 1 + x4
POL(U1_ga(x1, x2, x3, x4)) = 0
POL(U2_GA(x1, x2, x3, x4, x5)) = 1 + x4
POL(U2_ga(x1, x2, x3, x4, x5)) = 0
POL(U3_ga(x1, x2, x3, x4, x5)) = 0
POL(U4_ga(x1, x2, x3, x4)) = 0
POL(U5_gga(x1, x2, x3, x4, x5)) = 0
POL(U6_gga(x1, x2, x3, x4, x5)) = 0
POL(U7_gga(x1, x2, x3, x4, x5)) = 0
POL(U8_gga(x1, x2, x3, x4, x5)) = 0
POL(U9_gaa(x1, x2, x3)) = 1 + x3
POL([]) = 0
POL(gt_in_gg(x1, x2)) = 0
POL(gt_out_gg(x1, x2)) = 0
POL(le_in_gg(x1, x2)) = 0
POL(le_out_gg(x1, x2)) = 0
POL(merge_in_gga(x1, x2)) = 0
POL(merge_out_gga(x1, x2, x3)) = 0
POL(mergesort_in_ga(x1)) = 0
POL(mergesort_out_ga(x1, x2)) = 0
POL(s(x1)) = 0
POL(split_in_gaa(x1)) = 1 + x1
POL(split_out_gaa(x1, x2, x3)) = 1 + x2 + x3
split_in_gaa([]) → split_out_gaa([], [], [])
split_in_gaa(.(E, U)) → U9_gaa(E, U, split_in_gaa(U))
U9_gaa(E, U, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U2_GA(E, F, U, L1, mergesort_out_ga(.(E, L2), X)) → MERGESORT_IN_GA(.(F, L1))
MERGESORT_IN_GA(.(E, .(F, U))) → U1_GA(E, F, U, split_in_gaa(U))
mergesort_in_ga(.(E, [])) → mergesort_out_ga(.(E, []), .(E, []))
mergesort_in_ga(.(E, .(F, U))) → U1_ga(E, F, U, split_in_gaa(U))
split_in_gaa([]) → split_out_gaa([], [], [])
split_in_gaa(.(E, U)) → U9_gaa(E, U, split_in_gaa(U))
U1_ga(E, F, U, split_out_gaa(U, L2, L1)) → U2_ga(E, F, U, L1, mergesort_in_ga(.(E, L2)))
U9_gaa(E, U, split_out_gaa(U, W, V)) → split_out_gaa(.(E, U), .(E, V), W)
U2_ga(E, F, U, L1, mergesort_out_ga(.(E, L2), X)) → U3_ga(E, F, U, X, mergesort_in_ga(.(F, L1)))
U3_ga(E, F, U, X, mergesort_out_ga(.(F, L1), Z)) → U4_ga(E, F, U, merge_in_gga(X, Z))
U4_ga(E, F, U, merge_out_gga(X, Z, V)) → mergesort_out_ga(.(E, .(F, U)), V)
merge_in_gga(X, []) → merge_out_gga(X, [], X)
merge_in_gga([], X) → merge_out_gga([], X, X)
merge_in_gga(.(A, X), .(B, Y)) → U5_gga(A, X, B, Y, le_in_gg(A, B))
merge_in_gga(.(A, X), .(B, Y)) → U7_gga(A, X, B, Y, gt_in_gg(A, B))
U5_gga(A, X, B, Y, le_out_gg(A, B)) → U6_gga(A, X, B, Y, merge_in_gga(X, .(B, Y)))
U7_gga(A, X, B, Y, gt_out_gg(A, B)) → U8_gga(A, X, B, Y, merge_in_gga(.(A, X), Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(Y)) → le_out_gg(0, s(Y))
le_in_gg(0, 0) → le_out_gg(0, 0)
U6_gga(A, X, B, Y, merge_out_gga(X, .(B, Y), Z)) → merge_out_gga(.(A, X), .(B, Y), .(A, Z))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(X), 0) → gt_out_gg(s(X), 0)
U8_gga(A, X, B, Y, merge_out_gga(.(A, X), Y, Z)) → merge_out_gga(.(A, X), .(B, Y), .(B, Z))
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
mergesort_in_ga(x0)
split_in_gaa(x0)
U1_ga(x0, x1, x2, x3)
U9_gaa(x0, x1, x2)
U2_ga(x0, x1, x2, x3, x4)
U3_ga(x0, x1, x2, x3, x4)
U4_ga(x0, x1, x2, x3)
merge_in_gga(x0, x1)
U5_gga(x0, x1, x2, x3, x4)
U7_gga(x0, x1, x2, x3, x4)
le_in_gg(x0, x1)
U6_gga(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U8_gga(x0, x1, x2, x3, x4)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)