tct
YES(?,O(n^3))
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Weak Trs:
{ #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We add following dependency tuples
Strict DPs:
{ #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#1^#(nil(), @l2) -> c_4()
, merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, merge#2^#(nil(), @x, @xs) -> c_6()
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#1^#(nil()) -> c_11()
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(nil(), @x1) -> c_13()
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#1^#(nil()) -> c_17()
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs'))
, msplit#2^#(nil(), @x1) -> c_19()
, msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() }
Weak DPs:
{ #cklt^#(#EQ()) -> c_33()
, #cklt^#(#GT()) -> c_34()
, #cklt^#(#LT()) -> c_35()
, #compare^#(#0(), #0()) -> c_21()
, #compare^#(#0(), #neg(@y)) -> c_22()
, #compare^#(#0(), #pos(@y)) -> c_23()
, #compare^#(#0(), #s(@y)) -> c_24()
, #compare^#(#neg(@x), #0()) -> c_25()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_27()
, #compare^#(#pos(@x), #0()) -> c_28()
, #compare^#(#pos(@x), #neg(@y)) -> c_29()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_31()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict DPs:
{ #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#1^#(nil(), @l2) -> c_4()
, merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, merge#2^#(nil(), @x, @xs) -> c_6()
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#1^#(nil()) -> c_11()
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(nil(), @x1) -> c_13()
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#1^#(nil()) -> c_17()
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs'))
, msplit#2^#(nil(), @x1) -> c_19()
, msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() }
Weak DPs:
{ #cklt^#(#EQ()) -> c_33()
, #cklt^#(#GT()) -> c_34()
, #cklt^#(#LT()) -> c_35()
, #compare^#(#0(), #0()) -> c_21()
, #compare^#(#0(), #neg(@y)) -> c_22()
, #compare^#(#0(), #pos(@y)) -> c_23()
, #compare^#(#0(), #s(@y)) -> c_24()
, #compare^#(#neg(@x), #0()) -> c_25()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_27()
, #compare^#(#pos(@x), #0()) -> c_28()
, #compare^#(#pos(@x), #neg(@y)) -> c_29()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_31()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We consider the (estimated) dependency graph
1: #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :35
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :33
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :29
-->_2 #compare^#(#s(@x), #0()) -> c_31() :34
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_29() :32
-->_2 #compare^#(#pos(@x), #0()) -> c_28() :31
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_27() :30
-->_2 #compare^#(#neg(@x), #0()) -> c_25() :28
-->_2 #compare^#(#0(), #s(@y)) -> c_24() :27
-->_2 #compare^#(#0(), #pos(@y)) -> c_23() :26
-->_2 #compare^#(#0(), #neg(@y)) -> c_22() :25
-->_2 #compare^#(#0(), #0()) -> c_21() :24
-->_1 #cklt^#(#LT()) -> c_35() :23
-->_1 #cklt^#(#GT()) -> c_34() :22
-->_1 #cklt^#(#EQ()) -> c_33() :21
2: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :3
-->_1 merge#1^#(nil(), @l2) -> c_4() :4
3: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y)) :5
-->_1 merge#2^#(nil(), @x, @xs) -> c_6() :6
4: merge#1^#(nil(), @l2) -> c_4()
5: merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :8
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :7
-->_2 #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) :1
6: merge#2^#(nil(), @x, @xs) -> c_6()
7: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :2
8: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :2
9: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :10
-->_1 mergesort#1^#(nil()) -> c_11() :11
10: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :12
-->_1 mergesort#2^#(nil(), @x1) -> c_13() :13
11: mergesort#1^#(nil()) -> c_11()
12: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :15
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :14
13: mergesort#2^#(nil(), @x1) -> c_13()
14: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :9
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :9
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :2
15: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :16
-->_1 msplit#1^#(nil()) -> c_17() :17
16: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) :18
-->_1 msplit#2^#(nil(), @x1) -> c_19() :19
17: msplit#1^#(nil()) -> c_17()
18: msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs'))
-->_1 msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() :20
-->_2 msplit^#(@l) -> msplit#1^#(@l) :15
19: msplit#2^#(nil(), @x1) -> c_19()
20: msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20()
21: #cklt^#(#EQ()) -> c_33()
22: #cklt^#(#GT()) -> c_34()
23: #cklt^#(#LT()) -> c_35()
24: #compare^#(#0(), #0()) -> c_21()
25: #compare^#(#0(), #neg(@y)) -> c_22()
26: #compare^#(#0(), #pos(@y)) -> c_23()
27: #compare^#(#0(), #s(@y)) -> c_24()
28: #compare^#(#neg(@x), #0()) -> c_25()
29: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :35
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :33
-->_1 #compare^#(#s(@x), #0()) -> c_31() :34
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_29() :32
-->_1 #compare^#(#pos(@x), #0()) -> c_28() :31
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_27() :30
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :29
-->_1 #compare^#(#neg(@x), #0()) -> c_25() :28
-->_1 #compare^#(#0(), #s(@y)) -> c_24() :27
-->_1 #compare^#(#0(), #pos(@y)) -> c_23() :26
-->_1 #compare^#(#0(), #neg(@y)) -> c_22() :25
-->_1 #compare^#(#0(), #0()) -> c_21() :24
30: #compare^#(#neg(@x), #pos(@y)) -> c_27()
31: #compare^#(#pos(@x), #0()) -> c_28()
32: #compare^#(#pos(@x), #neg(@y)) -> c_29()
33: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :35
-->_1 #compare^#(#s(@x), #0()) -> c_31() :34
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :33
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_29() :32
-->_1 #compare^#(#pos(@x), #0()) -> c_28() :31
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_27() :30
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :29
-->_1 #compare^#(#neg(@x), #0()) -> c_25() :28
-->_1 #compare^#(#0(), #s(@y)) -> c_24() :27
-->_1 #compare^#(#0(), #pos(@y)) -> c_23() :26
-->_1 #compare^#(#0(), #neg(@y)) -> c_22() :25
-->_1 #compare^#(#0(), #0()) -> c_21() :24
34: #compare^#(#s(@x), #0()) -> c_31()
35: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :35
-->_1 #compare^#(#s(@x), #0()) -> c_31() :34
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :33
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_29() :32
-->_1 #compare^#(#pos(@x), #0()) -> c_28() :31
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_27() :30
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :29
-->_1 #compare^#(#neg(@x), #0()) -> c_25() :28
-->_1 #compare^#(#0(), #s(@y)) -> c_24() :27
-->_1 #compare^#(#0(), #pos(@y)) -> c_23() :26
-->_1 #compare^#(#0(), #neg(@y)) -> c_22() :25
-->_1 #compare^#(#0(), #0()) -> c_21() :24
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {11} and add Pre({11}) = {9} to the strict component.
- We remove {13} and add Pre({13}) = {10} to the strict component.
- We remove {17} and add Pre({17}) = {15} to the strict component.
- We remove {19} and add Pre({19}) = {16} to the strict component.
- We remove {20} and add Pre({20}) = {18} to the strict component.
- We remove {4} and add Pre({4}) = {2} to the strict component.
- We remove {6} and add Pre({6}) = {3} to the strict component.
- We remove {1} and add Pre({1}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) }
Weak DPs:
{ #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #cklt^#(#EQ()) -> c_33()
, #cklt^#(#GT()) -> c_34()
, #cklt^#(#LT()) -> c_35()
, #compare^#(#0(), #0()) -> c_21()
, #compare^#(#0(), #neg(@y)) -> c_22()
, #compare^#(#0(), #pos(@y)) -> c_23()
, #compare^#(#0(), #s(@y)) -> c_24()
, #compare^#(#neg(@x), #0()) -> c_25()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_27()
, #compare^#(#pos(@x), #0()) -> c_28()
, #compare^#(#pos(@x), #neg(@y)) -> c_29()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_31()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, merge#1^#(nil(), @l2) -> c_4()
, merge#2^#(nil(), @x, @xs) -> c_6()
, mergesort#1^#(nil()) -> c_11()
, mergesort#2^#(nil(), @x1) -> c_13()
, msplit#1^#(nil()) -> c_17()
, msplit#2^#(nil(), @x1) -> c_19()
, msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We consider the the dependency graph
->1:{6,9,8,7}
|
|->8:{1,5,3,2,4}
| |
| |->11:{13} Weak SCC
| | |
| | |->12:{14} Weak SCC
| | |
| | |->13:{15} Weak SCC
| | |
| | |->14:{16} Weak SCC
| | |
| | |->16:{17} Weak SCC
| | |
| | |->17:{18} Weak SCC
| | |
| | |->18:{19} Weak SCC
| | |
| | |->19:{20} Weak SCC
| | |
| | |->20:{21} Weak SCC
| | |
| | |->21:{23} Weak SCC
| | |
| | |->22:{24} Weak SCC
| | |
| | |->23:{25} Weak SCC
| | |
| | |->24:{27} Weak SCC
| | |
| | `->15:{28,26,22} Weak SCC
| | |
| | |->16:{17} Weak SCC
| | |
| | |->17:{18} Weak SCC
| | |
| | |->18:{19} Weak SCC
| | |
| | |->19:{20} Weak SCC
| | |
| | |->20:{21} Weak SCC
| | |
| | |->21:{23} Weak SCC
| | |
| | |->22:{24} Weak SCC
| | |
| | |->23:{25} Weak SCC
| | |
| | `->24:{27} Weak SCC
| |
| |->9:{29} Weak SCC
| |
| `->10:{30} Weak SCC
|
|->4:{10,12,11}
| |
| |->5:{33} Weak SCC
| |
| |->6:{34} Weak SCC
| |
| `->7:{35} Weak SCC
|
|->2:{31} Weak SCC
|
`->3:{32} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, 3: merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, 4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, 5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
, 6: mergesort^#(@l) -> mergesort#1^#(@l)
, 7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, 9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, 10: msplit^#(@l) -> msplit#1^#(@l)
, 11: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, 12: msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) }
Weak DPs:
{ 13: #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 14: #cklt^#(#EQ()) -> c_33()
, 15: #cklt^#(#GT()) -> c_34()
, 16: #cklt^#(#LT()) -> c_35()
, 17: #compare^#(#0(), #0()) -> c_21()
, 18: #compare^#(#0(), #neg(@y)) -> c_22()
, 19: #compare^#(#0(), #pos(@y)) -> c_23()
, 20: #compare^#(#0(), #s(@y)) -> c_24()
, 21: #compare^#(#neg(@x), #0()) -> c_25()
, 22: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 23: #compare^#(#neg(@x), #pos(@y)) -> c_27()
, 24: #compare^#(#pos(@x), #0()) -> c_28()
, 25: #compare^#(#pos(@x), #neg(@y)) -> c_29()
, 26: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 27: #compare^#(#s(@x), #0()) -> c_31()
, 28: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 29: merge#1^#(nil(), @l2) -> c_4()
, 30: merge#2^#(nil(), @x, @xs) -> c_6()
, 31: mergesort#1^#(nil()) -> c_11()
, 32: mergesort#2^#(nil(), @x1) -> c_13()
, 33: msplit#1^#(nil()) -> c_17()
, 34: msplit#2^#(nil(), @x1) -> c_19()
, 35: msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 31: mergesort#1^#(nil()) -> c_11()
, 32: mergesort#2^#(nil(), @x1) -> c_13()
, 33: msplit#1^#(nil()) -> c_17()
, 34: msplit#2^#(nil(), @x1) -> c_19()
, 35: msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20()
, 29: merge#1^#(nil(), @l2) -> c_4()
, 30: merge#2^#(nil(), @x, @xs) -> c_6()
, 13: #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 14: #cklt^#(#EQ()) -> c_33()
, 15: #cklt^#(#GT()) -> c_34()
, 16: #cklt^#(#LT()) -> c_35()
, 28: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 26: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 22: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 17: #compare^#(#0(), #0()) -> c_21()
, 18: #compare^#(#0(), #neg(@y)) -> c_22()
, 19: #compare^#(#0(), #pos(@y)) -> c_23()
, 20: #compare^#(#0(), #s(@y)) -> c_24()
, 21: #compare^#(#neg(@x), #0()) -> c_25()
, 23: #compare^#(#neg(@x), #pos(@y)) -> c_27()
, 24: #compare^#(#pos(@x), #0()) -> c_28()
, 25: #compare^#(#pos(@x), #neg(@y)) -> c_29()
, 27: #compare^#(#s(@x), #0()) -> c_31() }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We consider the following dependency-graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y)) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :5
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :4
4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :7
7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :8
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :10
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :6
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :6
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
10: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :11
11: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) :12
12: msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs'))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :10
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We employ 'linear path analysis' using the following approximated
dependency graph:
->1:{6,9,8,7} [ ? ]
|
|->3:{1,5,3,2,4} [ YES(O(1),O(n^3)) ]
|
`->2:{10,12,11} [ YES(O(1),O(n^3)) ]
Here dependency-pairs are as follows:
Strict DPs:
{ 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, 3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, 4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, 5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
, 6: mergesort^#(@l) -> mergesort#1^#(@l)
, 7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, 9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, 10: msplit^#(@l) -> msplit#1^#(@l)
, 11: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, 12: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
* Path 1:{6,9,8,7}->3:{1,5,3,2,4}: YES(O(1),O(n^3))
-------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :5
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :4
4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :7
7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :8
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :6
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :6
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :9
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :4
4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
5: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :6
6: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :7
7: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :8
8: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :5
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :5
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :9
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :8
4: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :5
5: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :6
6: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :7
7: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :4
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :4
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
8: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :7
3: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :4
4: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :5
5: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :6
6: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :3
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :3
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
7: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :9
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :8
8: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :6
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :5
5: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :7
7: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :9
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :8
8: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :5
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
5: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :6
6: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :8
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :7
7: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
8: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :4
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :8
4: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :5
5: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :7
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :6
6: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
7: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the following dependency-graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :3
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :7
3: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :4
4: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :6
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :5
5: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :8
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Remaining Rules (B):
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^2)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
2: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :2
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {1} and add Pre({1}) = {2,2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We use the processor 'matrix interpretation of dimension 2' to
orient following rules strictly.
DPs:
{ 1: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Trs: { msplit#1(nil()) -> tuple#2(nil(), nil()) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#less) = {}, Uargs(#compare) = {}, Uargs(#cklt) = {},
Uargs(merge) = {}, Uargs(merge#1) = {}, Uargs(::) = {},
Uargs(merge#2) = {}, Uargs(merge#3) = {}, Uargs(mergesort) = {},
Uargs(mergesort#1) = {}, Uargs(mergesort#2) = {},
Uargs(msplit) = {}, Uargs(mergesort#3) = {}, Uargs(tuple#2) = {},
Uargs(msplit#1) = {}, Uargs(msplit#2) = {}, Uargs(msplit#3) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#less^#) = {}, Uargs(#cklt^#) = {}, Uargs(#compare^#) = {},
Uargs(merge^#) = {}, Uargs(merge#1^#) = {}, Uargs(merge#2^#) = {},
Uargs(merge#3^#) = {}, Uargs(mergesort^#) = {},
Uargs(mergesort#1^#) = {}, Uargs(mergesort#2^#) = {},
Uargs(mergesort#3^#) = {}, Uargs(msplit^#) = {},
Uargs(msplit#1^#) = {}, Uargs(msplit#2^#) = {},
Uargs(msplit#3^#) = {}, Uargs(c_1) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#less](x1, x2) = [0]
[0]
[#compare](x1, x2) = [0]
[0]
[#cklt](x1) = [0]
[0]
[merge](x1, x2) = [0]
[0]
[merge#1](x1, x2) = [0]
[0]
[::](x1, x2) = [1 2] x2 + [2]
[0 1] [1]
[merge#2](x1, x2, x3) = [0]
[0]
[nil] = [0]
[0]
[merge#3](x1, x2, x3, x4, x5) = [0]
[0]
[#false] = [0]
[0]
[#true] = [0]
[0]
[mergesort](x1) = [0]
[0]
[mergesort#1](x1) = [0]
[0]
[mergesort#2](x1, x2) = [0]
[0]
[msplit](x1) = [1 0] x1 + [1]
[0 1] [2]
[mergesort#3](x1) = [0]
[0]
[tuple#2](x1, x2) = [1 1] x1 + [1 1] x2 + [0]
[0 1] [0 1] [2]
[msplit#1](x1) = [1 0] x1 + [1]
[0 1] [2]
[msplit#2](x1, x2) = [1 2] x1 + [3]
[0 1] [3]
[msplit#3](x1, x2, x3) = [1 2] x1 + [2]
[0 1] [2]
[#EQ] = [0]
[0]
[#GT] = [0]
[0]
[#LT] = [0]
[0]
[#0] = [0]
[0]
[#neg](x1) = [0 0] x1 + [0]
[0 1] [0]
[#pos](x1) = [0]
[0]
[#s](x1) = [1 0] x1 + [0]
[0 0] [0]
[#less^#](x1, x2) = [0]
[0]
[#cklt^#](x1) = [0]
[0]
[#compare^#](x1, x2) = [0]
[0]
[merge^#](x1, x2) = [0]
[0]
[merge#1^#](x1, x2) = [0]
[0]
[merge#2^#](x1, x2, x3) = [0]
[0]
[merge#3^#](x1, x2, x3, x4, x5) = [0]
[0]
[mergesort^#](x1) = [1 1] x1 + [0]
[0 1] [3]
[mergesort#1^#](x1) = [1 1] x1 + [0]
[0 0] [2]
[mergesort#2^#](x1, x2) = [1 3] x1 + [3]
[0 0] [0]
[mergesort#3^#](x1) = [1 0] x1 + [1]
[0 0] [0]
[msplit^#](x1) = [0]
[0]
[msplit#1^#](x1) = [0]
[0]
[msplit#2^#](x1, x2) = [0]
[0]
[msplit#3^#](x1, x2, x3) = [0]
[0]
[c_1](x1, x2, x3) = [0]
[0]
[c] = [0]
[0]
[c_1](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 0] [0 0] [0]
This order satisfies following ordering constraints
[msplit(@l)] = [1 0] @l + [1]
[0 1] [2]
>= [1 0] @l + [1]
[0 1] [2]
= [msplit#1(@l)]
[msplit#1(::(@x1, @xs))] = [1 2] @xs + [3]
[0 1] [3]
>= [1 2] @xs + [3]
[0 1] [3]
= [msplit#2(@xs, @x1)]
[msplit#1(nil())] = [1]
[2]
> [0]
[2]
= [tuple#2(nil(), nil())]
[msplit#2(::(@x2, @xs'), @x1)] = [1 4] @xs' + [7]
[0 1] [4]
>= [1 2] @xs' + [7]
[0 1] [4]
= [msplit#3(msplit(@xs'), @x1, @x2)]
[msplit#2(nil(), @x1)] = [3]
[3]
>= [3]
[3]
= [tuple#2(::(@x1, nil()), nil())]
[msplit#3(tuple#2(@l1, @l2), @x1, @x2)] = [1 3] @l1 + [1 3] @l2 + [6]
[0 1] [0 1] [4]
>= [1 3] @l1 + [1 3] @l2 + [6]
[0 1] [0 1] [4]
= [tuple#2(::(@x1, @l1), ::(@x2, @l2))]
[mergesort^#(@l)] = [1 1] @l + [0]
[0 1] [3]
>= [1 1] @l + [0]
[0 0] [2]
= [mergesort#1^#(@l)]
[mergesort#1^#(::(@x1, @xs))] = [1 3] @xs + [3]
[0 0] [2]
>= [1 3] @xs + [3]
[0 0] [0]
= [mergesort#2^#(@xs, @x1)]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [1 5] @xs' + [8]
[0 0] [0]
>= [1 4] @xs' + [8]
[0 0] [0]
= [mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [1 1] @l1 + [1 1] @l2 + [1]
[0 0] [0 0] [0]
> [1 1] @l1 + [1 1] @l2 + [0]
[0 0] [0 0] [0]
= [c_1(mergesort^#(@l1), mergesort^#(@l2))]
Processor 'matrix interpretation of dimension 2' induces the
complexity certificate YES(?,O(n^2)) on application of rules {1}.
Here rules are labeled according to the (estimated) dependency
graph
1: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2))
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :2
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) :1
- The rules {1} have known complexity. These cover all predecessors
of {2}, their complexity is equally bounded.
- The rules {1,2} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
- The rules {1,2,3} have known complexity. These cover all
predecessors of {4}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4} is given by YES(?,O(n^2)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,4,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2))
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#less) = {}, Uargs(#compare) = {}, Uargs(#cklt) = {},
Uargs(merge) = {}, Uargs(merge#1) = {}, Uargs(::) = {},
Uargs(merge#2) = {}, Uargs(merge#3) = {}, Uargs(mergesort) = {},
Uargs(mergesort#1) = {}, Uargs(mergesort#2) = {},
Uargs(msplit) = {}, Uargs(mergesort#3) = {}, Uargs(tuple#2) = {},
Uargs(msplit#1) = {}, Uargs(msplit#2) = {}, Uargs(msplit#3) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#less^#) = {}, Uargs(#cklt^#) = {}, Uargs(#compare^#) = {},
Uargs(merge^#) = {}, Uargs(merge#1^#) = {}, Uargs(merge#2^#) = {},
Uargs(merge#3^#) = {}, Uargs(mergesort^#) = {},
Uargs(mergesort#1^#) = {}, Uargs(mergesort#2^#) = {},
Uargs(mergesort#3^#) = {}, Uargs(msplit^#) = {},
Uargs(msplit#1^#) = {}, Uargs(msplit#2^#) = {},
Uargs(msplit#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#less](x1, x2) = [1]
[#compare](x1, x2) = [1]
[#cklt](x1) = [1] x1 + [0]
[merge](x1, x2) = [1] x1 + [1] x2 + [0]
[merge#1](x1, x2) = [1] x1 + [1] x2 + [0]
[::](x1, x2) = [1] x2 + [1]
[merge#2](x1, x2, x3) = [1] x1 + [1] x3 + [1]
[nil] = [0]
[merge#3](x1, x2, x3, x4, x5) = [2] x1 + [1] x3 + [1] x5 + [0]
[#false] = [1]
[#true] = [1]
[mergesort](x1) = [1] x1 + [0]
[mergesort#1](x1) = [1] x1 + [0]
[mergesort#2](x1, x2) = [1] x1 + [1]
[msplit](x1) = [1] x1 + [0]
[mergesort#3](x1) = [1] x1 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[msplit#1](x1) = [1] x1 + [0]
[msplit#2](x1, x2) = [1] x1 + [1]
[msplit#3](x1, x2, x3) = [1] x1 + [2]
[#EQ] = [1]
[#GT] = [1]
[#LT] = [1]
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#less^#](x1, x2) = [0]
[#cklt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[merge^#](x1, x2) = [2] x1 + [2] x2 + [1]
[merge#1^#](x1, x2) = [2] x1 + [2] x2 + [0]
[merge#2^#](x1, x2, x3) = [2] x1 + [2] x3 + [1]
[merge#3^#](x1, x2, x3, x4, x5) = [3] x1 + [2] x3 + [2] x5 + [0]
[mergesort^#](x1) = [2] x1 + [1]
[mergesort#1^#](x1) = [2] x1 + [1]
[mergesort#2^#](x1, x2) = [2] x1 + [3]
[mergesort#3^#](x1) = [2] x1 + [1]
[msplit^#](x1) = [0]
[msplit#1^#](x1) = [0]
[msplit#2^#](x1, x2) = [0]
[msplit#3^#](x1, x2, x3) = [0]
This order satisfies following ordering constraints
[#less(@x, @y)] = [1]
>= [1]
= [#cklt(#compare(@x, @y))]
[#compare(#0(), #0())] = [1]
>= [1]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [1]
>= [1]
= [#GT()]
[#compare(#0(), #pos(@y))] = [1]
>= [1]
= [#LT()]
[#compare(#0(), #s(@y))] = [1]
>= [1]
= [#LT()]
[#compare(#neg(@x), #0())] = [1]
>= [1]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [1]
>= [1]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [1]
>= [1]
= [#LT()]
[#compare(#pos(@x), #0())] = [1]
>= [1]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [1]
>= [1]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [1]
>= [1]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [1]
>= [1]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [1]
>= [1]
= [#compare(@x, @y)]
[#cklt(#EQ())] = [1]
>= [1]
= [#false()]
[#cklt(#GT())] = [1]
>= [1]
= [#false()]
[#cklt(#LT())] = [1]
>= [1]
= [#true()]
[merge(@l1, @l2)] = [1] @l1 + [1] @l2 + [0]
>= [1] @l1 + [1] @l2 + [0]
= [merge#1(@l1, @l2)]
[merge#1(::(@x, @xs), @l2)] = [1] @l2 + [1] @xs + [1]
>= [1] @l2 + [1] @xs + [1]
= [merge#2(@l2, @x, @xs)]
[merge#1(nil(), @l2)] = [1] @l2 + [0]
>= [1] @l2 + [0]
= [@l2]
[merge#2(::(@y, @ys), @x, @xs)] = [1] @xs + [1] @ys + [2]
>= [1] @xs + [1] @ys + [2]
= [merge#3(#less(@x, @y), @x, @xs, @y, @ys)]
[merge#2(nil(), @x, @xs)] = [1] @xs + [1]
>= [1] @xs + [1]
= [::(@x, @xs)]
[merge#3(#false(), @x, @xs, @y, @ys)] = [1] @xs + [1] @ys + [2]
>= [1] @xs + [1] @ys + [2]
= [::(@y, merge(::(@x, @xs), @ys))]
[merge#3(#true(), @x, @xs, @y, @ys)] = [1] @xs + [1] @ys + [2]
>= [1] @xs + [1] @ys + [2]
= [::(@x, merge(@xs, ::(@y, @ys)))]
[mergesort(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [mergesort#1(@l)]
[mergesort#1(::(@x1, @xs))] = [1] @xs + [1]
>= [1] @xs + [1]
= [mergesort#2(@xs, @x1)]
[mergesort#1(nil())] = [0]
>= [0]
= [nil()]
[mergesort#2(::(@x2, @xs'), @x1)] = [1] @xs' + [2]
>= [1] @xs' + [2]
= [mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#2(nil(), @x1)] = [1]
>= [1]
= [::(@x1, nil())]
[msplit(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [msplit#1(@l)]
[mergesort#3(tuple#2(@l1, @l2))] = [1] @l1 + [1] @l2 + [0]
>= [1] @l1 + [1] @l2 + [0]
= [merge(mergesort(@l1), mergesort(@l2))]
[msplit#1(::(@x1, @xs))] = [1] @xs + [1]
>= [1] @xs + [1]
= [msplit#2(@xs, @x1)]
[msplit#1(nil())] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[msplit#2(::(@x2, @xs'), @x1)] = [1] @xs' + [2]
>= [1] @xs' + [2]
= [msplit#3(msplit(@xs'), @x1, @x2)]
[msplit#2(nil(), @x1)] = [1]
>= [1]
= [tuple#2(::(@x1, nil()), nil())]
[msplit#3(tuple#2(@l1, @l2), @x1, @x2)] = [1] @l1 + [1] @l2 + [2]
>= [1] @l1 + [1] @l2 + [2]
= [tuple#2(::(@x1, @l1), ::(@x2, @l2))]
[merge^#(@l1, @l2)] = [2] @l1 + [2] @l2 + [1]
> [2] @l1 + [2] @l2 + [0]
= [merge#1^#(@l1, @l2)]
[merge#1^#(::(@x, @xs), @l2)] = [2] @l2 + [2] @xs + [2]
> [2] @l2 + [2] @xs + [1]
= [merge#2^#(@l2, @x, @xs)]
[merge#2^#(::(@y, @ys), @x, @xs)] = [2] @xs + [2] @ys + [3]
>= [2] @xs + [2] @ys + [3]
= [merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)]
[merge#3^#(#false(), @x, @xs, @y, @ys)] = [2] @xs + [2] @ys + [3]
>= [2] @xs + [2] @ys + [3]
= [merge^#(::(@x, @xs), @ys)]
[merge#3^#(#true(), @x, @xs, @y, @ys)] = [2] @xs + [2] @ys + [3]
>= [2] @xs + [2] @ys + [3]
= [merge^#(@xs, ::(@y, @ys))]
[mergesort^#(@l)] = [2] @l + [1]
>= [2] @l + [1]
= [mergesort#1^#(@l)]
[mergesort#1^#(::(@x1, @xs))] = [2] @xs + [3]
>= [2] @xs + [3]
= [mergesort#2^#(@xs, @x1)]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [2] @xs' + [5]
>= [2] @xs' + [5]
= [mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [2] @l1 + [2] @l2 + [1]
>= [2] @l1 + [2] @l2 + [1]
= [merge^#(mergesort(@l1), mergesort(@l2))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [2] @l1 + [2] @l2 + [1]
>= [2] @l1 + [1]
= [mergesort^#(@l1)]
[mergesort#3^#(tuple#2(@l1, @l2))] = [2] @l1 + [2] @l2 + [1]
>= [2] @l2 + [1]
= [mergesort^#(@l2)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {1,2}.
Here rules are labeled according to the (estimated) dependency
graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :5
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :4
4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :7
7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :8
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) :11
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1) :10
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
10: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :6
11: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :6
- The rules {1,2} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
- The rules {1,2,3} have known complexity. These cover all
predecessors of {4,5}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{6,11,8,7,10} Weak SCC
|
`->2:{9} Weak SCC
|
`->3:{1,5,3,2,4} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, 3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, 4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, 5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
, 6: mergesort^#(@l) -> mergesort#1^#(@l)
, 7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 8: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 9: mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, 10: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, 11: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 6: mergesort^#(@l) -> mergesort#1^#(@l)
, 11: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, 8: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 10: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, 9: mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
, 3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, 4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
* Path 1:{6,9,8,7}->2:{10,12,11}: YES(O(1),O(n^3))
------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :3
3: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :5
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :4
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
5: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {6} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) }
Weak DPs: { msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :3
3: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :5
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :4
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
5: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :3
3: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :5
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :4
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
5: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :3
3: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :5
-->_2 msplit^#(@l) -> msplit#1^#(@l) :4
4: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
5: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :4
3: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :5
-->_2 msplit^#(@l) -> msplit#1^#(@l) :3
5: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the following dependency-graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
2: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :5
-->_2 msplit^#(@l) -> msplit#1^#(@l) :2
5: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :2
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Remaining Rules (B):
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^2)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
2: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2)) :4
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :2
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2))
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We use the processor 'matrix interpretation of dimension 2' to
orient following rules strictly.
DPs:
{ 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Trs: { msplit#1(nil()) -> tuple#2(nil(), nil()) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(::) = {}, Uargs(msplit) = {}, Uargs(tuple#2) = {},
Uargs(msplit#1) = {}, Uargs(msplit#2) = {}, Uargs(msplit#3) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#less^#) = {}, Uargs(#cklt^#) = {}, Uargs(#compare^#) = {},
Uargs(merge^#) = {}, Uargs(merge#1^#) = {}, Uargs(merge#2^#) = {},
Uargs(merge#3^#) = {}, Uargs(mergesort^#) = {},
Uargs(mergesort#1^#) = {}, Uargs(mergesort#2^#) = {},
Uargs(mergesort#3^#) = {}, Uargs(msplit^#) = {},
Uargs(msplit#1^#) = {}, Uargs(msplit#2^#) = {},
Uargs(msplit#3^#) = {}, Uargs(c_1) = {}, Uargs(c_2) = {},
Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[::](x1, x2) = [1 2] x2 + [1]
[0 1] [1]
[nil] = [0]
[0]
[#false] = [0]
[0]
[#true] = [0]
[0]
[msplit](x1) = [1 0] x1 + [1]
[0 2] [2]
[tuple#2](x1, x2) = [1 1] x1 + [1 1] x2 + [0]
[0 1] [0 1] [2]
[msplit#1](x1) = [1 0] x1 + [1]
[0 2] [2]
[msplit#2](x1, x2) = [1 2] x1 + [2]
[0 2] [3]
[msplit#3](x1, x2, x3) = [1 2] x1 + [0]
[0 1] [2]
[#EQ] = [0]
[0]
[#GT] = [0]
[0]
[#LT] = [0]
[0]
[#0] = [0]
[0]
[#neg](x1) = [1 0] x1 + [0]
[0 0] [0]
[#pos](x1) = [0]
[0]
[#s](x1) = [1 0] x1 + [0]
[0 1] [0]
[#less^#](x1, x2) = [0]
[0]
[#cklt^#](x1) = [0]
[0]
[#compare^#](x1, x2) = [0]
[0]
[merge^#](x1, x2) = [0]
[0]
[merge#1^#](x1, x2) = [0]
[0]
[merge#2^#](x1, x2, x3) = [0]
[0]
[merge#3^#](x1, x2, x3, x4, x5) = [0]
[0]
[mergesort^#](x1) = [1 1] x1 + [0]
[0 0] [0]
[mergesort#1^#](x1) = [1 1] x1 + [0]
[0 0] [0]
[mergesort#2^#](x1, x2) = [1 3] x1 + [2]
[0 0] [0]
[mergesort#3^#](x1) = [1 0] x1 + [1]
[0 0] [0]
[msplit^#](x1) = [0]
[0]
[msplit#1^#](x1) = [0]
[0]
[msplit#2^#](x1, x2) = [0]
[0]
[msplit#3^#](x1, x2, x3) = [0]
[0]
[c_1](x1, x2) = [0]
[0]
[c_2](x1, x2) = [0]
[0]
[c] = [0]
[0]
[c_1](x1, x2) = [1 0] x1 + [1 1] x2 + [0]
[0 0] [0 0] [0]
This order satisfies following ordering constraints
[msplit(@l)] = [1 0] @l + [1]
[0 2] [2]
>= [1 0] @l + [1]
[0 2] [2]
= [msplit#1(@l)]
[msplit#1(::(@x1, @xs))] = [1 2] @xs + [2]
[0 2] [4]
>= [1 2] @xs + [2]
[0 2] [3]
= [msplit#2(@xs, @x1)]
[msplit#1(nil())] = [1]
[2]
> [0]
[2]
= [tuple#2(nil(), nil())]
[msplit#2(::(@x2, @xs'), @x1)] = [1 4] @xs' + [5]
[0 2] [5]
>= [1 4] @xs' + [5]
[0 2] [4]
= [msplit#3(msplit(@xs'), @x1, @x2)]
[msplit#2(nil(), @x1)] = [2]
[3]
>= [2]
[3]
= [tuple#2(::(@x1, nil()), nil())]
[msplit#3(tuple#2(@l1, @l2), @x1, @x2)] = [1 3] @l1 + [1 3] @l2 + [4]
[0 1] [0 1] [4]
>= [1 3] @l1 + [1 3] @l2 + [4]
[0 1] [0 1] [4]
= [tuple#2(::(@x1, @l1), ::(@x2, @l2))]
[mergesort^#(@l)] = [1 1] @l + [0]
[0 0] [0]
>= [1 1] @l + [0]
[0 0] [0]
= [mergesort#1^#(@l)]
[mergesort#1^#(::(@x1, @xs))] = [1 3] @xs + [2]
[0 0] [0]
>= [1 3] @xs + [2]
[0 0] [0]
= [mergesort#2^#(@xs, @x1)]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [1 5] @xs' + [6]
[0 0] [0]
>= [1 4] @xs' + [6]
[0 0] [0]
= [mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [1 1] @l1 + [1 1] @l2 + [1]
[0 0] [0 0] [0]
> [1 1] @l1 + [1 1] @l2 + [0]
[0 0] [0 0] [0]
= [c_1(mergesort^#(@l1), mergesort^#(@l2))]
Processor 'matrix interpretation of dimension 2' induces the
complexity certificate YES(?,O(n^2)) on application of rules {4}.
Here rules are labeled according to the (estimated) dependency
graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
2: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) :4
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :2
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2))
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :1
- The rules {4} have known complexity. These cover all predecessors
of {1}, their complexity is equally bounded.
- The rules {1,4} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
- The rules {1,3,4} have known complexity. These cover all
predecessors of {2}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4} is given by YES(?,O(n^2)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,4,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2))
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 5: mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, 8: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, 9: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Sub-proof:
----------
The following argument positions are usable:
Uargs(::) = {}, Uargs(msplit) = {}, Uargs(tuple#2) = {},
Uargs(msplit#1) = {}, Uargs(msplit#2) = {}, Uargs(msplit#3) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#less^#) = {}, Uargs(#cklt^#) = {}, Uargs(#compare^#) = {},
Uargs(merge^#) = {}, Uargs(merge#1^#) = {}, Uargs(merge#2^#) = {},
Uargs(merge#3^#) = {}, Uargs(mergesort^#) = {},
Uargs(mergesort#1^#) = {}, Uargs(mergesort#2^#) = {},
Uargs(mergesort#3^#) = {}, Uargs(msplit^#) = {},
Uargs(msplit#1^#) = {}, Uargs(msplit#2^#) = {},
Uargs(msplit#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[#false] = [0]
[#true] = [0]
[msplit](x1) = [1] x1 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[msplit#1](x1) = [1] x1 + [0]
[msplit#2](x1, x2) = [1] x1 + [1]
[msplit#3](x1, x2, x3) = [1] x1 + [2]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#0] = [0]
[#neg](x1) = [0]
[#pos](x1) = [0]
[#s](x1) = [0]
[#less^#](x1, x2) = [0]
[#cklt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[merge^#](x1, x2) = [0]
[merge#1^#](x1, x2) = [0]
[merge#2^#](x1, x2, x3) = [0]
[merge#3^#](x1, x2, x3, x4, x5) = [0]
[mergesort^#](x1) = [3] x1 + [0]
[mergesort#1^#](x1) = [3] x1 + [0]
[mergesort#2^#](x1, x2) = [3] x1 + [3]
[mergesort#3^#](x1) = [3] x1 + [0]
[msplit^#](x1) = [2] x1 + [0]
[msplit#1^#](x1) = [2] x1 + [0]
[msplit#2^#](x1, x2) = [2] x1 + [0]
[msplit#3^#](x1, x2, x3) = [0]
This order satisfies following ordering constraints
[msplit(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [msplit#1(@l)]
[msplit#1(::(@x1, @xs))] = [1] @xs + [1]
>= [1] @xs + [1]
= [msplit#2(@xs, @x1)]
[msplit#1(nil())] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[msplit#2(::(@x2, @xs'), @x1)] = [1] @xs' + [2]
>= [1] @xs' + [2]
= [msplit#3(msplit(@xs'), @x1, @x2)]
[msplit#2(nil(), @x1)] = [1]
>= [1]
= [tuple#2(::(@x1, nil()), nil())]
[msplit#3(tuple#2(@l1, @l2), @x1, @x2)] = [1] @l1 + [1] @l2 + [2]
>= [1] @l1 + [1] @l2 + [2]
= [tuple#2(::(@x1, @l1), ::(@x2, @l2))]
[mergesort^#(@l)] = [3] @l + [0]
>= [3] @l + [0]
= [mergesort#1^#(@l)]
[mergesort#1^#(::(@x1, @xs))] = [3] @xs + [3]
>= [3] @xs + [3]
= [mergesort#2^#(@xs, @x1)]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [3] @xs' + [6]
>= [3] @xs' + [6]
= [mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [3] @xs' + [6]
> [2] @xs' + [4]
= [msplit^#(::(@x1, ::(@x2, @xs')))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [3] @l1 + [3] @l2 + [0]
>= [3] @l1 + [0]
= [mergesort^#(@l1)]
[mergesort#3^#(tuple#2(@l1, @l2))] = [3] @l1 + [3] @l2 + [0]
>= [3] @l2 + [0]
= [mergesort^#(@l2)]
[msplit^#(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [msplit#1^#(@l)]
[msplit#1^#(::(@x1, @xs))] = [2] @xs + [2]
> [2] @xs + [0]
= [msplit#2^#(@xs, @x1)]
[msplit#2^#(::(@x2, @xs'), @x1)] = [2] @xs' + [2]
> [2] @xs' + [0]
= [msplit^#(@xs')]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{5,8,9}. Here rules are labeled according to the (estimated)
dependency graph
1: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :8
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs'))) :5
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) :7
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1) :6
5: mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
-->_1 msplit^#(@l) -> msplit#1^#(@l) :1
6: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :2
7: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :2
8: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :9
9: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :1
- The rules {5,8,9} have known complexity. These cover all
predecessors of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,5,8,9} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,6,3,2,5} Weak SCC
|
`->2:{4} Weak SCC
|
`->3:{7,9,8} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 4: mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, 5: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, 6: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, 7: msplit^#(@l) -> msplit#1^#(@l)
, 8: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, 9: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 6: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 5: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, 4: mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, 7: msplit^#(@l) -> msplit#1^#(@l)
, 9: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
, 8: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
Hurray, we answered YES(?,O(n^3))
tct-popstar
YES(?,O(n^3))
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Weak Trs:
{ #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We add following dependency tuples
Strict DPs:
{ #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#1^#(nil(), @l2) -> c_4()
, merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, merge#2^#(nil(), @x, @xs) -> c_6()
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#1^#(nil()) -> c_11()
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(nil(), @x1) -> c_13()
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#1^#(nil()) -> c_17()
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs'))
, msplit#2^#(nil(), @x1) -> c_19()
, msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() }
Weak DPs:
{ #cklt^#(#EQ()) -> c_33()
, #cklt^#(#GT()) -> c_34()
, #cklt^#(#LT()) -> c_35()
, #compare^#(#0(), #0()) -> c_21()
, #compare^#(#0(), #neg(@y)) -> c_22()
, #compare^#(#0(), #pos(@y)) -> c_23()
, #compare^#(#0(), #s(@y)) -> c_24()
, #compare^#(#neg(@x), #0()) -> c_25()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_27()
, #compare^#(#pos(@x), #0()) -> c_28()
, #compare^#(#pos(@x), #neg(@y)) -> c_29()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_31()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict DPs:
{ #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#1^#(nil(), @l2) -> c_4()
, merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, merge#2^#(nil(), @x, @xs) -> c_6()
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#1^#(nil()) -> c_11()
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(nil(), @x1) -> c_13()
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#1^#(nil()) -> c_17()
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs'))
, msplit#2^#(nil(), @x1) -> c_19()
, msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() }
Weak DPs:
{ #cklt^#(#EQ()) -> c_33()
, #cklt^#(#GT()) -> c_34()
, #cklt^#(#LT()) -> c_35()
, #compare^#(#0(), #0()) -> c_21()
, #compare^#(#0(), #neg(@y)) -> c_22()
, #compare^#(#0(), #pos(@y)) -> c_23()
, #compare^#(#0(), #s(@y)) -> c_24()
, #compare^#(#neg(@x), #0()) -> c_25()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_27()
, #compare^#(#pos(@x), #0()) -> c_28()
, #compare^#(#pos(@x), #neg(@y)) -> c_29()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_31()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We consider the (estimated) dependency graph
1: #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :35
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :33
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :29
-->_2 #compare^#(#s(@x), #0()) -> c_31() :34
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_29() :32
-->_2 #compare^#(#pos(@x), #0()) -> c_28() :31
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_27() :30
-->_2 #compare^#(#neg(@x), #0()) -> c_25() :28
-->_2 #compare^#(#0(), #s(@y)) -> c_24() :27
-->_2 #compare^#(#0(), #pos(@y)) -> c_23() :26
-->_2 #compare^#(#0(), #neg(@y)) -> c_22() :25
-->_2 #compare^#(#0(), #0()) -> c_21() :24
-->_1 #cklt^#(#LT()) -> c_35() :23
-->_1 #cklt^#(#GT()) -> c_34() :22
-->_1 #cklt^#(#EQ()) -> c_33() :21
2: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :3
-->_1 merge#1^#(nil(), @l2) -> c_4() :4
3: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y)) :5
-->_1 merge#2^#(nil(), @x, @xs) -> c_6() :6
4: merge#1^#(nil(), @l2) -> c_4()
5: merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :8
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :7
-->_2 #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) :1
6: merge#2^#(nil(), @x, @xs) -> c_6()
7: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :2
8: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :2
9: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :10
-->_1 mergesort#1^#(nil()) -> c_11() :11
10: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :12
-->_1 mergesort#2^#(nil(), @x1) -> c_13() :13
11: mergesort#1^#(nil()) -> c_11()
12: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :15
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :14
13: mergesort#2^#(nil(), @x1) -> c_13()
14: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :9
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :9
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :2
15: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :16
-->_1 msplit#1^#(nil()) -> c_17() :17
16: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) :18
-->_1 msplit#2^#(nil(), @x1) -> c_19() :19
17: msplit#1^#(nil()) -> c_17()
18: msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs'))
-->_1 msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() :20
-->_2 msplit^#(@l) -> msplit#1^#(@l) :15
19: msplit#2^#(nil(), @x1) -> c_19()
20: msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20()
21: #cklt^#(#EQ()) -> c_33()
22: #cklt^#(#GT()) -> c_34()
23: #cklt^#(#LT()) -> c_35()
24: #compare^#(#0(), #0()) -> c_21()
25: #compare^#(#0(), #neg(@y)) -> c_22()
26: #compare^#(#0(), #pos(@y)) -> c_23()
27: #compare^#(#0(), #s(@y)) -> c_24()
28: #compare^#(#neg(@x), #0()) -> c_25()
29: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :35
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :33
-->_1 #compare^#(#s(@x), #0()) -> c_31() :34
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_29() :32
-->_1 #compare^#(#pos(@x), #0()) -> c_28() :31
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_27() :30
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :29
-->_1 #compare^#(#neg(@x), #0()) -> c_25() :28
-->_1 #compare^#(#0(), #s(@y)) -> c_24() :27
-->_1 #compare^#(#0(), #pos(@y)) -> c_23() :26
-->_1 #compare^#(#0(), #neg(@y)) -> c_22() :25
-->_1 #compare^#(#0(), #0()) -> c_21() :24
30: #compare^#(#neg(@x), #pos(@y)) -> c_27()
31: #compare^#(#pos(@x), #0()) -> c_28()
32: #compare^#(#pos(@x), #neg(@y)) -> c_29()
33: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :35
-->_1 #compare^#(#s(@x), #0()) -> c_31() :34
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :33
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_29() :32
-->_1 #compare^#(#pos(@x), #0()) -> c_28() :31
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_27() :30
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :29
-->_1 #compare^#(#neg(@x), #0()) -> c_25() :28
-->_1 #compare^#(#0(), #s(@y)) -> c_24() :27
-->_1 #compare^#(#0(), #pos(@y)) -> c_23() :26
-->_1 #compare^#(#0(), #neg(@y)) -> c_22() :25
-->_1 #compare^#(#0(), #0()) -> c_21() :24
34: #compare^#(#s(@x), #0()) -> c_31()
35: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :35
-->_1 #compare^#(#s(@x), #0()) -> c_31() :34
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :33
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_29() :32
-->_1 #compare^#(#pos(@x), #0()) -> c_28() :31
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_27() :30
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :29
-->_1 #compare^#(#neg(@x), #0()) -> c_25() :28
-->_1 #compare^#(#0(), #s(@y)) -> c_24() :27
-->_1 #compare^#(#0(), #pos(@y)) -> c_23() :26
-->_1 #compare^#(#0(), #neg(@y)) -> c_22() :25
-->_1 #compare^#(#0(), #0()) -> c_21() :24
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {11} and add Pre({11}) = {9} to the strict component.
- We remove {13} and add Pre({13}) = {10} to the strict component.
- We remove {17} and add Pre({17}) = {15} to the strict component.
- We remove {19} and add Pre({19}) = {16} to the strict component.
- We remove {20} and add Pre({20}) = {18} to the strict component.
- We remove {4} and add Pre({4}) = {2} to the strict component.
- We remove {6} and add Pre({6}) = {3} to the strict component.
- We remove {1} and add Pre({1}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) }
Weak DPs:
{ #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #cklt^#(#EQ()) -> c_33()
, #cklt^#(#GT()) -> c_34()
, #cklt^#(#LT()) -> c_35()
, #compare^#(#0(), #0()) -> c_21()
, #compare^#(#0(), #neg(@y)) -> c_22()
, #compare^#(#0(), #pos(@y)) -> c_23()
, #compare^#(#0(), #s(@y)) -> c_24()
, #compare^#(#neg(@x), #0()) -> c_25()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_27()
, #compare^#(#pos(@x), #0()) -> c_28()
, #compare^#(#pos(@x), #neg(@y)) -> c_29()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_31()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, merge#1^#(nil(), @l2) -> c_4()
, merge#2^#(nil(), @x, @xs) -> c_6()
, mergesort#1^#(nil()) -> c_11()
, mergesort#2^#(nil(), @x1) -> c_13()
, msplit#1^#(nil()) -> c_17()
, msplit#2^#(nil(), @x1) -> c_19()
, msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We consider the the dependency graph
->1:{6,9,8,7}
|
|->8:{1,5,3,2,4}
| |
| |->11:{13} Weak SCC
| | |
| | |->12:{14} Weak SCC
| | |
| | |->13:{15} Weak SCC
| | |
| | |->14:{16} Weak SCC
| | |
| | |->16:{17} Weak SCC
| | |
| | |->17:{18} Weak SCC
| | |
| | |->18:{19} Weak SCC
| | |
| | |->19:{20} Weak SCC
| | |
| | |->20:{21} Weak SCC
| | |
| | |->21:{23} Weak SCC
| | |
| | |->22:{24} Weak SCC
| | |
| | |->23:{25} Weak SCC
| | |
| | |->24:{27} Weak SCC
| | |
| | `->15:{28,26,22} Weak SCC
| | |
| | |->16:{17} Weak SCC
| | |
| | |->17:{18} Weak SCC
| | |
| | |->18:{19} Weak SCC
| | |
| | |->19:{20} Weak SCC
| | |
| | |->20:{21} Weak SCC
| | |
| | |->21:{23} Weak SCC
| | |
| | |->22:{24} Weak SCC
| | |
| | |->23:{25} Weak SCC
| | |
| | `->24:{27} Weak SCC
| |
| |->9:{29} Weak SCC
| |
| `->10:{30} Weak SCC
|
|->4:{10,12,11}
| |
| |->5:{33} Weak SCC
| |
| |->6:{34} Weak SCC
| |
| `->7:{35} Weak SCC
|
|->2:{31} Weak SCC
|
`->3:{32} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, 3: merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, 4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, 5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
, 6: mergesort^#(@l) -> mergesort#1^#(@l)
, 7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, 9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, 10: msplit^#(@l) -> msplit#1^#(@l)
, 11: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, 12: msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) }
Weak DPs:
{ 13: #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 14: #cklt^#(#EQ()) -> c_33()
, 15: #cklt^#(#GT()) -> c_34()
, 16: #cklt^#(#LT()) -> c_35()
, 17: #compare^#(#0(), #0()) -> c_21()
, 18: #compare^#(#0(), #neg(@y)) -> c_22()
, 19: #compare^#(#0(), #pos(@y)) -> c_23()
, 20: #compare^#(#0(), #s(@y)) -> c_24()
, 21: #compare^#(#neg(@x), #0()) -> c_25()
, 22: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 23: #compare^#(#neg(@x), #pos(@y)) -> c_27()
, 24: #compare^#(#pos(@x), #0()) -> c_28()
, 25: #compare^#(#pos(@x), #neg(@y)) -> c_29()
, 26: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 27: #compare^#(#s(@x), #0()) -> c_31()
, 28: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 29: merge#1^#(nil(), @l2) -> c_4()
, 30: merge#2^#(nil(), @x, @xs) -> c_6()
, 31: mergesort#1^#(nil()) -> c_11()
, 32: mergesort#2^#(nil(), @x1) -> c_13()
, 33: msplit#1^#(nil()) -> c_17()
, 34: msplit#2^#(nil(), @x1) -> c_19()
, 35: msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 31: mergesort#1^#(nil()) -> c_11()
, 32: mergesort#2^#(nil(), @x1) -> c_13()
, 33: msplit#1^#(nil()) -> c_17()
, 34: msplit#2^#(nil(), @x1) -> c_19()
, 35: msplit#3^#(tuple#2(@l1, @l2), @x1, @x2) -> c_20()
, 29: merge#1^#(nil(), @l2) -> c_4()
, 30: merge#2^#(nil(), @x, @xs) -> c_6()
, 13: #less^#(@x, @y) ->
c_1(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 14: #cklt^#(#EQ()) -> c_33()
, 15: #cklt^#(#GT()) -> c_34()
, 16: #cklt^#(#LT()) -> c_35()
, 28: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 26: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 22: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 17: #compare^#(#0(), #0()) -> c_21()
, 18: #compare^#(#0(), #neg(@y)) -> c_22()
, 19: #compare^#(#0(), #pos(@y)) -> c_23()
, 20: #compare^#(#0(), #s(@y)) -> c_24()
, 21: #compare^#(#neg(@x), #0()) -> c_25()
, 23: #compare^#(#neg(@x), #pos(@y)) -> c_27()
, 24: #compare^#(#pos(@x), #0()) -> c_28()
, 25: #compare^#(#pos(@x), #neg(@y)) -> c_29()
, 27: #compare^#(#s(@x), #0()) -> c_31() }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We consider the following dependency-graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y)) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :5
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :4
4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :7
7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :8
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_12(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :10
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_15(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :6
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :6
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
10: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :11
11: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) :12
12: msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs'))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :10
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ merge#2^#(::(@y, @ys), @x, @xs) ->
c_5(merge#3^#(#less(@x, @y), @x, @xs, @y, @ys), #less^#(@x, @y))
, msplit#2^#(::(@x2, @xs'), @x1) ->
c_18(msplit#3^#(msplit(@xs'), @x1, @x2), msplit^#(@xs')) }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^3))
We employ 'linear path analysis' using the following approximated
dependency graph:
->1:{6,9,8,7} [ ? ]
|
|->3:{1,5,3,2,4} [ YES(O(1),O(n^3)) ]
|
`->2:{10,12,11} [ YES(O(1),O(n^3)) ]
Here dependency-pairs are as follows:
Strict DPs:
{ 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, 3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, 4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, 5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
, 6: mergesort^#(@l) -> mergesort#1^#(@l)
, 7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, 9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, 10: msplit^#(@l) -> msplit#1^#(@l)
, 11: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, 12: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
* Path 1:{6,9,8,7}->3:{1,5,3,2,4}: YES(O(1),O(n^3))
-------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :5
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :4
4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :7
7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :8
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :6
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :6
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :9
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :4
4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
5: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :6
6: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :7
7: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :8
8: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :5
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :5
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :9
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :8
4: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :5
5: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :6
6: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :7
7: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :4
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :4
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
8: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :7
3: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :4
4: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :5
5: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :6
6: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :3
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :3
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
7: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :9
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :8
8: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :6
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :5
5: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :7
7: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :9
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :8
8: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :5
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
5: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :6
6: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :8
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :7
7: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
8: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :4
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :8
4: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :5
5: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :7
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :6
6: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
7: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the following dependency-graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :3
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :7
3: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :4
4: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :6
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :5
5: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :8
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, mergesort^#(@l) -> mergesort#1^#(@l) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) }
Remaining Rules (B):
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^2)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
2: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :2
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {1} and add Pre({1}) = {2,2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We use the processor 'matrix interpretation of dimension 2' to
orient following rules strictly.
DPs:
{ 1: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Trs: { msplit#1(nil()) -> tuple#2(nil(), nil()) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#less) = {}, Uargs(#compare) = {}, Uargs(#cklt) = {},
Uargs(merge) = {}, Uargs(merge#1) = {}, Uargs(::) = {},
Uargs(merge#2) = {}, Uargs(merge#3) = {}, Uargs(mergesort) = {},
Uargs(mergesort#1) = {}, Uargs(mergesort#2) = {},
Uargs(msplit) = {}, Uargs(mergesort#3) = {}, Uargs(tuple#2) = {},
Uargs(msplit#1) = {}, Uargs(msplit#2) = {}, Uargs(msplit#3) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#less^#) = {}, Uargs(#cklt^#) = {}, Uargs(#compare^#) = {},
Uargs(merge^#) = {}, Uargs(merge#1^#) = {}, Uargs(merge#2^#) = {},
Uargs(merge#3^#) = {}, Uargs(mergesort^#) = {},
Uargs(mergesort#1^#) = {}, Uargs(mergesort#2^#) = {},
Uargs(mergesort#3^#) = {}, Uargs(msplit^#) = {},
Uargs(msplit#1^#) = {}, Uargs(msplit#2^#) = {},
Uargs(msplit#3^#) = {}, Uargs(c_1) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#less](x1, x2) = [0]
[0]
[#compare](x1, x2) = [0]
[0]
[#cklt](x1) = [0]
[0]
[merge](x1, x2) = [0]
[0]
[merge#1](x1, x2) = [0]
[0]
[::](x1, x2) = [1 2] x2 + [2]
[0 1] [1]
[merge#2](x1, x2, x3) = [0]
[0]
[nil] = [0]
[0]
[merge#3](x1, x2, x3, x4, x5) = [0]
[0]
[#false] = [0]
[0]
[#true] = [0]
[0]
[mergesort](x1) = [0]
[0]
[mergesort#1](x1) = [0]
[0]
[mergesort#2](x1, x2) = [0]
[0]
[msplit](x1) = [1 0] x1 + [1]
[0 1] [2]
[mergesort#3](x1) = [0]
[0]
[tuple#2](x1, x2) = [1 1] x1 + [1 1] x2 + [0]
[0 1] [0 1] [2]
[msplit#1](x1) = [1 0] x1 + [1]
[0 1] [2]
[msplit#2](x1, x2) = [1 2] x1 + [3]
[0 1] [3]
[msplit#3](x1, x2, x3) = [1 2] x1 + [2]
[0 1] [2]
[#EQ] = [0]
[0]
[#GT] = [0]
[0]
[#LT] = [0]
[0]
[#0] = [0]
[0]
[#neg](x1) = [0 0] x1 + [0]
[0 1] [0]
[#pos](x1) = [0]
[0]
[#s](x1) = [1 0] x1 + [0]
[0 0] [0]
[#less^#](x1, x2) = [0]
[0]
[#cklt^#](x1) = [0]
[0]
[#compare^#](x1, x2) = [0]
[0]
[merge^#](x1, x2) = [0]
[0]
[merge#1^#](x1, x2) = [0]
[0]
[merge#2^#](x1, x2, x3) = [0]
[0]
[merge#3^#](x1, x2, x3, x4, x5) = [0]
[0]
[mergesort^#](x1) = [1 1] x1 + [0]
[0 1] [3]
[mergesort#1^#](x1) = [1 1] x1 + [0]
[0 0] [2]
[mergesort#2^#](x1, x2) = [1 3] x1 + [3]
[0 0] [0]
[mergesort#3^#](x1) = [1 0] x1 + [1]
[0 0] [0]
[msplit^#](x1) = [0]
[0]
[msplit#1^#](x1) = [0]
[0]
[msplit#2^#](x1, x2) = [0]
[0]
[msplit#3^#](x1, x2, x3) = [0]
[0]
[c_1](x1, x2, x3) = [0]
[0]
[c] = [0]
[0]
[c_1](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 0] [0 0] [0]
This order satisfies following ordering constraints
[msplit(@l)] = [1 0] @l + [1]
[0 1] [2]
>= [1 0] @l + [1]
[0 1] [2]
= [msplit#1(@l)]
[msplit#1(::(@x1, @xs))] = [1 2] @xs + [3]
[0 1] [3]
>= [1 2] @xs + [3]
[0 1] [3]
= [msplit#2(@xs, @x1)]
[msplit#1(nil())] = [1]
[2]
> [0]
[2]
= [tuple#2(nil(), nil())]
[msplit#2(::(@x2, @xs'), @x1)] = [1 4] @xs' + [7]
[0 1] [4]
>= [1 2] @xs' + [7]
[0 1] [4]
= [msplit#3(msplit(@xs'), @x1, @x2)]
[msplit#2(nil(), @x1)] = [3]
[3]
>= [3]
[3]
= [tuple#2(::(@x1, nil()), nil())]
[msplit#3(tuple#2(@l1, @l2), @x1, @x2)] = [1 3] @l1 + [1 3] @l2 + [6]
[0 1] [0 1] [4]
>= [1 3] @l1 + [1 3] @l2 + [6]
[0 1] [0 1] [4]
= [tuple#2(::(@x1, @l1), ::(@x2, @l2))]
[mergesort^#(@l)] = [1 1] @l + [0]
[0 1] [3]
>= [1 1] @l + [0]
[0 0] [2]
= [mergesort#1^#(@l)]
[mergesort#1^#(::(@x1, @xs))] = [1 3] @xs + [3]
[0 0] [2]
>= [1 3] @xs + [3]
[0 0] [0]
= [mergesort#2^#(@xs, @x1)]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [1 5] @xs' + [8]
[0 0] [0]
>= [1 4] @xs' + [8]
[0 0] [0]
= [mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [1 1] @l1 + [1 1] @l2 + [1]
[0 0] [0 0] [0]
> [1 1] @l1 + [1 1] @l2 + [0]
[0 0] [0 0] [0]
= [c_1(mergesort^#(@l1), mergesort^#(@l2))]
Processor 'matrix interpretation of dimension 2' induces the
complexity certificate YES(?,O(n^2)) on application of rules {1}.
Here rules are labeled according to the (estimated) dependency
graph
1: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2))
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :2
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :2
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) :1
- The rules {1} have known complexity. These cover all predecessors
of {2}, their complexity is equally bounded.
- The rules {1,2} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
- The rules {1,2,3} have known complexity. These cover all
predecessors of {4}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4} is given by YES(?,O(n^2)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,4,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2))
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) }
Weak DPs:
{ merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#less) = {}, Uargs(#compare) = {}, Uargs(#cklt) = {},
Uargs(merge) = {}, Uargs(merge#1) = {}, Uargs(::) = {},
Uargs(merge#2) = {}, Uargs(merge#3) = {}, Uargs(mergesort) = {},
Uargs(mergesort#1) = {}, Uargs(mergesort#2) = {},
Uargs(msplit) = {}, Uargs(mergesort#3) = {}, Uargs(tuple#2) = {},
Uargs(msplit#1) = {}, Uargs(msplit#2) = {}, Uargs(msplit#3) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#less^#) = {}, Uargs(#cklt^#) = {}, Uargs(#compare^#) = {},
Uargs(merge^#) = {}, Uargs(merge#1^#) = {}, Uargs(merge#2^#) = {},
Uargs(merge#3^#) = {}, Uargs(mergesort^#) = {},
Uargs(mergesort#1^#) = {}, Uargs(mergesort#2^#) = {},
Uargs(mergesort#3^#) = {}, Uargs(msplit^#) = {},
Uargs(msplit#1^#) = {}, Uargs(msplit#2^#) = {},
Uargs(msplit#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#less](x1, x2) = [1]
[#compare](x1, x2) = [1]
[#cklt](x1) = [1] x1 + [0]
[merge](x1, x2) = [1] x1 + [1] x2 + [0]
[merge#1](x1, x2) = [1] x1 + [1] x2 + [0]
[::](x1, x2) = [1] x2 + [1]
[merge#2](x1, x2, x3) = [1] x1 + [1] x3 + [1]
[nil] = [0]
[merge#3](x1, x2, x3, x4, x5) = [2] x1 + [1] x3 + [1] x5 + [0]
[#false] = [1]
[#true] = [1]
[mergesort](x1) = [1] x1 + [0]
[mergesort#1](x1) = [1] x1 + [0]
[mergesort#2](x1, x2) = [1] x1 + [1]
[msplit](x1) = [1] x1 + [0]
[mergesort#3](x1) = [1] x1 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[msplit#1](x1) = [1] x1 + [0]
[msplit#2](x1, x2) = [1] x1 + [1]
[msplit#3](x1, x2, x3) = [1] x1 + [2]
[#EQ] = [1]
[#GT] = [1]
[#LT] = [1]
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#less^#](x1, x2) = [0]
[#cklt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[merge^#](x1, x2) = [2] x1 + [2] x2 + [1]
[merge#1^#](x1, x2) = [2] x1 + [2] x2 + [0]
[merge#2^#](x1, x2, x3) = [2] x1 + [2] x3 + [1]
[merge#3^#](x1, x2, x3, x4, x5) = [3] x1 + [2] x3 + [2] x5 + [0]
[mergesort^#](x1) = [2] x1 + [1]
[mergesort#1^#](x1) = [2] x1 + [1]
[mergesort#2^#](x1, x2) = [2] x1 + [3]
[mergesort#3^#](x1) = [2] x1 + [1]
[msplit^#](x1) = [0]
[msplit#1^#](x1) = [0]
[msplit#2^#](x1, x2) = [0]
[msplit#3^#](x1, x2, x3) = [0]
This order satisfies following ordering constraints
[#less(@x, @y)] = [1]
>= [1]
= [#cklt(#compare(@x, @y))]
[#compare(#0(), #0())] = [1]
>= [1]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [1]
>= [1]
= [#GT()]
[#compare(#0(), #pos(@y))] = [1]
>= [1]
= [#LT()]
[#compare(#0(), #s(@y))] = [1]
>= [1]
= [#LT()]
[#compare(#neg(@x), #0())] = [1]
>= [1]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [1]
>= [1]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [1]
>= [1]
= [#LT()]
[#compare(#pos(@x), #0())] = [1]
>= [1]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [1]
>= [1]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [1]
>= [1]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [1]
>= [1]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [1]
>= [1]
= [#compare(@x, @y)]
[#cklt(#EQ())] = [1]
>= [1]
= [#false()]
[#cklt(#GT())] = [1]
>= [1]
= [#false()]
[#cklt(#LT())] = [1]
>= [1]
= [#true()]
[merge(@l1, @l2)] = [1] @l1 + [1] @l2 + [0]
>= [1] @l1 + [1] @l2 + [0]
= [merge#1(@l1, @l2)]
[merge#1(::(@x, @xs), @l2)] = [1] @l2 + [1] @xs + [1]
>= [1] @l2 + [1] @xs + [1]
= [merge#2(@l2, @x, @xs)]
[merge#1(nil(), @l2)] = [1] @l2 + [0]
>= [1] @l2 + [0]
= [@l2]
[merge#2(::(@y, @ys), @x, @xs)] = [1] @xs + [1] @ys + [2]
>= [1] @xs + [1] @ys + [2]
= [merge#3(#less(@x, @y), @x, @xs, @y, @ys)]
[merge#2(nil(), @x, @xs)] = [1] @xs + [1]
>= [1] @xs + [1]
= [::(@x, @xs)]
[merge#3(#false(), @x, @xs, @y, @ys)] = [1] @xs + [1] @ys + [2]
>= [1] @xs + [1] @ys + [2]
= [::(@y, merge(::(@x, @xs), @ys))]
[merge#3(#true(), @x, @xs, @y, @ys)] = [1] @xs + [1] @ys + [2]
>= [1] @xs + [1] @ys + [2]
= [::(@x, merge(@xs, ::(@y, @ys)))]
[mergesort(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [mergesort#1(@l)]
[mergesort#1(::(@x1, @xs))] = [1] @xs + [1]
>= [1] @xs + [1]
= [mergesort#2(@xs, @x1)]
[mergesort#1(nil())] = [0]
>= [0]
= [nil()]
[mergesort#2(::(@x2, @xs'), @x1)] = [1] @xs' + [2]
>= [1] @xs' + [2]
= [mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#2(nil(), @x1)] = [1]
>= [1]
= [::(@x1, nil())]
[msplit(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [msplit#1(@l)]
[mergesort#3(tuple#2(@l1, @l2))] = [1] @l1 + [1] @l2 + [0]
>= [1] @l1 + [1] @l2 + [0]
= [merge(mergesort(@l1), mergesort(@l2))]
[msplit#1(::(@x1, @xs))] = [1] @xs + [1]
>= [1] @xs + [1]
= [msplit#2(@xs, @x1)]
[msplit#1(nil())] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[msplit#2(::(@x2, @xs'), @x1)] = [1] @xs' + [2]
>= [1] @xs' + [2]
= [msplit#3(msplit(@xs'), @x1, @x2)]
[msplit#2(nil(), @x1)] = [1]
>= [1]
= [tuple#2(::(@x1, nil()), nil())]
[msplit#3(tuple#2(@l1, @l2), @x1, @x2)] = [1] @l1 + [1] @l2 + [2]
>= [1] @l1 + [1] @l2 + [2]
= [tuple#2(::(@x1, @l1), ::(@x2, @l2))]
[merge^#(@l1, @l2)] = [2] @l1 + [2] @l2 + [1]
> [2] @l1 + [2] @l2 + [0]
= [merge#1^#(@l1, @l2)]
[merge#1^#(::(@x, @xs), @l2)] = [2] @l2 + [2] @xs + [2]
> [2] @l2 + [2] @xs + [1]
= [merge#2^#(@l2, @x, @xs)]
[merge#2^#(::(@y, @ys), @x, @xs)] = [2] @xs + [2] @ys + [3]
>= [2] @xs + [2] @ys + [3]
= [merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)]
[merge#3^#(#false(), @x, @xs, @y, @ys)] = [2] @xs + [2] @ys + [3]
>= [2] @xs + [2] @ys + [3]
= [merge^#(::(@x, @xs), @ys)]
[merge#3^#(#true(), @x, @xs, @y, @ys)] = [2] @xs + [2] @ys + [3]
>= [2] @xs + [2] @ys + [3]
= [merge^#(@xs, ::(@y, @ys))]
[mergesort^#(@l)] = [2] @l + [1]
>= [2] @l + [1]
= [mergesort#1^#(@l)]
[mergesort#1^#(::(@x1, @xs))] = [2] @xs + [3]
>= [2] @xs + [3]
= [mergesort#2^#(@xs, @x1)]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [2] @xs' + [5]
>= [2] @xs' + [5]
= [mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [2] @l1 + [2] @l2 + [1]
>= [2] @l1 + [2] @l2 + [1]
= [merge^#(mergesort(@l1), mergesort(@l2))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [2] @l1 + [2] @l2 + [1]
>= [2] @l1 + [1]
= [mergesort^#(@l1)]
[mergesort#3^#(tuple#2(@l1, @l2))] = [2] @l1 + [2] @l2 + [1]
>= [2] @l2 + [1]
= [mergesort^#(@l2)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {1,2}.
Here rules are labeled according to the (estimated) dependency
graph
1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
-->_1 merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs) :2
2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
-->_1 merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys) :3
3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
-->_1 merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys)) :5
-->_1 merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) :4
4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
6: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :7
7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :8
8: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) :11
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1) :10
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2)) :9
9: mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
-->_1 merge^#(@l1, @l2) -> merge#1^#(@l1, @l2) :1
10: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :6
11: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :6
- The rules {1,2} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
- The rules {1,2,3} have known complexity. These cover all
predecessors of {4,5}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, merge#3^#(#true(), @x, @xs, @y, @ys) -> merge^#(@xs, ::(@y, @ys))
, mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{6,11,8,7,10} Weak SCC
|
`->2:{9} Weak SCC
|
`->3:{1,5,3,2,4} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, 3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, 4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys)
, 5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
, 6: mergesort^#(@l) -> mergesort#1^#(@l)
, 7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 8: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 9: mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, 10: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, 11: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 6: mergesort^#(@l) -> mergesort#1^#(@l)
, 11: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, 8: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 7: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 10: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, 9: mergesort#3^#(tuple#2(@l1, @l2)) ->
merge^#(mergesort(@l1), mergesort(@l2))
, 1: merge^#(@l1, @l2) -> merge#1^#(@l1, @l2)
, 5: merge#3^#(#true(), @x, @xs, @y, @ys) ->
merge^#(@xs, ::(@y, @ys))
, 3: merge#2^#(::(@y, @ys), @x, @xs) ->
merge#3^#(#less(@x, @y), @x, @xs, @y, @ys)
, 2: merge#1^#(::(@x, @xs), @l2) -> merge#2^#(@l2, @x, @xs)
, 4: merge#3^#(#false(), @x, @xs, @y, @ys) ->
merge^#(::(@x, @xs), @ys) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
* Path 1:{6,9,8,7}->2:{10,12,11}: YES(O(1),O(n^3))
------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :3
3: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :5
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :4
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
5: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {6} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) }
Weak DPs: { msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :3
3: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :5
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :4
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
5: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :3
3: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_2 msplit^#(@l) -> msplit#1^#(@l) :5
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :4
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
5: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :3
3: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :5
-->_2 msplit^#(@l) -> msplit#1^#(@l) :4
4: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
5: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the (estimated) dependency graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :2
2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :4
3: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :5
-->_2 msplit^#(@l) -> msplit#1^#(@l) :3
5: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We consider the following dependency-graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
2: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :6
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) :5
-->_2 msplit^#(@l) -> msplit#1^#(@l) :2
5: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2))
-->_3 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
6: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :7
7: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :2
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(merge^#(mergesort(@l1), mergesort(@l2)),
mergesort^#(@l1),
mergesort^#(@l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, merge(@l1, @l2) -> merge#1(@l1, @l2)
, merge#1(::(@x, @xs), @l2) -> merge#2(@l2, @x, @xs)
, merge#1(nil(), @l2) -> @l2
, merge#2(::(@y, @ys), @x, @xs) ->
merge#3(#less(@x, @y), @x, @xs, @y, @ys)
, merge#2(nil(), @x, @xs) -> ::(@x, @xs)
, merge#3(#false(), @x, @xs, @y, @ys) ->
::(@y, merge(::(@x, @xs), @ys))
, merge#3(#true(), @x, @xs, @y, @ys) ->
::(@x, merge(@xs, ::(@y, @ys)))
, mergesort(@l) -> mergesort#1(@l)
, mergesort#1(::(@x1, @xs)) -> mergesort#2(@xs, @x1)
, mergesort#1(nil()) -> nil()
, mergesort#2(::(@x2, @xs'), @x1) ->
mergesort#3(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2(nil(), @x1) -> ::(@x1, nil())
, msplit(@l) -> msplit#1(@l)
, mergesort#3(tuple#2(@l1, @l2)) ->
merge(mergesort(@l1), mergesort(@l2))
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^3)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2))
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^3))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Remaining Rules (B):
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^2)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
2: mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2)) :4
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) :2
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_2(mergesort^#(@l1), mergesort^#(@l2))
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ mergesort#2^#(::(@x2, @xs'), @x1) ->
c_1(mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))),
msplit^#(::(@x1, ::(@x2, @xs')))) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) }
Weak DPs:
{ mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We use the processor 'matrix interpretation of dimension 2' to
orient following rules strictly.
DPs:
{ 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Trs: { msplit#1(nil()) -> tuple#2(nil(), nil()) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(::) = {}, Uargs(msplit) = {}, Uargs(tuple#2) = {},
Uargs(msplit#1) = {}, Uargs(msplit#2) = {}, Uargs(msplit#3) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#less^#) = {}, Uargs(#cklt^#) = {}, Uargs(#compare^#) = {},
Uargs(merge^#) = {}, Uargs(merge#1^#) = {}, Uargs(merge#2^#) = {},
Uargs(merge#3^#) = {}, Uargs(mergesort^#) = {},
Uargs(mergesort#1^#) = {}, Uargs(mergesort#2^#) = {},
Uargs(mergesort#3^#) = {}, Uargs(msplit^#) = {},
Uargs(msplit#1^#) = {}, Uargs(msplit#2^#) = {},
Uargs(msplit#3^#) = {}, Uargs(c_1) = {}, Uargs(c_2) = {},
Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[::](x1, x2) = [1 2] x2 + [1]
[0 1] [1]
[nil] = [0]
[0]
[#false] = [0]
[0]
[#true] = [0]
[0]
[msplit](x1) = [1 0] x1 + [1]
[0 2] [2]
[tuple#2](x1, x2) = [1 1] x1 + [1 1] x2 + [0]
[0 1] [0 1] [2]
[msplit#1](x1) = [1 0] x1 + [1]
[0 2] [2]
[msplit#2](x1, x2) = [1 2] x1 + [2]
[0 2] [3]
[msplit#3](x1, x2, x3) = [1 2] x1 + [0]
[0 1] [2]
[#EQ] = [0]
[0]
[#GT] = [0]
[0]
[#LT] = [0]
[0]
[#0] = [0]
[0]
[#neg](x1) = [1 0] x1 + [0]
[0 0] [0]
[#pos](x1) = [0]
[0]
[#s](x1) = [1 0] x1 + [0]
[0 1] [0]
[#less^#](x1, x2) = [0]
[0]
[#cklt^#](x1) = [0]
[0]
[#compare^#](x1, x2) = [0]
[0]
[merge^#](x1, x2) = [0]
[0]
[merge#1^#](x1, x2) = [0]
[0]
[merge#2^#](x1, x2, x3) = [0]
[0]
[merge#3^#](x1, x2, x3, x4, x5) = [0]
[0]
[mergesort^#](x1) = [1 1] x1 + [0]
[0 0] [0]
[mergesort#1^#](x1) = [1 1] x1 + [0]
[0 0] [0]
[mergesort#2^#](x1, x2) = [1 3] x1 + [2]
[0 0] [0]
[mergesort#3^#](x1) = [1 0] x1 + [1]
[0 0] [0]
[msplit^#](x1) = [0]
[0]
[msplit#1^#](x1) = [0]
[0]
[msplit#2^#](x1, x2) = [0]
[0]
[msplit#3^#](x1, x2, x3) = [0]
[0]
[c_1](x1, x2) = [0]
[0]
[c_2](x1, x2) = [0]
[0]
[c] = [0]
[0]
[c_1](x1, x2) = [1 0] x1 + [1 1] x2 + [0]
[0 0] [0 0] [0]
This order satisfies following ordering constraints
[msplit(@l)] = [1 0] @l + [1]
[0 2] [2]
>= [1 0] @l + [1]
[0 2] [2]
= [msplit#1(@l)]
[msplit#1(::(@x1, @xs))] = [1 2] @xs + [2]
[0 2] [4]
>= [1 2] @xs + [2]
[0 2] [3]
= [msplit#2(@xs, @x1)]
[msplit#1(nil())] = [1]
[2]
> [0]
[2]
= [tuple#2(nil(), nil())]
[msplit#2(::(@x2, @xs'), @x1)] = [1 4] @xs' + [5]
[0 2] [5]
>= [1 4] @xs' + [5]
[0 2] [4]
= [msplit#3(msplit(@xs'), @x1, @x2)]
[msplit#2(nil(), @x1)] = [2]
[3]
>= [2]
[3]
= [tuple#2(::(@x1, nil()), nil())]
[msplit#3(tuple#2(@l1, @l2), @x1, @x2)] = [1 3] @l1 + [1 3] @l2 + [4]
[0 1] [0 1] [4]
>= [1 3] @l1 + [1 3] @l2 + [4]
[0 1] [0 1] [4]
= [tuple#2(::(@x1, @l1), ::(@x2, @l2))]
[mergesort^#(@l)] = [1 1] @l + [0]
[0 0] [0]
>= [1 1] @l + [0]
[0 0] [0]
= [mergesort#1^#(@l)]
[mergesort#1^#(::(@x1, @xs))] = [1 3] @xs + [2]
[0 0] [0]
>= [1 3] @xs + [2]
[0 0] [0]
= [mergesort#2^#(@xs, @x1)]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [1 5] @xs' + [6]
[0 0] [0]
>= [1 4] @xs' + [6]
[0 0] [0]
= [mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [1 1] @l1 + [1 1] @l2 + [1]
[0 0] [0 0] [0]
> [1 1] @l1 + [1 1] @l2 + [0]
[0 0] [0 0] [0]
= [c_1(mergesort^#(@l1), mergesort^#(@l2))]
Processor 'matrix interpretation of dimension 2' induces the
complexity certificate YES(?,O(n^2)) on application of rules {4}.
Here rules are labeled according to the (estimated) dependency
graph
1: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
2: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) :4
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :2
4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2))
-->_2 mergesort^#(@l) -> mergesort#1^#(@l) :1
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :1
- The rules {4} have known complexity. These cover all predecessors
of {1}, their complexity is equally bounded.
- The rules {1,4} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
- The rules {1,3,4} have known complexity. These cover all
predecessors of {2}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4} is given by YES(?,O(n^2)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,4,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 4: mergesort#3^#(tuple#2(@l1, @l2)) ->
c_1(mergesort^#(@l1), mergesort^#(@l2))
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { msplit^#(@l) -> msplit#1^#(@l) }
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 5: mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, 8: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, 9: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Sub-proof:
----------
The following argument positions are usable:
Uargs(::) = {}, Uargs(msplit) = {}, Uargs(tuple#2) = {},
Uargs(msplit#1) = {}, Uargs(msplit#2) = {}, Uargs(msplit#3) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#less^#) = {}, Uargs(#cklt^#) = {}, Uargs(#compare^#) = {},
Uargs(merge^#) = {}, Uargs(merge#1^#) = {}, Uargs(merge#2^#) = {},
Uargs(merge#3^#) = {}, Uargs(mergesort^#) = {},
Uargs(mergesort#1^#) = {}, Uargs(mergesort#2^#) = {},
Uargs(mergesort#3^#) = {}, Uargs(msplit^#) = {},
Uargs(msplit#1^#) = {}, Uargs(msplit#2^#) = {},
Uargs(msplit#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[#false] = [0]
[#true] = [0]
[msplit](x1) = [1] x1 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[msplit#1](x1) = [1] x1 + [0]
[msplit#2](x1, x2) = [1] x1 + [1]
[msplit#3](x1, x2, x3) = [1] x1 + [2]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#0] = [0]
[#neg](x1) = [0]
[#pos](x1) = [0]
[#s](x1) = [0]
[#less^#](x1, x2) = [0]
[#cklt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[merge^#](x1, x2) = [0]
[merge#1^#](x1, x2) = [0]
[merge#2^#](x1, x2, x3) = [0]
[merge#3^#](x1, x2, x3, x4, x5) = [0]
[mergesort^#](x1) = [3] x1 + [0]
[mergesort#1^#](x1) = [3] x1 + [0]
[mergesort#2^#](x1, x2) = [3] x1 + [3]
[mergesort#3^#](x1) = [3] x1 + [0]
[msplit^#](x1) = [2] x1 + [0]
[msplit#1^#](x1) = [2] x1 + [0]
[msplit#2^#](x1, x2) = [2] x1 + [0]
[msplit#3^#](x1, x2, x3) = [0]
This order satisfies following ordering constraints
[msplit(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [msplit#1(@l)]
[msplit#1(::(@x1, @xs))] = [1] @xs + [1]
>= [1] @xs + [1]
= [msplit#2(@xs, @x1)]
[msplit#1(nil())] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[msplit#2(::(@x2, @xs'), @x1)] = [1] @xs' + [2]
>= [1] @xs' + [2]
= [msplit#3(msplit(@xs'), @x1, @x2)]
[msplit#2(nil(), @x1)] = [1]
>= [1]
= [tuple#2(::(@x1, nil()), nil())]
[msplit#3(tuple#2(@l1, @l2), @x1, @x2)] = [1] @l1 + [1] @l2 + [2]
>= [1] @l1 + [1] @l2 + [2]
= [tuple#2(::(@x1, @l1), ::(@x2, @l2))]
[mergesort^#(@l)] = [3] @l + [0]
>= [3] @l + [0]
= [mergesort#1^#(@l)]
[mergesort#1^#(::(@x1, @xs))] = [3] @xs + [3]
>= [3] @xs + [3]
= [mergesort#2^#(@xs, @x1)]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [3] @xs' + [6]
>= [3] @xs' + [6]
= [mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))]
[mergesort#2^#(::(@x2, @xs'), @x1)] = [3] @xs' + [6]
> [2] @xs' + [4]
= [msplit^#(::(@x1, ::(@x2, @xs')))]
[mergesort#3^#(tuple#2(@l1, @l2))] = [3] @l1 + [3] @l2 + [0]
>= [3] @l1 + [0]
= [mergesort^#(@l1)]
[mergesort#3^#(tuple#2(@l1, @l2))] = [3] @l1 + [3] @l2 + [0]
>= [3] @l2 + [0]
= [mergesort^#(@l2)]
[msplit^#(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [msplit#1^#(@l)]
[msplit#1^#(::(@x1, @xs))] = [2] @xs + [2]
> [2] @xs + [0]
= [msplit#2^#(@xs, @x1)]
[msplit#2^#(::(@x2, @xs'), @x1)] = [2] @xs' + [2]
> [2] @xs' + [0]
= [msplit^#(@xs')]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{5,8,9}. Here rules are labeled according to the (estimated)
dependency graph
1: msplit^#(@l) -> msplit#1^#(@l)
-->_1 msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) :8
2: mergesort^#(@l) -> mergesort#1^#(@l)
-->_1 mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1) :3
3: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs'))) :5
-->_1 mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs')))) :4
4: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2) :7
-->_1 mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1) :6
5: mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
-->_1 msplit^#(@l) -> msplit#1^#(@l) :1
6: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :2
7: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
-->_1 mergesort^#(@l) -> mergesort#1^#(@l) :2
8: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
-->_1 msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') :9
9: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
-->_1 msplit^#(@l) -> msplit#1^#(@l) :1
- The rules {5,8,9} have known complexity. These cover all
predecessors of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,5,8,9} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ mergesort^#(@l) -> mergesort#1^#(@l)
, mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, msplit^#(@l) -> msplit#1^#(@l)
, msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,6,3,2,5} Weak SCC
|
`->2:{4} Weak SCC
|
`->3:{7,9,8} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 4: mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, 5: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, 6: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, 7: msplit^#(@l) -> msplit#1^#(@l)
, 8: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1)
, 9: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs') }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: mergesort^#(@l) -> mergesort#1^#(@l)
, 6: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l2)
, 3: mergesort#2^#(::(@x2, @xs'), @x1) ->
mergesort#3^#(msplit(::(@x1, ::(@x2, @xs'))))
, 2: mergesort#1^#(::(@x1, @xs)) -> mergesort#2^#(@xs, @x1)
, 5: mergesort#3^#(tuple#2(@l1, @l2)) -> mergesort^#(@l1)
, 4: mergesort#2^#(::(@x2, @xs'), @x1) ->
msplit^#(::(@x1, ::(@x2, @xs')))
, 7: msplit^#(@l) -> msplit#1^#(@l)
, 9: msplit#2^#(::(@x2, @xs'), @x1) -> msplit^#(@xs')
, 8: msplit#1^#(::(@x1, @xs)) -> msplit#2^#(@xs, @x1) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ msplit(@l) -> msplit#1(@l)
, msplit#1(::(@x1, @xs)) -> msplit#2(@xs, @x1)
, msplit#1(nil()) -> tuple#2(nil(), nil())
, msplit#2(::(@x2, @xs'), @x1) -> msplit#3(msplit(@xs'), @x1, @x2)
, msplit#2(nil(), @x1) -> tuple#2(::(@x1, nil()), nil())
, msplit#3(tuple#2(@l1, @l2), @x1, @x2) ->
tuple#2(::(@x1, @l1), ::(@x2, @l2)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
Hurray, we answered YES(?,O(n^3))