/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^2)) proof of /export/starexec/sandbox/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 154 ms] (2) CpxRelTRS (3) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (4) CdtProblem (5) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (6) CdtProblem (7) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CdtProblem (9) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 459 ms] (10) CdtProblem (11) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 359 ms] (12) CdtProblem (13) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 271 ms] (14) CdtProblem (15) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CdtProblem (17) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (18) CdtProblem (19) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (20) CdtProblem (21) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 796 ms] (22) CdtProblem (23) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 807 ms] (24) CdtProblem (25) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (26) CdtProblem (27) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (28) CdtProblem (29) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (30) CdtProblem (31) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (32) CdtProblem (33) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 1610 ms] (34) CdtProblem (35) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 2379 ms] (36) CdtProblem (37) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 3191 ms] (38) CdtProblem (39) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (40) CdtProblem (41) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (42) CdtProblem (43) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (44) CdtProblem (45) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (46) CdtProblem (47) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (48) CdtProblem (49) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (50) CdtProblem (51) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (52) CdtProblem (53) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (54) CdtProblem (55) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (56) CdtProblem (57) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (58) CdtProblem (59) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (60) CdtProblem (61) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (62) CdtProblem (63) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (64) CdtProblem (65) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (66) CdtProblem (67) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (68) CdtProblem (69) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (70) CdtProblem (71) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (72) CdtProblem (73) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (74) CdtProblem (75) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (76) CdtProblem (77) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (78) CdtProblem (79) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 4787 ms] (80) CdtProblem (81) SIsEmptyProof [BOTH BOUNDS(ID, ID), 0 ms] (82) BOUNDS(1, 1) (83) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (84) CpxRelTRS (85) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (86) typed CpxTrs (87) OrderProof [LOWER BOUND(ID), 0 ms] (88) typed CpxTrs (89) RewriteLemmaProof [LOWER BOUND(ID), 261 ms] (90) typed CpxTrs (91) RewriteLemmaProof [LOWER BOUND(ID), 30 ms] (92) BEST (93) proven lower bound (94) LowerBoundPropagationProof [FINISHED, 0 ms] (95) BOUNDS(n^1, INF) (96) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) The (relative) TRS S consists of the following rules: <=(S(x), S(y)) -> <=(x, y) <=(0, y) -> True <=(S(x), 0) -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Rewrite Strategy: INNERMOST ---------------------------------------- (1) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) The (relative) TRS S consists of the following rules: <=(S(x), S(y)) -> <=(x, y) <=(0, y) -> True <=(S(x), 0) -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Rewrite Strategy: INNERMOST ---------------------------------------- (3) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS to CDT ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False goal(z0) -> mergesort(z0) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) <='(0, z0) -> c1 <='(S(z0), 0) -> c2 MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGESORT(Cons(z0, Nil)) -> c6 MERGESORT(Nil) -> c7 MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) NOTEMPTY(Cons(z0, z1)) -> c13 NOTEMPTY(Nil) -> c14 GOAL(z0) -> c15(MERGESORT(z0)) S tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGESORT(Cons(z0, Nil)) -> c6 MERGESORT(Nil) -> c7 MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) NOTEMPTY(Cons(z0, z1)) -> c13 NOTEMPTY(Nil) -> c14 GOAL(z0) -> c15(MERGESORT(z0)) K tuples:none Defined Rule Symbols: mergesort_1, merge_2, splitmerge_3, notEmpty_1, goal_1, <=_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, MERGE_2, SPLITMERGE_3, NOTEMPTY_1, GOAL_1 Compound Symbols: c_1, c1, c2, c3_1, c4_1, c5_1, c6, c7, c8_2, c9, c10, c11_1, c12_3, c13, c14, c15_1 ---------------------------------------- (5) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: GOAL(z0) -> c15(MERGESORT(z0)) Removed 6 trailing nodes: <='(0, z0) -> c1 <='(S(z0), 0) -> c2 NOTEMPTY(Cons(z0, z1)) -> c13 MERGESORT(Cons(z0, Nil)) -> c6 MERGESORT(Nil) -> c7 NOTEMPTY(Nil) -> c14 ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False goal(z0) -> mergesort(z0) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) S tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) K tuples:none Defined Rule Symbols: mergesort_1, merge_2, splitmerge_3, notEmpty_1, goal_1, <=_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, MERGE_2, SPLITMERGE_3 Compound Symbols: c_1, c3_1, c4_1, c5_1, c8_2, c9, c10, c11_1, c12_3 ---------------------------------------- (7) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: notEmpty(Cons(z0, z1)) -> True notEmpty(Nil) -> False goal(z0) -> mergesort(z0) ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) S tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) K tuples:none Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, MERGE_2, SPLITMERGE_3 Compound Symbols: c_1, c3_1, c4_1, c5_1, c8_2, c9, c10, c11_1, c12_3 ---------------------------------------- (9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) We considered the (Usable) Rules:none And the Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(<=(x_1, x_2)) = 0 POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [1] + x_2 POL(False) = 0 POL(MERGE(x_1, x_2)) = 0 POL(MERGESORT(x_1)) = [2]x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = 0 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = [1] + x_1 + [2]x_3 + [2]x_3^2 + [2]x_1*x_3 + x_1^2 + [2]x_1*x_2 + [2]x_2^2 POL(True) = 0 POL(c(x_1)) = x_1 POL(c10) = 0 POL(c11(x_1)) = x_1 POL(c12(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c3(x_1)) = x_1 POL(c4(x_1)) = x_1 POL(c5(x_1)) = x_1 POL(c8(x_1, x_2)) = x_1 + x_2 POL(c9) = 0 POL(merge(x_1, x_2)) = [1] + x_1 + x_2 + x_2^2 + x_1*x_2 + x_1^2 POL(merge[Ite](x_1, x_2, x_3)) = [1] + x_2 + x_3 + x_3^2 + x_2*x_3 + x_2^2 POL(mergesort(x_1)) = 0 POL(splitmerge(x_1, x_2, x_3)) = [1] + x_1 + x_2 + x_3 + x_3^2 + x_2*x_3 + x_1*x_3 + x_1^2 + x_1*x_2 + x_2^2 ---------------------------------------- (10) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) S tuples: MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, MERGE_2, SPLITMERGE_3 Compound Symbols: c_1, c3_1, c4_1, c5_1, c8_2, c9, c10, c11_1, c12_3 ---------------------------------------- (11) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 We considered the (Usable) Rules: <=(0, z0) -> True <=(S(z0), S(z1)) -> <=(z0, z1) <=(S(z0), 0) -> False And the Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(<=(x_1, x_2)) = [1] POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [1] + x_2 POL(False) = [1] POL(MERGE(x_1, x_2)) = [1] POL(MERGESORT(x_1)) = [2]x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = x_1^2 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = [2] + x_1 + [2]x_3 + [2]x_3^2 + [2]x_1*x_3 + x_1^2 + [2]x_1*x_2 + [2]x_2^2 POL(True) = [1] POL(c(x_1)) = x_1 POL(c10) = 0 POL(c11(x_1)) = x_1 POL(c12(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c3(x_1)) = x_1 POL(c4(x_1)) = x_1 POL(c5(x_1)) = x_1 POL(c8(x_1, x_2)) = x_1 + x_2 POL(c9) = 0 POL(merge(x_1, x_2)) = [1] + x_1 + x_2 + x_2^2 + x_1*x_2 + x_1^2 POL(merge[Ite](x_1, x_2, x_3)) = [1] + x_2 + x_3 + x_3^2 + x_2*x_3 + x_2^2 POL(mergesort(x_1)) = 0 POL(splitmerge(x_1, x_2, x_3)) = [1] + x_1 + x_2 + x_3 + x_3^2 + x_2*x_3 + x_1*x_3 + x_1^2 + x_1*x_2 + x_2^2 ---------------------------------------- (12) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) S tuples: MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, MERGE_2, SPLITMERGE_3 Compound Symbols: c_1, c3_1, c4_1, c5_1, c8_2, c9, c10, c11_1, c12_3 ---------------------------------------- (13) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) We considered the (Usable) Rules:none And the Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(<=(x_1, x_2)) = 0 POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [1] + x_2 POL(False) = 0 POL(MERGE(x_1, x_2)) = 0 POL(MERGESORT(x_1)) = [2]x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = 0 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = [2]x_1 + [2]x_3 + [2]x_3^2 + [2]x_1*x_3 + x_1^2 + [2]x_1*x_2 + [2]x_2^2 POL(True) = 0 POL(c(x_1)) = x_1 POL(c10) = 0 POL(c11(x_1)) = x_1 POL(c12(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c3(x_1)) = x_1 POL(c4(x_1)) = x_1 POL(c5(x_1)) = x_1 POL(c8(x_1, x_2)) = x_1 + x_2 POL(c9) = 0 POL(merge(x_1, x_2)) = [1] + x_1 + x_2 + x_2^2 + x_1*x_2 + x_1^2 POL(merge[Ite](x_1, x_2, x_3)) = [1] + x_2 + x_3 + x_3^2 + x_2*x_3 + x_2^2 POL(mergesort(x_1)) = 0 POL(splitmerge(x_1, x_2, x_3)) = [1] + x_1 + x_2 + x_3 + x_3^2 + x_2*x_3 + x_1*x_3 + x_1^2 + x_1*x_2 + x_2^2 ---------------------------------------- (14) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) S tuples: MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, MERGE_2, SPLITMERGE_3 Compound Symbols: c_1, c3_1, c4_1, c5_1, c8_2, c9, c10, c11_1, c12_3 ---------------------------------------- (15) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace MERGE(Cons(z0, z1), Cons(z2, z3)) -> c8(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2)) by MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3)), <='(0, z0)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3)), <='(S(z0), 0)) ---------------------------------------- (16) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3)), <='(0, z0)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3)), <='(S(z0), 0)) S tuples: MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3)), <='(0, z0)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3)), <='(S(z0), 0)) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, MERGE_2, SPLITMERGE_3 Compound Symbols: c_1, c3_1, c4_1, c5_1, c9, c10, c11_1, c12_3, c8_2 ---------------------------------------- (17) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing nodes: MERGE(Nil, z0) -> c10 MERGE(Cons(z0, z1), Nil) -> c9 ---------------------------------------- (18) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3)), <='(0, z0)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3)), <='(S(z0), 0)) S tuples: MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3)), <='(0, z0)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3)), <='(S(z0), 0)) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c12_3, c8_2 ---------------------------------------- (19) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (20) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) S tuples: MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c12_3, c8_2, c8_1 ---------------------------------------- (21) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) We considered the (Usable) Rules: splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) <=(S(z0), 0) -> False merge(Nil, z0) -> z0 merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Nil) -> Nil <=(0, z0) -> True <=(S(z0), S(z1)) -> <=(z0, z1) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) And the Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(<=(x_1, x_2)) = [1] POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [2] + x_2 POL(False) = [1] POL(MERGE(x_1, x_2)) = x_2 + x_1*x_2 POL(MERGESORT(x_1)) = x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = x_2*x_3 + x_1*x_3 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = x_3 + x_3^2 + x_2*x_3 + [2]x_1*x_3 + x_1^2 + [2]x_1*x_2 + x_2^2 POL(True) = 0 POL(c(x_1)) = x_1 POL(c11(x_1)) = x_1 POL(c12(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c3(x_1)) = x_1 POL(c4(x_1)) = x_1 POL(c5(x_1)) = x_1 POL(c8(x_1)) = x_1 POL(c8(x_1, x_2)) = x_1 + x_2 POL(merge(x_1, x_2)) = x_1 + x_2 POL(merge[Ite](x_1, x_2, x_3)) = x_2 + x_3 POL(mergesort(x_1)) = x_1 POL(splitmerge(x_1, x_2, x_3)) = x_1 + x_2 + x_3 ---------------------------------------- (22) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) S tuples: MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c12_3, c8_2, c8_1 ---------------------------------------- (23) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) We considered the (Usable) Rules: splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) <=(S(z0), 0) -> False merge(Nil, z0) -> z0 merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Nil) -> Nil <=(0, z0) -> True <=(S(z0), S(z1)) -> <=(z0, z1) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) And the Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(<=(x_1, x_2)) = [1] POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [1] + x_2 POL(False) = 0 POL(MERGE(x_1, x_2)) = [1] + x_2 POL(MERGESORT(x_1)) = [2]x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = x_1 + x_3 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = [1] + x_1 + [2]x_3 + [2]x_3^2 + [2]x_1*x_3 + x_1^2 + [2]x_1*x_2 + [2]x_2^2 POL(True) = [1] POL(c(x_1)) = x_1 POL(c11(x_1)) = x_1 POL(c12(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c3(x_1)) = x_1 POL(c4(x_1)) = x_1 POL(c5(x_1)) = x_1 POL(c8(x_1)) = x_1 POL(c8(x_1, x_2)) = x_1 + x_2 POL(merge(x_1, x_2)) = x_1 + x_2 POL(merge[Ite](x_1, x_2, x_3)) = x_2 + x_3 POL(mergesort(x_1)) = [2]x_1 POL(splitmerge(x_1, x_2, x_3)) = [2]x_1 + [2]x_2 + [2]x_3 ---------------------------------------- (24) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) S tuples: MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c12_3, c8_2, c8_1 ---------------------------------------- (25) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) by SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGE(mergesort(x0), Nil), MERGESORT(x0), MERGESORT(Nil)) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(Cons(z0, Nil)), MERGESORT(x1)) SPLITMERGE(Nil, Nil, x1) -> c12(MERGE(Nil, mergesort(x1)), MERGESORT(Nil), MERGESORT(x1)) ---------------------------------------- (26) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGE(mergesort(x0), Nil), MERGESORT(x0), MERGESORT(Nil)) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(Cons(z0, Nil)), MERGESORT(x1)) SPLITMERGE(Nil, Nil, x1) -> c12(MERGE(Nil, mergesort(x1)), MERGESORT(Nil), MERGESORT(x1)) S tuples: MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_2, c8_1, c12_3 ---------------------------------------- (27) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 6 trailing tuple parts ---------------------------------------- (28) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Nil, x1) -> c12(MERGESORT(x1)) S tuples: MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0), MERGESORT(z1)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_2, c8_1, c12_3, c12_2, c12_1 ---------------------------------------- (29) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: SPLITMERGE(Nil, Nil, x1) -> c12(MERGESORT(x1)) ---------------------------------------- (30) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) S tuples: MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_2, c8_1, c12_3, c12_2, c12_1 ---------------------------------------- (31) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace MERGE(Cons(S(z0), x1), Cons(S(z1), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3)), <='(S(z0), S(z1))) by MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) ---------------------------------------- (32) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_3, c12_2, c12_1, c8_2 ---------------------------------------- (33) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) We considered the (Usable) Rules: splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) <=(S(z0), 0) -> False merge(Nil, z0) -> z0 merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Nil) -> Nil <=(0, z0) -> True <=(S(z0), S(z1)) -> <=(z0, z1) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) And the Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(<=(x_1, x_2)) = [1] POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [2] + x_2 POL(False) = [1] POL(MERGE(x_1, x_2)) = x_2 POL(MERGESORT(x_1)) = x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = x_1*x_3 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = x_3 + x_3^2 + [2]x_1*x_3 + x_1^2 + [2]x_1*x_2 + x_2^2 POL(True) = [1] POL(c(x_1)) = x_1 POL(c11(x_1)) = x_1 POL(c12(x_1)) = x_1 POL(c12(x_1, x_2)) = x_1 + x_2 POL(c12(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c3(x_1)) = x_1 POL(c4(x_1)) = x_1 POL(c5(x_1)) = x_1 POL(c8(x_1)) = x_1 POL(c8(x_1, x_2)) = x_1 + x_2 POL(merge(x_1, x_2)) = x_1 + x_2 POL(merge[Ite](x_1, x_2, x_3)) = x_2 + x_3 POL(mergesort(x_1)) = x_1 POL(splitmerge(x_1, x_2, x_3)) = x_1 + x_2 + x_3 ---------------------------------------- (34) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_3, c12_2, c12_1, c8_2 ---------------------------------------- (35) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) We considered the (Usable) Rules: splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) <=(S(z0), 0) -> False merge(Nil, z0) -> z0 merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Nil) -> Nil <=(0, z0) -> True <=(S(z0), S(z1)) -> <=(z0, z1) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) And the Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(<=(x_1, x_2)) = [1] POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [2] + x_2 POL(False) = [1] POL(MERGE(x_1, x_2)) = x_2 + x_1*x_2 POL(MERGESORT(x_1)) = x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = x_2*x_3 + x_1*x_3 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = x_3 + x_3^2 + x_2*x_3 + [2]x_1*x_3 + x_1^2 + [2]x_1*x_2 + x_2^2 POL(True) = 0 POL(c(x_1)) = x_1 POL(c11(x_1)) = x_1 POL(c12(x_1)) = x_1 POL(c12(x_1, x_2)) = x_1 + x_2 POL(c12(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c3(x_1)) = x_1 POL(c4(x_1)) = x_1 POL(c5(x_1)) = x_1 POL(c8(x_1)) = x_1 POL(c8(x_1, x_2)) = x_1 + x_2 POL(merge(x_1, x_2)) = x_1 + x_2 POL(merge[Ite](x_1, x_2, x_3)) = x_2 + x_3 POL(mergesort(x_1)) = x_1 POL(splitmerge(x_1, x_2, x_3)) = x_1 + x_2 + x_3 ---------------------------------------- (36) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_3, c12_2, c12_1, c8_2 ---------------------------------------- (37) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) We considered the (Usable) Rules: splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) <=(S(z0), 0) -> False merge(Nil, z0) -> z0 merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Nil) -> Nil <=(0, z0) -> True <=(S(z0), S(z1)) -> <=(z0, z1) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) And the Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(<=(x_1, x_2)) = [1] POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [1] + x_2 POL(False) = 0 POL(MERGE(x_1, x_2)) = [1] + x_2 POL(MERGESORT(x_1)) = [2]x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = x_1 + x_3 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = [2] + x_1 + [2]x_3 + [2]x_3^2 + [2]x_1*x_3 + x_1^2 + [2]x_1*x_2 + [2]x_2^2 POL(True) = [1] POL(c(x_1)) = x_1 POL(c11(x_1)) = x_1 POL(c12(x_1)) = x_1 POL(c12(x_1, x_2)) = x_1 + x_2 POL(c12(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c3(x_1)) = x_1 POL(c4(x_1)) = x_1 POL(c5(x_1)) = x_1 POL(c8(x_1)) = x_1 POL(c8(x_1, x_2)) = x_1 + x_2 POL(merge(x_1, x_2)) = x_1 + x_2 POL(merge[Ite](x_1, x_2, x_3)) = x_2 + x_3 POL(mergesort(x_1)) = [2]x_1 POL(splitmerge(x_1, x_2, x_3)) = [2]x_1 + [2]x_2 + [2]x_3 ---------------------------------------- (38) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_3, c12_2, c12_1, c8_2 ---------------------------------------- (39) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(z1, z2)))) by SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c12(MERGE(Nil, splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Nil), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) ---------------------------------------- (40) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c12(MERGE(Nil, splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Nil), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_3, c12_2, c12_1, c8_2 ---------------------------------------- (41) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 3 trailing tuple parts ---------------------------------------- (42) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_3, c12_2, c12_1, c8_2 ---------------------------------------- (43) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) ---------------------------------------- (44) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_3, c12_2, c12_1, c8_2 ---------------------------------------- (45) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(x1)) by SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Cons(z1, z2))) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(x0, Cons(x1, x2))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2))), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Nil), MERGESORT(Cons(x0, Cons(x1, x2))), MERGESORT(Nil)) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) ---------------------------------------- (46) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2))), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Nil), MERGESORT(Cons(x0, Cons(x1, x2))), MERGESORT(Nil)) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_2, c12_1, c8_2, c12_3 ---------------------------------------- (47) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 3 trailing tuple parts ---------------------------------------- (48) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_2, c12_1, c8_2, c12_3 ---------------------------------------- (49) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Nil)) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), Cons(x1, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Nil, Cons(x1, Nil)) -> c12(MERGE(Nil, Cons(x1, Nil)), MERGESORT(Nil)) ---------------------------------------- (50) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Nil, Cons(x1, Nil)) -> c12(MERGE(Nil, Cons(x1, Nil)), MERGESORT(Nil)) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_1, c12_2, c8_2, c12_3 ---------------------------------------- (51) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Nil, Cons(x1, Nil)) -> c12(MERGE(Nil, Cons(x1, Nil)), MERGESORT(Nil)) ---------------------------------------- (52) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil)), MERGESORT(Cons(z0, Nil))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_1, c12_2, c8_2, c12_3 ---------------------------------------- (53) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (54) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_1, c12_2, c8_2, c12_3 ---------------------------------------- (55) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) by SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Cons(z1, z2))) -> c12(MERGE(Cons(x0, Nil), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c12(MERGE(Cons(x0, Nil), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c12(MERGE(Cons(x0, Nil), Nil), MERGESORT(Nil)) ---------------------------------------- (56) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c12(MERGE(Cons(x0, Nil), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c12(MERGE(Cons(x0, Nil), Nil), MERGESORT(Nil)) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_1, c8_2, c12_3, c12_2 ---------------------------------------- (57) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c12(MERGE(Cons(x0, Nil), Nil), MERGESORT(Nil)) ---------------------------------------- (58) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c12(MERGE(Cons(x0, Nil), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_1, c8_2, c12_3, c12_2 ---------------------------------------- (59) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (60) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c3_1, c4_1, c5_1, c11_1, c8_1, c12_1, c8_2, c12_3, c12_2 ---------------------------------------- (61) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace MERGE[ITE](False, z0, Cons(z1, z2)) -> c3(MERGE(z0, z2)) by MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) ---------------------------------------- (62) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGE[ITE]_3, MERGESORT_1, SPLITMERGE_3, MERGE_2 Compound Symbols: c_1, c4_1, c5_1, c11_1, c8_1, c12_1, c8_2, c12_3, c12_2, c3_1 ---------------------------------------- (63) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) by MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) ---------------------------------------- (64) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGESORT_1, SPLITMERGE_3, MERGE_2, MERGE[ITE]_3 Compound Symbols: c_1, c5_1, c11_1, c8_1, c12_1, c8_2, c12_3, c12_2, c3_1, c4_1 ---------------------------------------- (65) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) by SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) ---------------------------------------- (66) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3 Compound Symbols: c_1, c5_1, c8_1, c12_1, c8_2, c12_3, c12_2, c3_1, c4_1, c11_1 ---------------------------------------- (67) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 2 leading nodes: SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) ---------------------------------------- (68) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3 Compound Symbols: c_1, c5_1, c8_1, c8_2, c12_3, c12_1, c12_2, c3_1, c4_1, c11_1 ---------------------------------------- (69) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0), MERGESORT(Cons(z0, Cons(x2, x3)))) by SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x0, x4)), MERGESORT(Cons(x2, Cons(z2, z3)))) ---------------------------------------- (70) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x0, x4)), MERGESORT(Cons(x2, Cons(z2, z3)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3 Compound Symbols: c_1, c5_1, c8_1, c8_2, c12_3, c12_1, c12_2, c3_1, c4_1, c11_1 ---------------------------------------- (71) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c12(MERGESORT(Cons(x1, Cons(x2, x3)))) by SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGESORT(Cons(x2, Cons(z2, z3)))) ---------------------------------------- (72) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x0, x4)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGESORT(Cons(x2, Cons(z2, z3)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3 Compound Symbols: c_1, c5_1, c8_1, c8_2, c12_3, c12_2, c12_1, c3_1, c4_1, c11_1 ---------------------------------------- (73) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(z3, Cons(z4, z5)))) ---------------------------------------- (74) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x0, x4)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(z3, Cons(z4, z5)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3 Compound Symbols: c_1, c5_1, c8_1, c8_2, c12_3, c12_2, c12_1, c3_1, c4_1, c11_1 ---------------------------------------- (75) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c12(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(Cons(z0, Cons(x1, x2))), MERGESORT(x3)) by SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2))), MERGESORT(Cons(x2, x3))) ---------------------------------------- (76) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x0, x4)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2))), MERGESORT(Cons(x2, x3))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3 Compound Symbols: c_1, c5_1, c8_1, c8_2, c12_3, c12_2, c12_1, c3_1, c4_1, c11_1 ---------------------------------------- (77) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) by SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, Cons(z2, z3)))) ---------------------------------------- (78) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x0, x4)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2))), MERGESORT(Cons(x2, x3))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, Cons(z2, z3)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3 Compound Symbols: c_1, c5_1, c8_1, c8_2, c12_3, c12_2, c12_1, c3_1, c4_1, c11_1 ---------------------------------------- (79) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2))) Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S. MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) We considered the (Usable) Rules: splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Nil) -> Nil mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) merge(Nil, z0) -> z0 merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) And the Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x0, x4)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2))), MERGESORT(Cons(x2, x3))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, Cons(z2, z3)))) The order we found is given by the following interpretation: Polynomial interpretation : POL(0) = 0 POL(<=(x_1, x_2)) = 0 POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [2] + x_2 POL(False) = 0 POL(MERGE(x_1, x_2)) = [1] + x_1 + [2]x_2 POL(MERGESORT(x_1)) = [1] + x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = x_2 + [2]x_3 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = [1] + x_3 + x_3^2 + x_2*x_3 + [2]x_1*x_3 + x_1^2 + [2]x_1*x_2 + x_2^2 POL(True) = 0 POL(c(x_1)) = x_1 POL(c11(x_1)) = x_1 POL(c12(x_1)) = x_1 POL(c12(x_1, x_2)) = x_1 + x_2 POL(c12(x_1, x_2, x_3)) = x_1 + x_2 + x_3 POL(c3(x_1)) = x_1 POL(c4(x_1)) = x_1 POL(c5(x_1)) = x_1 POL(c8(x_1)) = x_1 POL(c8(x_1, x_2)) = x_1 + x_2 POL(merge(x_1, x_2)) = x_1 + x_2 POL(merge[Ite](x_1, x_2, x_3)) = x_2 + x_3 POL(mergesort(x_1)) = x_1 POL(splitmerge(x_1, x_2, x_3)) = x_1 + x_2 + x_3 ---------------------------------------- (80) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c12(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) MERGE[ITE](False, Cons(S(x0), x1), Cons(0, x2)) -> c3(MERGE(Cons(S(x0), x1), x2)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c3(MERGE(Cons(S(S(x0)), x1), x3)) MERGE[ITE](False, Cons(S(S(x0)), x1), Cons(S(0), x2)) -> c3(MERGE(Cons(S(S(x0)), x1), x2)) MERGE[ITE](True, Cons(0, x0), Cons(x1, x2)) -> c4(MERGE(x0, Cons(x1, x2))) MERGE[ITE](True, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3)) -> c4(MERGE(x1, Cons(S(S(x2)), x3))) MERGE[ITE](True, Cons(S(0), x0), Cons(S(x1), x2)) -> c4(MERGE(x0, Cons(S(x1), x2))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x0, x4)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z0, Cons(z1, z2))), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2))), MERGESORT(Cons(x2, x3))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, Cons(z2, z3)))) S tuples:none K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: <='_2, MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3 Compound Symbols: c_1, c5_1, c8_1, c8_2, c12_3, c12_2, c12_1, c3_1, c4_1, c11_1 ---------------------------------------- (81) SIsEmptyProof (BOTH BOUNDS(ID, ID)) The set S is empty ---------------------------------------- (82) BOUNDS(1, 1) ---------------------------------------- (83) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (84) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) The (relative) TRS S consists of the following rules: <=(S(x), S(y)) -> <=(x, y) <=(0', y) -> True <=(S(x), 0') -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Rewrite Strategy: INNERMOST ---------------------------------------- (85) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (86) Obligation: Innermost TRS: Rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) <=(S(x), S(y)) -> <=(x, y) <=(0', y) -> True <=(S(x), 0') -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Types: mergesort :: Cons:Nil -> Cons:Nil Cons :: S:0' -> Cons:Nil -> Cons:Nil splitmerge :: Cons:Nil -> Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil merge :: Cons:Nil -> Cons:Nil -> Cons:Nil merge[Ite] :: True:False -> Cons:Nil -> Cons:Nil -> Cons:Nil <= :: S:0' -> S:0' -> True:False notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil S :: S:0' -> S:0' 0' :: S:0' hole_Cons:Nil1_0 :: Cons:Nil hole_S:0'2_0 :: S:0' hole_True:False3_0 :: True:False gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' ---------------------------------------- (87) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: mergesort, splitmerge, merge, <= They will be analysed ascendingly in the following order: mergesort = splitmerge merge < splitmerge <= < merge ---------------------------------------- (88) Obligation: Innermost TRS: Rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) <=(S(x), S(y)) -> <=(x, y) <=(0', y) -> True <=(S(x), 0') -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Types: mergesort :: Cons:Nil -> Cons:Nil Cons :: S:0' -> Cons:Nil -> Cons:Nil splitmerge :: Cons:Nil -> Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil merge :: Cons:Nil -> Cons:Nil -> Cons:Nil merge[Ite] :: True:False -> Cons:Nil -> Cons:Nil -> Cons:Nil <= :: S:0' -> S:0' -> True:False notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil S :: S:0' -> S:0' 0' :: S:0' hole_Cons:Nil1_0 :: Cons:Nil hole_S:0'2_0 :: S:0' hole_True:False3_0 :: True:False gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' Generator Equations: gen_Cons:Nil4_0(0) <=> Nil gen_Cons:Nil4_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil4_0(x)) gen_S:0'5_0(0) <=> 0' gen_S:0'5_0(+(x, 1)) <=> S(gen_S:0'5_0(x)) The following defined symbols remain to be analysed: <=, mergesort, splitmerge, merge They will be analysed ascendingly in the following order: mergesort = splitmerge merge < splitmerge <= < merge ---------------------------------------- (89) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: <=(gen_S:0'5_0(n7_0), gen_S:0'5_0(n7_0)) -> True, rt in Omega(0) Induction Base: <=(gen_S:0'5_0(0), gen_S:0'5_0(0)) ->_R^Omega(0) True Induction Step: <=(gen_S:0'5_0(+(n7_0, 1)), gen_S:0'5_0(+(n7_0, 1))) ->_R^Omega(0) <=(gen_S:0'5_0(n7_0), gen_S:0'5_0(n7_0)) ->_IH True We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (90) Obligation: Innermost TRS: Rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) <=(S(x), S(y)) -> <=(x, y) <=(0', y) -> True <=(S(x), 0') -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Types: mergesort :: Cons:Nil -> Cons:Nil Cons :: S:0' -> Cons:Nil -> Cons:Nil splitmerge :: Cons:Nil -> Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil merge :: Cons:Nil -> Cons:Nil -> Cons:Nil merge[Ite] :: True:False -> Cons:Nil -> Cons:Nil -> Cons:Nil <= :: S:0' -> S:0' -> True:False notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil S :: S:0' -> S:0' 0' :: S:0' hole_Cons:Nil1_0 :: Cons:Nil hole_S:0'2_0 :: S:0' hole_True:False3_0 :: True:False gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' Lemmas: <=(gen_S:0'5_0(n7_0), gen_S:0'5_0(n7_0)) -> True, rt in Omega(0) Generator Equations: gen_Cons:Nil4_0(0) <=> Nil gen_Cons:Nil4_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil4_0(x)) gen_S:0'5_0(0) <=> 0' gen_S:0'5_0(+(x, 1)) <=> S(gen_S:0'5_0(x)) The following defined symbols remain to be analysed: merge, mergesort, splitmerge They will be analysed ascendingly in the following order: mergesort = splitmerge merge < splitmerge ---------------------------------------- (91) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: merge(gen_Cons:Nil4_0(n258_0), gen_Cons:Nil4_0(1)) -> gen_Cons:Nil4_0(+(1, n258_0)), rt in Omega(1 + n258_0) Induction Base: merge(gen_Cons:Nil4_0(0), gen_Cons:Nil4_0(1)) ->_R^Omega(1) gen_Cons:Nil4_0(1) Induction Step: merge(gen_Cons:Nil4_0(+(n258_0, 1)), gen_Cons:Nil4_0(1)) ->_R^Omega(1) merge[Ite](<=(0', 0'), Cons(0', gen_Cons:Nil4_0(n258_0)), Cons(0', gen_Cons:Nil4_0(0))) ->_L^Omega(0) merge[Ite](True, Cons(0', gen_Cons:Nil4_0(n258_0)), Cons(0', gen_Cons:Nil4_0(0))) ->_R^Omega(0) Cons(0', merge(gen_Cons:Nil4_0(n258_0), Cons(0', gen_Cons:Nil4_0(0)))) ->_IH Cons(0', gen_Cons:Nil4_0(+(1, c259_0))) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (92) Complex Obligation (BEST) ---------------------------------------- (93) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) <=(S(x), S(y)) -> <=(x, y) <=(0', y) -> True <=(S(x), 0') -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Types: mergesort :: Cons:Nil -> Cons:Nil Cons :: S:0' -> Cons:Nil -> Cons:Nil splitmerge :: Cons:Nil -> Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil merge :: Cons:Nil -> Cons:Nil -> Cons:Nil merge[Ite] :: True:False -> Cons:Nil -> Cons:Nil -> Cons:Nil <= :: S:0' -> S:0' -> True:False notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil S :: S:0' -> S:0' 0' :: S:0' hole_Cons:Nil1_0 :: Cons:Nil hole_S:0'2_0 :: S:0' hole_True:False3_0 :: True:False gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' Lemmas: <=(gen_S:0'5_0(n7_0), gen_S:0'5_0(n7_0)) -> True, rt in Omega(0) Generator Equations: gen_Cons:Nil4_0(0) <=> Nil gen_Cons:Nil4_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil4_0(x)) gen_S:0'5_0(0) <=> 0' gen_S:0'5_0(+(x, 1)) <=> S(gen_S:0'5_0(x)) The following defined symbols remain to be analysed: merge, mergesort, splitmerge They will be analysed ascendingly in the following order: mergesort = splitmerge merge < splitmerge ---------------------------------------- (94) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (95) BOUNDS(n^1, INF) ---------------------------------------- (96) Obligation: Innermost TRS: Rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) <=(S(x), S(y)) -> <=(x, y) <=(0', y) -> True <=(S(x), 0') -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Types: mergesort :: Cons:Nil -> Cons:Nil Cons :: S:0' -> Cons:Nil -> Cons:Nil splitmerge :: Cons:Nil -> Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil merge :: Cons:Nil -> Cons:Nil -> Cons:Nil merge[Ite] :: True:False -> Cons:Nil -> Cons:Nil -> Cons:Nil <= :: S:0' -> S:0' -> True:False notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil S :: S:0' -> S:0' 0' :: S:0' hole_Cons:Nil1_0 :: Cons:Nil hole_S:0'2_0 :: S:0' hole_True:False3_0 :: True:False gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' Lemmas: <=(gen_S:0'5_0(n7_0), gen_S:0'5_0(n7_0)) -> True, rt in Omega(0) merge(gen_Cons:Nil4_0(n258_0), gen_Cons:Nil4_0(1)) -> gen_Cons:Nil4_0(+(1, n258_0)), rt in Omega(1 + n258_0) Generator Equations: gen_Cons:Nil4_0(0) <=> Nil gen_Cons:Nil4_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil4_0(x)) gen_S:0'5_0(0) <=> 0' gen_S:0'5_0(+(x, 1)) <=> S(gen_S:0'5_0(x)) The following defined symbols remain to be analysed: splitmerge, mergesort They will be analysed ascendingly in the following order: mergesort = splitmerge