KILLED proof of input_xXI2UjoJBK.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 unpublished The Runtime Complexity (parallel-innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, INF). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 208 ms] (2) CpxRelTRS (3) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxRelTRS (5) RelTrsToTrsProof [UPPER BOUND(ID), 0 ms] (6) CpxTRS (7) RelTrsToWeightedTrsProof [UPPER BOUND(ID), 0 ms] (8) CpxWeightedTrs (9) CpxWeightedTrsRenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxWeightedTrs (11) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTypedWeightedTrs (13) CompletionProof [UPPER BOUND(ID), 0 ms] (14) CpxTypedWeightedCompleteTrs (15) NarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxTypedWeightedCompleteTrs (17) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (18) CpxRNTS (19) SimplificationProof [BOTH BOUNDS(ID, ID), 12 ms] (20) CpxRNTS (21) CpxRntsAnalysisOrderProof [BOTH BOUNDS(ID, ID), 0 ms] (22) CpxRNTS (23) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (24) CpxRNTS (25) IntTrsBoundProof [UPPER BOUND(ID), 174 ms] (26) CpxRNTS (27) IntTrsBoundProof [UPPER BOUND(ID), 67 ms] (28) CpxRNTS (29) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (30) CpxRNTS (31) IntTrsBoundProof [UPPER BOUND(ID), 259 ms] (32) CpxRNTS (33) IntTrsBoundProof [UPPER BOUND(ID), 97 ms] (34) CpxRNTS (35) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (36) CpxRNTS (37) IntTrsBoundProof [UPPER BOUND(ID), 3275 ms] (38) CpxRNTS (39) IntTrsBoundProof [UPPER BOUND(ID), 1044 ms] (40) CpxRNTS (41) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (42) CpxRNTS (43) IntTrsBoundProof [UPPER BOUND(ID), 6030 ms] (44) CpxRNTS (45) IntTrsBoundProof [UPPER BOUND(ID), 2157 ms] (46) CpxRNTS (47) CompletionProof [UPPER BOUND(ID), 0 ms] (48) CpxTypedWeightedCompleteTrs (49) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (50) CpxRNTS (51) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (52) CdtProblem (53) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (54) CdtProblem (55) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (56) CdtProblem (57) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 633 ms] (58) CdtProblem (59) CdtKnowledgeProof [BOTH BOUNDS(ID, ID), 0 ms] (60) CdtProblem (61) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 483 ms] (62) CdtProblem (63) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (64) CdtProblem (65) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (66) CdtProblem (67) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (68) CdtProblem (69) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 679 ms] (70) CdtProblem (71) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 419 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) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (86) CdtProblem (87) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (88) CdtProblem (89) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 2404 ms] (90) CdtProblem (91) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 3171 ms] (92) CdtProblem (93) CdtRuleRemovalProof [UPPER BOUND(ADD(n^2)), 4391 ms] (94) CdtProblem (95) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (96) CdtProblem (97) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (98) CdtProblem (99) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (100) CdtProblem (101) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (102) CdtProblem (103) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (104) CdtProblem (105) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (106) CdtProblem (107) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (108) CdtProblem (109) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (110) CdtProblem (111) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (112) CdtProblem (113) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (114) CdtProblem (115) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (116) CdtProblem (117) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (118) CdtProblem (119) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (120) CdtProblem (121) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (122) CdtProblem (123) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (124) CdtProblem (125) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (126) CdtProblem (127) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 6 ms] (128) CdtProblem (129) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (130) CdtProblem (131) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (132) CdtProblem (133) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (134) CdtProblem (135) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (136) CdtProblem (137) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (138) CdtProblem (139) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (140) CdtProblem (141) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (142) CdtProblem (143) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (144) CdtProblem (145) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (146) CdtProblem (147) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (148) CdtProblem (149) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (150) CdtProblem (151) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (152) CdtProblem (153) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (154) CdtProblem (155) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (156) CdtProblem (157) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (158) CdtProblem (159) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (160) CdtProblem (161) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (162) CdtProblem (163) CdtForwardInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (164) CdtProblem (165) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (166) CdtProblem (167) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (168) CdtProblem (169) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (170) CdtProblem (171) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (172) CdtProblem (173) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (174) CdtProblem (175) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (176) CdtProblem (177) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (178) CdtProblem (179) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (180) CdtProblem (181) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (182) CdtProblem (183) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (184) CdtProblem (185) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (186) CdtProblem (187) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (188) CdtProblem (189) CdtGraphSplitRhsProof [BOTH BOUNDS(ID, ID), 0 ms] (190) CdtProblem (191) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (192) CdtProblem (193) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (194) CdtProblem (195) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (196) CdtProblem (197) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (198) CdtProblem (199) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (200) CdtProblem (201) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (202) CdtProblem (203) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (204) CdtProblem (205) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (206) CdtProblem (207) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (208) CdtProblem (209) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (210) CdtProblem ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, INF). The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) The (relative) TRS S consists of the following rules: <=(S(x), S(y)) -> <=(x, y) <=(0, y) -> True <=(S(x), 0) -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Rewrite Strategy: 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, INF). The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) The (relative) TRS S consists of the following rules: <=(S(x), S(y)) -> <=(x, y) <=(0, y) -> True <=(S(x), 0) -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (3) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (4) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, INF). The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) The (relative) TRS S consists of the following rules: <=(S(x), S(y)) -> <=(x, y) <=(0', y) -> True <=(S(x), 0') -> False merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (5) RelTrsToTrsProof (UPPER BOUND(ID)) transformed relative TRS to TRS ---------------------------------------- (6) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(1, INF). The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) mergesort(Cons(x, Nil)) -> Cons(x, Nil) merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) merge(Cons(x, xs), Nil) -> Cons(x, xs) splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) mergesort(Nil) -> Nil merge(Nil, xs2) -> xs2 notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> mergesort(xs) <=(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)) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (7) RelTrsToWeightedTrsProof (UPPER BOUND(ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (8) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, INF). The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) [1] mergesort(Cons(x, Nil)) -> Cons(x, Nil) [1] merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs)) [1] merge(Cons(x, xs), Nil) -> Cons(x, xs) [1] splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) [1] splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) [1] mergesort(Nil) -> Nil [1] merge(Nil, xs2) -> xs2 [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> mergesort(xs) [1] <=(S(x), S(y)) -> <=(x, y) [0] <=(0, y) -> True [0] <=(S(x), 0) -> False [0] merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) [0] merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (9) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID)) Renamed defined symbols to avoid conflicts with arithmetic symbols: <= => lteq ---------------------------------------- (10) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, INF). The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) [1] mergesort(Cons(x, Nil)) -> Cons(x, Nil) [1] merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](lteq(x', x), Cons(x', xs'), Cons(x, xs)) [1] merge(Cons(x, xs), Nil) -> Cons(x, xs) [1] splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) [1] splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) [1] mergesort(Nil) -> Nil [1] merge(Nil, xs2) -> xs2 [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> mergesort(xs) [1] lteq(S(x), S(y)) -> lteq(x, y) [0] lteq(0, y) -> True [0] lteq(S(x), 0) -> False [0] merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) [0] merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (11) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (12) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) [1] mergesort(Cons(x, Nil)) -> Cons(x, Nil) [1] merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](lteq(x', x), Cons(x', xs'), Cons(x, xs)) [1] merge(Cons(x, xs), Nil) -> Cons(x, xs) [1] splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) [1] splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) [1] mergesort(Nil) -> Nil [1] merge(Nil, xs2) -> xs2 [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> mergesort(xs) [1] lteq(S(x), S(y)) -> lteq(x, y) [0] lteq(0, y) -> True [0] lteq(S(x), 0) -> False [0] merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) [0] merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) [0] The TRS has the following type information: mergesort :: Cons:Nil -> Cons:Nil Cons :: S:0 -> Cons:Nil -> Cons:Nil splitmerge :: Cons:Nil -> Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil merge :: Cons:Nil -> Cons:Nil -> Cons:Nil merge[Ite] :: True:False -> Cons:Nil -> Cons:Nil -> Cons:Nil lteq :: S:0 -> S:0 -> True:False notEmpty :: Cons:Nil -> True:False True :: True:False False :: True:False goal :: Cons:Nil -> Cons:Nil S :: S:0 -> S:0 0 :: S:0 Rewrite Strategy: INNERMOST ---------------------------------------- (13) CompletionProof (UPPER BOUND(ID)) The transformation into a RNTS is sound, since: (a) The obligation is a constructor system where every type has a constant constructor, (b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols: notEmpty_1 goal_1 (c) The following functions are completely defined: mergesort_1 splitmerge_3 merge_2 lteq_2 merge[Ite]_3 Due to the following rules being added: lteq(v0, v1) -> null_lteq [0] merge[Ite](v0, v1, v2) -> Nil [0] And the following fresh constants: null_lteq ---------------------------------------- (14) Obligation: Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) [1] mergesort(Cons(x, Nil)) -> Cons(x, Nil) [1] merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](lteq(x', x), Cons(x', xs'), Cons(x, xs)) [1] merge(Cons(x, xs), Nil) -> Cons(x, xs) [1] splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) [1] splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) [1] mergesort(Nil) -> Nil [1] merge(Nil, xs2) -> xs2 [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> mergesort(xs) [1] lteq(S(x), S(y)) -> lteq(x, y) [0] lteq(0, y) -> True [0] lteq(S(x), 0) -> False [0] merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) [0] merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) [0] lteq(v0, v1) -> null_lteq [0] merge[Ite](v0, v1, v2) -> Nil [0] The TRS has the following type information: mergesort :: Cons:Nil -> Cons:Nil Cons :: S:0 -> Cons:Nil -> Cons:Nil splitmerge :: Cons:Nil -> Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil merge :: Cons:Nil -> Cons:Nil -> Cons:Nil merge[Ite] :: True:False:null_lteq -> Cons:Nil -> Cons:Nil -> Cons:Nil lteq :: S:0 -> S:0 -> True:False:null_lteq notEmpty :: Cons:Nil -> True:False:null_lteq True :: True:False:null_lteq False :: True:False:null_lteq goal :: Cons:Nil -> Cons:Nil S :: S:0 -> S:0 0 :: S:0 null_lteq :: True:False:null_lteq Rewrite Strategy: INNERMOST ---------------------------------------- (15) NarrowingProof (BOTH BOUNDS(ID, ID)) Narrowed the inner basic terms of all right-hand sides by a single narrowing step. ---------------------------------------- (16) Obligation: Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) [1] mergesort(Cons(x, Nil)) -> Cons(x, Nil) [1] merge(Cons(S(x''), xs'), Cons(S(y'), xs)) -> merge[Ite](lteq(x'', y'), Cons(S(x''), xs'), Cons(S(y'), xs)) [1] merge(Cons(0, xs'), Cons(x, xs)) -> merge[Ite](True, Cons(0, xs'), Cons(x, xs)) [1] merge(Cons(S(x1), xs'), Cons(0, xs)) -> merge[Ite](False, Cons(S(x1), xs'), Cons(0, xs)) [1] merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](null_lteq, Cons(x', xs'), Cons(x, xs)) [1] merge(Cons(x, xs), Nil) -> Cons(x, xs) [1] splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) [1] splitmerge(Nil, Cons(x''', Cons(x2, xs'')), Cons(x'1, Cons(x4, xs3))) -> merge(splitmerge(Cons(x''', Cons(x2, xs'')), Nil, Nil), splitmerge(Cons(x'1, Cons(x4, xs3)), Nil, Nil)) [3] splitmerge(Nil, Cons(x''', Cons(x2, xs'')), Cons(x5, Nil)) -> merge(splitmerge(Cons(x''', Cons(x2, xs'')), Nil, Nil), Cons(x5, Nil)) [3] splitmerge(Nil, Cons(x''', Cons(x2, xs'')), Nil) -> merge(splitmerge(Cons(x''', Cons(x2, xs'')), Nil, Nil), Nil) [3] splitmerge(Nil, Cons(x3, Nil), Cons(x'2, Cons(x6, xs4))) -> merge(Cons(x3, Nil), splitmerge(Cons(x'2, Cons(x6, xs4)), Nil, Nil)) [3] splitmerge(Nil, Cons(x3, Nil), Cons(x7, Nil)) -> merge(Cons(x3, Nil), Cons(x7, Nil)) [3] splitmerge(Nil, Cons(x3, Nil), Nil) -> merge(Cons(x3, Nil), Nil) [3] splitmerge(Nil, Nil, Cons(x'3, Cons(x8, xs5))) -> merge(Nil, splitmerge(Cons(x'3, Cons(x8, xs5)), Nil, Nil)) [3] splitmerge(Nil, Nil, Cons(x9, Nil)) -> merge(Nil, Cons(x9, Nil)) [3] splitmerge(Nil, Nil, Nil) -> merge(Nil, Nil) [3] mergesort(Nil) -> Nil [1] merge(Nil, xs2) -> xs2 [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> mergesort(xs) [1] lteq(S(x), S(y)) -> lteq(x, y) [0] lteq(0, y) -> True [0] lteq(S(x), 0) -> False [0] merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) [0] merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) [0] lteq(v0, v1) -> null_lteq [0] merge[Ite](v0, v1, v2) -> Nil [0] The TRS has the following type information: mergesort :: Cons:Nil -> Cons:Nil Cons :: S:0 -> Cons:Nil -> Cons:Nil splitmerge :: Cons:Nil -> Cons:Nil -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil merge :: Cons:Nil -> Cons:Nil -> Cons:Nil merge[Ite] :: True:False:null_lteq -> Cons:Nil -> Cons:Nil -> Cons:Nil lteq :: S:0 -> S:0 -> True:False:null_lteq notEmpty :: Cons:Nil -> True:False:null_lteq True :: True:False:null_lteq False :: True:False:null_lteq goal :: Cons:Nil -> Cons:Nil S :: S:0 -> S:0 0 :: S:0 null_lteq :: True:False:null_lteq Rewrite Strategy: INNERMOST ---------------------------------------- (17) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: Nil => 0 True => 2 False => 1 0 => 0 null_lteq => 0 ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(xs) :|: xs >= 0, z = xs lteq(z, z') -{ 0 }-> lteq(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x lteq(z, z') -{ 0 }-> 2 :|: y >= 0, z = 0, z' = y lteq(z, z') -{ 0 }-> 1 :|: x >= 0, z = 1 + x, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 merge(z, z') -{ 1 }-> xs2 :|: xs2 >= 0, z' = xs2, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x'', y'), 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z = 1 + 0 + xs', xs' >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + xs) :|: xs >= 0, x1 >= 0, z' = 1 + 0 + xs, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, xs2) :|: z = 2, xs >= 0, xs2 >= 0, z' = 1 + x + xs, x >= 0, z'' = xs2 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs1, xs) :|: xs >= 0, z = 1, x >= 0, xs1 >= 0, z'' = 1 + x + xs, z' = xs1 mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + x + 0 :|: x >= 0, z = 1 + x + 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + xs2, xs1) :|: z = 1 + x + xs, xs >= 0, xs2 >= 0, x >= 0, xs1 >= 0, z' = xs1, z'' = xs2 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + x5 + 0) :|: x5 >= 0, xs'' >= 0, z'' = 1 + x5 + 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + x9 + 0) :|: z = 0, x9 >= 0, z' = 0, z'' = 1 + x9 + 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + x3 + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z' = 1 + x3 + 0, z = 0, x3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + x3 + 0, 0) :|: z'' = 0, z' = 1 + x3 + 0, z = 0, x3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + x3 + 0, 1 + x7 + 0) :|: x7 >= 0, z'' = 1 + x7 + 0, z' = 1 + x3 + 0, z = 0, x3 >= 0 ---------------------------------------- (19) SimplificationProof (BOTH BOUNDS(ID, ID)) Simplified the RNTS by moving equalities from the constraints into the right-hand sides. ---------------------------------------- (20) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> lteq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x'', y'), 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 ---------------------------------------- (21) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID)) Found the following analysis order by SCC decomposition: { notEmpty } { lteq } { merge[Ite], merge } { splitmerge } { mergesort } { goal } ---------------------------------------- (22) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> lteq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x'', y'), 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {notEmpty}, {lteq}, {merge[Ite],merge}, {splitmerge}, {mergesort}, {goal} ---------------------------------------- (23) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (24) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> lteq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x'', y'), 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {notEmpty}, {lteq}, {merge[Ite],merge}, {splitmerge}, {mergesort}, {goal} ---------------------------------------- (25) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: notEmpty after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 2 ---------------------------------------- (26) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> lteq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x'', y'), 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {notEmpty}, {lteq}, {merge[Ite],merge}, {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: ?, size: O(1) [2] ---------------------------------------- (27) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: notEmpty after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 1 ---------------------------------------- (28) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> lteq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x'', y'), 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {lteq}, {merge[Ite],merge}, {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] ---------------------------------------- (29) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (30) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> lteq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x'', y'), 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {lteq}, {merge[Ite],merge}, {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] ---------------------------------------- (31) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: lteq after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 2 ---------------------------------------- (32) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> lteq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x'', y'), 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {lteq}, {merge[Ite],merge}, {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] lteq: runtime: ?, size: O(1) [2] ---------------------------------------- (33) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: lteq after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 0 ---------------------------------------- (34) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> lteq(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x'', y'), 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {merge[Ite],merge}, {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] lteq: runtime: O(1) [0], size: O(1) [2] ---------------------------------------- (35) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (36) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](s, 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: s >= 0, s <= 2, z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {merge[Ite],merge}, {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] lteq: runtime: O(1) [0], size: O(1) [2] ---------------------------------------- (37) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: merge[Ite] after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z' + z'' Computed SIZE bound using CoFloCo for: merge after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z + z' ---------------------------------------- (38) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](s, 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: s >= 0, s <= 2, z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {merge[Ite],merge}, {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] lteq: runtime: O(1) [0], size: O(1) [2] merge[Ite]: runtime: ?, size: O(n^1) [z' + z''] merge: runtime: ?, size: O(n^1) [z + z'] ---------------------------------------- (39) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: merge[Ite] after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 8 + z' + z'' Computed RUNTIME bound using CoFloCo for: merge after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 9 + z + z' ---------------------------------------- (40) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> merge[Ite](s, 1 + (1 + x'') + xs', 1 + (1 + y') + xs) :|: s >= 0, s <= 2, z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 1 }-> merge[Ite](2, 1 + 0 + (z - 1), 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 1 }-> merge[Ite](1, 1 + (1 + x1) + xs', 1 + 0 + (z' - 1)) :|: z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 1 }-> merge[Ite](0, 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, z'') :|: z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(z', xs) :|: xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 0) :|: z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, 1 + (z'' - 1) + 0) :|: z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 0) :|: z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] lteq: runtime: O(1) [0], size: O(1) [2] merge[Ite]: runtime: O(n^1) [8 + z' + z''], size: O(n^1) [z' + z''] merge: runtime: O(n^1) [9 + z + z'], size: O(n^1) [z + z'] ---------------------------------------- (41) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (42) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 13 + x'' + xs + xs' + y' }-> s'' :|: s'' >= 0, s'' <= 1 + (1 + x'') + xs' + (1 + (1 + y') + xs), s >= 0, s <= 2, z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 10 + x + xs + z }-> s1 :|: s1 >= 0, s1 <= 1 + 0 + (z - 1) + (1 + x + xs), xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 11 + x1 + xs' + z' }-> s2 :|: s2 >= 0, s2 <= 1 + (1 + x1) + xs' + (1 + 0 + (z' - 1)), z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 11 + x + x' + xs + xs' }-> s3 :|: s3 >= 0, s3 <= 1 + x' + xs' + (1 + x + xs), xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 9 + xs + z' }-> 1 + x + s8 :|: s8 >= 0, s8 <= z' + xs, xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs merge[Ite](z, z', z'') -{ 9 + xs + z'' }-> 1 + x + s9 :|: s9 >= 0, s9 <= xs + z'', z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 12 + z' + z'' }-> s4 :|: s4 >= 0, s4 <= 1 + (z' - 1) + 0 + (1 + (z'' - 1) + 0), z'' - 1 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 12 + z' }-> s5 :|: s5 >= 0, s5 <= 1 + (z' - 1) + 0 + 0, z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 12 + z'' }-> s6 :|: s6 >= 0, s6 <= 0 + (1 + (z'' - 1) + 0), z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 12 }-> s7 :|: s7 >= 0, s7 <= 0 + 0, z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] lteq: runtime: O(1) [0], size: O(1) [2] merge[Ite]: runtime: O(n^1) [8 + z' + z''], size: O(n^1) [z' + z''] merge: runtime: O(n^1) [9 + z + z'], size: O(n^1) [z + z'] ---------------------------------------- (43) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: splitmerge after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 11 + 23*z + 23*z' + 23*z'' ---------------------------------------- (44) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 13 + x'' + xs + xs' + y' }-> s'' :|: s'' >= 0, s'' <= 1 + (1 + x'') + xs' + (1 + (1 + y') + xs), s >= 0, s <= 2, z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 10 + x + xs + z }-> s1 :|: s1 >= 0, s1 <= 1 + 0 + (z - 1) + (1 + x + xs), xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 11 + x1 + xs' + z' }-> s2 :|: s2 >= 0, s2 <= 1 + (1 + x1) + xs' + (1 + 0 + (z' - 1)), z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 11 + x + x' + xs + xs' }-> s3 :|: s3 >= 0, s3 <= 1 + x' + xs' + (1 + x + xs), xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 9 + xs + z' }-> 1 + x + s8 :|: s8 >= 0, s8 <= z' + xs, xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs merge[Ite](z, z', z'') -{ 9 + xs + z'' }-> 1 + x + s9 :|: s9 >= 0, s9 <= xs + z'', z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 12 + z' + z'' }-> s4 :|: s4 >= 0, s4 <= 1 + (z' - 1) + 0 + (1 + (z'' - 1) + 0), z'' - 1 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 12 + z' }-> s5 :|: s5 >= 0, s5 <= 1 + (z' - 1) + 0 + 0, z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 12 + z'' }-> s6 :|: s6 >= 0, s6 <= 0 + (1 + (z'' - 1) + 0), z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 12 }-> s7 :|: s7 >= 0, s7 <= 0 + 0, z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] lteq: runtime: O(1) [0], size: O(1) [2] merge[Ite]: runtime: O(n^1) [8 + z' + z''], size: O(n^1) [z' + z''] merge: runtime: O(n^1) [9 + z + z'], size: O(n^1) [z + z'] splitmerge: runtime: ?, size: O(n^1) [11 + 23*z + 23*z' + 23*z''] ---------------------------------------- (45) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: splitmerge after applying outer abstraction to obtain an ITS, resulting in: INF with polynomial bound: ? ---------------------------------------- (46) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(z) :|: z >= 0 lteq(z, z') -{ 0 }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 lteq(z, z') -{ 0 }-> 2 :|: z' >= 0, z = 0 lteq(z, z') -{ 0 }-> 1 :|: z - 1 >= 0, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge(z, z') -{ 13 + x'' + xs + xs' + y' }-> s'' :|: s'' >= 0, s'' <= 1 + (1 + x'') + xs' + (1 + (1 + y') + xs), s >= 0, s <= 2, z = 1 + (1 + x'') + xs', xs >= 0, z' = 1 + (1 + y') + xs, xs' >= 0, y' >= 0, x'' >= 0 merge(z, z') -{ 10 + x + xs + z }-> s1 :|: s1 >= 0, s1 <= 1 + 0 + (z - 1) + (1 + x + xs), xs >= 0, z' = 1 + x + xs, z - 1 >= 0, x >= 0 merge(z, z') -{ 11 + x1 + xs' + z' }-> s2 :|: s2 >= 0, s2 <= 1 + (1 + x1) + xs' + (1 + 0 + (z' - 1)), z' - 1 >= 0, x1 >= 0, z = 1 + (1 + x1) + xs', xs' >= 0 merge(z, z') -{ 11 + x + x' + xs + xs' }-> s3 :|: s3 >= 0, s3 <= 1 + x' + xs' + (1 + x + xs), xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 1 }-> z' :|: z' >= 0, z = 0 merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: z >= 0, z' >= 0, z'' >= 0 merge[Ite](z, z', z'') -{ 9 + xs + z' }-> 1 + x + s8 :|: s8 >= 0, s8 <= z' + xs, xs >= 0, z = 1, x >= 0, z' >= 0, z'' = 1 + x + xs merge[Ite](z, z', z'') -{ 9 + xs + z'' }-> 1 + x + s9 :|: s9 >= 0, s9 <= xs + z'', z = 2, xs >= 0, z'' >= 0, z' = 1 + x + xs, x >= 0 mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 1 }-> 1 + (z - 1) + 0 :|: z - 1 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 splitmerge(z, z', z'') -{ 12 + z' + z'' }-> s4 :|: s4 >= 0, s4 <= 1 + (z' - 1) + 0 + (1 + (z'' - 1) + 0), z'' - 1 >= 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 12 + z' }-> s5 :|: s5 >= 0, s5 <= 1 + (z' - 1) + 0 + 0, z'' = 0, z = 0, z' - 1 >= 0 splitmerge(z, z', z'') -{ 12 + z'' }-> s6 :|: s6 >= 0, s6 <= 0 + (1 + (z'' - 1) + 0), z = 0, z'' - 1 >= 0, z' = 0 splitmerge(z, z', z'') -{ 12 }-> s7 :|: s7 >= 0, s7 <= 0 + 0, z'' = 0, z = 0, z' = 0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + z'', z') :|: z = 1 + x + xs, xs >= 0, z'' >= 0, x >= 0, z' >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), splitmerge(1 + x'1 + (1 + x4 + xs3), 0, 0)) :|: x4 >= 0, z'' = 1 + x'1 + (1 + x4 + xs3), x'1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0, xs3 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 0) :|: z'' = 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(splitmerge(1 + x''' + (1 + x2 + xs''), 0, 0), 1 + (z'' - 1) + 0) :|: z'' - 1 >= 0, xs'' >= 0, x''' >= 0, z = 0, z' = 1 + x''' + (1 + x2 + xs''), x2 >= 0 splitmerge(z, z', z'') -{ 3 }-> merge(0, splitmerge(1 + x'3 + (1 + x8 + xs5), 0, 0)) :|: x8 >= 0, x'3 >= 0, xs5 >= 0, z = 0, z'' = 1 + x'3 + (1 + x8 + xs5), z' = 0 splitmerge(z, z', z'') -{ 3 }-> merge(1 + (z' - 1) + 0, splitmerge(1 + x'2 + (1 + x6 + xs4), 0, 0)) :|: z'' = 1 + x'2 + (1 + x6 + xs4), x'2 >= 0, x6 >= 0, xs4 >= 0, z = 0, z' - 1 >= 0 Function symbols to be analyzed: {splitmerge}, {mergesort}, {goal} Previous analysis results are: notEmpty: runtime: O(1) [1], size: O(1) [2] lteq: runtime: O(1) [0], size: O(1) [2] merge[Ite]: runtime: O(n^1) [8 + z' + z''], size: O(n^1) [z' + z''] merge: runtime: O(n^1) [9 + z + z'], size: O(n^1) [z + z'] splitmerge: runtime: INF, size: O(n^1) [11 + 23*z + 23*z' + 23*z''] ---------------------------------------- (47) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: lteq(v0, v1) -> null_lteq [0] merge[Ite](v0, v1, v2) -> null_merge[Ite] [0] mergesort(v0) -> null_mergesort [0] merge(v0, v1) -> null_merge [0] splitmerge(v0, v1, v2) -> null_splitmerge [0] notEmpty(v0) -> null_notEmpty [0] And the following fresh constants: null_lteq, null_merge[Ite], null_mergesort, null_merge, null_splitmerge, null_notEmpty ---------------------------------------- (48) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: mergesort(Cons(x', Cons(x, xs))) -> splitmerge(Cons(x', Cons(x, xs)), Nil, Nil) [1] mergesort(Cons(x, Nil)) -> Cons(x, Nil) [1] merge(Cons(x', xs'), Cons(x, xs)) -> merge[Ite](lteq(x', x), Cons(x', xs'), Cons(x, xs)) [1] merge(Cons(x, xs), Nil) -> Cons(x, xs) [1] splitmerge(Cons(x, xs), xs1, xs2) -> splitmerge(xs, Cons(x, xs2), xs1) [1] splitmerge(Nil, xs1, xs2) -> merge(mergesort(xs1), mergesort(xs2)) [1] mergesort(Nil) -> Nil [1] merge(Nil, xs2) -> xs2 [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> mergesort(xs) [1] lteq(S(x), S(y)) -> lteq(x, y) [0] lteq(0, y) -> True [0] lteq(S(x), 0) -> False [0] merge[Ite](False, xs1, Cons(x, xs)) -> Cons(x, merge(xs1, xs)) [0] merge[Ite](True, Cons(x, xs), xs2) -> Cons(x, merge(xs, xs2)) [0] lteq(v0, v1) -> null_lteq [0] merge[Ite](v0, v1, v2) -> null_merge[Ite] [0] mergesort(v0) -> null_mergesort [0] merge(v0, v1) -> null_merge [0] splitmerge(v0, v1, v2) -> null_splitmerge [0] notEmpty(v0) -> null_notEmpty [0] The TRS has the following type information: mergesort :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge Cons :: S:0 -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge splitmerge :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge Nil :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge merge :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge merge[Ite] :: True:False:null_lteq:null_notEmpty -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge lteq :: S:0 -> S:0 -> True:False:null_lteq:null_notEmpty notEmpty :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> True:False:null_lteq:null_notEmpty True :: True:False:null_lteq:null_notEmpty False :: True:False:null_lteq:null_notEmpty goal :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge -> Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge S :: S:0 -> S:0 0 :: S:0 null_lteq :: True:False:null_lteq:null_notEmpty null_merge[Ite] :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge null_mergesort :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge null_merge :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge null_splitmerge :: Cons:Nil:null_merge[Ite]:null_mergesort:null_merge:null_splitmerge null_notEmpty :: True:False:null_lteq:null_notEmpty Rewrite Strategy: INNERMOST ---------------------------------------- (49) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: Nil => 0 True => 2 False => 1 0 => 0 null_lteq => 0 null_merge[Ite] => 0 null_mergesort => 0 null_merge => 0 null_splitmerge => 0 null_notEmpty => 0 ---------------------------------------- (50) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> mergesort(xs) :|: xs >= 0, z = xs lteq(z, z') -{ 0 }-> lteq(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x lteq(z, z') -{ 0 }-> 2 :|: y >= 0, z = 0, z' = y lteq(z, z') -{ 0 }-> 1 :|: x >= 0, z = 1 + x, z' = 0 lteq(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 merge(z, z') -{ 1 }-> xs2 :|: xs2 >= 0, z' = xs2, z = 0 merge(z, z') -{ 1 }-> merge[Ite](lteq(x', x), 1 + x' + xs', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, xs' >= 0, x >= 0, z = 1 + x' + xs' merge(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 merge(z, z') -{ 1 }-> 1 + x + xs :|: z = 1 + x + xs, xs >= 0, x >= 0, z' = 0 merge[Ite](z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs, xs2) :|: z = 2, xs >= 0, xs2 >= 0, z' = 1 + x + xs, x >= 0, z'' = xs2 merge[Ite](z, z', z'') -{ 0 }-> 1 + x + merge(xs1, xs) :|: xs >= 0, z = 1, x >= 0, xs1 >= 0, z'' = 1 + x + xs, z' = xs1 mergesort(z) -{ 1 }-> splitmerge(1 + x' + (1 + x + xs), 0, 0) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) mergesort(z) -{ 1 }-> 0 :|: z = 0 mergesort(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 mergesort(z) -{ 1 }-> 1 + x + 0 :|: x >= 0, z = 1 + x + 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 notEmpty(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 splitmerge(z, z', z'') -{ 1 }-> splitmerge(xs, 1 + x + xs2, xs1) :|: z = 1 + x + xs, xs >= 0, xs2 >= 0, x >= 0, xs1 >= 0, z' = xs1, z'' = xs2 splitmerge(z, z', z'') -{ 1 }-> merge(mergesort(xs1), mergesort(xs2)) :|: xs2 >= 0, xs1 >= 0, z = 0, z' = xs1, z'' = xs2 splitmerge(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (51) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (52) 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 ---------------------------------------- (53) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: GOAL(z0) -> c16(MERGESORT(z0)) Removed 6 trailing nodes: NOTEMPTY(Cons(z0, z1)) -> c14 NOTEMPTY(Nil) -> c15 MERGESORT(Cons(z0, Nil)) -> c6 <='(S(z0), 0) -> c2 MERGESORT(Nil) -> c7 <='(0, z0) -> c1 ---------------------------------------- (54) 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 ---------------------------------------- (55) 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) ---------------------------------------- (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)) 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 ---------------------------------------- (57) 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 ---------------------------------------- (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)) 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 ---------------------------------------- (59) 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)) ---------------------------------------- (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)) 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 ---------------------------------------- (61) 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 ---------------------------------------- (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)) 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 ---------------------------------------- (63) 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)) ---------------------------------------- (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)) 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 ---------------------------------------- (65) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing nodes: MERGE(Cons(z0, z1), Nil) -> c9 MERGE(Nil, z0) -> c10 ---------------------------------------- (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)) 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 ---------------------------------------- (67) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (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)) 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 ---------------------------------------- (69) 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 ---------------------------------------- (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)) 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 ---------------------------------------- (71) 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 ---------------------------------------- (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)) 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 ---------------------------------------- (73) 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)) ---------------------------------------- (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)) 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 ---------------------------------------- (75) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Nil, x1) -> c12(MERGE(Nil, mergesort(x1)), 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)) 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 ---------------------------------------- (77) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 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)) 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 ---------------------------------------- (79) 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)) ---------------------------------------- (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(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 ---------------------------------------- (81) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, x0, Nil) -> c13(MERGE(mergesort(x0), 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(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 ---------------------------------------- (83) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 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(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 ---------------------------------------- (85) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: SPLITMERGE(Nil, Nil, x1) -> c13(MERGESORT(x1)) ---------------------------------------- (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(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 ---------------------------------------- (87) 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))) ---------------------------------------- (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, 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 ---------------------------------------- (89) 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 ---------------------------------------- (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, 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 ---------------------------------------- (91) 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 ---------------------------------------- (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](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 ---------------------------------------- (93) 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 ---------------------------------------- (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](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 ---------------------------------------- (95) 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)) ---------------------------------------- (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)) 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 ---------------------------------------- (97) 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)) ---------------------------------------- (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)) 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 ---------------------------------------- (99) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (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)) 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 ---------------------------------------- (101) 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)) ---------------------------------------- (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)) 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 ---------------------------------------- (103) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Nil, Cons(x1, Nil)) -> c12(MERGE(Nil, Cons(x1, Nil)), MERGESORT(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)) 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 ---------------------------------------- (105) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (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)) 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 ---------------------------------------- (107) 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)))) ---------------------------------------- (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)) 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 ---------------------------------------- (109) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (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)) 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 ---------------------------------------- (111) 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)) ---------------------------------------- (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)) 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 ---------------------------------------- (113) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c12(MERGE(Cons(x0, Nil), Nil)) ---------------------------------------- (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)) 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 ---------------------------------------- (115) 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)))) ---------------------------------------- (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)) 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 ---------------------------------------- (117) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (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)) 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 ---------------------------------------- (119) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: SPLITMERGE(Nil, Nil, Cons(x1, Cons(x2, x3))) -> c13(MERGESORT(Cons(x1, Cons(x2, x3)))) ---------------------------------------- (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)) 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 ---------------------------------------- (121) 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)) ---------------------------------------- (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)) 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 ---------------------------------------- (123) 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)) ---------------------------------------- (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: <='(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 ---------------------------------------- (125) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 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: <='(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 ---------------------------------------- (127) 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)) ---------------------------------------- (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: <='(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 ---------------------------------------- (129) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Cons(x0, Nil), Nil) -> c13(MERGE(Cons(x0, Nil), Nil), MERGESORT(Nil)) ---------------------------------------- (130) 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 ---------------------------------------- (131) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (132) 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 ---------------------------------------- (133) 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))) ---------------------------------------- (134) 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 ---------------------------------------- (135) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing nodes: SPLITMERGE(Nil, Nil, Cons(x1, Nil)) -> c13(MERGE(Nil, Cons(x1, Nil))) ---------------------------------------- (136) 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 ---------------------------------------- (137) 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)) ---------------------------------------- (138) Obligation: Complexity Dependency Tuples Problem Rules: <=(S(z0), S(z1)) -> <=(z0, z1) <=(0, z0) -> True <=(S(z0), 0) -> False mergesort(Cons(z0, Cons(z1, z2))) -> splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil) mergesort(Cons(z0, Nil)) -> Cons(z0, Nil) mergesort(Nil) -> Nil splitmerge(Cons(z0, z1), z2, z3) -> splitmerge(z1, Cons(z0, z3), z2) splitmerge(Nil, z0, z1) -> merge(mergesort(z0), mergesort(z1)) merge(Cons(z0, z1), Cons(z2, z3)) -> merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)) merge(Cons(z0, z1), Nil) -> Cons(z0, z1) merge(Nil, z0) -> z0 merge[Ite](False, z0, Cons(z1, z2)) -> Cons(z1, merge(z0, z2)) merge[Ite](True, Cons(z0, z1), z2) -> Cons(z0, merge(z1, z2)) Tuples: <='(S(z0), S(z1)) -> c(<='(z0, z1)) MERGE[ITE](True, Cons(z0, z1), z2) -> c4(MERGE(z1, z2)) MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) SPLITMERGE(Cons(z0, z1), z2, z3) -> c11(SPLITMERGE(z1, Cons(z0, z3), z2)) MERGE(Cons(0, x1), Cons(z0, x3)) -> c8(MERGE[ITE](True, Cons(0, x1), Cons(z0, x3))) MERGE(Cons(S(z0), x1), Cons(0, x3)) -> c8(MERGE[ITE](False, Cons(S(z0), x1), Cons(0, x3))) SPLITMERGE(Nil, x0, Nil) -> c12(MERGESORT(x0)) MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) MERGE(Cons(S(0), x1), Cons(S(z0), x3)) -> c8(MERGE[ITE](True, Cons(S(0), x1), Cons(S(z0), x3)), <='(S(0), S(z0))) MERGE(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c8(MERGE[ITE](False, Cons(S(S(z0)), x1), Cons(S(0), x3)), <='(S(S(z0)), S(0))) MERGE(Cons(S(x0), x1), Cons(S(x2), x3)) -> c8(<='(S(x0), S(x2))) SPLITMERGE(Nil, x0, Cons(z0, Cons(x2, x3))) -> c12(MERGE(mergesort(x0), splitmerge(Cons(x2, x3), Cons(z0, Nil), Nil)), MERGESORT(x0)) 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))) 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 ---------------------------------------- (139) 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)) ---------------------------------------- (140) 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))) 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, 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, c4_1, c5_1, c11_1, c8_1, c12_1, c8_2, c12_2, c13_2, c13_1, c3_1 ---------------------------------------- (141) 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)))) ---------------------------------------- (142) 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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 ---------------------------------------- (143) 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))) ---------------------------------------- (144) 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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 ---------------------------------------- (145) 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))) ---------------------------------------- (146) 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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 ---------------------------------------- (147) 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)))) ---------------------------------------- (148) 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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 ---------------------------------------- (149) 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))) ---------------------------------------- (150) 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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 ---------------------------------------- (151) 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)))) ---------------------------------------- (152) 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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 ---------------------------------------- (153) 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)))) ---------------------------------------- (154) 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(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 ---------------------------------------- (155) 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)))) ---------------------------------------- (156) 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)), 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(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 ---------------------------------------- (157) 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)))) ---------------------------------------- (158) 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(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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(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, c13_2, c13_1, c3_1, c12_2, c4_1, c11_1 ---------------------------------------- (159) 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)))) ---------------------------------------- (160) 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, 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, c3_1, c12_2, c4_1, c11_1 ---------------------------------------- (161) 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))) ---------------------------------------- (162) 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, 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, 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, c3_1, c12_2, c4_1, c11_1 ---------------------------------------- (163) 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))) ---------------------------------------- (164) 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, 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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 ---------------------------------------- (165) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (166) 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, 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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 ---------------------------------------- (167) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting 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, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) ---------------------------------------- (168) 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, 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(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 ---------------------------------------- (169) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) ---------------------------------------- (170) 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, 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(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 ---------------------------------------- (171) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, Cons(z2, z3)))) ---------------------------------------- (172) 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, 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, Cons(z2, z3)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(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 ---------------------------------------- (173) 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)))) ---------------------------------------- (174) 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(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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, 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))) 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 ---------------------------------------- (175) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) ---------------------------------------- (176) 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, 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))) 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, 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))) 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 ---------------------------------------- (177) 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))) ---------------------------------------- (178) 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, 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, 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))) 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 ---------------------------------------- (179) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace SPLITMERGE(Nil, Cons(x0, Cons(x1, x2)), Cons(z0, Nil)) -> c13(MERGE(splitmerge(Cons(x0, Cons(x1, x2)), Nil, Nil), Cons(z0, Nil))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) ---------------------------------------- (180) 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, 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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, 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))) 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 ---------------------------------------- (181) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, Cons(z2, z3)))) ---------------------------------------- (182) 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(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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, 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))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2 ---------------------------------------- (183) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(x1, Nil)) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), Cons(x1, Nil))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) ---------------------------------------- (184) 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(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, z0, Cons(z1, Cons(z2, z3))) -> c12(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(z0)) 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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, 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))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2 ---------------------------------------- (185) 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))) ---------------------------------------- (186) 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(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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2 ---------------------------------------- (187) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Cons(z0, z1), Cons(x0, x3), x2) -> c11(SPLITMERGE(z1, Cons(z0, x2), Cons(x0, x3))) by SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) ---------------------------------------- (188) 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(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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c13(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil)), MERGESORT(Cons(z1, 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), 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))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2 ---------------------------------------- (189) CdtGraphSplitRhsProof (BOTH BOUNDS(ID, ID)) Split RHS of tuples not part of any SCC ---------------------------------------- (190) 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(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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGESORT(Cons(z1, Cons(z2, z3)))) S tuples: MERGE(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c8(MERGE[ITE](<=(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)), <='(S(S(z0)), S(S(z1)))) K tuples: MERGESORT(Cons(z0, Cons(z1, z2))) -> c5(SPLITMERGE(Cons(z0, Cons(z1, z2)), Nil, Nil)) MERGE(Cons(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)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2, c1_1 ---------------------------------------- (191) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGESORT(Cons(z1, Cons(z2, z3)))) ---------------------------------------- (192) 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(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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(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))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2, c1_1 ---------------------------------------- (193) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) ---------------------------------------- (194) 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(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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, 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))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2, c1_1 ---------------------------------------- (195) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, z0, Cons(z1, Cons(z2, z3))) -> c13(MERGE(mergesort(z0), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil))), MERGESORT(Cons(z1, Cons(z2, z3)))) by SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x2, Cons(z2, z3)))) ---------------------------------------- (196) 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(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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z3, Cons(z2, Nil), Cons(x2, 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))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2, c1_1 ---------------------------------------- (197) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) by SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil)))) ---------------------------------------- (198) 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(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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(z3, Cons(z2, Nil), Cons(z1, 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))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2, c1_1 ---------------------------------------- (199) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) ---------------------------------------- (200) 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(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(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(MERGE(splitmerge(Cons(z1, z2), Cons(x0, Nil), Nil), mergesort(Cons(x2, x3))), MERGESORT(Cons(x0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, 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))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2, c1_1 ---------------------------------------- (201) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, z4)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), mergesort(Cons(z3, z4))), MERGESORT(Cons(z0, Cons(z1, z2)))) ---------------------------------------- (202) 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(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(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(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))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, z4)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), mergesort(Cons(z3, z4))), 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))) SPLITMERGE(Cons(x0, Cons(x1, x2)), Nil, Nil) -> c11(SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2, c1_1 ---------------------------------------- (203) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace SPLITMERGE(Nil, Cons(x0, x4), Cons(x2, Cons(z2, z3))) -> c13(MERGESORT(Cons(x2, Cons(z2, z3)))) by SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z3, z4))) -> c13(MERGESORT(Cons(x2, Cons(z3, z4)))) ---------------------------------------- (204) 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(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(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(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))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, z4)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), mergesort(Cons(z3, z4))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z3, z4))) -> c13(MERGESORT(Cons(x2, Cons(z3, z4)))) 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)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c12_2, c4_1, c11_1, c_1, c13_2, c1_1 ---------------------------------------- (205) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) ---------------------------------------- (206) 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(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)) 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(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(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))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, z4)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), mergesort(Cons(z3, z4))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z3, z4))) -> c13(MERGESORT(Cons(x2, Cons(z3, z4)))) 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)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c4_1, c11_1, c12_2, c_1, c13_2, c1_1 ---------------------------------------- (207) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace 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))) by SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z3, z4))) -> c12(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z4, Cons(z3, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, Cons(x4, x5)))) ---------------------------------------- (208) 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(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)) 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(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(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))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, z4)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), mergesort(Cons(z3, z4))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z3, z4))) -> c13(MERGESORT(Cons(x2, Cons(z3, z4)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z3, z4))) -> c12(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z4, Cons(z3, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, Cons(x4, x5)))) 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)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c4_1, c11_1, c12_2, c_1, c13_2, c1_1 ---------------------------------------- (209) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace 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)))) by SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) ---------------------------------------- (210) 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(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)) 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(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(x0, Cons(z1, z2)), Cons(x2, x3)) -> c12(MERGESORT(Cons(x0, Cons(z1, z2)))) <='(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))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c13(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(Cons(z4, z5), Cons(z3, Nil), Nil)), MERGESORT(Cons(z3, Cons(z4, z5)))) 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(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c13(MERGE(splitmerge(Cons(z1, z2), Cons(z0, Nil), Nil), Cons(z3, Nil))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c1(MERGE(Cons(z0, Nil), splitmerge(Cons(z2, z3), Cons(z1, Nil), Nil))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Cons(z4, z5))) -> c12(MERGE(splitmerge(Cons(z0, Cons(z1, z2)), Nil, Nil), splitmerge(z5, Cons(z4, Nil), Cons(z3, Nil))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z2, z3))) -> c13(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z3, Cons(z2, Nil), Cons(x2, Nil))), MERGESORT(Cons(x2, Cons(z2, z3)))) SPLITMERGE(Nil, Cons(z0, Nil), Cons(z1, Cons(z2, z3))) -> c12(MERGE(Cons(z0, Nil), splitmerge(z3, Cons(z2, Nil), Cons(z1, Nil)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, Nil)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), Cons(z3, Nil)), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(z0, Cons(z1, z2)), Cons(z3, z4)) -> c12(MERGE(splitmerge(z2, Cons(z1, Nil), Cons(z0, Nil)), mergesort(Cons(z3, z4))), MERGESORT(Cons(z0, Cons(z1, z2)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z3, z4))) -> c13(MERGESORT(Cons(x2, Cons(z3, z4)))) SPLITMERGE(Nil, Cons(x0, Cons(x4, x5)), Cons(x2, Cons(z3, z4))) -> c12(MERGE(mergesort(Cons(x0, Cons(x4, x5))), splitmerge(z4, Cons(z3, Nil), Cons(x2, Nil))), MERGESORT(Cons(x0, Cons(x4, x5)))) 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)) 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))) SPLITMERGE(Cons(x1, x2), Cons(x0, Nil), Nil) -> c11(SPLITMERGE(x2, Cons(x1, Nil), Cons(x0, Nil))) SPLITMERGE(Cons(z0, z1), Cons(x0, x4), Cons(x2, x3)) -> c11(SPLITMERGE(z1, Cons(z0, Cons(x2, x3)), Cons(x0, x4))) 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_1, c3_1, c4_1, c11_1, c_1, c13_2, c1_1, c12_2