KILLED proof of input_opzmNy4ifg.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(1, INF). (0) CpxTRS (1) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxTRS (3) RelTrsToTrsProof [UPPER BOUND(ID), 0 ms] (4) CpxTRS (5) RelTrsToWeightedTrsProof [UPPER BOUND(ID), 0 ms] (6) CpxWeightedTrs (7) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxTypedWeightedTrs (9) CompletionProof [UPPER BOUND(ID), 0 ms] (10) CpxTypedWeightedCompleteTrs (11) NarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTypedWeightedCompleteTrs (13) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 19 ms] (14) CpxRNTS (15) SimplificationProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxRNTS (17) CpxRntsAnalysisOrderProof [BOTH BOUNDS(ID, ID), 3 ms] (18) CpxRNTS (19) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (20) CpxRNTS (21) IntTrsBoundProof [UPPER BOUND(ID), 393 ms] (22) CpxRNTS (23) IntTrsBoundProof [UPPER BOUND(ID), 135 ms] (24) CpxRNTS (25) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (26) CpxRNTS (27) IntTrsBoundProof [UPPER BOUND(ID), 520 ms] (28) CpxRNTS (29) IntTrsBoundProof [UPPER BOUND(ID), 98 ms] (30) CpxRNTS (31) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (32) CpxRNTS (33) IntTrsBoundProof [UPPER BOUND(ID), 184 ms] (34) CpxRNTS (35) IntTrsBoundProof [UPPER BOUND(ID), 84 ms] (36) CpxRNTS (37) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (38) CpxRNTS (39) IntTrsBoundProof [UPPER BOUND(ID), 141 ms] (40) CpxRNTS (41) IntTrsBoundProof [UPPER BOUND(ID), 85 ms] (42) CpxRNTS (43) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (44) CpxRNTS (45) IntTrsBoundProof [UPPER BOUND(ID), 255 ms] (46) CpxRNTS (47) IntTrsBoundProof [UPPER BOUND(ID), 148 ms] (48) CpxRNTS (49) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (50) CpxRNTS (51) IntTrsBoundProof [UPPER BOUND(ID), 4261 ms] (52) CpxRNTS (53) IntTrsBoundProof [UPPER BOUND(ID), 1286 ms] (54) CpxRNTS (55) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (56) CpxRNTS (57) IntTrsBoundProof [UPPER BOUND(ID), 179 ms] (58) CpxRNTS (59) IntTrsBoundProof [UPPER BOUND(ID), 73 ms] (60) CpxRNTS (61) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (62) CpxRNTS (63) IntTrsBoundProof [UPPER BOUND(ID), 141 ms] (64) CpxRNTS (65) IntTrsBoundProof [UPPER BOUND(ID), 3 ms] (66) CpxRNTS (67) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (68) CpxRNTS (69) IntTrsBoundProof [UPPER BOUND(ID), 11.9 s] (70) CpxRNTS (71) IntTrsBoundProof [UPPER BOUND(ID), 1840 ms] (72) CpxRNTS (73) CompletionProof [UPPER BOUND(ID), 0 ms] (74) CpxTypedWeightedCompleteTrs (75) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 25 ms] (76) CpxRNTS (77) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (78) CdtProblem (79) CdtLeafRemovalProof [ComplexityIfPolyImplication, 0 ms] (80) CdtProblem (81) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (82) CdtProblem (83) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (84) CdtProblem (85) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (86) CdtProblem (87) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (88) CdtProblem (89) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (90) CdtProblem (91) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (92) CdtProblem (93) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 13 ms] (94) CdtProblem (95) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (96) CdtProblem (97) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (98) CdtProblem (99) CdtNarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (100) CdtProblem (101) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (102) CdtProblem (103) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (104) CdtProblem (105) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (106) CdtProblem (107) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (108) CdtProblem (109) CdtForwardInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (110) CdtProblem (111) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (112) CdtProblem (113) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (114) CdtProblem (115) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (116) CdtProblem (117) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (118) CdtProblem (119) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (120) CdtProblem (121) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (122) CdtProblem (123) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (124) CdtProblem (125) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (126) CdtProblem (127) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (128) CdtProblem (129) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (130) CdtProblem (131) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (132) CdtProblem (133) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (134) CdtProblem (135) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (136) CdtProblem (137) CdtRewritingProof [BOTH BOUNDS(ID, ID), 5 ms] (138) CdtProblem (139) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (140) CdtProblem (141) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (142) CdtProblem (143) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (144) CdtProblem (145) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (146) CdtProblem (147) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (148) CdtProblem (149) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (150) CdtProblem (151) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (152) CdtProblem (153) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (154) CdtProblem (155) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (156) CdtProblem (157) CdtRewritingProof [BOTH BOUNDS(ID, ID), 1 ms] (158) CdtProblem (159) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (160) CdtProblem (161) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (162) CdtProblem (163) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (164) CdtProblem (165) CdtRewritingProof [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) CdtForwardInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (172) CdtProblem (173) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (174) CdtProblem (175) CdtInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (176) CdtProblem (177) CdtRewritingProof [BOTH BOUNDS(ID, ID), 7 ms] (178) CdtProblem (179) CdtForwardInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (180) CdtProblem (181) CdtForwardInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (182) CdtProblem (183) CdtForwardInstantiationProof [BOTH BOUNDS(ID, ID), 0 ms] (184) CdtProblem (185) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (186) CdtProblem (187) CdtRewritingProof [BOTH BOUNDS(ID, ID), 0 ms] (188) CdtProblem (189) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (190) CdtProblem ---------------------------------------- (0) 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: divide_ys#1(x2, x1) -> Cons(take#2(x1, x2), Cons(drop#2(x1, x2), Nil)) cond_merge_ys_zs_2(True, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x4, merge#2(x3, Cons(x5, x6))) cond_merge_ys_zs_2(False, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x2, merge#2(Cons(x7, x8), x1)) merge#2(Nil, x2) -> x2 merge#2(Cons(x4, x2), Nil) -> Cons(x4, x2) merge#2(Cons(x8, x6), Cons(x4, x2)) -> cond_merge_ys_zs_2(leq#2(x8, x4), Cons(x8, x6), Cons(x4, x2), x8, x6, x4, x2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x229, Nil)) -> Cons(x229, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, x33))) -> const_f#2(Cons(x51, Cons(x25, x33)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, x33)), S(halve#1(length#1(x33)))))) drop#2(0, x2) -> x2 drop#2(S(0), Nil) -> bot[1] drop#2(S(x10), Cons(x56, x64)) -> drop#2(x10, x64) take#2(0, x2) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(x22), Cons(x56, x64)) -> Cons(x56, take#2(x22, x64)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(x14))) -> S(halve#1(x14)) const_f#2(x3, Cons(x6, Cons(x4, x2))) -> merge#2(x6, x4) leq#2(0, x16) -> True leq#2(S(x20), 0) -> False leq#2(S(x4), S(x2)) -> leq#2(x4, x2) length#1(Nil) -> 0 length#1(Cons(x6, x8)) -> S(length#1(x8)) map#2(dc(x2, x4, x6, x8, x10), Nil) -> Nil map#2(dc(x6, x8, x10, x12, x14), Cons(x4, x2)) -> Cons(dc#1(x6, x8, x10, x12, x14, x4), map#2(dc(x6, x8, x10, x12, x14), x2)) main(x113) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, x113) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (1) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (2) 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: divide_ys#1(x2, x1) -> Cons(take#2(x1, x2), Cons(drop#2(x1, x2), Nil)) cond_merge_ys_zs_2(True, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x4, merge#2(x3, Cons(x5, x6))) cond_merge_ys_zs_2(False, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x2, merge#2(Cons(x7, x8), x1)) merge#2(Nil, x2) -> x2 merge#2(Cons(x4, x2), Nil) -> Cons(x4, x2) merge#2(Cons(x8, x6), Cons(x4, x2)) -> cond_merge_ys_zs_2(leq#2(x8, x4), Cons(x8, x6), Cons(x4, x2), x8, x6, x4, x2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x229, Nil)) -> Cons(x229, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, x33))) -> const_f#2(Cons(x51, Cons(x25, x33)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, x33)), S(halve#1(length#1(x33)))))) drop#2(0', x2) -> x2 drop#2(S(0'), Nil) -> bot[1] drop#2(S(x10), Cons(x56, x64)) -> drop#2(x10, x64) take#2(0', x2) -> Nil take#2(S(0'), Nil) -> Cons(bot[0], Nil) take#2(S(x22), Cons(x56, x64)) -> Cons(x56, take#2(x22, x64)) halve#1(0') -> 0' halve#1(S(0')) -> S(0') halve#1(S(S(x14))) -> S(halve#1(x14)) const_f#2(x3, Cons(x6, Cons(x4, x2))) -> merge#2(x6, x4) leq#2(0', x16) -> True leq#2(S(x20), 0') -> False leq#2(S(x4), S(x2)) -> leq#2(x4, x2) length#1(Nil) -> 0' length#1(Cons(x6, x8)) -> S(length#1(x8)) map#2(dc(x2, x4, x6, x8, x10), Nil) -> Nil map#2(dc(x6, x8, x10, x12, x14), Cons(x4, x2)) -> Cons(dc#1(x6, x8, x10, x12, x14, x4), map#2(dc(x6, x8, x10, x12, x14), x2)) main(x113) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, x113) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (3) RelTrsToTrsProof (UPPER BOUND(ID)) transformed relative TRS to TRS ---------------------------------------- (4) 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: divide_ys#1(x2, x1) -> Cons(take#2(x1, x2), Cons(drop#2(x1, x2), Nil)) cond_merge_ys_zs_2(True, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x4, merge#2(x3, Cons(x5, x6))) cond_merge_ys_zs_2(False, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x2, merge#2(Cons(x7, x8), x1)) merge#2(Nil, x2) -> x2 merge#2(Cons(x4, x2), Nil) -> Cons(x4, x2) merge#2(Cons(x8, x6), Cons(x4, x2)) -> cond_merge_ys_zs_2(leq#2(x8, x4), Cons(x8, x6), Cons(x4, x2), x8, x6, x4, x2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x229, Nil)) -> Cons(x229, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, x33))) -> const_f#2(Cons(x51, Cons(x25, x33)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, x33)), S(halve#1(length#1(x33)))))) drop#2(0, x2) -> x2 drop#2(S(0), Nil) -> bot[1] drop#2(S(x10), Cons(x56, x64)) -> drop#2(x10, x64) take#2(0, x2) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(x22), Cons(x56, x64)) -> Cons(x56, take#2(x22, x64)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(x14))) -> S(halve#1(x14)) const_f#2(x3, Cons(x6, Cons(x4, x2))) -> merge#2(x6, x4) leq#2(0, x16) -> True leq#2(S(x20), 0) -> False leq#2(S(x4), S(x2)) -> leq#2(x4, x2) length#1(Nil) -> 0 length#1(Cons(x6, x8)) -> S(length#1(x8)) map#2(dc(x2, x4, x6, x8, x10), Nil) -> Nil map#2(dc(x6, x8, x10, x12, x14), Cons(x4, x2)) -> Cons(dc#1(x6, x8, x10, x12, x14, x4), map#2(dc(x6, x8, x10, x12, x14), x2)) main(x113) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, x113) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (5) RelTrsToWeightedTrsProof (UPPER BOUND(ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (6) 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: divide_ys#1(x2, x1) -> Cons(take#2(x1, x2), Cons(drop#2(x1, x2), Nil)) [1] cond_merge_ys_zs_2(True, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x4, merge#2(x3, Cons(x5, x6))) [1] cond_merge_ys_zs_2(False, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x2, merge#2(Cons(x7, x8), x1)) [1] merge#2(Nil, x2) -> x2 [1] merge#2(Cons(x4, x2), Nil) -> Cons(x4, x2) [1] merge#2(Cons(x8, x6), Cons(x4, x2)) -> cond_merge_ys_zs_2(leq#2(x8, x4), Cons(x8, x6), Cons(x4, x2), x8, x6, x4, x2) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x229, Nil)) -> Cons(x229, Nil) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, x33))) -> const_f#2(Cons(x51, Cons(x25, x33)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, x33)), S(halve#1(length#1(x33)))))) [1] drop#2(0, x2) -> x2 [1] drop#2(S(0), Nil) -> bot[1] [1] drop#2(S(x10), Cons(x56, x64)) -> drop#2(x10, x64) [1] take#2(0, x2) -> Nil [1] take#2(S(0), Nil) -> Cons(bot[0], Nil) [1] take#2(S(x22), Cons(x56, x64)) -> Cons(x56, take#2(x22, x64)) [1] halve#1(0) -> 0 [1] halve#1(S(0)) -> S(0) [1] halve#1(S(S(x14))) -> S(halve#1(x14)) [1] const_f#2(x3, Cons(x6, Cons(x4, x2))) -> merge#2(x6, x4) [1] leq#2(0, x16) -> True [1] leq#2(S(x20), 0) -> False [1] leq#2(S(x4), S(x2)) -> leq#2(x4, x2) [1] length#1(Nil) -> 0 [1] length#1(Cons(x6, x8)) -> S(length#1(x8)) [1] map#2(dc(x2, x4, x6, x8, x10), Nil) -> Nil [1] map#2(dc(x6, x8, x10, x12, x14), Cons(x4, x2)) -> Cons(dc#1(x6, x8, x10, x12, x14, x4), map#2(dc(x6, x8, x10, x12, x14), x2)) [1] main(x113) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, x113) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (7) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (8) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: divide_ys#1(x2, x1) -> Cons(take#2(x1, x2), Cons(drop#2(x1, x2), Nil)) [1] cond_merge_ys_zs_2(True, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x4, merge#2(x3, Cons(x5, x6))) [1] cond_merge_ys_zs_2(False, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x2, merge#2(Cons(x7, x8), x1)) [1] merge#2(Nil, x2) -> x2 [1] merge#2(Cons(x4, x2), Nil) -> Cons(x4, x2) [1] merge#2(Cons(x8, x6), Cons(x4, x2)) -> cond_merge_ys_zs_2(leq#2(x8, x4), Cons(x8, x6), Cons(x4, x2), x8, x6, x4, x2) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x229, Nil)) -> Cons(x229, Nil) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, x33))) -> const_f#2(Cons(x51, Cons(x25, x33)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, x33)), S(halve#1(length#1(x33)))))) [1] drop#2(0, x2) -> x2 [1] drop#2(S(0), Nil) -> bot[1] [1] drop#2(S(x10), Cons(x56, x64)) -> drop#2(x10, x64) [1] take#2(0, x2) -> Nil [1] take#2(S(0), Nil) -> Cons(bot[0], Nil) [1] take#2(S(x22), Cons(x56, x64)) -> Cons(x56, take#2(x22, x64)) [1] halve#1(0) -> 0 [1] halve#1(S(0)) -> S(0) [1] halve#1(S(S(x14))) -> S(halve#1(x14)) [1] const_f#2(x3, Cons(x6, Cons(x4, x2))) -> merge#2(x6, x4) [1] leq#2(0, x16) -> True [1] leq#2(S(x20), 0) -> False [1] leq#2(S(x4), S(x2)) -> leq#2(x4, x2) [1] length#1(Nil) -> 0 [1] length#1(Cons(x6, x8)) -> S(length#1(x8)) [1] map#2(dc(x2, x4, x6, x8, x10), Nil) -> Nil [1] map#2(dc(x6, x8, x10, x12, x14), Cons(x4, x2)) -> Cons(dc#1(x6, x8, x10, x12, x14, x4), map#2(dc(x6, x8, x10, x12, x14), x2)) [1] main(x113) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, x113) [1] The TRS has the following type information: divide_ys#1 :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] Cons :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] take#2 :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] drop#2 :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] Nil :: Nil:Cons:S:0:bot[1]:bot[0] cond_merge_ys_zs_2 :: True:False -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] True :: True:False merge#2 :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] False :: True:False leq#2 :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> True:False dc#1 :: map -> divisible -> mergesort_zs_3 -> divide -> const_f -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] map :: map divisible :: divisible mergesort_zs_3 :: mergesort_zs_3 divide :: divide const_f :: const_f const_f#2 :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] map#2 :: dc -> Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] dc :: map -> divisible -> mergesort_zs_3 -> divide -> const_f -> dc S :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] halve#1 :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] length#1 :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] 0 :: Nil:Cons:S:0:bot[1]:bot[0] bot[1] :: Nil:Cons:S:0:bot[1]:bot[0] bot[0] :: Nil:Cons:S:0:bot[1]:bot[0] main :: Nil:Cons:S:0:bot[1]:bot[0] -> Nil:Cons:S:0:bot[1]:bot[0] Rewrite Strategy: INNERMOST ---------------------------------------- (9) 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: main_1 (c) The following functions are completely defined: leq#2_2 map#2_2 divide_ys#1_2 halve#1_1 length#1_1 dc#1_6 take#2_2 drop#2_2 const_f#2_2 merge#2_2 cond_merge_ys_zs_2_7 Due to the following rules being added: leq#2(v0, v1) -> null_leq#2 [0] map#2(v0, v1) -> null_map#2 [0] halve#1(v0) -> null_halve#1 [0] length#1(v0) -> null_length#1 [0] dc#1(v0, v1, v2, v3, v4, v5) -> null_dc#1 [0] take#2(v0, v1) -> null_take#2 [0] drop#2(v0, v1) -> null_drop#2 [0] const_f#2(v0, v1) -> null_const_f#2 [0] merge#2(v0, v1) -> null_merge#2 [0] cond_merge_ys_zs_2(v0, v1, v2, v3, v4, v5, v6) -> null_cond_merge_ys_zs_2 [0] And the following fresh constants: null_leq#2, null_map#2, null_halve#1, null_length#1, null_dc#1, null_take#2, null_drop#2, null_const_f#2, null_merge#2, null_cond_merge_ys_zs_2, const ---------------------------------------- (10) 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: divide_ys#1(x2, x1) -> Cons(take#2(x1, x2), Cons(drop#2(x1, x2), Nil)) [1] cond_merge_ys_zs_2(True, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x4, merge#2(x3, Cons(x5, x6))) [1] cond_merge_ys_zs_2(False, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x2, merge#2(Cons(x7, x8), x1)) [1] merge#2(Nil, x2) -> x2 [1] merge#2(Cons(x4, x2), Nil) -> Cons(x4, x2) [1] merge#2(Cons(x8, x6), Cons(x4, x2)) -> cond_merge_ys_zs_2(leq#2(x8, x4), Cons(x8, x6), Cons(x4, x2), x8, x6, x4, x2) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x229, Nil)) -> Cons(x229, Nil) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, x33))) -> const_f#2(Cons(x51, Cons(x25, x33)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, x33)), S(halve#1(length#1(x33)))))) [1] drop#2(0, x2) -> x2 [1] drop#2(S(0), Nil) -> bot[1] [1] drop#2(S(x10), Cons(x56, x64)) -> drop#2(x10, x64) [1] take#2(0, x2) -> Nil [1] take#2(S(0), Nil) -> Cons(bot[0], Nil) [1] take#2(S(x22), Cons(x56, x64)) -> Cons(x56, take#2(x22, x64)) [1] halve#1(0) -> 0 [1] halve#1(S(0)) -> S(0) [1] halve#1(S(S(x14))) -> S(halve#1(x14)) [1] const_f#2(x3, Cons(x6, Cons(x4, x2))) -> merge#2(x6, x4) [1] leq#2(0, x16) -> True [1] leq#2(S(x20), 0) -> False [1] leq#2(S(x4), S(x2)) -> leq#2(x4, x2) [1] length#1(Nil) -> 0 [1] length#1(Cons(x6, x8)) -> S(length#1(x8)) [1] map#2(dc(x2, x4, x6, x8, x10), Nil) -> Nil [1] map#2(dc(x6, x8, x10, x12, x14), Cons(x4, x2)) -> Cons(dc#1(x6, x8, x10, x12, x14, x4), map#2(dc(x6, x8, x10, x12, x14), x2)) [1] main(x113) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, x113) [1] leq#2(v0, v1) -> null_leq#2 [0] map#2(v0, v1) -> null_map#2 [0] halve#1(v0) -> null_halve#1 [0] length#1(v0) -> null_length#1 [0] dc#1(v0, v1, v2, v3, v4, v5) -> null_dc#1 [0] take#2(v0, v1) -> null_take#2 [0] drop#2(v0, v1) -> null_drop#2 [0] const_f#2(v0, v1) -> null_const_f#2 [0] merge#2(v0, v1) -> null_merge#2 [0] cond_merge_ys_zs_2(v0, v1, v2, v3, v4, v5, v6) -> null_cond_merge_ys_zs_2 [0] The TRS has the following type information: divide_ys#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 Cons :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 take#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 drop#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 Nil :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 cond_merge_ys_zs_2 :: True:False:null_leq#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 True :: True:False:null_leq#2 merge#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 False :: True:False:null_leq#2 leq#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> True:False:null_leq#2 dc#1 :: map -> divisible -> mergesort_zs_3 -> divide -> const_f -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 map :: map divisible :: divisible mergesort_zs_3 :: mergesort_zs_3 divide :: divide const_f :: const_f const_f#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 map#2 :: dc -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 dc :: map -> divisible -> mergesort_zs_3 -> divide -> const_f -> dc S :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 halve#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 length#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 0 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 bot[1] :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 bot[0] :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 main :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_leq#2 :: True:False:null_leq#2 null_map#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_halve#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_length#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_dc#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_take#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_drop#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_const_f#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_merge#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_cond_merge_ys_zs_2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 const :: dc Rewrite Strategy: INNERMOST ---------------------------------------- (11) NarrowingProof (BOTH BOUNDS(ID, ID)) Narrowed the inner basic terms of all right-hand sides by a single narrowing step. ---------------------------------------- (12) 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: divide_ys#1(x2, x1) -> Cons(take#2(x1, x2), Cons(drop#2(x1, x2), Nil)) [1] cond_merge_ys_zs_2(True, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x4, merge#2(x3, Cons(x5, x6))) [1] cond_merge_ys_zs_2(False, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x2, merge#2(Cons(x7, x8), x1)) [1] merge#2(Nil, x2) -> x2 [1] merge#2(Cons(x4, x2), Nil) -> Cons(x4, x2) [1] merge#2(Cons(0, x6), Cons(x4, x2)) -> cond_merge_ys_zs_2(True, Cons(0, x6), Cons(x4, x2), 0, x6, x4, x2) [2] merge#2(Cons(S(x20'), x6), Cons(0, x2)) -> cond_merge_ys_zs_2(False, Cons(S(x20'), x6), Cons(0, x2), S(x20'), x6, 0, x2) [2] merge#2(Cons(S(x4'), x6), Cons(S(x2'), x2)) -> cond_merge_ys_zs_2(leq#2(x4', x2'), Cons(S(x4'), x6), Cons(S(x2'), x2), S(x4'), x6, S(x2'), x2) [2] merge#2(Cons(x8, x6), Cons(x4, x2)) -> cond_merge_ys_zs_2(null_leq#2, Cons(x8, x6), Cons(x4, x2), x8, x6, x4, x2) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x229, Nil)) -> Cons(x229, Nil) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, Nil))) -> const_f#2(Cons(x51, Cons(x25, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, Nil)), S(halve#1(0))))) [2] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, Cons(x6', x8')))) -> const_f#2(Cons(x51, Cons(x25, Cons(x6', x8'))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, Cons(x6', x8'))), S(halve#1(S(length#1(x8'))))))) [2] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, x33))) -> const_f#2(Cons(x51, Cons(x25, x33)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, x33)), S(halve#1(null_length#1))))) [1] drop#2(0, x2) -> x2 [1] drop#2(S(0), Nil) -> bot[1] [1] drop#2(S(x10), Cons(x56, x64)) -> drop#2(x10, x64) [1] take#2(0, x2) -> Nil [1] take#2(S(0), Nil) -> Cons(bot[0], Nil) [1] take#2(S(x22), Cons(x56, x64)) -> Cons(x56, take#2(x22, x64)) [1] halve#1(0) -> 0 [1] halve#1(S(0)) -> S(0) [1] halve#1(S(S(x14))) -> S(halve#1(x14)) [1] const_f#2(x3, Cons(x6, Cons(x4, x2))) -> merge#2(x6, x4) [1] leq#2(0, x16) -> True [1] leq#2(S(x20), 0) -> False [1] leq#2(S(x4), S(x2)) -> leq#2(x4, x2) [1] length#1(Nil) -> 0 [1] length#1(Cons(x6, x8)) -> S(length#1(x8)) [1] map#2(dc(x2, x4, x6, x8, x10), Nil) -> Nil [1] map#2(dc(x6, x8, x10, x12, x14), Cons(x4, x2)) -> Cons(dc#1(x6, x8, x10, x12, x14, x4), map#2(dc(x6, x8, x10, x12, x14), x2)) [1] main(x113) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, x113) [1] leq#2(v0, v1) -> null_leq#2 [0] map#2(v0, v1) -> null_map#2 [0] halve#1(v0) -> null_halve#1 [0] length#1(v0) -> null_length#1 [0] dc#1(v0, v1, v2, v3, v4, v5) -> null_dc#1 [0] take#2(v0, v1) -> null_take#2 [0] drop#2(v0, v1) -> null_drop#2 [0] const_f#2(v0, v1) -> null_const_f#2 [0] merge#2(v0, v1) -> null_merge#2 [0] cond_merge_ys_zs_2(v0, v1, v2, v3, v4, v5, v6) -> null_cond_merge_ys_zs_2 [0] The TRS has the following type information: divide_ys#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 Cons :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 take#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 drop#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 Nil :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 cond_merge_ys_zs_2 :: True:False:null_leq#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 True :: True:False:null_leq#2 merge#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 False :: True:False:null_leq#2 leq#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> True:False:null_leq#2 dc#1 :: map -> divisible -> mergesort_zs_3 -> divide -> const_f -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 map :: map divisible :: divisible mergesort_zs_3 :: mergesort_zs_3 divide :: divide const_f :: const_f const_f#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 map#2 :: dc -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 dc :: map -> divisible -> mergesort_zs_3 -> divide -> const_f -> dc S :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 halve#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 length#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 0 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 bot[1] :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 bot[0] :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 main :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_leq#2 :: True:False:null_leq#2 null_map#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_halve#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_length#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_dc#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_take#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_drop#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_const_f#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_merge#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 null_cond_merge_ys_zs_2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_map#2:null_halve#1:null_length#1:null_dc#1:null_take#2:null_drop#2:null_const_f#2:null_merge#2:null_cond_merge_ys_zs_2 const :: dc Rewrite Strategy: INNERMOST ---------------------------------------- (13) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: Nil => 1 True => 2 False => 1 map => 0 divisible => 0 mergesort_zs_3 => 0 divide => 0 const_f => 0 0 => 0 bot[1] => 3 bot[0] => 2 null_leq#2 => 0 null_map#2 => 0 null_halve#1 => 0 null_length#1 => 0 null_dc#1 => 0 null_take#2 => 0 null_drop#2 => 0 null_const_f#2 => 0 null_merge#2 => 0 null_cond_merge_ys_zs_2 => 0 const => 0 ---------------------------------------- (14) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z1 = v3, v0 >= 0, v6 >= 0, z'' = v2, v1 >= 0, v5 >= 0, z = v0, z' = v1, z2 = v4, v2 >= 0, v3 >= 0, z3 = v5, v4 >= 0, z4 = v6 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + x2 + merge#2(1 + x7 + x8, x1) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, x3 >= 0, x2 >= 0, z1 = x4, z2 = x3, z3 = x2, z4 = x1, x4 >= 0, x1 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + x4 + merge#2(x3, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, x3 >= 0, x2 >= 0, z = 2, z1 = x4, z2 = x3, z3 = x2, z4 = x1, x4 >= 0, x1 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), z = x3, x6 >= 0, x3 >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z1 = v3, z3 = v5, v0 >= 0, v4 >= 0, z'' = v2, v1 >= 0, v5 >= 0, z = v0, z' = v1, z2 = v4, v2 >= 0, v3 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + x229 + 1 :|: z'' = 0, z1 = 0, z2 = 0, x229 >= 0, z = 0, z' = 0, z3 = 1 + x229 + 1 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(x1, x2) + (1 + drop#2(x1, x2) + 1) :|: x1 >= 0, z = x2, z' = x1, x2 >= 0 drop#2(z, z') -{ 1 }-> x2 :|: z' = x2, z = 0, x2 >= 0 drop#2(z, z') -{ 1 }-> drop#2(x10, x64) :|: z' = 1 + x56 + x64, z = 1 + x10, x10 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 halve#1(z) -{ 1 }-> 1 + halve#1(x14) :|: z = 1 + (1 + x14), x14 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 1 }-> leq#2(x4, x2) :|: x4 >= 0, z' = 1 + x2, z = 1 + x4, x2 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z' = x16, z = 0, x16 >= 0 leq#2(z, z') -{ 1 }-> 1 :|: x20 >= 0, z = 1 + x20, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, x113) :|: z = x113, x113 >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> x2 :|: z' = x2, z = 1, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(leq#2(x4', x2'), 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + x6, 1 + x4 + x2, 0, x6, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z = 1 + 0 + x6, x6 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + x2, 1 + x20', x6, 0, x2) :|: z = 1 + (1 + x20') + x6, x6 >= 0, z' = 1 + 0 + x2, x20' >= 0, x2 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z' = x2, z = 0, x2 >= 0 take#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(x22, x64) :|: z' = 1 + x56 + x64, x22 >= 0, z = 1 + x22, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 ---------------------------------------- (15) SimplificationProof (BOTH BOUNDS(ID, ID)) Simplified the RNTS by moving equalities from the constraints into the right-hand sides. ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(z', z) + (1 + drop#2(z', z) + 1) :|: z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 1 }-> leq#2(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(leq#2(x4', x2'), 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 ---------------------------------------- (17) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID)) Found the following analysis order by SCC decomposition: { leq#2 } { take#2 } { halve#1 } { length#1 } { drop#2 } { merge#2, cond_merge_ys_zs_2 } { divide_ys#1 } { const_f#2 } { dc#1, map#2 } { main } ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(z', z) + (1 + drop#2(z', z) + 1) :|: z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 1 }-> leq#2(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(leq#2(x4', x2'), 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {leq#2}, {take#2}, {halve#1}, {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} ---------------------------------------- (19) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (20) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(z', z) + (1 + drop#2(z', z) + 1) :|: z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 1 }-> leq#2(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(leq#2(x4', x2'), 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {leq#2}, {take#2}, {halve#1}, {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} ---------------------------------------- (21) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: leq#2 after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 2 ---------------------------------------- (22) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(z', z) + (1 + drop#2(z', z) + 1) :|: z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 1 }-> leq#2(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(leq#2(x4', x2'), 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {leq#2}, {take#2}, {halve#1}, {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: ?, size: O(1) [2] ---------------------------------------- (23) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using KoAT for: leq#2 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 2 + z' ---------------------------------------- (24) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(z', z) + (1 + drop#2(z', z) + 1) :|: z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 1 }-> leq#2(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(leq#2(x4', x2'), 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {take#2}, {halve#1}, {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] ---------------------------------------- (25) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (26) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(z', z) + (1 + drop#2(z', z) + 1) :|: z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {take#2}, {halve#1}, {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] ---------------------------------------- (27) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: take#2 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 4 + z' ---------------------------------------- (28) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(z', z) + (1 + drop#2(z', z) + 1) :|: z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {take#2}, {halve#1}, {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: ?, size: O(n^1) [4 + z'] ---------------------------------------- (29) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using KoAT for: take#2 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 2 + z' ---------------------------------------- (30) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(z', z) + (1 + drop#2(z', z) + 1) :|: z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {halve#1}, {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] ---------------------------------------- (31) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (32) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 3 + z }-> 1 + s'' + (1 + drop#2(z', z) + 1) :|: s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {halve#1}, {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] ---------------------------------------- (33) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: halve#1 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 1 + z ---------------------------------------- (34) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 3 + z }-> 1 + s'' + (1 + drop#2(z', z) + 1) :|: s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {halve#1}, {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: ?, size: O(n^1) [1 + z] ---------------------------------------- (35) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: halve#1 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 2 + z ---------------------------------------- (36) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(0)))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + halve#1(0)))) :|: z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 3 + z }-> 1 + s'' + (1 + drop#2(z', z) + 1) :|: s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 }-> 1 + halve#1(z - 2) :|: z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] ---------------------------------------- (37) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (38) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 3 + z }-> 1 + s'' + (1 + drop#2(z', z) + 1) :|: s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] ---------------------------------------- (39) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: length#1 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z ---------------------------------------- (40) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 3 + z }-> 1 + s'' + (1 + drop#2(z', z) + 1) :|: s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {length#1}, {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: ?, size: O(n^1) [z] ---------------------------------------- (41) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using KoAT for: length#1 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 1 + z ---------------------------------------- (42) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 2 }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + halve#1(1 + length#1(x8'))))) :|: z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 3 + z }-> 1 + s'' + (1 + drop#2(z', z) + 1) :|: s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] ---------------------------------------- (43) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (44) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 6 + s5 + x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + s6))) :|: s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 3 + z }-> 1 + s'' + (1 + drop#2(z', z) + 1) :|: s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] ---------------------------------------- (45) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: drop#2 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 2 + z' ---------------------------------------- (46) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 6 + s5 + x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + s6))) :|: s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 3 + z }-> 1 + s'' + (1 + drop#2(z', z) + 1) :|: s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {drop#2}, {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: ?, size: O(n^1) [2 + z'] ---------------------------------------- (47) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using KoAT for: drop#2 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 2 + z' ---------------------------------------- (48) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 6 + s5 + x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + s6))) :|: s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 3 + z }-> 1 + s'' + (1 + drop#2(z', z) + 1) :|: s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> drop#2(z - 1, x64) :|: z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] ---------------------------------------- (49) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (50) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 6 + s5 + x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + s6))) :|: s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] ---------------------------------------- (51) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: merge#2 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 1 + z + z' Computed SIZE bound using CoFloCo for: cond_merge_ys_zs_2 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 2 + z' + z'' + z1 + z2 + z3 + z4 ---------------------------------------- (52) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 6 + s5 + x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + s6))) :|: s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {merge#2,cond_merge_ys_zs_2}, {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: ?, size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: ?, size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] ---------------------------------------- (53) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: merge#2 after applying outer abstraction to obtain an ITS, resulting in: O(n^2) with polynomial bound: 11 + 5*z + z*z' + 12*z' + 2*z'^2 Computed RUNTIME bound using KoAT for: cond_merge_ys_zs_2 after applying outer abstraction to obtain an ITS, resulting in: O(n^2) with polynomial bound: 43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2 ---------------------------------------- (54) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z1 + merge#2(z2, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + z3 + merge#2(1 + x7 + x8, z4) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 6 + s5 + x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + s6))) :|: s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 4 + x2' }-> cond_merge_ys_zs_2(s, 1 + (1 + x4') + x6, 1 + (1 + x2') + x2, 1 + x4', x6, 1 + x2', x2) :|: s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(2, 1 + 0 + (z - 1), 1 + x4 + x2, 0, z - 1, x4, x2) :|: x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 2 }-> cond_merge_ys_zs_2(1, 1 + (1 + x20') + x6, 1 + 0 + (z' - 1), 1 + x20', x6, 0, z' - 1) :|: z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(0, 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] ---------------------------------------- (55) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (56) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 26 + 16*x5 + 4*x5*x6 + x5*z2 + 2*x5^2 + 16*x6 + x6*z2 + 2*x6^2 + 6*z2 }-> 1 + z1 + s10 :|: s10 >= 0, s10 <= 1 + x5 + x6 + z2 + 1, x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 17 + 5*x7 + x7*z4 + 5*x8 + x8*z4 + 13*z4 + 2*z4^2 }-> 1 + z3 + s11 :|: s11 >= 0, s11 <= z4 + (1 + x7 + x8) + 1, x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 12 + 12*x4 + x4*x6 + 2*x4^2 + 5*x6 }-> s16 :|: s16 >= 0, s16 <= x4 + x6 + 1, x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 6 + s5 + x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + s6))) :|: s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 77 + 59*x2 + 16*x2*x4 + 4*x2*z + 10*x2^2 + 46*x4 + 2*x4*z + 8*x4^2 + 18*z }-> s12 :|: s12 >= 0, s12 <= 1 + x4 + x2 + 0 + (z - 1) + 2 + (1 + 0 + (z - 1)) + x4 + x2, x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 50 + 8*x20' + 2*x20'*z' + 14*x6 + 4*x6*z' + 45*z' + 10*z'^2 }-> s13 :|: s13 >= 0, s13 <= 1 + 0 + (z' - 1) + (1 + x20') + x6 + 2 + (1 + (1 + x20') + x6) + 0 + (z' - 1), z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 163 + 81*x2 + 16*x2*x2' + 2*x2*x4' + 4*x2*x6 + 10*x2^2 + 65*x2' + 2*x2'*x6 + 8*x2'^2 + 10*x4' + 20*x6 }-> s14 :|: s14 >= 0, s14 <= 1 + (1 + x2') + x2 + (1 + x4') + x6 + 2 + (1 + (1 + x4') + x6) + (1 + x2') + x2, s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 94 + 63*x2 + 16*x2*x4 + 4*x2*x6 + 2*x2*x8 + 10*x2^2 + 48*x4 + 2*x4*x6 + 8*x4^2 + 18*x6 + 10*x8 }-> s15 :|: s15 >= 0, s15 <= 1 + x4 + x2 + x8 + x6 + 2 + (1 + x8 + x6) + x4 + x2, x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] ---------------------------------------- (57) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: divide_ys#1 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 9 + 2*z ---------------------------------------- (58) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 26 + 16*x5 + 4*x5*x6 + x5*z2 + 2*x5^2 + 16*x6 + x6*z2 + 2*x6^2 + 6*z2 }-> 1 + z1 + s10 :|: s10 >= 0, s10 <= 1 + x5 + x6 + z2 + 1, x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 17 + 5*x7 + x7*z4 + 5*x8 + x8*z4 + 13*z4 + 2*z4^2 }-> 1 + z3 + s11 :|: s11 >= 0, s11 <= z4 + (1 + x7 + x8) + 1, x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 12 + 12*x4 + x4*x6 + 2*x4^2 + 5*x6 }-> s16 :|: s16 >= 0, s16 <= x4 + x6 + 1, x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 6 + s5 + x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + s6))) :|: s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 77 + 59*x2 + 16*x2*x4 + 4*x2*z + 10*x2^2 + 46*x4 + 2*x4*z + 8*x4^2 + 18*z }-> s12 :|: s12 >= 0, s12 <= 1 + x4 + x2 + 0 + (z - 1) + 2 + (1 + 0 + (z - 1)) + x4 + x2, x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 50 + 8*x20' + 2*x20'*z' + 14*x6 + 4*x6*z' + 45*z' + 10*z'^2 }-> s13 :|: s13 >= 0, s13 <= 1 + 0 + (z' - 1) + (1 + x20') + x6 + 2 + (1 + (1 + x20') + x6) + 0 + (z' - 1), z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 163 + 81*x2 + 16*x2*x2' + 2*x2*x4' + 4*x2*x6 + 10*x2^2 + 65*x2' + 2*x2'*x6 + 8*x2'^2 + 10*x4' + 20*x6 }-> s14 :|: s14 >= 0, s14 <= 1 + (1 + x2') + x2 + (1 + x4') + x6 + 2 + (1 + (1 + x4') + x6) + (1 + x2') + x2, s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 94 + 63*x2 + 16*x2*x4 + 4*x2*x6 + 2*x2*x8 + 10*x2^2 + 48*x4 + 2*x4*x6 + 8*x4^2 + 18*x6 + 10*x8 }-> s15 :|: s15 >= 0, s15 <= 1 + x4 + x2 + x8 + x6 + 2 + (1 + x8 + x6) + x4 + x2, x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {divide_ys#1}, {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] divide_ys#1: runtime: ?, size: O(n^1) [9 + 2*z] ---------------------------------------- (59) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: divide_ys#1 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 5 + 2*z ---------------------------------------- (60) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 26 + 16*x5 + 4*x5*x6 + x5*z2 + 2*x5^2 + 16*x6 + x6*z2 + 2*x6^2 + 6*z2 }-> 1 + z1 + s10 :|: s10 >= 0, s10 <= 1 + x5 + x6 + z2 + 1, x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 17 + 5*x7 + x7*z4 + 5*x8 + x8*z4 + 13*z4 + 2*z4^2 }-> 1 + z3 + s11 :|: s11 >= 0, s11 <= z4 + (1 + x7 + x8) + 1, x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 12 + 12*x4 + x4*x6 + 2*x4^2 + 5*x6 }-> s16 :|: s16 >= 0, s16 <= x4 + x6 + 1, x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 3 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + s3))) :|: s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 4 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + 1), 1 + s2))) :|: s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 6 + s5 + x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + (1 + x6' + x8')), 1 + s6))) :|: s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 77 + 59*x2 + 16*x2*x4 + 4*x2*z + 10*x2^2 + 46*x4 + 2*x4*z + 8*x4^2 + 18*z }-> s12 :|: s12 >= 0, s12 <= 1 + x4 + x2 + 0 + (z - 1) + 2 + (1 + 0 + (z - 1)) + x4 + x2, x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 50 + 8*x20' + 2*x20'*z' + 14*x6 + 4*x6*z' + 45*z' + 10*z'^2 }-> s13 :|: s13 >= 0, s13 <= 1 + 0 + (z' - 1) + (1 + x20') + x6 + 2 + (1 + (1 + x20') + x6) + 0 + (z' - 1), z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 163 + 81*x2 + 16*x2*x2' + 2*x2*x4' + 4*x2*x6 + 10*x2^2 + 65*x2' + 2*x2'*x6 + 8*x2'^2 + 10*x4' + 20*x6 }-> s14 :|: s14 >= 0, s14 <= 1 + (1 + x2') + x2 + (1 + x4') + x6 + 2 + (1 + (1 + x4') + x6) + (1 + x2') + x2, s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 94 + 63*x2 + 16*x2*x4 + 4*x2*x6 + 2*x2*x8 + 10*x2^2 + 48*x4 + 2*x4*x6 + 8*x4^2 + 18*x6 + 10*x8 }-> s15 :|: s15 >= 0, s15 <= 1 + x4 + x2 + x8 + x6 + 2 + (1 + x8 + x6) + x4 + x2, x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] divide_ys#1: runtime: O(n^1) [5 + 2*z], size: O(n^1) [9 + 2*z] ---------------------------------------- (61) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (62) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 26 + 16*x5 + 4*x5*x6 + x5*z2 + 2*x5^2 + 16*x6 + x6*z2 + 2*x6^2 + 6*z2 }-> 1 + z1 + s10 :|: s10 >= 0, s10 <= 1 + x5 + x6 + z2 + 1, x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 17 + 5*x7 + x7*z4 + 5*x8 + x8*z4 + 13*z4 + 2*z4^2 }-> 1 + z3 + s11 :|: s11 >= 0, s11 <= z4 + (1 + x7 + x8) + 1, x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 12 + 12*x4 + x4*x6 + 2*x4^2 + 5*x6 }-> s16 :|: s16 >= 0, s16 <= x4 + x6 + 1, x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 12 + 2*x25 + 2*x33 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, s19)) :|: s19 >= 0, s19 <= 2 * (1 + x51 + (1 + x25 + x33)) + 9, s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 15 + 2*x25 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, s17)) :|: s17 >= 0, s17 <= 2 * (1 + x51 + (1 + x25 + 1)) + 9, s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 17 + s5 + 2*x25 + 2*x51 + 2*x6' + 3*x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, s18)) :|: s18 >= 0, s18 <= 2 * (1 + x51 + (1 + x25 + (1 + x6' + x8'))) + 9, s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 77 + 59*x2 + 16*x2*x4 + 4*x2*z + 10*x2^2 + 46*x4 + 2*x4*z + 8*x4^2 + 18*z }-> s12 :|: s12 >= 0, s12 <= 1 + x4 + x2 + 0 + (z - 1) + 2 + (1 + 0 + (z - 1)) + x4 + x2, x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 50 + 8*x20' + 2*x20'*z' + 14*x6 + 4*x6*z' + 45*z' + 10*z'^2 }-> s13 :|: s13 >= 0, s13 <= 1 + 0 + (z' - 1) + (1 + x20') + x6 + 2 + (1 + (1 + x20') + x6) + 0 + (z' - 1), z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 163 + 81*x2 + 16*x2*x2' + 2*x2*x4' + 4*x2*x6 + 10*x2^2 + 65*x2' + 2*x2'*x6 + 8*x2'^2 + 10*x4' + 20*x6 }-> s14 :|: s14 >= 0, s14 <= 1 + (1 + x2') + x2 + (1 + x4') + x6 + 2 + (1 + (1 + x4') + x6) + (1 + x2') + x2, s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 94 + 63*x2 + 16*x2*x4 + 4*x2*x6 + 2*x2*x8 + 10*x2^2 + 48*x4 + 2*x4*x6 + 8*x4^2 + 18*x6 + 10*x8 }-> s15 :|: s15 >= 0, s15 <= 1 + x4 + x2 + x8 + x6 + 2 + (1 + x8 + x6) + x4 + x2, x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] divide_ys#1: runtime: O(n^1) [5 + 2*z], size: O(n^1) [9 + 2*z] ---------------------------------------- (63) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: const_f#2 after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z' ---------------------------------------- (64) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 26 + 16*x5 + 4*x5*x6 + x5*z2 + 2*x5^2 + 16*x6 + x6*z2 + 2*x6^2 + 6*z2 }-> 1 + z1 + s10 :|: s10 >= 0, s10 <= 1 + x5 + x6 + z2 + 1, x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 17 + 5*x7 + x7*z4 + 5*x8 + x8*z4 + 13*z4 + 2*z4^2 }-> 1 + z3 + s11 :|: s11 >= 0, s11 <= z4 + (1 + x7 + x8) + 1, x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 12 + 12*x4 + x4*x6 + 2*x4^2 + 5*x6 }-> s16 :|: s16 >= 0, s16 <= x4 + x6 + 1, x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 12 + 2*x25 + 2*x33 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, s19)) :|: s19 >= 0, s19 <= 2 * (1 + x51 + (1 + x25 + x33)) + 9, s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 15 + 2*x25 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, s17)) :|: s17 >= 0, s17 <= 2 * (1 + x51 + (1 + x25 + 1)) + 9, s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 17 + s5 + 2*x25 + 2*x51 + 2*x6' + 3*x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, s18)) :|: s18 >= 0, s18 <= 2 * (1 + x51 + (1 + x25 + (1 + x6' + x8'))) + 9, s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 77 + 59*x2 + 16*x2*x4 + 4*x2*z + 10*x2^2 + 46*x4 + 2*x4*z + 8*x4^2 + 18*z }-> s12 :|: s12 >= 0, s12 <= 1 + x4 + x2 + 0 + (z - 1) + 2 + (1 + 0 + (z - 1)) + x4 + x2, x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 50 + 8*x20' + 2*x20'*z' + 14*x6 + 4*x6*z' + 45*z' + 10*z'^2 }-> s13 :|: s13 >= 0, s13 <= 1 + 0 + (z' - 1) + (1 + x20') + x6 + 2 + (1 + (1 + x20') + x6) + 0 + (z' - 1), z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 163 + 81*x2 + 16*x2*x2' + 2*x2*x4' + 4*x2*x6 + 10*x2^2 + 65*x2' + 2*x2'*x6 + 8*x2'^2 + 10*x4' + 20*x6 }-> s14 :|: s14 >= 0, s14 <= 1 + (1 + x2') + x2 + (1 + x4') + x6 + 2 + (1 + (1 + x4') + x6) + (1 + x2') + x2, s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 94 + 63*x2 + 16*x2*x4 + 4*x2*x6 + 2*x2*x8 + 10*x2^2 + 48*x4 + 2*x4*x6 + 8*x4^2 + 18*x6 + 10*x8 }-> s15 :|: s15 >= 0, s15 <= 1 + x4 + x2 + x8 + x6 + 2 + (1 + x8 + x6) + x4 + x2, x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {const_f#2}, {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] divide_ys#1: runtime: O(n^1) [5 + 2*z], size: O(n^1) [9 + 2*z] const_f#2: runtime: ?, size: O(n^1) [z'] ---------------------------------------- (65) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using KoAT for: const_f#2 after applying outer abstraction to obtain an ITS, resulting in: O(n^2) with polynomial bound: 12 + 17*z' + 3*z'^2 ---------------------------------------- (66) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 26 + 16*x5 + 4*x5*x6 + x5*z2 + 2*x5^2 + 16*x6 + x6*z2 + 2*x6^2 + 6*z2 }-> 1 + z1 + s10 :|: s10 >= 0, s10 <= 1 + x5 + x6 + z2 + 1, x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 17 + 5*x7 + x7*z4 + 5*x8 + x8*z4 + 13*z4 + 2*z4^2 }-> 1 + z3 + s11 :|: s11 >= 0, s11 <= z4 + (1 + x7 + x8) + 1, x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 12 + 12*x4 + x4*x6 + 2*x4^2 + 5*x6 }-> s16 :|: s16 >= 0, s16 <= x4 + x6 + 1, x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 12 + 2*x25 + 2*x33 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, s19)) :|: s19 >= 0, s19 <= 2 * (1 + x51 + (1 + x25 + x33)) + 9, s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 15 + 2*x25 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, s17)) :|: s17 >= 0, s17 <= 2 * (1 + x51 + (1 + x25 + 1)) + 9, s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 17 + s5 + 2*x25 + 2*x51 + 2*x6' + 3*x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, s18)) :|: s18 >= 0, s18 <= 2 * (1 + x51 + (1 + x25 + (1 + x6' + x8'))) + 9, s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 77 + 59*x2 + 16*x2*x4 + 4*x2*z + 10*x2^2 + 46*x4 + 2*x4*z + 8*x4^2 + 18*z }-> s12 :|: s12 >= 0, s12 <= 1 + x4 + x2 + 0 + (z - 1) + 2 + (1 + 0 + (z - 1)) + x4 + x2, x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 50 + 8*x20' + 2*x20'*z' + 14*x6 + 4*x6*z' + 45*z' + 10*z'^2 }-> s13 :|: s13 >= 0, s13 <= 1 + 0 + (z' - 1) + (1 + x20') + x6 + 2 + (1 + (1 + x20') + x6) + 0 + (z' - 1), z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 163 + 81*x2 + 16*x2*x2' + 2*x2*x4' + 4*x2*x6 + 10*x2^2 + 65*x2' + 2*x2'*x6 + 8*x2'^2 + 10*x4' + 20*x6 }-> s14 :|: s14 >= 0, s14 <= 1 + (1 + x2') + x2 + (1 + x4') + x6 + 2 + (1 + (1 + x4') + x6) + (1 + x2') + x2, s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 94 + 63*x2 + 16*x2*x4 + 4*x2*x6 + 2*x2*x8 + 10*x2^2 + 48*x4 + 2*x4*x6 + 8*x4^2 + 18*x6 + 10*x8 }-> s15 :|: s15 >= 0, s15 <= 1 + x4 + x2 + x8 + x6 + 2 + (1 + x8 + x6) + x4 + x2, x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] divide_ys#1: runtime: O(n^1) [5 + 2*z], size: O(n^1) [9 + 2*z] const_f#2: runtime: O(n^2) [12 + 17*z' + 3*z'^2], size: O(n^1) [z'] ---------------------------------------- (67) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (68) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 26 + 16*x5 + 4*x5*x6 + x5*z2 + 2*x5^2 + 16*x6 + x6*z2 + 2*x6^2 + 6*z2 }-> 1 + z1 + s10 :|: s10 >= 0, s10 <= 1 + x5 + x6 + z2 + 1, x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 17 + 5*x7 + x7*z4 + 5*x8 + x8*z4 + 13*z4 + 2*z4^2 }-> 1 + z3 + s11 :|: s11 >= 0, s11 <= z4 + (1 + x7 + x8) + 1, x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 12 + 12*x4 + x4*x6 + 2*x4^2 + 5*x6 }-> s16 :|: s16 >= 0, s16 <= x4 + x6 + 1, x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 12 + 2*x25 + 2*x33 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, s19)) :|: s19 >= 0, s19 <= 2 * (1 + x51 + (1 + x25 + x33)) + 9, s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 15 + 2*x25 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, s17)) :|: s17 >= 0, s17 <= 2 * (1 + x51 + (1 + x25 + 1)) + 9, s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 17 + s5 + 2*x25 + 2*x51 + 2*x6' + 3*x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, s18)) :|: s18 >= 0, s18 <= 2 * (1 + x51 + (1 + x25 + (1 + x6' + x8'))) + 9, s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 77 + 59*x2 + 16*x2*x4 + 4*x2*z + 10*x2^2 + 46*x4 + 2*x4*z + 8*x4^2 + 18*z }-> s12 :|: s12 >= 0, s12 <= 1 + x4 + x2 + 0 + (z - 1) + 2 + (1 + 0 + (z - 1)) + x4 + x2, x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 50 + 8*x20' + 2*x20'*z' + 14*x6 + 4*x6*z' + 45*z' + 10*z'^2 }-> s13 :|: s13 >= 0, s13 <= 1 + 0 + (z' - 1) + (1 + x20') + x6 + 2 + (1 + (1 + x20') + x6) + 0 + (z' - 1), z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 163 + 81*x2 + 16*x2*x2' + 2*x2*x4' + 4*x2*x6 + 10*x2^2 + 65*x2' + 2*x2'*x6 + 8*x2'^2 + 10*x4' + 20*x6 }-> s14 :|: s14 >= 0, s14 <= 1 + (1 + x2') + x2 + (1 + x4') + x6 + 2 + (1 + (1 + x4') + x6) + (1 + x2') + x2, s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 94 + 63*x2 + 16*x2*x4 + 4*x2*x6 + 2*x2*x8 + 10*x2^2 + 48*x4 + 2*x4*x6 + 8*x4^2 + 18*x6 + 10*x8 }-> s15 :|: s15 >= 0, s15 <= 1 + x4 + x2 + x8 + x6 + 2 + (1 + x8 + x6) + x4 + x2, x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] divide_ys#1: runtime: O(n^1) [5 + 2*z], size: O(n^1) [9 + 2*z] const_f#2: runtime: O(n^2) [12 + 17*z' + 3*z'^2], size: O(n^1) [z'] ---------------------------------------- (69) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: dc#1 after applying outer abstraction to obtain an ITS, resulting in: INF with polynomial bound: ? Computed SIZE bound using CoFloCo for: map#2 after applying outer abstraction to obtain an ITS, resulting in: INF with polynomial bound: ? ---------------------------------------- (70) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 26 + 16*x5 + 4*x5*x6 + x5*z2 + 2*x5^2 + 16*x6 + x6*z2 + 2*x6^2 + 6*z2 }-> 1 + z1 + s10 :|: s10 >= 0, s10 <= 1 + x5 + x6 + z2 + 1, x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 17 + 5*x7 + x7*z4 + 5*x8 + x8*z4 + 13*z4 + 2*z4^2 }-> 1 + z3 + s11 :|: s11 >= 0, s11 <= z4 + (1 + x7 + x8) + 1, x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 12 + 12*x4 + x4*x6 + 2*x4^2 + 5*x6 }-> s16 :|: s16 >= 0, s16 <= x4 + x6 + 1, x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 12 + 2*x25 + 2*x33 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, s19)) :|: s19 >= 0, s19 <= 2 * (1 + x51 + (1 + x25 + x33)) + 9, s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 15 + 2*x25 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, s17)) :|: s17 >= 0, s17 <= 2 * (1 + x51 + (1 + x25 + 1)) + 9, s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 17 + s5 + 2*x25 + 2*x51 + 2*x6' + 3*x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, s18)) :|: s18 >= 0, s18 <= 2 * (1 + x51 + (1 + x25 + (1 + x6' + x8'))) + 9, s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 77 + 59*x2 + 16*x2*x4 + 4*x2*z + 10*x2^2 + 46*x4 + 2*x4*z + 8*x4^2 + 18*z }-> s12 :|: s12 >= 0, s12 <= 1 + x4 + x2 + 0 + (z - 1) + 2 + (1 + 0 + (z - 1)) + x4 + x2, x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 50 + 8*x20' + 2*x20'*z' + 14*x6 + 4*x6*z' + 45*z' + 10*z'^2 }-> s13 :|: s13 >= 0, s13 <= 1 + 0 + (z' - 1) + (1 + x20') + x6 + 2 + (1 + (1 + x20') + x6) + 0 + (z' - 1), z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 163 + 81*x2 + 16*x2*x2' + 2*x2*x4' + 4*x2*x6 + 10*x2^2 + 65*x2' + 2*x2'*x6 + 8*x2'^2 + 10*x4' + 20*x6 }-> s14 :|: s14 >= 0, s14 <= 1 + (1 + x2') + x2 + (1 + x4') + x6 + 2 + (1 + (1 + x4') + x6) + (1 + x2') + x2, s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 94 + 63*x2 + 16*x2*x4 + 4*x2*x6 + 2*x2*x8 + 10*x2^2 + 48*x4 + 2*x4*x6 + 8*x4^2 + 18*x6 + 10*x8 }-> s15 :|: s15 >= 0, s15 <= 1 + x4 + x2 + x8 + x6 + 2 + (1 + x8 + x6) + x4 + x2, x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] divide_ys#1: runtime: O(n^1) [5 + 2*z], size: O(n^1) [9 + 2*z] const_f#2: runtime: O(n^2) [12 + 17*z' + 3*z'^2], size: O(n^1) [z'] dc#1: runtime: ?, size: INF map#2: runtime: ?, size: INF ---------------------------------------- (71) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: dc#1 after applying outer abstraction to obtain an ITS, resulting in: INF with polynomial bound: ? ---------------------------------------- (72) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z >= 0, z4 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0, z2 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 26 + 16*x5 + 4*x5*x6 + x5*z2 + 2*x5^2 + 16*x6 + x6*z2 + 2*x6^2 + 6*z2 }-> 1 + z1 + s10 :|: s10 >= 0, s10 <= 1 + x5 + x6 + z2 + 1, x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z = 2, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 17 + 5*x7 + x7*z4 + 5*x8 + x8*z4 + 13*z4 + 2*z4^2 }-> 1 + z3 + s11 :|: s11 >= 0, s11 <= z4 + (1 + x7 + x8) + 1, x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, z2 >= 0, z3 >= 0, z1 >= 0, z4 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 12 + 12*x4 + x4*x6 + 2*x4^2 + 5*x6 }-> s16 :|: s16 >= 0, s16 <= x4 + x6 + 1, x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), x6 >= 0, z >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 12 + 2*x25 + 2*x33 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, s19)) :|: s19 >= 0, s19 <= 2 * (1 + x51 + (1 + x25 + x33)) + 9, s3 >= 0, s3 <= 0 + 1, z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 15 + 2*x25 + 2*x51 }-> const_f#2(1 + x51 + (1 + x25 + 1), map#2(1 + 0 + 0 + 0 + 0 + 0, s17)) :|: s17 >= 0, s17 <= 2 * (1 + x51 + (1 + x25 + 1)) + 9, s2 >= 0, s2 <= 0 + 1, z'' = 0, z3 = 1 + x51 + (1 + x25 + 1), z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 17 + s5 + 2*x25 + 2*x51 + 2*x6' + 3*x8' }-> const_f#2(1 + x51 + (1 + x25 + (1 + x6' + x8')), map#2(1 + 0 + 0 + 0 + 0 + 0, s18)) :|: s18 >= 0, s18 <= 2 * (1 + x51 + (1 + x25 + (1 + x6' + x8'))) + 9, s5 >= 0, s5 <= x8', s6 >= 0, s6 <= 1 + s5 + 1, z'' = 0, z1 = 0, z2 = 0, x51 >= 0, x25 >= 0, x6' >= 0, z3 = 1 + x51 + (1 + x25 + (1 + x6' + x8')), z = 0, x8' >= 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z >= 0, z2 >= 0, z' >= 0, z3 >= 0, z'' >= 0, z1 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + (z3 - 2) + 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 - 2 >= 0, z = 0, z' = 0 divide_ys#1(z, z') -{ 5 + 2*z }-> 1 + s'' + (1 + s8 + 1) :|: s8 >= 0, s8 <= z + 2, s'' >= 0, s'' <= z + 4, z' >= 0, z >= 0 drop#2(z, z') -{ 3 + x64 }-> s9 :|: s9 >= 0, s9 <= x64 + 2, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> z' :|: z = 0, z' >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: z >= 0 halve#1(z) -{ 1 + z }-> 1 + s4 :|: s4 >= 0, s4 <= z - 2 + 1, z - 2 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: z >= 0 length#1(z) -{ 2 + x8 }-> 1 + s7 :|: s7 >= 0, s7 <= x8, x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 2 + z' }-> s' :|: s' >= 0, s' <= 2, z - 1 >= 0, z' - 1 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z = 0, z' >= 0 leq#2(z, z') -{ 1 }-> 1 :|: z - 1 >= 0, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, z) :|: z >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 77 + 59*x2 + 16*x2*x4 + 4*x2*z + 10*x2^2 + 46*x4 + 2*x4*z + 8*x4^2 + 18*z }-> s12 :|: s12 >= 0, s12 <= 1 + x4 + x2 + 0 + (z - 1) + 2 + (1 + 0 + (z - 1)) + x4 + x2, x4 >= 0, z' = 1 + x4 + x2, z - 1 >= 0, x2 >= 0 merge#2(z, z') -{ 50 + 8*x20' + 2*x20'*z' + 14*x6 + 4*x6*z' + 45*z' + 10*z'^2 }-> s13 :|: s13 >= 0, s13 <= 1 + 0 + (z' - 1) + (1 + x20') + x6 + 2 + (1 + (1 + x20') + x6) + 0 + (z' - 1), z = 1 + (1 + x20') + x6, x6 >= 0, x20' >= 0, z' - 1 >= 0 merge#2(z, z') -{ 163 + 81*x2 + 16*x2*x2' + 2*x2*x4' + 4*x2*x6 + 10*x2^2 + 65*x2' + 2*x2'*x6 + 8*x2'^2 + 10*x4' + 20*x6 }-> s14 :|: s14 >= 0, s14 <= 1 + (1 + x2') + x2 + (1 + x4') + x6 + 2 + (1 + (1 + x4') + x6) + (1 + x2') + x2, s >= 0, s <= 2, x2' >= 0, z = 1 + (1 + x4') + x6, x6 >= 0, z' = 1 + (1 + x2') + x2, x4' >= 0, x2 >= 0 merge#2(z, z') -{ 94 + 63*x2 + 16*x2*x4 + 4*x2*x6 + 2*x2*x8 + 10*x2^2 + 48*x4 + 2*x4*x6 + 8*x4^2 + 18*x6 + 10*x8 }-> s15 :|: s15 >= 0, s15 <= 1 + x4 + x2 + x8 + x6 + 2 + (1 + x8 + x6) + x4 + x2, x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 1 }-> z' :|: z = 1, z' >= 0 merge#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z = 0, z' >= 0 take#2(z, z') -{ 0 }-> 0 :|: z >= 0, z' >= 0 take#2(z, z') -{ 3 + x64 }-> 1 + x56 + s1 :|: s1 >= 0, s1 <= x64 + 4, z' = 1 + x56 + x64, z - 1 >= 0, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Function symbols to be analyzed: {dc#1,map#2}, {main} Previous analysis results are: leq#2: runtime: O(n^1) [2 + z'], size: O(1) [2] take#2: runtime: O(n^1) [2 + z'], size: O(n^1) [4 + z'] halve#1: runtime: O(n^1) [2 + z], size: O(n^1) [1 + z] length#1: runtime: O(n^1) [1 + z], size: O(n^1) [z] drop#2: runtime: O(n^1) [2 + z'], size: O(n^1) [2 + z'] merge#2: runtime: O(n^2) [11 + 5*z + z*z' + 12*z' + 2*z'^2], size: O(n^1) [1 + z + z'] cond_merge_ys_zs_2: runtime: O(n^2) [43 + 10*z' + 2*z'*z4 + 32*z'' + 2*z''*z2 + 8*z''^2 + 6*z2 + 13*z4 + 2*z4^2], size: O(n^1) [2 + z' + z'' + z1 + z2 + z3 + z4] divide_ys#1: runtime: O(n^1) [5 + 2*z], size: O(n^1) [9 + 2*z] const_f#2: runtime: O(n^2) [12 + 17*z' + 3*z'^2], size: O(n^1) [z'] dc#1: runtime: INF, size: INF map#2: runtime: ?, size: INF ---------------------------------------- (73) 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: cond_merge_ys_zs_2(v0, v1, v2, v3, v4, v5, v6) -> null_cond_merge_ys_zs_2 [0] merge#2(v0, v1) -> null_merge#2 [0] dc#1(v0, v1, v2, v3, v4, v5) -> null_dc#1 [0] drop#2(v0, v1) -> null_drop#2 [0] take#2(v0, v1) -> null_take#2 [0] halve#1(v0) -> null_halve#1 [0] const_f#2(v0, v1) -> null_const_f#2 [0] leq#2(v0, v1) -> null_leq#2 [0] length#1(v0) -> null_length#1 [0] map#2(v0, v1) -> null_map#2 [0] And the following fresh constants: null_cond_merge_ys_zs_2, null_merge#2, null_dc#1, null_drop#2, null_take#2, null_halve#1, null_const_f#2, null_leq#2, null_length#1, null_map#2, const ---------------------------------------- (74) 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: divide_ys#1(x2, x1) -> Cons(take#2(x1, x2), Cons(drop#2(x1, x2), Nil)) [1] cond_merge_ys_zs_2(True, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x4, merge#2(x3, Cons(x5, x6))) [1] cond_merge_ys_zs_2(False, Cons(x7, x8), Cons(x5, x6), x4, x3, x2, x1) -> Cons(x2, merge#2(Cons(x7, x8), x1)) [1] merge#2(Nil, x2) -> x2 [1] merge#2(Cons(x4, x2), Nil) -> Cons(x4, x2) [1] merge#2(Cons(x8, x6), Cons(x4, x2)) -> cond_merge_ys_zs_2(leq#2(x8, x4), Cons(x8, x6), Cons(x4, x2), x8, x6, x4, x2) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x229, Nil)) -> Cons(x229, Nil) [1] dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x51, Cons(x25, x33))) -> const_f#2(Cons(x51, Cons(x25, x33)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x51, Cons(x25, x33)), S(halve#1(length#1(x33)))))) [1] drop#2(0, x2) -> x2 [1] drop#2(S(0), Nil) -> bot[1] [1] drop#2(S(x10), Cons(x56, x64)) -> drop#2(x10, x64) [1] take#2(0, x2) -> Nil [1] take#2(S(0), Nil) -> Cons(bot[0], Nil) [1] take#2(S(x22), Cons(x56, x64)) -> Cons(x56, take#2(x22, x64)) [1] halve#1(0) -> 0 [1] halve#1(S(0)) -> S(0) [1] halve#1(S(S(x14))) -> S(halve#1(x14)) [1] const_f#2(x3, Cons(x6, Cons(x4, x2))) -> merge#2(x6, x4) [1] leq#2(0, x16) -> True [1] leq#2(S(x20), 0) -> False [1] leq#2(S(x4), S(x2)) -> leq#2(x4, x2) [1] length#1(Nil) -> 0 [1] length#1(Cons(x6, x8)) -> S(length#1(x8)) [1] map#2(dc(x2, x4, x6, x8, x10), Nil) -> Nil [1] map#2(dc(x6, x8, x10, x12, x14), Cons(x4, x2)) -> Cons(dc#1(x6, x8, x10, x12, x14, x4), map#2(dc(x6, x8, x10, x12, x14), x2)) [1] main(x113) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, x113) [1] cond_merge_ys_zs_2(v0, v1, v2, v3, v4, v5, v6) -> null_cond_merge_ys_zs_2 [0] merge#2(v0, v1) -> null_merge#2 [0] dc#1(v0, v1, v2, v3, v4, v5) -> null_dc#1 [0] drop#2(v0, v1) -> null_drop#2 [0] take#2(v0, v1) -> null_take#2 [0] halve#1(v0) -> null_halve#1 [0] const_f#2(v0, v1) -> null_const_f#2 [0] leq#2(v0, v1) -> null_leq#2 [0] length#1(v0) -> null_length#1 [0] map#2(v0, v1) -> null_map#2 [0] The TRS has the following type information: divide_ys#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 Cons :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 take#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 drop#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 Nil :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 cond_merge_ys_zs_2 :: True:False:null_leq#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 True :: True:False:null_leq#2 merge#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 False :: True:False:null_leq#2 leq#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> True:False:null_leq#2 dc#1 :: map -> divisible -> mergesort_zs_3 -> divide -> const_f -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 map :: map divisible :: divisible mergesort_zs_3 :: mergesort_zs_3 divide :: divide const_f :: const_f const_f#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 map#2 :: dc -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 dc :: map -> divisible -> mergesort_zs_3 -> divide -> const_f -> dc S :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 halve#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 length#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 0 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 bot[1] :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 bot[0] :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 main :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 -> Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 null_cond_merge_ys_zs_2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 null_merge#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 null_dc#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 null_drop#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 null_take#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 null_halve#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 null_const_f#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 null_leq#2 :: True:False:null_leq#2 null_length#1 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 null_map#2 :: Nil:Cons:S:0:bot[1]:bot[0]:null_cond_merge_ys_zs_2:null_merge#2:null_dc#1:null_drop#2:null_take#2:null_halve#1:null_const_f#2:null_length#1:null_map#2 const :: dc Rewrite Strategy: INNERMOST ---------------------------------------- (75) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: Nil => 1 True => 2 False => 1 map => 0 divisible => 0 mergesort_zs_3 => 0 divide => 0 const_f => 0 0 => 0 bot[1] => 3 bot[0] => 2 null_cond_merge_ys_zs_2 => 0 null_merge#2 => 0 null_dc#1 => 0 null_drop#2 => 0 null_take#2 => 0 null_halve#1 => 0 null_const_f#2 => 0 null_leq#2 => 0 null_length#1 => 0 null_map#2 => 0 const => 0 ---------------------------------------- (76) Obligation: Complexity RNTS consisting of the following rules: cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 0 }-> 0 :|: z1 = v3, v0 >= 0, v6 >= 0, z'' = v2, v1 >= 0, v5 >= 0, z = v0, z' = v1, z2 = v4, v2 >= 0, v3 >= 0, z3 = v5, v4 >= 0, z4 = v6 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + x2 + merge#2(1 + x7 + x8, x1) :|: x5 >= 0, x8 >= 0, z = 1, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, x3 >= 0, x2 >= 0, z1 = x4, z2 = x3, z3 = x2, z4 = x1, x4 >= 0, x1 >= 0, x7 >= 0, x6 >= 0 cond_merge_ys_zs_2(z, z', z'', z1, z2, z3, z4) -{ 1 }-> 1 + x4 + merge#2(x3, 1 + x5 + x6) :|: x5 >= 0, x8 >= 0, z' = 1 + x7 + x8, z'' = 1 + x5 + x6, x3 >= 0, x2 >= 0, z = 2, z1 = x4, z2 = x3, z3 = x2, z4 = x1, x4 >= 0, x1 >= 0, x7 >= 0, x6 >= 0 const_f#2(z, z') -{ 1 }-> merge#2(x6, x4) :|: x4 >= 0, z' = 1 + x6 + (1 + x4 + x2), z = x3, x6 >= 0, x3 >= 0, x2 >= 0 const_f#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> const_f#2(1 + x51 + (1 + x25 + x33), map#2(1 + 0 + 0 + 0 + 0 + 0, divide_ys#1(1 + x51 + (1 + x25 + x33), 1 + halve#1(length#1(x33))))) :|: z'' = 0, z1 = 0, x33 >= 0, z3 = 1 + x51 + (1 + x25 + x33), z2 = 0, x51 >= 0, x25 >= 0, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 :|: z'' = 0, z1 = 0, z2 = 0, z3 = 1, z = 0, z' = 0 dc#1(z, z', z'', z1, z2, z3) -{ 0 }-> 0 :|: z1 = v3, z3 = v5, v0 >= 0, v4 >= 0, z'' = v2, v1 >= 0, v5 >= 0, z = v0, z' = v1, z2 = v4, v2 >= 0, v3 >= 0 dc#1(z, z', z'', z1, z2, z3) -{ 1 }-> 1 + x229 + 1 :|: z'' = 0, z1 = 0, z2 = 0, x229 >= 0, z = 0, z' = 0, z3 = 1 + x229 + 1 divide_ys#1(z, z') -{ 1 }-> 1 + take#2(x1, x2) + (1 + drop#2(x1, x2) + 1) :|: x1 >= 0, z = x2, z' = x1, x2 >= 0 drop#2(z, z') -{ 1 }-> x2 :|: z' = x2, z = 0, x2 >= 0 drop#2(z, z') -{ 1 }-> drop#2(x10, x64) :|: z' = 1 + x56 + x64, z = 1 + x10, x10 >= 0, x64 >= 0, x56 >= 0 drop#2(z, z') -{ 1 }-> 3 :|: z = 1 + 0, z' = 1 drop#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 halve#1(z) -{ 1 }-> 0 :|: z = 0 halve#1(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 halve#1(z) -{ 1 }-> 1 + halve#1(x14) :|: z = 1 + (1 + x14), x14 >= 0 halve#1(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 length#1(z) -{ 1 }-> 0 :|: z = 1 length#1(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 length#1(z) -{ 1 }-> 1 + length#1(x8) :|: x8 >= 0, x6 >= 0, z = 1 + x6 + x8 leq#2(z, z') -{ 1 }-> leq#2(x4, x2) :|: x4 >= 0, z' = 1 + x2, z = 1 + x4, x2 >= 0 leq#2(z, z') -{ 1 }-> 2 :|: z' = x16, z = 0, x16 >= 0 leq#2(z, z') -{ 1 }-> 1 :|: x20 >= 0, z = 1 + x20, z' = 0 leq#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 main(z) -{ 1 }-> dc#1(0, 0, 0, 0, 0, x113) :|: z = x113, x113 >= 0 map#2(z, z') -{ 1 }-> 1 :|: x4 >= 0, x8 >= 0, x6 >= 0, z = 1 + x2 + x4 + x6 + x8 + x10, z' = 1, x10 >= 0, x2 >= 0 map#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 map#2(z, z') -{ 1 }-> 1 + dc#1(x6, x8, x10, x12, x14, x4) + map#2(1 + x6 + x8 + x10 + x12 + x14, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, x12 >= 0, x14 >= 0, x10 >= 0, x2 >= 0, z = 1 + x6 + x8 + x10 + x12 + x14 merge#2(z, z') -{ 1 }-> x2 :|: z' = x2, z = 1, x2 >= 0 merge#2(z, z') -{ 1 }-> cond_merge_ys_zs_2(leq#2(x8, x4), 1 + x8 + x6, 1 + x4 + x2, x8, x6, x4, x2) :|: x4 >= 0, x8 >= 0, z' = 1 + x4 + x2, x6 >= 0, z = 1 + x8 + x6, x2 >= 0 merge#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 merge#2(z, z') -{ 1 }-> 1 + x4 + x2 :|: x4 >= 0, z = 1 + x4 + x2, z' = 1, x2 >= 0 take#2(z, z') -{ 1 }-> 1 :|: z' = x2, z = 0, x2 >= 0 take#2(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 take#2(z, z') -{ 1 }-> 1 + x56 + take#2(x22, x64) :|: z' = 1 + x56 + x64, x22 >= 0, z = 1 + x22, x64 >= 0, x56 >= 0 take#2(z, z') -{ 1 }-> 1 + 2 + 1 :|: z = 1 + 0, z' = 1 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (77) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (78) Obligation: Complexity Dependency Tuples Problem Rules: divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) main(z0) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, z0) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) MERGE#2(Nil, z0) -> c4 MERGE#2(Cons(z0, z1), Nil) -> c5 MERGE#2(Cons(z0, z1), Cons(z2, z3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3), LEQ#2(z0, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> c7 DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> c8 DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(0, z0) -> c10 DROP#2(S(0), Nil) -> c11 DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(0, z0) -> c13 TAKE#2(S(0), Nil) -> c14 TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(0) -> c16 HALVE#1(S(0)) -> c17 HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(0, z0) -> c20 LEQ#2(S(z0), 0) -> c21 LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Nil) -> c23 LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Nil) -> c25 MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MAIN(z0) -> c28(DC#1(map, divisible, mergesort_zs_3, divide, const_f, z0)) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) MERGE#2(Nil, z0) -> c4 MERGE#2(Cons(z0, z1), Nil) -> c5 MERGE#2(Cons(z0, z1), Cons(z2, z3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3), LEQ#2(z0, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> c7 DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> c8 DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(0, z0) -> c10 DROP#2(S(0), Nil) -> c11 DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(0, z0) -> c13 TAKE#2(S(0), Nil) -> c14 TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(0) -> c16 HALVE#1(S(0)) -> c17 HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(0, z0) -> c20 LEQ#2(S(z0), 0) -> c21 LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Nil) -> c23 LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Nil) -> c25 MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MAIN(z0) -> c28(DC#1(map, divisible, mergesort_zs_3, divide, const_f, z0)) K tuples:none Defined Rule Symbols: divide_ys#1_2, cond_merge_ys_zs_2_7, merge#2_2, dc#1_6, drop#2_2, take#2_2, halve#1_1, const_f#2_2, leq#2_2, length#1_1, map#2_2, main_1 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, MERGE#2_2, DC#1_6, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MAIN_1 Compound Symbols: c_1, c1_1, c2_1, c3_1, c4, c5, c6_2, c7, c8, c9_5, c10, c11, c12_1, c13, c14, c15_1, c16, c17, c18_1, c19_1, c20, c21, c22_1, c23, c24_1, c25, c26_1, c27_1, c28_1 ---------------------------------------- (79) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: MAIN(z0) -> c28(DC#1(map, divisible, mergesort_zs_3, divide, const_f, z0)) Removed 14 trailing nodes: MAP#2(dc(z0, z1, z2, z3, z4), Nil) -> c25 MERGE#2(Cons(z0, z1), Nil) -> c5 LEQ#2(S(z0), 0) -> c21 TAKE#2(0, z0) -> c13 DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> c8 LENGTH#1(Nil) -> c23 DC#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> c7 TAKE#2(S(0), Nil) -> c14 HALVE#1(0) -> c16 HALVE#1(S(0)) -> c17 MERGE#2(Nil, z0) -> c4 LEQ#2(0, z0) -> c20 DROP#2(S(0), Nil) -> c11 DROP#2(0, z0) -> c10 ---------------------------------------- (80) Obligation: Complexity Dependency Tuples Problem Rules: divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) main(z0) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, z0) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) MERGE#2(Cons(z0, z1), Cons(z2, z3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3), LEQ#2(z0, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) MERGE#2(Cons(z0, z1), Cons(z2, z3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3), LEQ#2(z0, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) K tuples:none Defined Rule Symbols: divide_ys#1_2, cond_merge_ys_zs_2_7, merge#2_2, dc#1_6, drop#2_2, take#2_2, halve#1_1, const_f#2_2, leq#2_2, length#1_1, map#2_2, main_1 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, MERGE#2_2, DC#1_6, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2 Compound Symbols: c_1, c1_1, c2_1, c3_1, c6_2, c9_5, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1 ---------------------------------------- (81) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: main(z0) -> dc#1(map, divisible, mergesort_zs_3, divide, const_f, z0) ---------------------------------------- (82) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) MERGE#2(Cons(z0, z1), Cons(z2, z3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3), LEQ#2(z0, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) MERGE#2(Cons(z0, z1), Cons(z2, z3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3), LEQ#2(z0, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, MERGE#2_2, DC#1_6, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2 Compound Symbols: c_1, c1_1, c2_1, c3_1, c6_2, c9_5, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1 ---------------------------------------- (83) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace MERGE#2(Cons(z0, z1), Cons(z2, z3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3), LEQ#2(z0, z2)) by MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3), LEQ#2(0, z0)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3), LEQ#2(S(z0), 0)) MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) ---------------------------------------- (84) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3), LEQ#2(0, z0)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3), LEQ#2(S(z0), 0)) MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3), LEQ#2(0, z0)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3), LEQ#2(S(z0), 0)) MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2 Compound Symbols: c_1, c1_1, c2_1, c3_1, c9_5, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_2 ---------------------------------------- (85) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (86) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2 Compound Symbols: c_1, c1_1, c2_1, c3_1, c9_5, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_2, c6_1 ---------------------------------------- (87) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil)), LENGTH#1(Nil)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) ---------------------------------------- (88) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil)), LENGTH#1(Nil)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil)), LENGTH#1(Nil)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6 Compound Symbols: c_1, c1_1, c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_2, c6_1, c9_5 ---------------------------------------- (89) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (90) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6 Compound Symbols: c_1, c1_1, c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_2, c6_1, c9_5, c9_4 ---------------------------------------- (91) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace MERGE#2(Cons(S(z0), x1), Cons(S(z1), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(z0), x1), Cons(S(z1), x3), S(z0), x1, S(z1), x3), LEQ#2(S(z0), S(z1))) by MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) ---------------------------------------- (92) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6 Compound Symbols: c_1, c1_1, c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c9_5, c9_4, c6_2 ---------------------------------------- (93) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil)), LENGTH#1(Nil)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil)), LENGTH#1(Nil)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) ---------------------------------------- (94) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil)), LENGTH#1(Nil)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil)), LENGTH#1(Nil)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil)), LENGTH#1(Nil)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil)), LENGTH#1(Nil)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6 Compound Symbols: c_1, c1_1, c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c9_5, c9_4, c6_2, c9_2 ---------------------------------------- (95) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (96) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6 Compound Symbols: c_1, c1_1, c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c9_5, c9_4, c6_2, c9_2 ---------------------------------------- (97) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(S(length#1(z1))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) ---------------------------------------- (98) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6 Compound Symbols: c_1, c1_1, c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c9_4, c6_2, c9_5, c9_2 ---------------------------------------- (99) CdtNarrowingProof (BOTH BOUNDS(ID, ID)) Use narrowing to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(0))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) ---------------------------------------- (100) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6 Compound Symbols: c_1, c1_1, c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_2, c9_4 ---------------------------------------- (101) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(x2))), Cons(x0, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) ---------------------------------------- (102) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) S tuples: DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6 Compound Symbols: c_1, c1_1, c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_2, c9_4 ---------------------------------------- (103) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace DIVIDE_YS#1(z0, z1) -> c(TAKE#2(z1, z0)) by DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) ---------------------------------------- (104) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) S tuples: DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6 Compound Symbols: c1_1, c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_2, c9_4, c_1 ---------------------------------------- (105) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace DIVIDE_YS#1(z0, z1) -> c1(DROP#2(z1, z0)) by DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) ---------------------------------------- (106) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) S tuples: COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2 Compound Symbols: c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_2, c9_4, c_1, c1_1 ---------------------------------------- (107) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Cons(drop#2(halve#1(length#1(x2)), Cons(x1, x2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) ---------------------------------------- (108) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) S tuples: COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2 Compound Symbols: c2_1, c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_2, c9_4, c_1, c1_1 ---------------------------------------- (109) CdtForwardInstantiationProof (BOTH BOUNDS(ID, ID)) Use forward instantiation to replace COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c2(MERGE#2(z5, Cons(z2, z3))) by COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) ---------------------------------------- (110) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) S tuples: COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2 Compound Symbols: c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_2, c9_4, c_1, c1_1, c2_1 ---------------------------------------- (111) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) ---------------------------------------- (112) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) S tuples: COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: COND_MERGE_YS_ZS_2_7, DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2 Compound Symbols: c3_1, c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_2, c9_4, c_1, c1_1, c2_1 ---------------------------------------- (113) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace COND_MERGE_YS_ZS_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> c3(MERGE#2(Cons(z0, z1), z7)) by COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) ---------------------------------------- (114) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_2, c9_4, c_1, c1_1, c2_1, c3_1 ---------------------------------------- (115) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z1, Cons(x1, x2))) -> c9(CONST_F#2(Cons(z1, Cons(x1, x2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z1, take#2(halve#1(length#1(x2)), Cons(x1, x2))), Cons(drop#2(S(halve#1(length#1(x2))), Cons(z1, Cons(x1, x2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(z1, Cons(x1, x2)), S(halve#1(length#1(x2)))), HALVE#1(length#1(x2)), LENGTH#1(x2)) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) ---------------------------------------- (116) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_2, c9_4, c_1, c1_1, c2_1, c3_1 ---------------------------------------- (117) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(z0, z1)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(z0, z1))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Cons(drop#2(S(halve#1(length#1(Cons(z0, z1)))), Cons(x0, Cons(x1, Cons(z0, z1)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(z0, z1))), S(halve#1(length#1(Cons(z0, z1))))), HALVE#1(length#1(Cons(z0, z1))), LENGTH#1(Cons(z0, z1))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) ---------------------------------------- (118) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_2, c9_4, c9_5, c_1, c1_1, c2_1, c3_1 ---------------------------------------- (119) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, x2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))), DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(halve#1(length#1(x2))))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) ---------------------------------------- (120) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_4, c9_5, c_1, c1_1, c2_1, c3_1, c9_2 ---------------------------------------- (121) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) ---------------------------------------- (122) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_4, c9_5, c_1, c1_1, c2_1, c3_1, c9_2 ---------------------------------------- (123) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (124) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_4, c9_5, c_1, c1_1, c2_1, c3_1, c9_2, c9_3 ---------------------------------------- (125) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) ---------------------------------------- (126) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_4, c_1, c1_1, c2_1, c3_1, c9_2, c9_3 ---------------------------------------- (127) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (128) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_4, c_1, c1_1, c2_1, c3_1, c9_2, c9_3 ---------------------------------------- (129) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Cons(drop#2(S(halve#1(S(length#1(x3)))), Cons(x0, Cons(x1, Cons(x2, x3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) ---------------------------------------- (130) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_4, c_1, c1_1, c2_1, c3_1, c9_2, c9_3 ---------------------------------------- (131) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Nil)))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(halve#1(length#1(Cons(x2, Nil))))), HALVE#1(length#1(Cons(x2, Nil))), LENGTH#1(Cons(x2, Nil))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) ---------------------------------------- (132) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c9_4, c_1, c1_1, c2_1, c3_1, c9_2, c9_3 ---------------------------------------- (133) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1))))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(S(S(length#1(z1)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1))))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(z0, z1)))), S(halve#1(length#1(Cons(x2, Cons(z0, z1)))))), HALVE#1(length#1(Cons(x2, Cons(z0, z1)))), LENGTH#1(Cons(x2, Cons(z0, z1)))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) ---------------------------------------- (134) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_4, c9_5, c_1, c1_1, c2_1, c3_1, c9_2, c9_3 ---------------------------------------- (135) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Cons(x2, x3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3)))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(halve#1(length#1(Cons(x2, x3))))), HALVE#1(length#1(Cons(x2, x3))), LENGTH#1(Cons(x2, x3))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) ---------------------------------------- (136) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_4, c9_5, c_1, c1_1, c2_1, c3_1, c9_2, c9_3 ---------------------------------------- (137) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(x0, Cons(x1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) ---------------------------------------- (138) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_4, c9_5, c_1, c1_1, c2_1, c3_1, c9_2, c9_3 ---------------------------------------- (139) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (140) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_4, c9_5, c_1, c1_1, c2_1, c3_1, c9_2, c9_3 ---------------------------------------- (141) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(x0, Cons(x1, Nil))) -> c9(CONST_F#2(Cons(x0, Cons(x1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(length#1(Nil))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) ---------------------------------------- (142) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil)))), HALVE#1(0)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c_1, c1_1, c2_1, c3_1, c9_2, c9_3, c9_4 ---------------------------------------- (143) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (144) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DC#1_6, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c9_5, c_1, c1_1, c2_1, c3_1, c9_2, c9_3, c9_4 ---------------------------------------- (145) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) ---------------------------------------- (146) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, CONST_F#2_2, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, DC#1_6, COND_MERGE_YS_ZS_2_7 Compound Symbols: c12_1, c15_1, c18_1, c19_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c9_5, c2_1, c3_1, c9_2, c9_3, c9_4 ---------------------------------------- (147) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace CONST_F#2(z0, Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) by CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) ---------------------------------------- (148) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, DC#1_6, COND_MERGE_YS_ZS_2_7, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c9_5, c2_1, c3_1, c9_2, c9_3, c9_4, c19_1 ---------------------------------------- (149) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) ---------------------------------------- (150) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c9_5, c3_1, c9_2, c9_3, c9_4, c19_1 ---------------------------------------- (151) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(z2, z3), z4, Cons(0, y0), z6, z7) -> c2(MERGE#2(Cons(0, y0), Cons(z2, z3))) by COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) ---------------------------------------- (152) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c9_5, c3_1, c9_2, c9_3, c9_4, c19_1 ---------------------------------------- (153) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) ---------------------------------------- (154) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_5, c9_2, c9_3, c9_4, c19_1 ---------------------------------------- (155) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(0, z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(0, z3))) by COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) ---------------------------------------- (156) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_5, c9_2, c9_3, c9_4, c19_1 ---------------------------------------- (157) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) ---------------------------------------- (158) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_5, c9_2, c9_3, c9_4, c19_1 ---------------------------------------- (159) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y1), z3), z4, Cons(S(0), y0), z6, z7) -> c2(MERGE#2(Cons(S(0), y0), Cons(S(y1), z3))) by COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) ---------------------------------------- (160) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_5, c9_2, c9_3, c9_4, c19_1 ---------------------------------------- (161) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) ---------------------------------------- (162) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_2, c9_3, c9_5, c9_4, c19_1 ---------------------------------------- (163) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(0), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(0), z3))) by COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) ---------------------------------------- (164) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_2, c9_3, c9_5, c9_4, c19_1 ---------------------------------------- (165) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) ---------------------------------------- (166) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_3, c9_5, c9_4, c19_1, c9_2 ---------------------------------------- (167) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) ---------------------------------------- (168) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_3, c9_5, c9_4, c19_1, c9_2 ---------------------------------------- (169) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) ---------------------------------------- (170) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) S tuples: DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2 Compound Symbols: c12_1, c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_5, c9_4, c9_3, c19_1, c9_2 ---------------------------------------- (171) CdtForwardInstantiationProof (BOTH BOUNDS(ID, ID)) Use forward instantiation to replace DROP#2(S(z0), Cons(z1, z2)) -> c12(DROP#2(z0, z2)) by DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) ---------------------------------------- (172) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) S tuples: TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2 Compound Symbols: c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_5, c9_4, c9_3, c19_1, c9_2, c12_1 ---------------------------------------- (173) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(S(y2)), z3), z4, Cons(S(S(y0)), y1), z6, z7) -> c2(MERGE#2(Cons(S(S(y0)), y1), Cons(S(S(y2)), z3))) by COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) ---------------------------------------- (174) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) S tuples: TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2 Compound Symbols: c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c2_1, c3_1, c9_5, c9_4, c9_3, c19_1, c9_2, c12_1 ---------------------------------------- (175) CdtInstantiationProof (BOTH BOUNDS(ID, ID)) Use instantiation to replace COND_MERGE_YS_ZS_2(True, Cons(z0, z1), Cons(S(y2), z3), z4, Cons(S(y0), y1), z6, z7) -> c2(MERGE#2(Cons(S(y0), y1), Cons(S(y2), z3))) by COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) ---------------------------------------- (176) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) S tuples: TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2 Compound Symbols: c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c3_1, c9_5, c9_4, c9_3, c19_1, c2_1, c9_2, c12_1 ---------------------------------------- (177) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) ---------------------------------------- (178) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) S tuples: TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: TAKE#2_2, HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2 Compound Symbols: c15_1, c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c3_1, c9_5, c9_4, c9_3, c19_1, c2_1, c9_2, c12_1 ---------------------------------------- (179) CdtForwardInstantiationProof (BOTH BOUNDS(ID, ID)) Use forward instantiation to replace TAKE#2(S(z0), Cons(z1, z2)) -> c15(TAKE#2(z0, z2)) by TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) ---------------------------------------- (180) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) S tuples: HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: HALVE#1_1, LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2, TAKE#2_2 Compound Symbols: c18_1, c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c3_1, c9_5, c9_4, c9_3, c19_1, c2_1, c9_2, c12_1, c15_1 ---------------------------------------- (181) CdtForwardInstantiationProof (BOTH BOUNDS(ID, ID)) Use forward instantiation to replace HALVE#1(S(S(z0))) -> c18(HALVE#1(z0)) by HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) ---------------------------------------- (182) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) S tuples: LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: LEQ#2_2, LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2, TAKE#2_2, HALVE#1_1 Compound Symbols: c22_1, c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c3_1, c9_5, c9_4, c9_3, c19_1, c2_1, c9_2, c12_1, c15_1, c18_1 ---------------------------------------- (183) CdtForwardInstantiationProof (BOTH BOUNDS(ID, ID)) Use forward instantiation to replace LEQ#2(S(z0), S(z1)) -> c22(LEQ#2(z0, z1)) by LEQ#2(S(S(y0)), S(S(y1))) -> c22(LEQ#2(S(y0), S(y1))) ---------------------------------------- (184) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) LEQ#2(S(S(y0)), S(S(y1))) -> c22(LEQ#2(S(y0), S(y1))) S tuples: LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3), LEQ#2(S(0), S(z0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3), LEQ#2(S(S(z0)), S(0))) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) LEQ#2(S(S(y0)), S(S(y1))) -> c22(LEQ#2(S(y0), S(y1))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2 Compound Symbols: c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c3_1, c9_5, c9_4, c9_3, c19_1, c2_1, c9_2, c12_1, c15_1, c18_1, c22_1 ---------------------------------------- (185) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (186) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) LEQ#2(S(S(y0)), S(S(y1))) -> c22(LEQ#2(S(y0), S(y1))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3)) S tuples: LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) LEQ#2(S(S(y0)), S(S(y1))) -> c22(LEQ#2(S(y0), S(y1))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3)) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2 Compound Symbols: c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c3_1, c9_5, c9_4, c9_3, c19_1, c2_1, c9_2, c12_1, c15_1, c18_1, c22_1 ---------------------------------------- (187) CdtRewritingProof (BOTH BOUNDS(ID, ID)) Used rewriting to replace DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(length#1(Nil))), LENGTH#1(Cons(z2, Nil))) by DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(0)), LENGTH#1(Cons(z2, Nil))) ---------------------------------------- (188) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) LEQ#2(S(S(y0)), S(S(y1))) -> c22(LEQ#2(S(y0), S(y1))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(0)), LENGTH#1(Cons(z2, Nil))) S tuples: LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) LEQ#2(S(S(y0)), S(S(y1))) -> c22(LEQ#2(S(y0), S(y1))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), HALVE#1(S(0)), LENGTH#1(Cons(z2, Nil))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2 Compound Symbols: c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c3_1, c9_5, c9_4, c9_3, c19_1, c2_1, c9_2, c12_1, c15_1, c18_1, c22_1 ---------------------------------------- (189) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (190) Obligation: Complexity Dependency Tuples Problem Rules: leq#2(0, z0) -> True leq#2(S(z0), 0) -> False leq#2(S(z0), S(z1)) -> leq#2(z0, z1) map#2(dc(z0, z1, z2, z3, z4), Nil) -> Nil map#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> Cons(dc#1(z0, z1, z2, z3, z4, z5), map#2(dc(z0, z1, z2, z3, z4), z6)) divide_ys#1(z0, z1) -> Cons(take#2(z1, z0), Cons(drop#2(z1, z0), Nil)) halve#1(0) -> 0 halve#1(S(0)) -> S(0) halve#1(S(S(z0))) -> S(halve#1(z0)) length#1(Nil) -> 0 length#1(Cons(z0, z1)) -> S(length#1(z1)) take#2(0, z0) -> Nil take#2(S(0), Nil) -> Cons(bot[0], Nil) take#2(S(z0), Cons(z1, z2)) -> Cons(z1, take#2(z0, z2)) drop#2(0, z0) -> z0 drop#2(S(0), Nil) -> bot[1] drop#2(S(z0), Cons(z1, z2)) -> drop#2(z0, z2) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Nil) -> Nil dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Nil)) -> Cons(z0, Nil) dc#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> const_f#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))))) const_f#2(z0, Cons(z1, Cons(z2, z3))) -> merge#2(z1, z2) merge#2(Nil, z0) -> z0 merge#2(Cons(z0, z1), Nil) -> Cons(z0, z1) merge#2(Cons(z0, z1), Cons(z2, z3)) -> cond_merge_ys_zs_2(leq#2(z0, z2), Cons(z0, z1), Cons(z2, z3), z0, z1, z2, z3) cond_merge_ys_zs_2(True, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z4, merge#2(z5, Cons(z2, z3))) cond_merge_ys_zs_2(False, Cons(z0, z1), Cons(z2, z3), z4, z5, z6, z7) -> Cons(z6, merge#2(Cons(z0, z1), z7)) Tuples: LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) LEQ#2(S(S(y0)), S(S(y1))) -> c22(LEQ#2(S(y0), S(y1))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), LENGTH#1(Cons(z2, Nil))) S tuples: LENGTH#1(Cons(z0, z1)) -> c24(LENGTH#1(z1)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c26(DC#1(z0, z1, z2, z3, z4, z5)) MAP#2(dc(z0, z1, z2, z3, z4), Cons(z5, z6)) -> c27(MAP#2(dc(z0, z1, z2, z3, z4), z6)) MERGE#2(Cons(0, x1), Cons(z0, x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(0, x1), Cons(z0, x3), 0, x1, z0, x3)) MERGE#2(Cons(S(z0), x1), Cons(0, x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(z0), x1), Cons(0, x3), S(z0), x1, 0, x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(S(z1)), x3)) -> c6(COND_MERGE_YS_ZS_2(leq#2(z0, z1), Cons(S(S(z0)), x1), Cons(S(S(z1)), x3), S(S(z0)), x1, S(S(z1)), x3), LEQ#2(S(S(z0)), S(S(z1)))) MERGE#2(Cons(S(x0), x1), Cons(S(x2), x3)) -> c6(LEQ#2(S(x0), S(x2))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c(TAKE#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c(TAKE#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c(TAKE#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c(TAKE#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) DIVIDE_YS#1(Cons(x0, Cons(x1, x2)), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, x2)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, x3))), S(y11)) -> c1(DROP#2(S(y11), Cons(x0, Cons(x1, Cons(x2, x3))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Nil)), S(y10)) -> c1(DROP#2(S(y10), Cons(x0, Cons(x1, Nil)))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Nil))), S(y7)) -> c1(DROP#2(S(y7), Cons(x0, Cons(x1, Cons(x2, Nil))))) DIVIDE_YS#1(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), S(y8)) -> c1(DROP#2(S(y8), Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))))) COND_MERGE_YS_ZS_2(False, Cons(S(x0), x1), Cons(0, x2), S(x0), x1, 0, x2) -> c3(MERGE#2(Cons(S(x0), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(0), x2), S(S(x0)), x1, S(0), x2) -> c3(MERGE#2(Cons(S(S(x0)), x1), x2)) COND_MERGE_YS_ZS_2(False, Cons(S(S(x0)), x1), Cons(S(S(x2)), x3), S(S(x0)), x1, S(S(x2)), x3) -> c3(MERGE#2(Cons(S(S(x0)), x1), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4))))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(S(S(length#1(z4)))))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4))))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Cons(z3, z4)))), S(halve#1(length#1(Cons(z2, Cons(z3, z4)))))), HALVE#1(S(length#1(Cons(z3, z4)))), LENGTH#1(Cons(z2, Cons(z3, z4)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(0)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), Cons(dc#1(map, divisible, mergesort_zs_3, divide, const_f, take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2)))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) CONST_F#2(Cons(x0, Cons(x1, x2)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, x3))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Nil)), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Nil))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) CONST_F#2(Cons(x0, Cons(x1, Cons(x2, Cons(x3, x4)))), Cons(z1, Cons(z2, z3))) -> c19(MERGE#2(z1, z2)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(0, z5)), Cons(x1, x2), 0, Cons(0, z5), x1, x2) -> c2(MERGE#2(Cons(0, z5), Cons(x1, x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(0, z5)), Cons(S(x1), x2), S(0), Cons(0, z5), S(x1), x2) -> c2(MERGE#2(Cons(0, z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(0, z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(0, z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(0, z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z4), z5)), Cons(0, x2), 0, Cons(S(z4), z5), 0, x2) -> c2(MERGE#2(Cons(S(z4), z5), Cons(0, x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(CONST_F#2(Cons(z0, Cons(z1, z2)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(Cons(z0, take#2(halve#1(length#1(z2)), Cons(z1, z2))), Cons(drop#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2)))), HALVE#1(length#1(z2)), LENGTH#1(z2)) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(0), z5)), Cons(S(z2), x2), 0, Cons(S(0), z5), S(z2), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(0), z5)), Cons(S(x1), x2), S(0), Cons(S(0), z5), S(x1), x2) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(0), z5)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(0), z5), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(0), z5), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(length#1(Cons(z2, z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z4)), z5)), Cons(S(0), x2), 0, Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z4)), z5)), Cons(S(0), x2), S(0), Cons(S(S(z4)), z5), S(0), x2) -> c2(MERGE#2(Cons(S(S(z4)), z5), Cons(S(0), x2))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, z2))) -> c9(MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(z2))), Cons(z0, Cons(z1, z2))), Cons(drop#2(halve#1(length#1(z2)), Cons(z1, z2)), Nil))), DIVIDE_YS#1(Cons(z0, Cons(z1, z2)), S(halve#1(length#1(z2))))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Nil))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Nil)), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(0)), Cons(z0, Cons(z1, Nil))), Cons(drop#2(S(halve#1(length#1(Nil))), Cons(z0, Cons(z1, Nil))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Nil)), S(halve#1(length#1(Nil))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Nil)), S(halve#1(0)))) DROP#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c12(DROP#2(S(y0), Cons(y1, y2))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), 0, Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(S(z5)), z6)), Cons(S(S(z2)), x2), S(0), Cons(S(S(z5)), z6), S(S(z2)), x2) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(z2)), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(S(z5)), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(S(z5)), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(S(z5)), z6), Cons(S(S(x2)), x3))) COND_MERGE_YS_ZS_2(True, Cons(0, Cons(S(z5), z6)), Cons(S(z2), x2), 0, Cons(S(z5), z6), S(z2), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(z2), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(0), Cons(S(z5), z6)), Cons(S(x1), x2), S(0), Cons(S(z5), z6), S(x1), x2) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(x1), x2))) COND_MERGE_YS_ZS_2(True, Cons(S(S(x0)), Cons(S(z5), z6)), Cons(S(S(x2)), x3), S(S(x0)), Cons(S(z5), z6), S(S(x2)), x3) -> c2(MERGE#2(Cons(S(z5), z6), Cons(S(S(x2)), x3))) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, z3)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, z3))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), Cons(take#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Cons(drop#2(S(halve#1(S(length#1(z3)))), Cons(z0, Cons(z1, Cons(z2, z3)))), Nil)))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(length#1(Cons(z2, z3)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, z3))), S(halve#1(S(length#1(z3))))), HALVE#1(S(length#1(z3))), LENGTH#1(Cons(z2, z3))) TAKE#2(S(S(y0)), Cons(z1, Cons(y1, y2))) -> c15(TAKE#2(S(y0), Cons(y1, y2))) HALVE#1(S(S(S(S(y0))))) -> c18(HALVE#1(S(S(y0)))) LEQ#2(S(S(y0)), S(S(y1))) -> c22(LEQ#2(S(y0), S(y1))) MERGE#2(Cons(S(0), x1), Cons(S(z0), x3)) -> c6(COND_MERGE_YS_ZS_2(True, Cons(S(0), x1), Cons(S(z0), x3), S(0), x1, S(z0), x3)) MERGE#2(Cons(S(S(z0)), x1), Cons(S(0), x3)) -> c6(COND_MERGE_YS_ZS_2(False, Cons(S(S(z0)), x1), Cons(S(0), x3), S(S(z0)), x1, S(0), x3)) DC#1(map, divisible, mergesort_zs_3, divide, const_f, Cons(z0, Cons(z1, Cons(z2, Nil)))) -> c9(CONST_F#2(Cons(z0, Cons(z1, Cons(z2, Nil))), map#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(S(0)))))), MAP#2(dc(map, divisible, mergesort_zs_3, divide, const_f), divide_ys#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil)))))), DIVIDE_YS#1(Cons(z0, Cons(z1, Cons(z2, Nil))), S(halve#1(length#1(Cons(z2, Nil))))), LENGTH#1(Cons(z2, Nil))) K tuples:none Defined Rule Symbols: leq#2_2, map#2_2, divide_ys#1_2, halve#1_1, length#1_1, take#2_2, drop#2_2, dc#1_6, const_f#2_2, merge#2_2, cond_merge_ys_zs_2_7 Defined Pair Symbols: LENGTH#1_1, MAP#2_2, MERGE#2_2, DIVIDE_YS#1_2, COND_MERGE_YS_ZS_2_7, DC#1_6, CONST_F#2_2, DROP#2_2, TAKE#2_2, HALVE#1_1, LEQ#2_2 Compound Symbols: c24_1, c26_1, c27_1, c6_1, c6_2, c_1, c1_1, c3_1, c9_5, c9_4, c9_3, c19_1, c2_1, c9_2, c12_1, c15_1, c18_1, c22_1