WORST_CASE(?,O(n^2)) proof of input_egMfbIKvYK.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 unpublished The Runtime Complexity (parallel-innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 216 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)), 664 ms] (10) CdtProblem (11) CdtKnowledgeProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CdtProblem (13) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 376 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)), 604 ms] (22) CdtProblem (23) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 382 ms] (24) CdtProblem (25) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (26) CdtProblem (27) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (28) CdtProblem (29) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (30) CdtProblem (31) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (32) CdtProblem (33) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (34) CdtProblem (35) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (36) CdtProblem (37) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (38) CdtProblem (39) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (40) CdtProblem (41) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 2437 ms] (42) CdtProblem (43) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 3300 ms] (44) CdtProblem (45) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 4562 ms] (46) CdtProblem (47) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (48) CdtProblem (49) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (50) CdtProblem (51) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (52) CdtProblem (53) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (54) CdtProblem (55) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (56) CdtProblem (57) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (58) CdtProblem (59) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (60) CdtProblem (61) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (62) CdtProblem (63) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (64) CdtProblem (65) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (66) CdtProblem (67) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 3 ms] (68) CdtProblem (69) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (70) CdtProblem (71) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (72) CdtProblem (73) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (74) CdtProblem (75) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (76) CdtProblem (77) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (78) CdtProblem (79) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (80) CdtProblem (81) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (82) CdtProblem (83) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (84) CdtProblem (85) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (86) CdtProblem (87) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (88) CdtProblem (89) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (90) CdtProblem (91) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (92) CdtProblem (93) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (94) CdtProblem (95) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (96) CdtProblem (97) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (98) CdtProblem (99) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (100) CdtProblem (101) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (102) CdtProblem (103) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (104) CdtProblem (105) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (106) CdtProblem (107) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (108) CdtProblem (109) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (110) CdtProblem (111) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (112) CdtProblem (113) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (114) CdtProblem (115) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (116) CdtProblem (117) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (118) CdtProblem (119) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (120) CdtProblem (121) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (122) CdtProblem (123) CdtForwardInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (124) CdtProblem (125) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (126) CdtProblem (127) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 5376 ms] (128) CdtProblem (129) SIsEmptyProof [BOTH BOUNDS(ID, ID), 0 ms] (130) BOUNDS(1, 1) ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxRelTRS could be proven to be BOUNDS(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: PARALLEL_INNERMOST ---------------------------------------- (1) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (2) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxRelTRS could be proven to be BOUNDS(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: PARALLEL_INNERMOST ---------------------------------------- (3) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) NOTEMPTY(Cons(z0, z1)) -> c14 NOTEMPTY(Nil) -> c15 GOAL(z0) -> c16(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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) NOTEMPTY(Cons(z0, z1)) -> c14 NOTEMPTY(Nil) -> c15 GOAL(z0) -> c16(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_2, c13_2, c14, c15, c16_1 ---------------------------------------- (5) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: GOAL(z0) -> c16(MERGESORT(z0)) Removed 6 trailing nodes: MERGESORT(Nil) -> c7 <='(0, z0) -> c1 NOTEMPTY(Cons(z0, z1)) -> c14 NOTEMPTY(Nil) -> c15 MERGESORT(Cons(z0, Nil)) -> c6 <='(S(z0), 0) -> c2 ---------------------------------------- (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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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_2, c13_2 ---------------------------------------- (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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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_2, c13_2 ---------------------------------------- (9) 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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_1 + x_2 POL(c13(x_1, x_2)) = x_1 + x_2 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) K tuples: 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_2, c13_2 ---------------------------------------- (11) CdtKnowledgeProof (BOTH BOUNDS(ID, ID)) The following tuples could be moved from S to K by knowledge propagation: SPLITMERGE(Nil, z0, z1) -> c12(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z0)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) 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)) ---------------------------------------- (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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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 K tuples: 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) 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_2, c13_2 ---------------------------------------- (13) 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: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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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)) = [1] POL(MERGESORT(x_1)) = [2]x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = [1] 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_1 + x_2 POL(c13(x_1, x_2)) = x_1 + x_2 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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: 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) 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 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_2, c13_2 ---------------------------------------- (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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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: 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) 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 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_2, c13_2, 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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: 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) 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_2, c13_2, 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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: 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) 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_2, c13_2, 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(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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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] + [2]x_2 POL(MERGESORT(x_1)) = [2]x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = [2]x_3 + x_1^2 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_1 + x_2 POL(c13(x_1, x_2)) = x_1 + x_2 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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))) K tuples: 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) 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_2, c13_2, 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(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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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)) = [2] POL(<='(x_1, x_2)) = 0 POL(Cons(x_1, x_2)) = [2] + x_2 POL(False) = [2] POL(MERGE(x_1, x_2)) = [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)) = [2]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_1 + x_2 POL(c13(x_1, x_2)) = x_1 + x_2 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 ---------------------------------------- (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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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: 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) 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_2, c13_2, 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)) by SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGE(mergesort(x0), Nil), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Nil, x1) -> c12(MERGE(Nil, mergesort(x1)), MERGESORT(Nil)) ---------------------------------------- (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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGE(mergesort(x0), Nil), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Nil, x1) -> c12(MERGE(Nil, mergesort(x1)), MERGESORT(Nil)) 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: 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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) 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, c13_2, c8_2, c8_1, c12_2 ---------------------------------------- (27) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Nil, x1) -> c12(MERGE(Nil, mergesort(x1)), MERGESORT(Nil)) ---------------------------------------- (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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Nil) -> c12(MERGE(mergesort(x0), Nil), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(Cons(z0, Nil))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) 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, c13_2, c8_2, c8_1, c12_2 ---------------------------------------- (29) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (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)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), 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))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) 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, c13_2, c8_2, c8_1, c12_2, c12_1 ---------------------------------------- (31) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) by SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, x0, Nil) -> c13(MERGE(mergesort(x0), Nil), MERGESORT(Nil)) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Nil, x1) -> c13(MERGE(Nil, mergesort(x1)), MERGESORT(x1)) ---------------------------------------- (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(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)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, x0, Nil) -> c13(MERGE(mergesort(x0), Nil), MERGESORT(Nil)) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Nil, x1) -> c13(MERGE(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) SPLITMERGE(Nil, z0, z1) -> c13(MERGE(mergesort(z0), mergesort(z1)), MERGESORT(z1)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) 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, c8_2, c8_1, c12_2, c12_1, c13_2 ---------------------------------------- (33) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, x0, Nil) -> c13(MERGE(mergesort(x0), Nil), MERGESORT(Nil)) ---------------------------------------- (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(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)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Nil, x1) -> c13(MERGE(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) 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, c8_2, c8_1, c12_2, c12_1, c13_2 ---------------------------------------- (35) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (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(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)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) SPLITMERGE(Nil, Nil, x1) -> c13(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) 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, c8_2, c8_1, c12_2, c12_1, c13_2, c13_1 ---------------------------------------- (37) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: SPLITMERGE(Nil, Nil, x1) -> c13(MERGESORT(x1)) ---------------------------------------- (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(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)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) 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, c8_2, c8_1, c12_2, c12_1, c13_2, c13_1 ---------------------------------------- (39) 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))) ---------------------------------------- (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, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) 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, c8_1, c12_2, c12_1, c13_2, c13_1, c8_2 ---------------------------------------- (41) 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(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)) 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)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) = 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)) = x_1*x_2 POL(MERGESORT(x_1)) = x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = x_2*x_3 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, 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(c13(x_1)) = x_1 POL(c13(x_1, x_2)) = x_1 + x_2 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 ---------------------------------------- (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, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_2, c12_1, c13_2, c13_1, c8_2 ---------------------------------------- (43) 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)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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(c13(x_1)) = x_1 POL(c13(x_1, x_2)) = x_1 + x_2 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 ---------------------------------------- (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, x0, Cons(z0, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_2, c12_1, c13_2, c13_1, c8_2 ---------------------------------------- (45) 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)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) = [2] + [2]x_2 POL(MERGESORT(x_1)) = [2]x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = [2]x_3 + [2]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(c11(x_1)) = x_1 POL(c12(x_1)) = x_1 POL(c12(x_1, x_2)) = x_1 + x_2 POL(c13(x_1)) = x_1 POL(c13(x_1, x_2)) = x_1 + x_2 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 ---------------------------------------- (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, Cons(z1, z2))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(x0)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2 ---------------------------------------- (47) 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)) by SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0)) 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)))) 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))) SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c12(MERGE(Nil, splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Nil)) ---------------------------------------- (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, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) 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))) SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c12(MERGE(Nil, splitmerge(Cons(x1, Cons(x2, x3)), 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2 ---------------------------------------- (49) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c12(MERGE(Nil, splitmerge(Cons(x1, Cons(x2, x3)), Nil, 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, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) 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))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2 ---------------------------------------- (51) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (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, Cons(z0, Nil)) -> c12(MERGE(mergesort(x0), Cons(z0, Nil)), MERGESORT(x0)) 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)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2 ---------------------------------------- (53) 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)) ---------------------------------------- (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, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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)) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2 ---------------------------------------- (55) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Nil, Cons(x1, Nil)) -> c12(MERGE(Nil, Cons(x1, 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, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2 ---------------------------------------- (57) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (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, Cons(z0, Cons(z1, z2)), x1) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2 ---------------------------------------- (59) 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)))) 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)))) 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(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Nil), MERGESORT(Cons(x0, Cons(x1, x2)))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) ---------------------------------------- (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)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), mergesort(x1))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) 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)))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (61) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (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](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))) SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (63) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c12(MERGE(Cons(z0, Nil), 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))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c12(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c12(MERGE(Cons(x0, Nil), Nil)) ---------------------------------------- (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)) 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, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c12(MERGE(Cons(x0, Nil), 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (65) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c12(MERGE(Cons(x0, Nil), Nil)) ---------------------------------------- (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)) 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, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (67) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, x0, Cons(z0, Cons(z1, z2))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) by SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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))) -> c13(MERGE(Nil, splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) ---------------------------------------- (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)) 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, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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))) -> c13(MERGE(Nil, splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (69) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (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)) 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, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c13(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (71) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) ---------------------------------------- (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)) 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, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (73) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), x1) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), mergesort(x1)), MERGESORT(x1)) by SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Cons(z1, z2))) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Nil), MERGESORT(Nil)) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) ---------------------------------------- (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)) 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) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Nil), MERGESORT(Nil)) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (75) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Nil), MERGESORT(Nil)) ---------------------------------------- (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)) 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) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (77) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (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)) 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) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_2, c13_1, c8_2, c12_2 ---------------------------------------- (79) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, Cons(z0, Nil), x1) -> c13(MERGE(Cons(z0, Nil), mergesort(x1)), MERGESORT(x1)) by SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Cons(z1, z2))) -> c13(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)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c13(MERGE(Cons(x0, Nil), Nil), MERGESORT(Nil)) ---------------------------------------- (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)) 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, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil)), MERGESORT(Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c13(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_1, c8_2, c12_2, c13_2 ---------------------------------------- (81) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c13(MERGE(Cons(x0, Nil), Nil), MERGESORT(Nil)) ---------------------------------------- (82) 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, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_1, c8_2, c12_2, c13_2 ---------------------------------------- (83) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (84) 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, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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, c13_1, c8_2, c12_2, c13_2 ---------------------------------------- (85) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace SPLITMERGE(Nil, x0, Cons(z0, Nil)) -> c13(MERGE(mergesort(x0), Cons(z0, Nil))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Nil)) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c13(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Nil, Cons(x1, Nil)) -> c13(MERGE(Nil, Cons(x1, Nil))) ---------------------------------------- (86) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Nil, Cons(x1, Nil)) -> c13(MERGE(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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_2, c13_2, c13_1 ---------------------------------------- (87) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Nil, Cons(x1, Nil)) -> c13(MERGE(Nil, Cons(x1, Nil))) ---------------------------------------- (88) 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)) 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_2, c13_2, c13_1 ---------------------------------------- (89) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0)) by SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) ---------------------------------------- (90) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_2, c13_2, c13_1 ---------------------------------------- (91) 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)) ---------------------------------------- (92) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_2, c13_2, c13_1, c3_1 ---------------------------------------- (93) 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)))) 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)))) ---------------------------------------- (94) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_2, c13_2, c13_1, c3_1 ---------------------------------------- (95) 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))) ---------------------------------------- (96) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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: SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_2, c13_2, c13_1, c3_1, c4_1 ---------------------------------------- (97) 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))) ---------------------------------------- (98) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Nil) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_2, c13_2, c13_1, c3_1, c4_1, c11_1 ---------------------------------------- (99) 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)))) ---------------------------------------- (100) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c12_2, c13_2, c13_1, c3_1, c4_1, c11_1 ---------------------------------------- (101) 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)))) 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)))) ---------------------------------------- (102) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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, 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)))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c12_2, c13_2, c13_1, c3_1, c4_1, c11_1 ---------------------------------------- (103) 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))) by SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) ---------------------------------------- (104) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), 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)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c12_2, c13_2, c13_1, c3_1, c4_1, c11_1 ---------------------------------------- (105) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) ---------------------------------------- (106) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c12_2, c13_2, c13_1, c3_1, c4_1, c11_1 ---------------------------------------- (107) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), x3) -> c12(MERGESORT(Cons(x0, Cons(x1, x2)))) by SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) ---------------------------------------- (108) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) 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)))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c12_2, c13_2, c13_1, c3_1, c4_1, c11_1 ---------------------------------------- (109) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) 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)))) ---------------------------------------- (110) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) 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))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c12_2, c13_2, c13_1, c3_1, c4_1, c11_1 ---------------------------------------- (111) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) ---------------------------------------- (112) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c13_2, c13_1, c12_2, c3_1, c4_1, c11_1 ---------------------------------------- (113) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c13(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(Cons(z0, Cons(x2, x3)))) by SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x2, Cons(z2, z3)))) ---------------------------------------- (114) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c13_2, c13_1, c12_2, c3_1, c4_1, c11_1 ---------------------------------------- (115) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, x0, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) by SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGESORT(Cons(x2, Cons(z2, z3)))) ---------------------------------------- (116) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c13_2, c13_1, c12_2, c3_1, c4_1, c11_1 ---------------------------------------- (117) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, Cons(z0, Cons(x1, x2)), x3) -> c13(MERGE(splitmerge(Cons(x1, x2), Cons(z0, Nil), Nil), mergesort(x3)), MERGESORT(x3)) by SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x2, x3))) ---------------------------------------- (118) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c13_2, c13_1, c12_2, c3_1, c4_1, c11_1 ---------------------------------------- (119) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) by SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, x4))) ---------------------------------------- (120) 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, Nil), Cons(x1, Cons(x2, x3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x2, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, x4))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c13_2, c13_1, c3_1, c12_2, c4_1, c11_1 ---------------------------------------- (121) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Cons(z1, z2))) -> c12(MERGE(Cons(x0, Nil), splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil))) by SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) ---------------------------------------- (122) 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, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x2, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, x4))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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_1, c13_2, c13_1, c3_1, c12_2, c4_1, c11_1 ---------------------------------------- (123) CdtForwardInstantiationProof (BOTH BOUNDS(ID, ID)) Use forward instantiation to replace <='(S(z0), S(z1)) -> c(<='(z0, z1)) by <='(S(S(y0)), S(S(y1))) -> c(<='(S(y0), S(y1))) ---------------------------------------- (124) 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: 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, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x2, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, x4))) <='(S(S(y0)), S(S(y1))) -> c(<='(S(y0), S(y1))) 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, 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: MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3, <='_2 Compound Symbols: c5_1, c8_1, c8_2, c12_1, c13_2, c13_1, c3_1, c12_2, c4_1, c11_1, c_1 ---------------------------------------- (125) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (126) 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: 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(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x2, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, x4))) <='(S(S(y0)), S(S(y1))) -> c(<='(S(y0), S(y1))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), 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(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(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))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3, <='_2 Compound Symbols: c5_1, c8_1, c8_2, c12_1, c13_2, c13_1, c3_1, c12_2, c4_1, c11_1, c_1 ---------------------------------------- (127) 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: 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(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x2, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, x4))) <='(S(S(y0)), S(S(y1))) -> c(<='(S(y0), S(y1))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3))) 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 + x_2 POL(MERGESORT(x_1)) = [1] + x_1^2 POL(MERGE[ITE](x_1, x_2, x_3)) = x_2 + x_3 POL(Nil) = 0 POL(S(x_1)) = 0 POL(SPLITMERGE(x_1, x_2, x_3)) = x_3^2 + [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(c13(x_1)) = x_1 POL(c13(x_1, x_2)) = x_1 + x_2 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 ---------------------------------------- (128) 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: 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(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Nil)) -> c12(MERGE(Cons(z0, Nil), Cons(x1, Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Cons(x2, x3))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(x1, Cons(x2, x3)), Nil, Nil)), MERGESORT(Cons(x1, Cons(x2, x3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(x1, Cons(x2, x3))) -> c13(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)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) SPLITMERGE(Nil, Cons(x0, Nil), Cons(z0, Nil)) -> c13(MERGE(Cons(x0, Nil), Cons(z0, 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)) 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)))) 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, 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)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, x4)), splitmerge(Cons(z2, z3), Cons(x2, Nil), Nil)), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x2, x3))) SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c12(MERGE(mergesort(Cons(x0, x4)), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, x4))) <='(S(S(y0)), S(S(y1))) -> c(<='(S(y0), S(y1))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3))) S tuples:none K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(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))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(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)))) Defined Rule Symbols: <=_2, mergesort_1, splitmerge_3, merge_2, merge[Ite]_3 Defined Pair Symbols: MERGESORT_1, MERGE_2, SPLITMERGE_3, MERGE[ITE]_3, <='_2 Compound Symbols: c5_1, c8_1, c8_2, c12_1, c13_2, c13_1, c3_1, c12_2, c4_1, c11_1, c_1 ---------------------------------------- (129) SIsEmptyProof (BOTH BOUNDS(ID, ID)) The set S is empty ---------------------------------------- (130) BOUNDS(1, 1)