tct
YES(?,O(n^2))
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We add following dependency tuples
Strict DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, append#1^#(nil(), @ys) -> c_8()
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, appendD#1^#(nil(), @ys) -> c_11()
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#1^#(nil()) -> c_14()
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, split#1^#(nil(), @pivot) -> c_23()
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#1^#(nil()) -> c_19()
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
, splitD#1^#(nil(), @pivot) -> c_28()
, split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, split#3^#(#false(), @ls, @rs, @x) -> c_25()
, split#3^#(#true(), @ls, @rs, @x) -> c_26()
, splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
Weak DPs:
{ #ckgt^#(#EQ()) -> c_44()
, #ckgt^#(#GT()) -> c_45()
, #ckgt^#(#LT()) -> c_46()
, #compare^#(#0(), #0()) -> c_32()
, #compare^#(#0(), #neg(@y)) -> c_33()
, #compare^#(#0(), #pos(@y)) -> c_34()
, #compare^#(#0(), #s(@y)) -> c_35()
, #compare^#(#neg(@x), #0()) -> c_36()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_38()
, #compare^#(#pos(@x), #0()) -> c_39()
, #compare^#(#pos(@x), #neg(@y)) -> c_40()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_42()
, #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^2)).
Strict DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, append#1^#(nil(), @ys) -> c_8()
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, appendD#1^#(nil(), @ys) -> c_11()
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#1^#(nil()) -> c_14()
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, split#1^#(nil(), @pivot) -> c_23()
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#1^#(nil()) -> c_19()
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
, splitD#1^#(nil(), @pivot) -> c_28()
, split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, split#3^#(#false(), @ls, @rs, @x) -> c_25()
, split#3^#(#true(), @ls, @rs, @x) -> c_26()
, splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
Weak DPs:
{ #ckgt^#(#EQ()) -> c_44()
, #ckgt^#(#GT()) -> c_45()
, #ckgt^#(#LT()) -> c_46()
, #compare^#(#0(), #0()) -> c_32()
, #compare^#(#0(), #neg(@y)) -> c_33()
, #compare^#(#0(), #pos(@y)) -> c_34()
, #compare^#(#0(), #s(@y)) -> c_35()
, #compare^#(#neg(@x), #0()) -> c_36()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_38()
, #compare^#(#pos(@x), #0()) -> c_39()
, #compare^#(#pos(@x), #neg(@y)) -> c_40()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_42()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: #abs^#(#0()) -> c_1()
2: #abs^#(#neg(@x)) -> c_2()
3: #abs^#(#pos(@x)) -> c_3()
4: #abs^#(#s(@x)) -> c_4()
5: #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :46
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :44
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :40
-->_2 #compare^#(#s(@x), #0()) -> c_42() :45
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_40() :43
-->_2 #compare^#(#pos(@x), #0()) -> c_39() :42
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_38() :41
-->_2 #compare^#(#neg(@x), #0()) -> c_36() :39
-->_2 #compare^#(#0(), #s(@y)) -> c_35() :38
-->_2 #compare^#(#0(), #pos(@y)) -> c_34() :37
-->_2 #compare^#(#0(), #neg(@y)) -> c_33() :36
-->_2 #compare^#(#0(), #0()) -> c_32() :35
-->_1 #ckgt^#(#LT()) -> c_46() :34
-->_1 #ckgt^#(#GT()) -> c_45() :33
-->_1 #ckgt^#(#EQ()) -> c_44() :32
6: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :7
-->_1 append#1^#(nil(), @ys) -> c_8() :8
7: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :6
8: append#1^#(nil(), @ys) -> c_8()
9: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :10
-->_1 appendD#1^#(nil(), @ys) -> c_11() :11
10: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :9
11: appendD#1^#(nil(), @ys) -> c_11()
12: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :13
-->_1 quicksort#1^#(nil()) -> c_14() :14
13: quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :16
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :15
14: quicksort#1^#(nil()) -> c_14()
15: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :12
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :12
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :6
16: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs)) :17
-->_1 split#1^#(nil(), @pivot) -> c_23() :18
17: split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
-->_1 split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) :26
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :16
18: split#1^#(nil(), @pivot) -> c_23()
19: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :20
-->_1 quicksortD#1^#(nil()) -> c_19() :21
20: quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :23
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :22
21: quicksortD#1^#(nil()) -> c_19()
22: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :19
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :19
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :9
23: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) :24
-->_1 splitD#1^#(nil(), @pivot) -> c_28() :25
24: splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
-->_1 splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) :29
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :23
25: splitD#1^#(nil(), @pivot) -> c_28()
26: split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
-->_1 split#3^#(#true(), @ls, @rs, @x) -> c_26() :28
-->_1 split#3^#(#false(), @ls, @rs, @x) -> c_25() :27
-->_2 #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :5
27: split#3^#(#false(), @ls, @rs, @x) -> c_25()
28: split#3^#(#true(), @ls, @rs, @x) -> c_26()
29: splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
-->_1 splitD#3^#(#true(), @ls, @rs, @x) -> c_31() :31
-->_1 splitD#3^#(#false(), @ls, @rs, @x) -> c_30() :30
-->_2 #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :5
30: splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
31: splitD#3^#(#true(), @ls, @rs, @x) -> c_31()
32: #ckgt^#(#EQ()) -> c_44()
33: #ckgt^#(#GT()) -> c_45()
34: #ckgt^#(#LT()) -> c_46()
35: #compare^#(#0(), #0()) -> c_32()
36: #compare^#(#0(), #neg(@y)) -> c_33()
37: #compare^#(#0(), #pos(@y)) -> c_34()
38: #compare^#(#0(), #s(@y)) -> c_35()
39: #compare^#(#neg(@x), #0()) -> c_36()
40: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :44
-->_1 #compare^#(#s(@x), #0()) -> c_42() :45
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :43
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :42
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :41
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :40
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :39
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :37
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :36
-->_1 #compare^#(#0(), #0()) -> c_32() :35
41: #compare^#(#neg(@x), #pos(@y)) -> c_38()
42: #compare^#(#pos(@x), #0()) -> c_39()
43: #compare^#(#pos(@x), #neg(@y)) -> c_40()
44: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#s(@x), #0()) -> c_42() :45
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :44
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :43
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :42
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :41
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :40
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :39
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :37
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :36
-->_1 #compare^#(#0(), #0()) -> c_32() :35
45: #compare^#(#s(@x), #0()) -> c_42()
46: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#s(@x), #0()) -> c_42() :45
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :44
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :43
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :42
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :41
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :40
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :39
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :37
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :36
-->_1 #compare^#(#0(), #0()) -> c_32() :35
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {21} and add Pre({21}) = {19} to the strict component.
- We remove {25} and add Pre({25}) = {23} to the strict component.
- We remove {30} and add Pre({30}) = {29} to the strict component.
- We remove {31} and add Pre({31}) = {29} to the strict component.
- We remove {14} and add Pre({14}) = {12} to the strict component.
- We remove {18} and add Pre({18}) = {16} to the strict component.
- We remove {27} and add Pre({27}) = {26} to the strict component.
- We remove {28} and add Pre({28}) = {26} to the strict component.
- We remove {11} and add Pre({11}) = {9} to the strict component.
- We remove {8} and add Pre({8}) = {6} to the strict component.
- We remove {5} and add Pre({5}) = {29,26} to the strict component.
- We remove {4} and add Pre({4}) = {} to the strict component.
- We remove {3} and add Pre({3}) = {} to the strict component.
- We remove {2} and add Pre({2}) = {} to the strict component.
- We remove {1} and add Pre({1}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
, split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_44()
, #ckgt^#(#GT()) -> c_45()
, #ckgt^#(#LT()) -> c_46()
, #compare^#(#0(), #0()) -> c_32()
, #compare^#(#0(), #neg(@y)) -> c_33()
, #compare^#(#0(), #pos(@y)) -> c_34()
, #compare^#(#0(), #s(@y)) -> c_35()
, #compare^#(#neg(@x), #0()) -> c_36()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_38()
, #compare^#(#pos(@x), #0()) -> c_39()
, #compare^#(#pos(@x), #neg(@y)) -> c_40()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_42()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, append#1^#(nil(), @ys) -> c_8()
, appendD#1^#(nil(), @ys) -> c_11()
, quicksort#1^#(nil()) -> c_14()
, split#1^#(nil(), @pivot) -> c_23()
, quicksortD#1^#(nil()) -> c_19()
, splitD#1^#(nil(), @pivot) -> c_28()
, split#3^#(#false(), @ls, @rs, @x) -> c_25()
, split#3^#(#true(), @ls, @rs, @x) -> c_26()
, splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :2
-->_1 append#1^#(nil(), @ys) -> c_8() :37
2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
3: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :4
-->_1 appendD#1^#(nil(), @ys) -> c_11() :38
4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :3
5: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :6
-->_1 quicksort#1^#(nil()) -> c_14() :39
6: quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :8
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :7
7: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :5
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :5
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
8: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs)) :9
-->_1 split#1^#(nil(), @pivot) -> c_23() :40
9: split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
-->_1 split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) :15
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :8
10: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :11
-->_1 quicksortD#1^#(nil()) -> c_19() :41
11: quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :13
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :12
12: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :10
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :10
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :3
13: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) :14
-->_1 splitD#1^#(nil(), @pivot) -> c_28() :42
14: splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
-->_1 splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) :16
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :13
15: split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
-->_2 #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :21
-->_1 split#3^#(#true(), @ls, @rs, @x) -> c_26() :44
-->_1 split#3^#(#false(), @ls, @rs, @x) -> c_25() :43
16: splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
-->_2 #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :21
-->_1 splitD#3^#(#true(), @ls, @rs, @x) -> c_31() :46
-->_1 splitD#3^#(#false(), @ls, @rs, @x) -> c_30() :45
17: #abs^#(#0()) -> c_1()
18: #abs^#(#neg(@x)) -> c_2()
19: #abs^#(#pos(@x)) -> c_3()
20: #abs^#(#s(@x)) -> c_4()
21: #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :36
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :34
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :30
-->_2 #compare^#(#s(@x), #0()) -> c_42() :35
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_40() :33
-->_2 #compare^#(#pos(@x), #0()) -> c_39() :32
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_38() :31
-->_2 #compare^#(#neg(@x), #0()) -> c_36() :29
-->_2 #compare^#(#0(), #s(@y)) -> c_35() :28
-->_2 #compare^#(#0(), #pos(@y)) -> c_34() :27
-->_2 #compare^#(#0(), #neg(@y)) -> c_33() :26
-->_2 #compare^#(#0(), #0()) -> c_32() :25
-->_1 #ckgt^#(#LT()) -> c_46() :24
-->_1 #ckgt^#(#GT()) -> c_45() :23
-->_1 #ckgt^#(#EQ()) -> c_44() :22
22: #ckgt^#(#EQ()) -> c_44()
23: #ckgt^#(#GT()) -> c_45()
24: #ckgt^#(#LT()) -> c_46()
25: #compare^#(#0(), #0()) -> c_32()
26: #compare^#(#0(), #neg(@y)) -> c_33()
27: #compare^#(#0(), #pos(@y)) -> c_34()
28: #compare^#(#0(), #s(@y)) -> c_35()
29: #compare^#(#neg(@x), #0()) -> c_36()
30: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :36
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :34
-->_1 #compare^#(#s(@x), #0()) -> c_42() :35
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :33
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :32
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :31
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :30
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :29
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :28
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :27
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :26
-->_1 #compare^#(#0(), #0()) -> c_32() :25
31: #compare^#(#neg(@x), #pos(@y)) -> c_38()
32: #compare^#(#pos(@x), #0()) -> c_39()
33: #compare^#(#pos(@x), #neg(@y)) -> c_40()
34: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :36
-->_1 #compare^#(#s(@x), #0()) -> c_42() :35
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :34
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :33
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :32
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :31
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :30
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :29
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :28
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :27
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :26
-->_1 #compare^#(#0(), #0()) -> c_32() :25
35: #compare^#(#s(@x), #0()) -> c_42()
36: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :36
-->_1 #compare^#(#s(@x), #0()) -> c_42() :35
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :34
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :33
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :32
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :31
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :30
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :29
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :28
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :27
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :26
-->_1 #compare^#(#0(), #0()) -> c_32() :25
37: append#1^#(nil(), @ys) -> c_8()
38: appendD#1^#(nil(), @ys) -> c_11()
39: quicksort#1^#(nil()) -> c_14()
40: split#1^#(nil(), @pivot) -> c_23()
41: quicksortD#1^#(nil()) -> c_19()
42: splitD#1^#(nil(), @pivot) -> c_28()
43: split#3^#(#false(), @ls, @rs, @x) -> c_25()
44: split#3^#(#true(), @ls, @rs, @x) -> c_26()
45: splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
46: splitD#3^#(#true(), @ls, @rs, @x) -> c_31()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {16} and add Pre({16}) = {14} to the strict component.
- We remove {15} and add Pre({15}) = {9} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_44()
, #ckgt^#(#GT()) -> c_45()
, #ckgt^#(#LT()) -> c_46()
, #compare^#(#0(), #0()) -> c_32()
, #compare^#(#0(), #neg(@y)) -> c_33()
, #compare^#(#0(), #pos(@y)) -> c_34()
, #compare^#(#0(), #s(@y)) -> c_35()
, #compare^#(#neg(@x), #0()) -> c_36()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_38()
, #compare^#(#pos(@x), #0()) -> c_39()
, #compare^#(#pos(@x), #neg(@y)) -> c_40()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_42()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, append#1^#(nil(), @ys) -> c_8()
, appendD#1^#(nil(), @ys) -> c_11()
, quicksort#1^#(nil()) -> c_14()
, split#1^#(nil(), @pivot) -> c_23()
, quicksortD#1^#(nil()) -> c_19()
, splitD#1^#(nil(), @pivot) -> c_28()
, split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, split#3^#(#false(), @ls, @rs, @x) -> c_25()
, split#3^#(#true(), @ls, @rs, @x) -> c_26()
, splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the the dependency graph
->12:{5,7,6}
|
|->35:{1,2}
| |
| `->36:{35} Weak SCC
|
|->14:{8,9}
| |
| |->15:{38} Weak SCC
| |
| `->16:{41} Weak SCC
| |
| |->17:{19} Weak SCC
| | |
| | |->18:{20} Weak SCC
| | |
| | |->19:{21} Weak SCC
| | |
| | |->20:{22} Weak SCC
| | |
| | |->22:{23} Weak SCC
| | |
| | |->23:{24} Weak SCC
| | |
| | |->24:{25} Weak SCC
| | |
| | |->25:{26} Weak SCC
| | |
| | |->26:{27} Weak SCC
| | |
| | |->27:{29} Weak SCC
| | |
| | |->28:{30} Weak SCC
| | |
| | |->29:{31} Weak SCC
| | |
| | |->30:{33} Weak SCC
| | |
| | `->21:{34,32,28} Weak SCC
| | |
| | |->22:{23} Weak SCC
| | |
| | |->23:{24} Weak SCC
| | |
| | |->24:{25} Weak SCC
| | |
| | |->25:{26} Weak SCC
| | |
| | |->26:{27} Weak SCC
| | |
| | |->27:{29} Weak SCC
| | |
| | |->28:{30} Weak SCC
| | |
| | |->29:{31} Weak SCC
| | |
| | `->30:{33} Weak SCC
| |
| |->31:{42} Weak SCC
| |
| `->32:{43} Weak SCC
|
`->13:{37} Weak SCC
->5:{10,12,11}
|
|->33:{3,4}
| |
| `->34:{36} Weak SCC
|
|->7:{13,14}
| |
| |->8:{40} Weak SCC
| |
| `->9:{44} Weak SCC
| |
| |->17:{19} Weak SCC
| | |
| | |->18:{20} Weak SCC
| | |
| | |->19:{21} Weak SCC
| | |
| | |->20:{22} Weak SCC
| | |
| | |->22:{23} Weak SCC
| | |
| | |->23:{24} Weak SCC
| | |
| | |->24:{25} Weak SCC
| | |
| | |->25:{26} Weak SCC
| | |
| | |->26:{27} Weak SCC
| | |
| | |->27:{29} Weak SCC
| | |
| | |->28:{30} Weak SCC
| | |
| | |->29:{31} Weak SCC
| | |
| | |->30:{33} Weak SCC
| | |
| | `->21:{34,32,28} Weak SCC
| | |
| | |->22:{23} Weak SCC
| | |
| | |->23:{24} Weak SCC
| | |
| | |->24:{25} Weak SCC
| | |
| | |->25:{26} Weak SCC
| | |
| | |->26:{27} Weak SCC
| | |
| | |->27:{29} Weak SCC
| | |
| | |->28:{30} Weak SCC
| | |
| | |->29:{31} Weak SCC
| | |
| | `->30:{33} Weak SCC
| |
| |->10:{45} Weak SCC
| |
| `->11:{46} Weak SCC
|
`->6:{39} Weak SCC
->4:{15} Weak SCC
->3:{16} Weak SCC
->2:{17} Weak SCC
->1:{18} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, 3: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, 4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, 5: quicksort^#(@l) -> quicksort#1^#(@l)
, 6: quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, 8: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 9: split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, 10: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 11: quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, 12: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, 13: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, 14: splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) }
Weak DPs:
{ 15: #abs^#(#0()) -> c_1()
, 16: #abs^#(#neg(@x)) -> c_2()
, 17: #abs^#(#pos(@x)) -> c_3()
, 18: #abs^#(#s(@x)) -> c_4()
, 19: #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 20: #ckgt^#(#EQ()) -> c_44()
, 21: #ckgt^#(#GT()) -> c_45()
, 22: #ckgt^#(#LT()) -> c_46()
, 23: #compare^#(#0(), #0()) -> c_32()
, 24: #compare^#(#0(), #neg(@y)) -> c_33()
, 25: #compare^#(#0(), #pos(@y)) -> c_34()
, 26: #compare^#(#0(), #s(@y)) -> c_35()
, 27: #compare^#(#neg(@x), #0()) -> c_36()
, 28: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 29: #compare^#(#neg(@x), #pos(@y)) -> c_38()
, 30: #compare^#(#pos(@x), #0()) -> c_39()
, 31: #compare^#(#pos(@x), #neg(@y)) -> c_40()
, 32: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 33: #compare^#(#s(@x), #0()) -> c_42()
, 34: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 35: append#1^#(nil(), @ys) -> c_8()
, 36: appendD#1^#(nil(), @ys) -> c_11()
, 37: quicksort#1^#(nil()) -> c_14()
, 38: split#1^#(nil(), @pivot) -> c_23()
, 39: quicksortD#1^#(nil()) -> c_19()
, 40: splitD#1^#(nil(), @pivot) -> c_28()
, 41: split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, 42: split#3^#(#false(), @ls, @rs, @x) -> c_25()
, 43: split#3^#(#true(), @ls, @rs, @x) -> c_26()
, 44: splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, 45: splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, 46: splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 18: #abs^#(#s(@x)) -> c_4()
, 17: #abs^#(#pos(@x)) -> c_3()
, 16: #abs^#(#neg(@x)) -> c_2()
, 15: #abs^#(#0()) -> c_1()
, 39: quicksortD#1^#(nil()) -> c_19()
, 40: splitD#1^#(nil(), @pivot) -> c_28()
, 44: splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, 45: splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, 46: splitD#3^#(#true(), @ls, @rs, @x) -> c_31()
, 37: quicksort#1^#(nil()) -> c_14()
, 38: split#1^#(nil(), @pivot) -> c_23()
, 41: split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, 19: #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 20: #ckgt^#(#EQ()) -> c_44()
, 21: #ckgt^#(#GT()) -> c_45()
, 22: #ckgt^#(#LT()) -> c_46()
, 34: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 32: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 28: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 23: #compare^#(#0(), #0()) -> c_32()
, 24: #compare^#(#0(), #neg(@y)) -> c_33()
, 25: #compare^#(#0(), #pos(@y)) -> c_34()
, 26: #compare^#(#0(), #s(@y)) -> c_35()
, 27: #compare^#(#neg(@x), #0()) -> c_36()
, 29: #compare^#(#neg(@x), #pos(@y)) -> c_38()
, 30: #compare^#(#pos(@x), #0()) -> c_39()
, 31: #compare^#(#pos(@x), #neg(@y)) -> c_40()
, 33: #compare^#(#s(@x), #0()) -> c_42()
, 42: split#3^#(#false(), @ls, @rs, @x) -> c_25()
, 43: split#3^#(#true(), @ls, @rs, @x) -> c_26()
, 36: appendD#1^#(nil(), @ys) -> c_11()
, 35: append#1^#(nil(), @ys) -> c_8() }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the following dependency-graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :2
2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
3: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :4
4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :3
5: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :6
6: quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :8
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :7
7: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :5
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :5
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
8: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs)) :9
9: split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :8
10: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :11
11: quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :13
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :12
12: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :10
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :10
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :3
13: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) :14
14: splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :13
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We employ 'linear path analysis' using the following approximated
dependency graph:
->3:{5,7,6} [ ? ]
|
|->6:{1,2} [ YES(O(1),O(n^2)) ]
|
`->4:{8,9} [ YES(O(1),O(n^2)) ]
->1:{10,12,11} [ ? ]
|
|->5:{3,4} [ YES(O(1),O(n^2)) ]
|
`->2:{13,14} [ YES(O(1),O(n^2)) ]
Here dependency-pairs are as follows:
Strict DPs:
{ 1: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, 3: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, 4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, 5: quicksort^#(@l) -> quicksort#1^#(@l)
, 6: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, 8: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 9: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
, 10: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 11: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, 12: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, 13: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, 14: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
* Path 3:{5,7,6}->6:{1,2}: YES(O(1),O(n^2))
-----------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :2
2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
3: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :4
4: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :5
5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :3
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :3
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :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^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak DPs: { append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :5
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :3
3: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :4
4: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
5: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :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^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :4
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :3
3: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :5
4: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :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^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :3
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :4
3: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
4: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :5
5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) }
Remaining Rules (B):
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { append^#(@l, @ys) -> append#1^#(@l, @ys) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :3
2: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
3: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :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^1)).
Strict DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :3
3: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
, 3: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(append) = {}, Uargs(append#1) = {}, Uargs(::) = {},
Uargs(quicksort) = {}, Uargs(quicksort#1) = {}, Uargs(split) = {},
Uargs(quicksort#2) = {}, Uargs(tuple#2) = {}, Uargs(split#1) = {},
Uargs(split#2) = {}, Uargs(split#3) = {}, Uargs(#abs^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}, Uargs(c_1) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[append](x1, x2) = [0]
[append#1](x1, x2) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[quicksort](x1) = [0]
[quicksort#1](x1) = [0]
[split](x1, x2) = [1] x2 + [0]
[quicksort#2](x1, x2) = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[split#1](x1, x2) = [1] x1 + [0]
[split#2](x1, x2, x3) = [1] x1 + [1]
[split#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#false] = [0]
[#true] = [0]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [2] x1 + [0]
[quicksort#1^#](x1) = [2] x1 + [0]
[quicksort#2^#](x1, x2) = [2] x1 + [1]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [0]
[quicksortD#1^#](x1) = [0]
[quicksortD#2^#](x1, x2) = [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
[c_1](x1, x2, x3) = [0]
[c] = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[split(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [split#1(@l, @pivot)]
[split#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [split#2(split(@pivot, @xs), @pivot, @x)]
[split#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[split#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [split#3(#greater(@x, @pivot), @ls, @rs, @x)]
[split#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[split#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksort^#(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [quicksort#1^#(@l)]
[quicksort#1^#(::(@z, @zs))] = [2] @zs + [2]
> [2] @zs + [1]
= [quicksort#2^#(split(@z, @zs), @z)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [1]
> [2] @xs + [2] @ys + [0]
= [c_1(quicksort^#(@xs), quicksort^#(@ys))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {1,3}.
Here rules are labeled according to the (estimated) dependency
graph
1: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :2
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :3
3: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) :1
- The rules {1,3} 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}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: { append^#(@l, @ys) -> append#1^#(@l, @ys) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 4: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, 6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
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(#s(@x), #0()) -> #GT()
, append#1(nil(), @ys) -> @ys
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys))) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(append) = {}, Uargs(append#1) = {}, Uargs(::) = {},
Uargs(quicksort) = {}, Uargs(quicksort#1) = {}, Uargs(split) = {},
Uargs(quicksort#2) = {}, Uargs(tuple#2) = {}, Uargs(split#1) = {},
Uargs(split#2) = {}, Uargs(split#3) = {}, Uargs(#abs^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [2]
[#neg](x1) = [1] x1 + [1]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [1]
[#compare](x1, x2) = [3] x1 + [3] x2 + [0]
[#ckgt](x1) = [1]
[append](x1, x2) = [1] x1 + [1] x2 + [1]
[append#1](x1, x2) = [1] x1 + [1] x2 + [1]
[::](x1, x2) = [1] x2 + [2]
[nil] = [0]
[quicksort](x1) = [2] x1 + [0]
[quicksort#1](x1) = [2] x1 + [0]
[split](x1, x2) = [1] x2 + [1]
[quicksort#2](x1, x2) = [2] x1 + [2]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [1]
[split#1](x1, x2) = [1] x1 + [1]
[split#2](x1, x2, x3) = [1] x1 + [2]
[split#3](x1, x2, x3, x4) = [2] x1 + [1] x2 + [1] x3 + [1]
[#false] = [1]
[#true] = [1]
[#EQ] = [0]
[#GT] = [2]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [1] x1 + [3]
[append#1^#](x1, x2) = [1] x1 + [1]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [3] x1 + [3]
[quicksort#1^#](x1) = [3] x1 + [3]
[quicksort#2^#](x1, x2) = [3] x1 + [1]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [0]
[quicksortD#1^#](x1) = [0]
[quicksortD#2^#](x1, x2) = [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [1]
>= [1]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [12]
> [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [3] @y + [9]
> [2]
= [#GT()]
[#compare(#0(), #pos(@y))] = [3] @y + [6]
> [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [3] @y + [6]
> [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [3] @x + [9]
> [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [3] @x + [3] @y + [6]
> [3] @x + [3] @y + [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [3] @x + [3] @y + [3]
> [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [3] @x + [6]
> [2]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [3] @x + [3] @y + [3]
> [2]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [3] @x + [3] @y + [0]
>= [3] @x + [3] @y + [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [3] @x + [6]
> [2]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [3] @x + [3] @y + [0]
>= [3] @x + [3] @y + [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [1]
>= [1]
= [#false()]
[#ckgt(#GT())] = [1]
>= [1]
= [#true()]
[#ckgt(#LT())] = [1]
>= [1]
= [#false()]
[append(@l, @ys)] = [1] @l + [1] @ys + [1]
>= [1] @l + [1] @ys + [1]
= [append#1(@l, @ys)]
[append#1(::(@x, @xs), @ys)] = [1] @xs + [1] @ys + [3]
>= [1] @xs + [1] @ys + [3]
= [::(@x, append(@xs, @ys))]
[append#1(nil(), @ys)] = [1] @ys + [1]
> [1] @ys + [0]
= [@ys]
[quicksort(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [quicksort#1(@l)]
[quicksort#1(::(@z, @zs))] = [2] @zs + [4]
>= [2] @zs + [4]
= [quicksort#2(split(@z, @zs), @z)]
[quicksort#1(nil())] = [0]
>= [0]
= [nil()]
[split(@pivot, @l)] = [1] @l + [1]
>= [1] @l + [1]
= [split#1(@l, @pivot)]
[quicksort#2(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [4]
> [2] @xs + [2] @ys + [3]
= [append(quicksort(@xs), ::(@z, quicksort(@ys)))]
[split#1(::(@x, @xs), @pivot)] = [1] @xs + [3]
>= [1] @xs + [3]
= [split#2(split(@pivot, @xs), @pivot, @x)]
[split#1(nil(), @pivot)] = [1]
>= [1]
= [tuple#2(nil(), nil())]
[split#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [3]
>= [1] @ls + [1] @rs + [3]
= [split#3(#greater(@x, @pivot), @ls, @rs, @x)]
[split#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [3]
>= [1] @ls + [1] @rs + [3]
= [tuple#2(::(@x, @ls), @rs)]
[split#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [3]
>= [1] @ls + [1] @rs + [3]
= [tuple#2(@ls, ::(@x, @rs))]
[append^#(@l, @ys)] = [1] @l + [3]
> [1] @l + [1]
= [append#1^#(@l, @ys)]
[append#1^#(::(@x, @xs), @ys)] = [1] @xs + [3]
>= [1] @xs + [3]
= [append^#(@xs, @ys)]
[quicksort^#(@l)] = [3] @l + [3]
>= [3] @l + [3]
= [quicksort#1^#(@l)]
[quicksort#1^#(::(@z, @zs))] = [3] @zs + [9]
> [3] @zs + [4]
= [quicksort#2^#(split(@z, @zs), @z)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [4]
> [2] @xs + [3]
= [append^#(quicksort(@xs), ::(@z, quicksort(@ys)))]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [4]
> [3] @xs + [3]
= [quicksort^#(@xs)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [4]
> [3] @ys + [3]
= [quicksort^#(@ys)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,4,5,6,7}. Here rules are labeled according to the (estimated)
dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :2
2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
3: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :4
4: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) :7
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs) :6
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys))) :5
5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :3
7: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :3
- The rules {1,4,5,6,7} have known complexity. These cover all
predecessors of {2,3}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{3,7,4,6} Weak SCC
|
`->2:{5} Weak SCC
|
`->3:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, 3: quicksort^#(@l) -> quicksort#1^#(@l)
, 4: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, 6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 3: quicksort^#(@l) -> quicksort#1^#(@l)
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, 4: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, 1: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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 3:{5,7,6}->4:{8,9}: YES(O(1),O(n^2))
-----------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :4
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
4: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :5
5: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :4
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^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :4
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
4: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :5
5: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :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^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :4
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :3
3: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :5
4: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
5: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :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^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :3
2: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :5
3: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :4
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :2
4: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
5: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :2
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys))
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys))
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Remaining Rules (B):
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
Weak DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
Weak DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys))
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :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^1)).
Strict DPs: { quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys))
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:
{ 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(split) = {}, Uargs(tuple#2) = {},
Uargs(split#1) = {}, Uargs(split#2) = {}, Uargs(split#3) = {},
Uargs(#abs^#) = {}, Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}, Uargs(c_1) = {}, Uargs(c_2) = {},
Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [2] x1 + [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[split](x1, x2) = [1] x2 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[split#1](x1, x2) = [1] x1 + [0]
[split#2](x1, x2, x3) = [1] x1 + [1]
[split#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#false] = [0]
[#true] = [0]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [2] x1 + [1]
[quicksort#1^#](x1) = [2] x1 + [1]
[quicksort#2^#](x1, x2) = [2] x1 + [3]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [0]
[quicksortD#1^#](x1) = [0]
[quicksortD#2^#](x1, x2) = [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
[c_1](x1, x2) = [0]
[c_2](x1, x2) = [0]
[c] = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [2] @x + [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[split(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [split#1(@l, @pivot)]
[split#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [split#2(split(@pivot, @xs), @pivot, @x)]
[split#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[split#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [split#3(#greater(@x, @pivot), @ls, @rs, @x)]
[split#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[split#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksort^#(@l)] = [2] @l + [1]
>= [2] @l + [1]
= [quicksort#1^#(@l)]
[quicksort#1^#(::(@z, @zs))] = [2] @zs + [3]
>= [2] @zs + [3]
= [quicksort#2^#(split(@z, @zs), @z)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [3]
> [2] @xs + [2] @ys + [2]
= [c_1(quicksort^#(@xs), quicksort^#(@ys))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {3}.
Here rules are labeled according to the (estimated) dependency
graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :2
2: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :1
- The rules {3} have known complexity. These cover all predecessors
of {1}, their complexity is equally bounded.
- The rules {1,3} 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}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: { split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 2: quicksort^#(@l) -> quicksort#1^#(@l)
, 3: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 4: quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(split) = {}, Uargs(tuple#2) = {},
Uargs(split#1) = {}, Uargs(split#2) = {}, Uargs(split#3) = {},
Uargs(#abs^#) = {}, Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[split](x1, x2) = [1] x2 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[split#1](x1, x2) = [1] x1 + [0]
[split#2](x1, x2, x3) = [1] x1 + [1]
[split#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#false] = [0]
[#true] = [0]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [3] x1 + [2]
[quicksort#1^#](x1) = [3] x1 + [0]
[quicksort#2^#](x1, x2) = [3] x1 + [2]
[split^#](x1, x2) = [1] x2 + [1]
[split#1^#](x1, x2) = [1] x1 + [0]
[quicksortD^#](x1) = [0]
[quicksortD#1^#](x1) = [0]
[quicksortD#2^#](x1, x2) = [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[split(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [split#1(@l, @pivot)]
[split#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [split#2(split(@pivot, @xs), @pivot, @x)]
[split#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[split#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [split#3(#greater(@x, @pivot), @ls, @rs, @x)]
[split#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[split#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksort^#(@l)] = [3] @l + [2]
> [3] @l + [0]
= [quicksort#1^#(@l)]
[quicksort#1^#(::(@z, @zs))] = [3] @zs + [3]
> [3] @zs + [2]
= [quicksort#2^#(split(@z, @zs), @z)]
[quicksort#1^#(::(@z, @zs))] = [3] @zs + [3]
> [1] @zs + [1]
= [split^#(@z, @zs)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [2]
>= [3] @xs + [2]
= [quicksort^#(@xs)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [2]
>= [3] @ys + [2]
= [quicksort^#(@ys)]
[split^#(@pivot, @l)] = [1] @l + [1]
> [1] @l + [0]
= [split#1^#(@l, @pivot)]
[split#1^#(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [split^#(@pivot, @xs)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,2,3,4}. Here rules are labeled according to the (estimated)
dependency graph
1: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :7
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs) :4
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :3
3: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) :6
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs) :5
4: quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :1
5: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :2
6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :2
7: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :1
- The rules {1,2,3,4} have known complexity. These cover all
predecessors of {5,6,7}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,5,2,4} Weak SCC
|
`->2:{3} Weak SCC
|
`->3:{6,7} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 3: quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, 4: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, 6: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 7: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 4: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 3: quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, 6: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 7: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:{10,12,11}->5:{3,4}: YES(O(1),O(n^2))
--------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :2
2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
3: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :4
4: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :5
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :3
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :3
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :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^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak DPs: { appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :5
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :3
3: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :4
4: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
5: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :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^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :4
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :3
3: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :5
4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :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^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :3
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :4
3: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
4: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :5
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) }
Remaining Rules (B):
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :3
2: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :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^1)).
Strict DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :3
3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
, 2: quicksortD^#(@l) -> quicksortD#1^#(@l) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(appendD) = {}, Uargs(appendD#1) = {},
Uargs(tuple#2) = {}, Uargs(quicksortD) = {},
Uargs(quicksortD#1) = {}, Uargs(splitD) = {},
Uargs(quicksortD#2) = {}, Uargs(splitD#1) = {},
Uargs(splitD#2) = {}, Uargs(splitD#3) = {}, Uargs(#abs^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}, Uargs(c_1) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [2] x2 + [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[appendD](x1, x2) = [0]
[appendD#1](x1, x2) = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[quicksortD](x1) = [0]
[quicksortD#1](x1) = [0]
[splitD](x1, x2) = [1] x2 + [0]
[quicksortD#2](x1, x2) = [0]
[#false] = [0]
[#true] = [0]
[splitD#1](x1, x2) = [1] x1 + [0]
[splitD#2](x1, x2, x3) = [1] x1 + [1]
[splitD#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [0]
[quicksort#1^#](x1) = [0]
[quicksort#2^#](x1, x2) = [0]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [3] x1 + [1]
[quicksortD#1^#](x1) = [3] x1 + [0]
[quicksortD#2^#](x1, x2) = [3] x1 + [3]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
[c_1](x1, x2, x3) = [0]
[c] = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [2] @y + [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[splitD(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [splitD#1(@l, @pivot)]
[splitD#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [splitD#2(splitD(@pivot, @xs), @pivot, @x)]
[splitD#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[splitD#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [splitD#3(#greater(@x, @pivot), @ls, @rs, @x)]
[splitD#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[splitD#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksortD^#(@l)] = [3] @l + [1]
> [3] @l + [0]
= [quicksortD#1^#(@l)]
[quicksortD#1^#(::(@z, @zs))] = [3] @zs + [3]
>= [3] @zs + [3]
= [quicksortD#2^#(splitD(@z, @zs), @z)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [3]
> [3] @xs + [3] @ys + [2]
= [c_1(quicksortD^#(@xs), quicksortD^#(@ys))]
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: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :3
3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) :1
- The rules {1,2} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules {1,2,3}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: { appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:
{ 2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, 4: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(appendD) = {}, Uargs(appendD#1) = {},
Uargs(tuple#2) = {}, Uargs(quicksortD) = {},
Uargs(quicksortD#1) = {}, Uargs(splitD) = {},
Uargs(quicksortD#2) = {}, Uargs(splitD#1) = {},
Uargs(splitD#2) = {}, Uargs(splitD#3) = {}, Uargs(#abs^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [1]
[#neg](x1) = [1] x1 + [1]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [1]
[#compare](x1, x2) = [1]
[#ckgt](x1) = [1] x1 + [0]
[::](x1, x2) = [1] x1 + [1] x2 + [1]
[nil] = [0]
[appendD](x1, x2) = [1] x1 + [1] x2 + [0]
[appendD#1](x1, x2) = [1] x1 + [1] x2 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [1]
[quicksortD](x1) = [1] x1 + [0]
[quicksortD#1](x1) = [1] x1 + [0]
[splitD](x1, x2) = [1] x2 + [1]
[quicksortD#2](x1, x2) = [1] x1 + [1] x2 + [0]
[#false] = [1]
[#true] = [1]
[splitD#1](x1, x2) = [1] x1 + [1]
[splitD#2](x1, x2, x3) = [1] x1 + [1] x3 + [1]
[splitD#3](x1, x2, x3, x4) = [1] x1 + [1] x2 + [1] x3 + [1] x4 + [1]
[#EQ] = [1]
[#GT] = [1]
[#LT] = [1]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [1] x1 + [2]
[appendD#1^#](x1, x2) = [1] x1 + [2]
[quicksort^#](x1) = [0]
[quicksort#1^#](x1) = [0]
[quicksort#2^#](x1, x2) = [0]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [1] x1 + [3]
[quicksortD#1^#](x1) = [1] x1 + [3]
[quicksortD#2^#](x1, x2) = [1] x1 + [2]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [1]
>= [1]
= [#ckgt(#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)]
[#ckgt(#EQ())] = [1]
>= [1]
= [#false()]
[#ckgt(#GT())] = [1]
>= [1]
= [#true()]
[#ckgt(#LT())] = [1]
>= [1]
= [#false()]
[appendD(@l, @ys)] = [1] @l + [1] @ys + [0]
>= [1] @l + [1] @ys + [0]
= [appendD#1(@l, @ys)]
[appendD#1(::(@x, @xs), @ys)] = [1] @x + [1] @xs + [1] @ys + [1]
>= [1] @x + [1] @xs + [1] @ys + [1]
= [::(@x, appendD(@xs, @ys))]
[appendD#1(nil(), @ys)] = [1] @ys + [0]
>= [1] @ys + [0]
= [@ys]
[quicksortD(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [quicksortD#1(@l)]
[quicksortD#1(::(@z, @zs))] = [1] @z + [1] @zs + [1]
>= [1] @z + [1] @zs + [1]
= [quicksortD#2(splitD(@z, @zs), @z)]
[quicksortD#1(nil())] = [0]
>= [0]
= [nil()]
[splitD(@pivot, @l)] = [1] @l + [1]
>= [1] @l + [1]
= [splitD#1(@l, @pivot)]
[quicksortD#2(tuple#2(@xs, @ys), @z)] = [1] @xs + [1] @ys + [1] @z + [1]
>= [1] @xs + [1] @ys + [1] @z + [1]
= [appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))]
[splitD#1(::(@x, @xs), @pivot)] = [1] @x + [1] @xs + [2]
>= [1] @x + [1] @xs + [2]
= [splitD#2(splitD(@pivot, @xs), @pivot, @x)]
[splitD#1(nil(), @pivot)] = [1]
>= [1]
= [tuple#2(nil(), nil())]
[splitD#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1] @x + [2]
>= [1] @ls + [1] @rs + [1] @x + [2]
= [splitD#3(#greater(@x, @pivot), @ls, @rs, @x)]
[splitD#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1] @x + [2]
>= [1] @ls + [1] @rs + [1] @x + [2]
= [tuple#2(::(@x, @ls), @rs)]
[splitD#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1] @x + [2]
>= [1] @ls + [1] @rs + [1] @x + [2]
= [tuple#2(@ls, ::(@x, @rs))]
[appendD^#(@l, @ys)] = [1] @l + [2]
>= [1] @l + [2]
= [appendD#1^#(@l, @ys)]
[appendD#1^#(::(@x, @xs), @ys)] = [1] @x + [1] @xs + [3]
> [1] @xs + [2]
= [appendD^#(@xs, @ys)]
[quicksortD^#(@l)] = [1] @l + [3]
>= [1] @l + [3]
= [quicksortD#1^#(@l)]
[quicksortD#1^#(::(@z, @zs))] = [1] @z + [1] @zs + [4]
> [1] @zs + [3]
= [quicksortD#2^#(splitD(@z, @zs), @z)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [1] @xs + [1] @ys + [3]
> [1] @xs + [2]
= [appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [1] @xs + [1] @ys + [3]
>= [1] @xs + [3]
= [quicksortD^#(@xs)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [1] @xs + [1] @ys + [3]
>= [1] @ys + [3]
= [quicksortD^#(@ys)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{2,4,5}. Here rules are labeled according to the (estimated)
dependency graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :2
2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
3: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :4
4: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) :7
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs) :6
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))) :5
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
6: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :3
7: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :3
- The rules {2,4,5} have known complexity. These cover all
predecessors of {1,6,7}, their complexity is equally bounded.
- The rules {1,2,4,5,6,7} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{3,7,4,6} Weak SCC
|
`->2:{5} Weak SCC
|
`->3:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, 2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, 3: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 4: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, 6: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, 7: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 3: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 7: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, 4: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 6: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, 1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, 2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:{10,12,11}->2:{13,14}: YES(O(1),O(n^2))
----------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :4
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
4: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :5
5: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :4
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^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :4
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
4: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :5
5: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :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^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :4
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :3
3: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :5
4: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
5: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :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^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :3
2: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :5
3: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :4
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :2
4: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
5: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :2
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys))
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys))
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Remaining Rules (B):
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
Weak DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
Weak DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys))
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :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^1)).
Strict DPs: { quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys))
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:
{ 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(tuple#2) = {}, Uargs(splitD) = {},
Uargs(splitD#1) = {}, Uargs(splitD#2) = {}, Uargs(splitD#3) = {},
Uargs(#abs^#) = {}, Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}, Uargs(c_1) = {}, Uargs(c_2) = {},
Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [2] x1 + [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[splitD](x1, x2) = [1] x2 + [0]
[#false] = [0]
[#true] = [0]
[splitD#1](x1, x2) = [1] x1 + [0]
[splitD#2](x1, x2, x3) = [1] x1 + [1]
[splitD#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [0]
[quicksort#1^#](x1) = [0]
[quicksort#2^#](x1, x2) = [0]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [2] x1 + [0]
[quicksortD#1^#](x1) = [2] x1 + [0]
[quicksortD#2^#](x1, x2) = [2] x1 + [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
[c_1](x1, x2) = [0]
[c_2](x1, x2) = [0]
[c] = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [2] @x + [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[splitD(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [splitD#1(@l, @pivot)]
[splitD#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [splitD#2(splitD(@pivot, @xs), @pivot, @x)]
[splitD#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[splitD#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [splitD#3(#greater(@x, @pivot), @ls, @rs, @x)]
[splitD#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[splitD#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksortD^#(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [quicksortD#1^#(@l)]
[quicksortD#1^#(::(@z, @zs))] = [2] @zs + [2]
> [2] @zs + [0]
= [quicksortD#2^#(splitD(@z, @zs), @z)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [0]
>= [2] @xs + [2] @ys + [0]
= [c_1(quicksortD^#(@xs), quicksortD^#(@ys))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2}.
Here rules are labeled according to the (estimated) dependency
graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :2
2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
- The rules {2} have known complexity. These cover all predecessors
of {3}, their complexity is equally bounded.
- The rules {2,3} 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,2,3}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: { splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:
{ 3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 4: quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, 7: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(tuple#2) = {}, Uargs(splitD) = {},
Uargs(splitD#1) = {}, Uargs(splitD#2) = {}, Uargs(splitD#3) = {},
Uargs(#abs^#) = {}, Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [2] x2 + [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[splitD](x1, x2) = [1] x2 + [0]
[#false] = [0]
[#true] = [0]
[splitD#1](x1, x2) = [1] x1 + [0]
[splitD#2](x1, x2, x3) = [1] x1 + [1]
[splitD#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [0]
[quicksort#1^#](x1) = [0]
[quicksort#2^#](x1, x2) = [0]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [2] x1 + [0]
[quicksortD#1^#](x1) = [2] x1 + [0]
[quicksortD#2^#](x1, x2) = [2] x1 + [0]
[splitD^#](x1, x2) = [2] x2 + [0]
[splitD#1^#](x1, x2) = [2] x1 + [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [2] @y + [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[splitD(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [splitD#1(@l, @pivot)]
[splitD#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [splitD#2(splitD(@pivot, @xs), @pivot, @x)]
[splitD#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[splitD#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [splitD#3(#greater(@x, @pivot), @ls, @rs, @x)]
[splitD#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[splitD#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksortD^#(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [quicksortD#1^#(@l)]
[quicksortD#1^#(::(@z, @zs))] = [2] @zs + [2]
> [2] @zs + [0]
= [quicksortD#2^#(splitD(@z, @zs), @z)]
[quicksortD#1^#(::(@z, @zs))] = [2] @zs + [2]
> [2] @zs + [0]
= [splitD^#(@z, @zs)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [0]
>= [2] @xs + [0]
= [quicksortD^#(@xs)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [0]
>= [2] @ys + [0]
= [quicksortD^#(@ys)]
[splitD^#(@pivot, @l)] = [2] @l + [0]
>= [2] @l + [0]
= [splitD#1^#(@l, @pivot)]
[splitD#1^#(::(@x, @xs), @pivot)] = [2] @xs + [2]
> [2] @xs + [0]
= [splitD^#(@pivot, @xs)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{3,4,7}. Here rules are labeled according to the (estimated)
dependency graph
1: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :7
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs) :4
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :3
3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) :6
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs) :5
4: quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :1
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
6: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
7: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :1
- The rules {3,4,7} have known complexity. These cover all
predecessors of {1,5,6}, their complexity is equally bounded.
- The rules {1,3,4,5,6,7} 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,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,5,2,4} Weak SCC
|
`->2:{3} Weak SCC
|
`->3:{6,7} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 3: quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, 4: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, 6: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, 7: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 4: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, 3: quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, 6: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, 7: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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^2))
tct-popstar
YES(?,O(n^2))
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#compare(@x, @y))
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We add following dependency tuples
Strict DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, append#1^#(nil(), @ys) -> c_8()
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, appendD#1^#(nil(), @ys) -> c_11()
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#1^#(nil()) -> c_14()
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, split#1^#(nil(), @pivot) -> c_23()
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#1^#(nil()) -> c_19()
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
, splitD#1^#(nil(), @pivot) -> c_28()
, split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, split#3^#(#false(), @ls, @rs, @x) -> c_25()
, split#3^#(#true(), @ls, @rs, @x) -> c_26()
, splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
Weak DPs:
{ #ckgt^#(#EQ()) -> c_44()
, #ckgt^#(#GT()) -> c_45()
, #ckgt^#(#LT()) -> c_46()
, #compare^#(#0(), #0()) -> c_32()
, #compare^#(#0(), #neg(@y)) -> c_33()
, #compare^#(#0(), #pos(@y)) -> c_34()
, #compare^#(#0(), #s(@y)) -> c_35()
, #compare^#(#neg(@x), #0()) -> c_36()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_38()
, #compare^#(#pos(@x), #0()) -> c_39()
, #compare^#(#pos(@x), #neg(@y)) -> c_40()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_42()
, #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^2)).
Strict DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, append#1^#(nil(), @ys) -> c_8()
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, appendD#1^#(nil(), @ys) -> c_11()
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#1^#(nil()) -> c_14()
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, split#1^#(nil(), @pivot) -> c_23()
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#1^#(nil()) -> c_19()
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
, splitD#1^#(nil(), @pivot) -> c_28()
, split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, split#3^#(#false(), @ls, @rs, @x) -> c_25()
, split#3^#(#true(), @ls, @rs, @x) -> c_26()
, splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
Weak DPs:
{ #ckgt^#(#EQ()) -> c_44()
, #ckgt^#(#GT()) -> c_45()
, #ckgt^#(#LT()) -> c_46()
, #compare^#(#0(), #0()) -> c_32()
, #compare^#(#0(), #neg(@y)) -> c_33()
, #compare^#(#0(), #pos(@y)) -> c_34()
, #compare^#(#0(), #s(@y)) -> c_35()
, #compare^#(#neg(@x), #0()) -> c_36()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_38()
, #compare^#(#pos(@x), #0()) -> c_39()
, #compare^#(#pos(@x), #neg(@y)) -> c_40()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_42()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: #abs^#(#0()) -> c_1()
2: #abs^#(#neg(@x)) -> c_2()
3: #abs^#(#pos(@x)) -> c_3()
4: #abs^#(#s(@x)) -> c_4()
5: #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :46
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :44
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :40
-->_2 #compare^#(#s(@x), #0()) -> c_42() :45
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_40() :43
-->_2 #compare^#(#pos(@x), #0()) -> c_39() :42
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_38() :41
-->_2 #compare^#(#neg(@x), #0()) -> c_36() :39
-->_2 #compare^#(#0(), #s(@y)) -> c_35() :38
-->_2 #compare^#(#0(), #pos(@y)) -> c_34() :37
-->_2 #compare^#(#0(), #neg(@y)) -> c_33() :36
-->_2 #compare^#(#0(), #0()) -> c_32() :35
-->_1 #ckgt^#(#LT()) -> c_46() :34
-->_1 #ckgt^#(#GT()) -> c_45() :33
-->_1 #ckgt^#(#EQ()) -> c_44() :32
6: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :7
-->_1 append#1^#(nil(), @ys) -> c_8() :8
7: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :6
8: append#1^#(nil(), @ys) -> c_8()
9: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :10
-->_1 appendD#1^#(nil(), @ys) -> c_11() :11
10: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :9
11: appendD#1^#(nil(), @ys) -> c_11()
12: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :13
-->_1 quicksort#1^#(nil()) -> c_14() :14
13: quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :16
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :15
14: quicksort#1^#(nil()) -> c_14()
15: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :12
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :12
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :6
16: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs)) :17
-->_1 split#1^#(nil(), @pivot) -> c_23() :18
17: split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
-->_1 split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) :26
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :16
18: split#1^#(nil(), @pivot) -> c_23()
19: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :20
-->_1 quicksortD#1^#(nil()) -> c_19() :21
20: quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :23
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :22
21: quicksortD#1^#(nil()) -> c_19()
22: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :19
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :19
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :9
23: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) :24
-->_1 splitD#1^#(nil(), @pivot) -> c_28() :25
24: splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
-->_1 splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) :29
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :23
25: splitD#1^#(nil(), @pivot) -> c_28()
26: split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
-->_1 split#3^#(#true(), @ls, @rs, @x) -> c_26() :28
-->_1 split#3^#(#false(), @ls, @rs, @x) -> c_25() :27
-->_2 #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :5
27: split#3^#(#false(), @ls, @rs, @x) -> c_25()
28: split#3^#(#true(), @ls, @rs, @x) -> c_26()
29: splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
-->_1 splitD#3^#(#true(), @ls, @rs, @x) -> c_31() :31
-->_1 splitD#3^#(#false(), @ls, @rs, @x) -> c_30() :30
-->_2 #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :5
30: splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
31: splitD#3^#(#true(), @ls, @rs, @x) -> c_31()
32: #ckgt^#(#EQ()) -> c_44()
33: #ckgt^#(#GT()) -> c_45()
34: #ckgt^#(#LT()) -> c_46()
35: #compare^#(#0(), #0()) -> c_32()
36: #compare^#(#0(), #neg(@y)) -> c_33()
37: #compare^#(#0(), #pos(@y)) -> c_34()
38: #compare^#(#0(), #s(@y)) -> c_35()
39: #compare^#(#neg(@x), #0()) -> c_36()
40: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :44
-->_1 #compare^#(#s(@x), #0()) -> c_42() :45
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :43
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :42
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :41
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :40
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :39
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :37
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :36
-->_1 #compare^#(#0(), #0()) -> c_32() :35
41: #compare^#(#neg(@x), #pos(@y)) -> c_38()
42: #compare^#(#pos(@x), #0()) -> c_39()
43: #compare^#(#pos(@x), #neg(@y)) -> c_40()
44: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#s(@x), #0()) -> c_42() :45
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :44
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :43
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :42
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :41
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :40
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :39
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :37
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :36
-->_1 #compare^#(#0(), #0()) -> c_32() :35
45: #compare^#(#s(@x), #0()) -> c_42()
46: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#s(@x), #0()) -> c_42() :45
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :44
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :43
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :42
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :41
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :40
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :39
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :37
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :36
-->_1 #compare^#(#0(), #0()) -> c_32() :35
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {21} and add Pre({21}) = {19} to the strict component.
- We remove {25} and add Pre({25}) = {23} to the strict component.
- We remove {30} and add Pre({30}) = {29} to the strict component.
- We remove {31} and add Pre({31}) = {29} to the strict component.
- We remove {14} and add Pre({14}) = {12} to the strict component.
- We remove {18} and add Pre({18}) = {16} to the strict component.
- We remove {27} and add Pre({27}) = {26} to the strict component.
- We remove {28} and add Pre({28}) = {26} to the strict component.
- We remove {11} and add Pre({11}) = {9} to the strict component.
- We remove {8} and add Pre({8}) = {6} to the strict component.
- We remove {5} and add Pre({5}) = {29,26} to the strict component.
- We remove {4} and add Pre({4}) = {} to the strict component.
- We remove {3} and add Pre({3}) = {} to the strict component.
- We remove {2} and add Pre({2}) = {} to the strict component.
- We remove {1} and add Pre({1}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
, split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_44()
, #ckgt^#(#GT()) -> c_45()
, #ckgt^#(#LT()) -> c_46()
, #compare^#(#0(), #0()) -> c_32()
, #compare^#(#0(), #neg(@y)) -> c_33()
, #compare^#(#0(), #pos(@y)) -> c_34()
, #compare^#(#0(), #s(@y)) -> c_35()
, #compare^#(#neg(@x), #0()) -> c_36()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_38()
, #compare^#(#pos(@x), #0()) -> c_39()
, #compare^#(#pos(@x), #neg(@y)) -> c_40()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_42()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, append#1^#(nil(), @ys) -> c_8()
, appendD#1^#(nil(), @ys) -> c_11()
, quicksort#1^#(nil()) -> c_14()
, split#1^#(nil(), @pivot) -> c_23()
, quicksortD#1^#(nil()) -> c_19()
, splitD#1^#(nil(), @pivot) -> c_28()
, split#3^#(#false(), @ls, @rs, @x) -> c_25()
, split#3^#(#true(), @ls, @rs, @x) -> c_26()
, splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the (estimated) dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :2
-->_1 append#1^#(nil(), @ys) -> c_8() :37
2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
3: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :4
-->_1 appendD#1^#(nil(), @ys) -> c_11() :38
4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :3
5: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :6
-->_1 quicksort#1^#(nil()) -> c_14() :39
6: quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :8
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :7
7: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :5
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :5
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
8: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs)) :9
-->_1 split#1^#(nil(), @pivot) -> c_23() :40
9: split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
-->_1 split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) :15
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :8
10: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :11
-->_1 quicksortD#1^#(nil()) -> c_19() :41
11: quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :13
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :12
12: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :10
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :10
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :3
13: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) :14
-->_1 splitD#1^#(nil(), @pivot) -> c_28() :42
14: splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
-->_1 splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot)) :16
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :13
15: split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
-->_2 #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :21
-->_1 split#3^#(#true(), @ls, @rs, @x) -> c_26() :44
-->_1 split#3^#(#false(), @ls, @rs, @x) -> c_25() :43
16: splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
-->_2 #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y)) :21
-->_1 splitD#3^#(#true(), @ls, @rs, @x) -> c_31() :46
-->_1 splitD#3^#(#false(), @ls, @rs, @x) -> c_30() :45
17: #abs^#(#0()) -> c_1()
18: #abs^#(#neg(@x)) -> c_2()
19: #abs^#(#pos(@x)) -> c_3()
20: #abs^#(#s(@x)) -> c_4()
21: #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :36
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :34
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :30
-->_2 #compare^#(#s(@x), #0()) -> c_42() :35
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_40() :33
-->_2 #compare^#(#pos(@x), #0()) -> c_39() :32
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_38() :31
-->_2 #compare^#(#neg(@x), #0()) -> c_36() :29
-->_2 #compare^#(#0(), #s(@y)) -> c_35() :28
-->_2 #compare^#(#0(), #pos(@y)) -> c_34() :27
-->_2 #compare^#(#0(), #neg(@y)) -> c_33() :26
-->_2 #compare^#(#0(), #0()) -> c_32() :25
-->_1 #ckgt^#(#LT()) -> c_46() :24
-->_1 #ckgt^#(#GT()) -> c_45() :23
-->_1 #ckgt^#(#EQ()) -> c_44() :22
22: #ckgt^#(#EQ()) -> c_44()
23: #ckgt^#(#GT()) -> c_45()
24: #ckgt^#(#LT()) -> c_46()
25: #compare^#(#0(), #0()) -> c_32()
26: #compare^#(#0(), #neg(@y)) -> c_33()
27: #compare^#(#0(), #pos(@y)) -> c_34()
28: #compare^#(#0(), #s(@y)) -> c_35()
29: #compare^#(#neg(@x), #0()) -> c_36()
30: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :36
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :34
-->_1 #compare^#(#s(@x), #0()) -> c_42() :35
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :33
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :32
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :31
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :30
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :29
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :28
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :27
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :26
-->_1 #compare^#(#0(), #0()) -> c_32() :25
31: #compare^#(#neg(@x), #pos(@y)) -> c_38()
32: #compare^#(#pos(@x), #0()) -> c_39()
33: #compare^#(#pos(@x), #neg(@y)) -> c_40()
34: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :36
-->_1 #compare^#(#s(@x), #0()) -> c_42() :35
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :34
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :33
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :32
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :31
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :30
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :29
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :28
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :27
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :26
-->_1 #compare^#(#0(), #0()) -> c_32() :25
35: #compare^#(#s(@x), #0()) -> c_42()
36: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :36
-->_1 #compare^#(#s(@x), #0()) -> c_42() :35
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :34
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_40() :33
-->_1 #compare^#(#pos(@x), #0()) -> c_39() :32
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_38() :31
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :30
-->_1 #compare^#(#neg(@x), #0()) -> c_36() :29
-->_1 #compare^#(#0(), #s(@y)) -> c_35() :28
-->_1 #compare^#(#0(), #pos(@y)) -> c_34() :27
-->_1 #compare^#(#0(), #neg(@y)) -> c_33() :26
-->_1 #compare^#(#0(), #0()) -> c_32() :25
37: append#1^#(nil(), @ys) -> c_8()
38: appendD#1^#(nil(), @ys) -> c_11()
39: quicksort#1^#(nil()) -> c_14()
40: split#1^#(nil(), @pivot) -> c_23()
41: quicksortD#1^#(nil()) -> c_19()
42: splitD#1^#(nil(), @pivot) -> c_28()
43: split#3^#(#false(), @ls, @rs, @x) -> c_25()
44: split#3^#(#true(), @ls, @rs, @x) -> c_26()
45: splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
46: splitD#3^#(#true(), @ls, @rs, @x) -> c_31()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {16} and add Pre({16}) = {14} to the strict component.
- We remove {15} and add Pre({15}) = {9} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) }
Weak DPs:
{ #abs^#(#0()) -> c_1()
, #abs^#(#neg(@x)) -> c_2()
, #abs^#(#pos(@x)) -> c_3()
, #abs^#(#s(@x)) -> c_4()
, #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #ckgt^#(#EQ()) -> c_44()
, #ckgt^#(#GT()) -> c_45()
, #ckgt^#(#LT()) -> c_46()
, #compare^#(#0(), #0()) -> c_32()
, #compare^#(#0(), #neg(@y)) -> c_33()
, #compare^#(#0(), #pos(@y)) -> c_34()
, #compare^#(#0(), #s(@y)) -> c_35()
, #compare^#(#neg(@x), #0()) -> c_36()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_38()
, #compare^#(#pos(@x), #0()) -> c_39()
, #compare^#(#pos(@x), #neg(@y)) -> c_40()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_42()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, append#1^#(nil(), @ys) -> c_8()
, appendD#1^#(nil(), @ys) -> c_11()
, quicksort#1^#(nil()) -> c_14()
, split#1^#(nil(), @pivot) -> c_23()
, quicksortD#1^#(nil()) -> c_19()
, splitD#1^#(nil(), @pivot) -> c_28()
, split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, split#3^#(#false(), @ls, @rs, @x) -> c_25()
, split#3^#(#true(), @ls, @rs, @x) -> c_26()
, splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the the dependency graph
->12:{5,7,6}
|
|->35:{1,2}
| |
| `->36:{35} Weak SCC
|
|->14:{8,9}
| |
| |->15:{38} Weak SCC
| |
| `->16:{41} Weak SCC
| |
| |->17:{19} Weak SCC
| | |
| | |->18:{20} Weak SCC
| | |
| | |->19:{21} Weak SCC
| | |
| | |->20:{22} Weak SCC
| | |
| | |->22:{23} Weak SCC
| | |
| | |->23:{24} Weak SCC
| | |
| | |->24:{25} Weak SCC
| | |
| | |->25:{26} Weak SCC
| | |
| | |->26:{27} Weak SCC
| | |
| | |->27:{29} Weak SCC
| | |
| | |->28:{30} Weak SCC
| | |
| | |->29:{31} Weak SCC
| | |
| | |->30:{33} Weak SCC
| | |
| | `->21:{34,32,28} Weak SCC
| | |
| | |->22:{23} Weak SCC
| | |
| | |->23:{24} Weak SCC
| | |
| | |->24:{25} Weak SCC
| | |
| | |->25:{26} Weak SCC
| | |
| | |->26:{27} Weak SCC
| | |
| | |->27:{29} Weak SCC
| | |
| | |->28:{30} Weak SCC
| | |
| | |->29:{31} Weak SCC
| | |
| | `->30:{33} Weak SCC
| |
| |->31:{42} Weak SCC
| |
| `->32:{43} Weak SCC
|
`->13:{37} Weak SCC
->5:{10,12,11}
|
|->33:{3,4}
| |
| `->34:{36} Weak SCC
|
|->7:{13,14}
| |
| |->8:{40} Weak SCC
| |
| `->9:{44} Weak SCC
| |
| |->17:{19} Weak SCC
| | |
| | |->18:{20} Weak SCC
| | |
| | |->19:{21} Weak SCC
| | |
| | |->20:{22} Weak SCC
| | |
| | |->22:{23} Weak SCC
| | |
| | |->23:{24} Weak SCC
| | |
| | |->24:{25} Weak SCC
| | |
| | |->25:{26} Weak SCC
| | |
| | |->26:{27} Weak SCC
| | |
| | |->27:{29} Weak SCC
| | |
| | |->28:{30} Weak SCC
| | |
| | |->29:{31} Weak SCC
| | |
| | |->30:{33} Weak SCC
| | |
| | `->21:{34,32,28} Weak SCC
| | |
| | |->22:{23} Weak SCC
| | |
| | |->23:{24} Weak SCC
| | |
| | |->24:{25} Weak SCC
| | |
| | |->25:{26} Weak SCC
| | |
| | |->26:{27} Weak SCC
| | |
| | |->27:{29} Weak SCC
| | |
| | |->28:{30} Weak SCC
| | |
| | |->29:{31} Weak SCC
| | |
| | `->30:{33} Weak SCC
| |
| |->10:{45} Weak SCC
| |
| `->11:{46} Weak SCC
|
`->6:{39} Weak SCC
->4:{15} Weak SCC
->3:{16} Weak SCC
->2:{17} Weak SCC
->1:{18} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, 3: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, 4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, 5: quicksort^#(@l) -> quicksort#1^#(@l)
, 6: quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, 8: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 9: split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, 10: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 11: quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, 12: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, 13: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, 14: splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) }
Weak DPs:
{ 15: #abs^#(#0()) -> c_1()
, 16: #abs^#(#neg(@x)) -> c_2()
, 17: #abs^#(#pos(@x)) -> c_3()
, 18: #abs^#(#s(@x)) -> c_4()
, 19: #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 20: #ckgt^#(#EQ()) -> c_44()
, 21: #ckgt^#(#GT()) -> c_45()
, 22: #ckgt^#(#LT()) -> c_46()
, 23: #compare^#(#0(), #0()) -> c_32()
, 24: #compare^#(#0(), #neg(@y)) -> c_33()
, 25: #compare^#(#0(), #pos(@y)) -> c_34()
, 26: #compare^#(#0(), #s(@y)) -> c_35()
, 27: #compare^#(#neg(@x), #0()) -> c_36()
, 28: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 29: #compare^#(#neg(@x), #pos(@y)) -> c_38()
, 30: #compare^#(#pos(@x), #0()) -> c_39()
, 31: #compare^#(#pos(@x), #neg(@y)) -> c_40()
, 32: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 33: #compare^#(#s(@x), #0()) -> c_42()
, 34: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 35: append#1^#(nil(), @ys) -> c_8()
, 36: appendD#1^#(nil(), @ys) -> c_11()
, 37: quicksort#1^#(nil()) -> c_14()
, 38: split#1^#(nil(), @pivot) -> c_23()
, 39: quicksortD#1^#(nil()) -> c_19()
, 40: splitD#1^#(nil(), @pivot) -> c_28()
, 41: split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, 42: split#3^#(#false(), @ls, @rs, @x) -> c_25()
, 43: split#3^#(#true(), @ls, @rs, @x) -> c_26()
, 44: splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, 45: splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, 46: splitD#3^#(#true(), @ls, @rs, @x) -> c_31() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 18: #abs^#(#s(@x)) -> c_4()
, 17: #abs^#(#pos(@x)) -> c_3()
, 16: #abs^#(#neg(@x)) -> c_2()
, 15: #abs^#(#0()) -> c_1()
, 39: quicksortD#1^#(nil()) -> c_19()
, 40: splitD#1^#(nil(), @pivot) -> c_28()
, 44: splitD#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_29(splitD#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, 45: splitD#3^#(#false(), @ls, @rs, @x) -> c_30()
, 46: splitD#3^#(#true(), @ls, @rs, @x) -> c_31()
, 37: quicksort#1^#(nil()) -> c_14()
, 38: split#1^#(nil(), @pivot) -> c_23()
, 41: split#2^#(tuple#2(@ls, @rs), @pivot, @x) ->
c_24(split#3^#(#greater(@x, @pivot), @ls, @rs, @x),
#greater^#(@x, @pivot))
, 19: #greater^#(@x, @y) ->
c_5(#ckgt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 20: #ckgt^#(#EQ()) -> c_44()
, 21: #ckgt^#(#GT()) -> c_45()
, 22: #ckgt^#(#LT()) -> c_46()
, 34: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 32: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 28: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 23: #compare^#(#0(), #0()) -> c_32()
, 24: #compare^#(#0(), #neg(@y)) -> c_33()
, 25: #compare^#(#0(), #pos(@y)) -> c_34()
, 26: #compare^#(#0(), #s(@y)) -> c_35()
, 27: #compare^#(#neg(@x), #0()) -> c_36()
, 29: #compare^#(#neg(@x), #pos(@y)) -> c_38()
, 30: #compare^#(#pos(@x), #0()) -> c_39()
, 31: #compare^#(#pos(@x), #neg(@y)) -> c_40()
, 33: #compare^#(#s(@x), #0()) -> c_42()
, 42: split#3^#(#false(), @ls, @rs, @x) -> c_25()
, 43: split#3^#(#true(), @ls, @rs, @x) -> c_26()
, 36: appendD#1^#(nil(), @ys) -> c_11()
, 35: append#1^#(nil(), @ys) -> c_8() }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We consider the following dependency-graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :2
2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
3: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :4
4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :3
5: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :6
6: quicksort#1^#(::(@z, @zs)) ->
c_13(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :8
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :7
7: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_16(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :5
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :5
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
8: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs)) :9
9: split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :8
10: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :11
11: quicksortD#1^#(::(@z, @zs)) ->
c_18(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :13
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :12
12: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_21(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :10
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :10
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :3
13: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) :14
14: splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :13
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ split#1^#(::(@x, @xs), @pivot) ->
c_22(split#2^#(split(@pivot, @xs), @pivot, @x),
split^#(@pivot, @xs))
, splitD#1^#(::(@x, @xs), @pivot) ->
c_27(splitD#2^#(splitD(@pivot, @xs), @pivot, @x),
splitD^#(@pivot, @xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^2))
We employ 'linear path analysis' using the following approximated
dependency graph:
->3:{5,7,6} [ ? ]
|
|->6:{1,2} [ YES(O(1),O(n^2)) ]
|
`->4:{8,9} [ YES(O(1),O(n^2)) ]
->1:{10,12,11} [ ? ]
|
|->5:{3,4} [ YES(O(1),O(n^2)) ]
|
`->2:{13,14} [ YES(O(1),O(n^2)) ]
Here dependency-pairs are as follows:
Strict DPs:
{ 1: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, 3: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, 4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, 5: quicksort^#(@l) -> quicksort#1^#(@l)
, 6: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, 8: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 9: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
, 10: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 11: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, 12: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, 13: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, 14: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
* Path 3:{5,7,6}->6:{1,2}: YES(O(1),O(n^2))
-----------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :2
2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
3: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :4
4: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :5
5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :3
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :3
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :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^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak DPs: { append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :5
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :3
3: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :4
4: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
5: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :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^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :4
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :3
3: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :5
4: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :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^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :3
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :4
3: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
4: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :5
5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) }
Remaining Rules (B):
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { append^#(@l, @ys) -> append#1^#(@l, @ys) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :3
2: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
3: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :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^1)).
Strict DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :3
3: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
, 3: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(append) = {}, Uargs(append#1) = {}, Uargs(::) = {},
Uargs(quicksort) = {}, Uargs(quicksort#1) = {}, Uargs(split) = {},
Uargs(quicksort#2) = {}, Uargs(tuple#2) = {}, Uargs(split#1) = {},
Uargs(split#2) = {}, Uargs(split#3) = {}, Uargs(#abs^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}, Uargs(c_1) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[append](x1, x2) = [0]
[append#1](x1, x2) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[quicksort](x1) = [0]
[quicksort#1](x1) = [0]
[split](x1, x2) = [1] x2 + [0]
[quicksort#2](x1, x2) = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[split#1](x1, x2) = [1] x1 + [0]
[split#2](x1, x2, x3) = [1] x1 + [1]
[split#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#false] = [0]
[#true] = [0]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [2] x1 + [0]
[quicksort#1^#](x1) = [2] x1 + [0]
[quicksort#2^#](x1, x2) = [2] x1 + [1]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [0]
[quicksortD#1^#](x1) = [0]
[quicksortD#2^#](x1, x2) = [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
[c_1](x1, x2, x3) = [0]
[c] = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[split(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [split#1(@l, @pivot)]
[split#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [split#2(split(@pivot, @xs), @pivot, @x)]
[split#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[split#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [split#3(#greater(@x, @pivot), @ls, @rs, @x)]
[split#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[split#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksort^#(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [quicksort#1^#(@l)]
[quicksort#1^#(::(@z, @zs))] = [2] @zs + [2]
> [2] @zs + [1]
= [quicksort#2^#(split(@z, @zs), @z)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [1]
> [2] @xs + [2] @ys + [0]
= [c_1(quicksort^#(@xs), quicksort^#(@ys))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {1,3}.
Here rules are labeled according to the (estimated) dependency
graph
1: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :2
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :2
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :3
3: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) :1
- The rules {1,3} 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}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: { append^#(@l, @ys) -> append#1^#(@l, @ys) }
Weak DPs:
{ append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 4: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, 6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
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(#s(@x), #0()) -> #GT()
, append#1(nil(), @ys) -> @ys
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys))) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(append) = {}, Uargs(append#1) = {}, Uargs(::) = {},
Uargs(quicksort) = {}, Uargs(quicksort#1) = {}, Uargs(split) = {},
Uargs(quicksort#2) = {}, Uargs(tuple#2) = {}, Uargs(split#1) = {},
Uargs(split#2) = {}, Uargs(split#3) = {}, Uargs(#abs^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [2]
[#neg](x1) = [1] x1 + [1]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [1]
[#compare](x1, x2) = [3] x1 + [3] x2 + [0]
[#ckgt](x1) = [1]
[append](x1, x2) = [1] x1 + [1] x2 + [1]
[append#1](x1, x2) = [1] x1 + [1] x2 + [1]
[::](x1, x2) = [1] x2 + [2]
[nil] = [0]
[quicksort](x1) = [2] x1 + [0]
[quicksort#1](x1) = [2] x1 + [0]
[split](x1, x2) = [1] x2 + [1]
[quicksort#2](x1, x2) = [2] x1 + [2]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [1]
[split#1](x1, x2) = [1] x1 + [1]
[split#2](x1, x2, x3) = [1] x1 + [2]
[split#3](x1, x2, x3, x4) = [2] x1 + [1] x2 + [1] x3 + [1]
[#false] = [1]
[#true] = [1]
[#EQ] = [0]
[#GT] = [2]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [1] x1 + [3]
[append#1^#](x1, x2) = [1] x1 + [1]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [3] x1 + [3]
[quicksort#1^#](x1) = [3] x1 + [3]
[quicksort#2^#](x1, x2) = [3] x1 + [1]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [0]
[quicksortD#1^#](x1) = [0]
[quicksortD#2^#](x1, x2) = [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [1]
>= [1]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [12]
> [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [3] @y + [9]
> [2]
= [#GT()]
[#compare(#0(), #pos(@y))] = [3] @y + [6]
> [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [3] @y + [6]
> [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [3] @x + [9]
> [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [3] @x + [3] @y + [6]
> [3] @x + [3] @y + [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [3] @x + [3] @y + [3]
> [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [3] @x + [6]
> [2]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [3] @x + [3] @y + [3]
> [2]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [3] @x + [3] @y + [0]
>= [3] @x + [3] @y + [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [3] @x + [6]
> [2]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [3] @x + [3] @y + [0]
>= [3] @x + [3] @y + [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [1]
>= [1]
= [#false()]
[#ckgt(#GT())] = [1]
>= [1]
= [#true()]
[#ckgt(#LT())] = [1]
>= [1]
= [#false()]
[append(@l, @ys)] = [1] @l + [1] @ys + [1]
>= [1] @l + [1] @ys + [1]
= [append#1(@l, @ys)]
[append#1(::(@x, @xs), @ys)] = [1] @xs + [1] @ys + [3]
>= [1] @xs + [1] @ys + [3]
= [::(@x, append(@xs, @ys))]
[append#1(nil(), @ys)] = [1] @ys + [1]
> [1] @ys + [0]
= [@ys]
[quicksort(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [quicksort#1(@l)]
[quicksort#1(::(@z, @zs))] = [2] @zs + [4]
>= [2] @zs + [4]
= [quicksort#2(split(@z, @zs), @z)]
[quicksort#1(nil())] = [0]
>= [0]
= [nil()]
[split(@pivot, @l)] = [1] @l + [1]
>= [1] @l + [1]
= [split#1(@l, @pivot)]
[quicksort#2(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [4]
> [2] @xs + [2] @ys + [3]
= [append(quicksort(@xs), ::(@z, quicksort(@ys)))]
[split#1(::(@x, @xs), @pivot)] = [1] @xs + [3]
>= [1] @xs + [3]
= [split#2(split(@pivot, @xs), @pivot, @x)]
[split#1(nil(), @pivot)] = [1]
>= [1]
= [tuple#2(nil(), nil())]
[split#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [3]
>= [1] @ls + [1] @rs + [3]
= [split#3(#greater(@x, @pivot), @ls, @rs, @x)]
[split#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [3]
>= [1] @ls + [1] @rs + [3]
= [tuple#2(::(@x, @ls), @rs)]
[split#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [3]
>= [1] @ls + [1] @rs + [3]
= [tuple#2(@ls, ::(@x, @rs))]
[append^#(@l, @ys)] = [1] @l + [3]
> [1] @l + [1]
= [append#1^#(@l, @ys)]
[append#1^#(::(@x, @xs), @ys)] = [1] @xs + [3]
>= [1] @xs + [3]
= [append^#(@xs, @ys)]
[quicksort^#(@l)] = [3] @l + [3]
>= [3] @l + [3]
= [quicksort#1^#(@l)]
[quicksort#1^#(::(@z, @zs))] = [3] @zs + [9]
> [3] @zs + [4]
= [quicksort#2^#(split(@z, @zs), @z)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [4]
> [2] @xs + [3]
= [append^#(quicksort(@xs), ::(@z, quicksort(@ys)))]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [4]
> [3] @xs + [3]
= [quicksort^#(@xs)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [4]
> [3] @ys + [3]
= [quicksort^#(@ys)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,4,5,6,7}. Here rules are labeled according to the (estimated)
dependency graph
1: append^#(@l, @ys) -> append#1^#(@l, @ys)
-->_1 append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) :2
2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
3: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :4
4: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) :7
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs) :6
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys))) :5
5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
-->_1 append^#(@l, @ys) -> append#1^#(@l, @ys) :1
6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :3
7: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :3
- The rules {1,4,5,6,7} have known complexity. These cover all
predecessors of {2,3}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ append^#(@l, @ys) -> append#1^#(@l, @ys)
, append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{3,7,4,6} Weak SCC
|
`->2:{5} Weak SCC
|
`->3:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys)
, 3: quicksort^#(@l) -> quicksort#1^#(@l)
, 4: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, 6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 3: quicksort^#(@l) -> quicksort#1^#(@l)
, 7: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, 4: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
append^#(quicksort(@xs), ::(@z, quicksort(@ys)))
, 1: append^#(@l, @ys) -> append#1^#(@l, @ys)
, 2: append#1^#(::(@x, @xs), @ys) -> append^#(@xs, @ys) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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 3:{5,7,6}->4:{8,9}: YES(O(1),O(n^2))
-----------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :4
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
4: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :5
5: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :4
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^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :4
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
4: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :5
5: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :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^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :4
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :3
3: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :5
4: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
5: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :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^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :3
2: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :5
3: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) :4
-->_2 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :2
4: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys))
-->_3 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
5: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :2
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(append^#(quicksort(@xs), ::(@z, quicksort(@ys))),
quicksort^#(@xs),
quicksort^#(@ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys))
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys))
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Remaining Rules (B):
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
Weak DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
Weak DPs:
{ quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys))
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :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^1)).
Strict DPs: { quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) :2
2: quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs))
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksort^#(@xs), quicksort^#(@ys))
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksort#1^#(::(@z, @zs)) ->
c_1(quicksort#2^#(split(@z, @zs), @z), split^#(@z, @zs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { quicksort^#(@l) -> quicksort#1^#(@l) }
Weak DPs:
{ quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:
{ 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(split) = {}, Uargs(tuple#2) = {},
Uargs(split#1) = {}, Uargs(split#2) = {}, Uargs(split#3) = {},
Uargs(#abs^#) = {}, Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}, Uargs(c_1) = {}, Uargs(c_2) = {},
Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [2] x1 + [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[split](x1, x2) = [1] x2 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[split#1](x1, x2) = [1] x1 + [0]
[split#2](x1, x2, x3) = [1] x1 + [1]
[split#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#false] = [0]
[#true] = [0]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [2] x1 + [1]
[quicksort#1^#](x1) = [2] x1 + [1]
[quicksort#2^#](x1, x2) = [2] x1 + [3]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [0]
[quicksortD#1^#](x1) = [0]
[quicksortD#2^#](x1, x2) = [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
[c_1](x1, x2) = [0]
[c_2](x1, x2) = [0]
[c] = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [2] @x + [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[split(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [split#1(@l, @pivot)]
[split#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [split#2(split(@pivot, @xs), @pivot, @x)]
[split#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[split#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [split#3(#greater(@x, @pivot), @ls, @rs, @x)]
[split#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[split#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksort^#(@l)] = [2] @l + [1]
>= [2] @l + [1]
= [quicksort#1^#(@l)]
[quicksort#1^#(::(@z, @zs))] = [2] @zs + [3]
>= [2] @zs + [3]
= [quicksort#2^#(split(@z, @zs), @z)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [3]
> [2] @xs + [2] @ys + [2]
= [c_1(quicksort^#(@xs), quicksort^#(@ys))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {3}.
Here rules are labeled according to the (estimated) dependency
graph
1: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :2
2: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) :3
3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
-->_2 quicksort^#(@l) -> quicksort#1^#(@l) :1
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :1
- The rules {3} have known complexity. These cover all predecessors
of {1}, their complexity is equally bounded.
- The rules {1,3} 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}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 3: quicksort#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksort^#(@xs), quicksort^#(@ys))
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: { split^#(@pivot, @l) -> split#1^#(@l, @pivot) }
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 2: quicksort^#(@l) -> quicksort#1^#(@l)
, 3: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 4: quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(split) = {}, Uargs(tuple#2) = {},
Uargs(split#1) = {}, Uargs(split#2) = {}, Uargs(split#3) = {},
Uargs(#abs^#) = {}, Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[split](x1, x2) = [1] x2 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[split#1](x1, x2) = [1] x1 + [0]
[split#2](x1, x2, x3) = [1] x1 + [1]
[split#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#false] = [0]
[#true] = [0]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [3] x1 + [2]
[quicksort#1^#](x1) = [3] x1 + [0]
[quicksort#2^#](x1, x2) = [3] x1 + [2]
[split^#](x1, x2) = [1] x2 + [1]
[split#1^#](x1, x2) = [1] x1 + [0]
[quicksortD^#](x1) = [0]
[quicksortD#1^#](x1) = [0]
[quicksortD#2^#](x1, x2) = [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[split(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [split#1(@l, @pivot)]
[split#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [split#2(split(@pivot, @xs), @pivot, @x)]
[split#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[split#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [split#3(#greater(@x, @pivot), @ls, @rs, @x)]
[split#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[split#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksort^#(@l)] = [3] @l + [2]
> [3] @l + [0]
= [quicksort#1^#(@l)]
[quicksort#1^#(::(@z, @zs))] = [3] @zs + [3]
> [3] @zs + [2]
= [quicksort#2^#(split(@z, @zs), @z)]
[quicksort#1^#(::(@z, @zs))] = [3] @zs + [3]
> [1] @zs + [1]
= [split^#(@z, @zs)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [2]
>= [3] @xs + [2]
= [quicksort^#(@xs)]
[quicksort#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [2]
>= [3] @ys + [2]
= [quicksort^#(@ys)]
[split^#(@pivot, @l)] = [1] @l + [1]
> [1] @l + [0]
= [split#1^#(@l, @pivot)]
[split#1^#(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [split^#(@pivot, @xs)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,2,3,4}. Here rules are labeled according to the (estimated)
dependency graph
1: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
-->_1 split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) :7
2: quicksort^#(@l) -> quicksort#1^#(@l)
-->_1 quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs) :4
-->_1 quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z) :3
3: quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys) :6
-->_1 quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs) :5
4: quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :1
5: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :2
6: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
-->_1 quicksort^#(@l) -> quicksort#1^#(@l) :2
7: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs)
-->_1 split^#(@pivot, @l) -> split#1^#(@l, @pivot) :1
- The rules {1,2,3,4} have known complexity. These cover all
predecessors of {5,6,7}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksort^#(@l) -> quicksort#1^#(@l)
, quicksort#1^#(::(@z, @zs)) -> quicksort#2^#(split(@z, @zs), @z)
, quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,5,2,4} Weak SCC
|
`->2:{3} Weak SCC
|
`->3:{6,7} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 3: quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, 4: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, 6: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 7: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksort^#(@l) -> quicksort#1^#(@l)
, 5: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@ys)
, 2: quicksort#1^#(::(@z, @zs)) ->
quicksort#2^#(split(@z, @zs), @z)
, 4: quicksort#2^#(tuple#2(@xs, @ys), @z) -> quicksort^#(@xs)
, 3: quicksort#1^#(::(@z, @zs)) -> split^#(@z, @zs)
, 6: split^#(@pivot, @l) -> split#1^#(@l, @pivot)
, 7: split#1^#(::(@x, @xs), @pivot) -> split^#(@pivot, @xs) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, split(@pivot, @l) -> split#1(@l, @pivot)
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:{10,12,11}->5:{3,4}: YES(O(1),O(n^2))
--------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :2
2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
3: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :4
4: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :5
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :3
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :3
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :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^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak DPs: { appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :5
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :3
3: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :4
4: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
5: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :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^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :4
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :3
3: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :5
4: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :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^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :3
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :4
3: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
4: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :5
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) }
Remaining Rules (B):
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :3
2: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :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^1)).
Strict DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :3
3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
, 2: quicksortD^#(@l) -> quicksortD#1^#(@l) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(appendD) = {}, Uargs(appendD#1) = {},
Uargs(tuple#2) = {}, Uargs(quicksortD) = {},
Uargs(quicksortD#1) = {}, Uargs(splitD) = {},
Uargs(quicksortD#2) = {}, Uargs(splitD#1) = {},
Uargs(splitD#2) = {}, Uargs(splitD#3) = {}, Uargs(#abs^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}, Uargs(c_1) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [2] x2 + [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[appendD](x1, x2) = [0]
[appendD#1](x1, x2) = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[quicksortD](x1) = [0]
[quicksortD#1](x1) = [0]
[splitD](x1, x2) = [1] x2 + [0]
[quicksortD#2](x1, x2) = [0]
[#false] = [0]
[#true] = [0]
[splitD#1](x1, x2) = [1] x1 + [0]
[splitD#2](x1, x2, x3) = [1] x1 + [1]
[splitD#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [0]
[quicksort#1^#](x1) = [0]
[quicksort#2^#](x1, x2) = [0]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [3] x1 + [1]
[quicksortD#1^#](x1) = [3] x1 + [0]
[quicksortD#2^#](x1, x2) = [3] x1 + [3]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
[c_1](x1, x2, x3) = [0]
[c] = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [2] @y + [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[splitD(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [splitD#1(@l, @pivot)]
[splitD#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [splitD#2(splitD(@pivot, @xs), @pivot, @x)]
[splitD#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[splitD#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [splitD#3(#greater(@x, @pivot), @ls, @rs, @x)]
[splitD#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[splitD#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksortD^#(@l)] = [3] @l + [1]
> [3] @l + [0]
= [quicksortD#1^#(@l)]
[quicksortD#1^#(::(@z, @zs))] = [3] @zs + [3]
>= [3] @zs + [3]
= [quicksortD#2^#(splitD(@z, @zs), @z)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [3] @xs + [3] @ys + [3]
> [3] @xs + [3] @ys + [2]
= [c_1(quicksortD^#(@xs), quicksortD^#(@ys))]
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: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :3
3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) :1
- The rules {1,2} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules {1,2,3}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: { appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) }
Weak DPs:
{ appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:
{ 2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, 4: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(appendD) = {}, Uargs(appendD#1) = {},
Uargs(tuple#2) = {}, Uargs(quicksortD) = {},
Uargs(quicksortD#1) = {}, Uargs(splitD) = {},
Uargs(quicksortD#2) = {}, Uargs(splitD#1) = {},
Uargs(splitD#2) = {}, Uargs(splitD#3) = {}, Uargs(#abs^#) = {},
Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [1]
[#neg](x1) = [1] x1 + [1]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [1]
[#compare](x1, x2) = [1]
[#ckgt](x1) = [1] x1 + [0]
[::](x1, x2) = [1] x1 + [1] x2 + [1]
[nil] = [0]
[appendD](x1, x2) = [1] x1 + [1] x2 + [0]
[appendD#1](x1, x2) = [1] x1 + [1] x2 + [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [1]
[quicksortD](x1) = [1] x1 + [0]
[quicksortD#1](x1) = [1] x1 + [0]
[splitD](x1, x2) = [1] x2 + [1]
[quicksortD#2](x1, x2) = [1] x1 + [1] x2 + [0]
[#false] = [1]
[#true] = [1]
[splitD#1](x1, x2) = [1] x1 + [1]
[splitD#2](x1, x2, x3) = [1] x1 + [1] x3 + [1]
[splitD#3](x1, x2, x3, x4) = [1] x1 + [1] x2 + [1] x3 + [1] x4 + [1]
[#EQ] = [1]
[#GT] = [1]
[#LT] = [1]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [1] x1 + [2]
[appendD#1^#](x1, x2) = [1] x1 + [2]
[quicksort^#](x1) = [0]
[quicksort#1^#](x1) = [0]
[quicksort#2^#](x1, x2) = [0]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [1] x1 + [3]
[quicksortD#1^#](x1) = [1] x1 + [3]
[quicksortD#2^#](x1, x2) = [1] x1 + [2]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [1]
>= [1]
= [#ckgt(#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)]
[#ckgt(#EQ())] = [1]
>= [1]
= [#false()]
[#ckgt(#GT())] = [1]
>= [1]
= [#true()]
[#ckgt(#LT())] = [1]
>= [1]
= [#false()]
[appendD(@l, @ys)] = [1] @l + [1] @ys + [0]
>= [1] @l + [1] @ys + [0]
= [appendD#1(@l, @ys)]
[appendD#1(::(@x, @xs), @ys)] = [1] @x + [1] @xs + [1] @ys + [1]
>= [1] @x + [1] @xs + [1] @ys + [1]
= [::(@x, appendD(@xs, @ys))]
[appendD#1(nil(), @ys)] = [1] @ys + [0]
>= [1] @ys + [0]
= [@ys]
[quicksortD(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [quicksortD#1(@l)]
[quicksortD#1(::(@z, @zs))] = [1] @z + [1] @zs + [1]
>= [1] @z + [1] @zs + [1]
= [quicksortD#2(splitD(@z, @zs), @z)]
[quicksortD#1(nil())] = [0]
>= [0]
= [nil()]
[splitD(@pivot, @l)] = [1] @l + [1]
>= [1] @l + [1]
= [splitD#1(@l, @pivot)]
[quicksortD#2(tuple#2(@xs, @ys), @z)] = [1] @xs + [1] @ys + [1] @z + [1]
>= [1] @xs + [1] @ys + [1] @z + [1]
= [appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))]
[splitD#1(::(@x, @xs), @pivot)] = [1] @x + [1] @xs + [2]
>= [1] @x + [1] @xs + [2]
= [splitD#2(splitD(@pivot, @xs), @pivot, @x)]
[splitD#1(nil(), @pivot)] = [1]
>= [1]
= [tuple#2(nil(), nil())]
[splitD#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1] @x + [2]
>= [1] @ls + [1] @rs + [1] @x + [2]
= [splitD#3(#greater(@x, @pivot), @ls, @rs, @x)]
[splitD#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1] @x + [2]
>= [1] @ls + [1] @rs + [1] @x + [2]
= [tuple#2(::(@x, @ls), @rs)]
[splitD#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1] @x + [2]
>= [1] @ls + [1] @rs + [1] @x + [2]
= [tuple#2(@ls, ::(@x, @rs))]
[appendD^#(@l, @ys)] = [1] @l + [2]
>= [1] @l + [2]
= [appendD#1^#(@l, @ys)]
[appendD#1^#(::(@x, @xs), @ys)] = [1] @x + [1] @xs + [3]
> [1] @xs + [2]
= [appendD^#(@xs, @ys)]
[quicksortD^#(@l)] = [1] @l + [3]
>= [1] @l + [3]
= [quicksortD#1^#(@l)]
[quicksortD#1^#(::(@z, @zs))] = [1] @z + [1] @zs + [4]
> [1] @zs + [3]
= [quicksortD#2^#(splitD(@z, @zs), @z)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [1] @xs + [1] @ys + [3]
> [1] @xs + [2]
= [appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [1] @xs + [1] @ys + [3]
>= [1] @xs + [3]
= [quicksortD^#(@xs)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [1] @xs + [1] @ys + [3]
>= [1] @ys + [3]
= [quicksortD^#(@ys)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{2,4,5}. Here rules are labeled according to the (estimated)
dependency graph
1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
-->_1 appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) :2
2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
3: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :4
4: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) :7
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs) :6
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))) :5
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
-->_1 appendD^#(@l, @ys) -> appendD#1^#(@l, @ys) :1
6: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :3
7: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :3
- The rules {2,4,5} have known complexity. These cover all
predecessors of {1,6,7}, their complexity is equally bounded.
- The rules {1,2,4,5,6,7} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{3,7,4,6} Weak SCC
|
`->2:{5} Weak SCC
|
`->3:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, 2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys)
, 3: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 4: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, 6: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, 7: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 3: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 7: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, 4: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 6: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, 1: appendD^#(@l, @ys) -> appendD#1^#(@l, @ys)
, 2: appendD#1^#(::(@x, @xs), @ys) -> appendD^#(@xs, @ys) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:{10,12,11}->2:{13,14}: YES(O(1),O(n^2))
----------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :4
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
4: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :5
5: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :4
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^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :4
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
4: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :5
5: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :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^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :4
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :3
3: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :5
4: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
5: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :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^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :3
2: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :5
3: quicksortD#1^#(::(@z, @zs)) ->
c_3(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) :4
-->_2 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :2
4: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys))
-->_3 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
5: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :2
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_4(appendD^#(quicksortD(@xs), ::(@z, quicksortD(@ys))),
quicksortD^#(@xs),
quicksortD^#(@ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys))
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #abs(#0()) -> #0()
, #abs(#neg(@x)) -> #pos(@x)
, #abs(#pos(@x)) -> #pos(@x)
, #abs(#s(@x)) -> #pos(#s(@x))
, #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, append(@l, @ys) -> append#1(@l, @ys)
, append#1(::(@x, @xs), @ys) -> ::(@x, append(@xs, @ys))
, append#1(nil(), @ys) -> @ys
, appendD(@l, @ys) -> appendD#1(@l, @ys)
, appendD#1(::(@x, @xs), @ys) -> ::(@x, appendD(@xs, @ys))
, appendD#1(nil(), @ys) -> @ys
, quicksort(@l) -> quicksort#1(@l)
, quicksort#1(::(@z, @zs)) -> quicksort#2(split(@z, @zs), @z)
, quicksort#1(nil()) -> nil()
, split(@pivot, @l) -> split#1(@l, @pivot)
, quicksort#2(tuple#2(@xs, @ys), @z) ->
append(quicksort(@xs), ::(@z, quicksort(@ys)))
, quicksortD(@l) -> quicksortD#1(@l)
, quicksortD#1(::(@z, @zs)) -> quicksortD#2(splitD(@z, @zs), @z)
, quicksortD#1(nil()) -> nil()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, quicksortD#2(tuple#2(@xs, @ys), @z) ->
appendD(quicksortD(@xs), ::(@z, quicksortD(@ys)))
, split#1(::(@x, @xs), @pivot) ->
split#2(split(@pivot, @xs), @pivot, @x)
, split#1(nil(), @pivot) -> tuple#2(nil(), nil())
, split#2(tuple#2(@ls, @rs), @pivot, @x) ->
split#3(#greater(@x, @pivot), @ls, @rs, @x)
, split#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, split#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs))
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys))
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Remaining Rules (B):
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs: { splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
Weak DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
Weak DPs:
{ quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys))
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :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^1)).
Strict DPs: { quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) :2
2: quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs))
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_2(quicksortD^#(@xs), quicksortD^#(@ys))
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ quicksortD#1^#(::(@z, @zs)) ->
c_1(quicksortD#2^#(splitD(@z, @zs), @z), splitD^#(@z, @zs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { quicksortD^#(@l) -> quicksortD#1^#(@l) }
Weak DPs:
{ quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:
{ 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(tuple#2) = {}, Uargs(splitD) = {},
Uargs(splitD#1) = {}, Uargs(splitD#2) = {}, Uargs(splitD#3) = {},
Uargs(#abs^#) = {}, Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}, Uargs(c_1) = {}, Uargs(c_2) = {},
Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [2] x1 + [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[splitD](x1, x2) = [1] x2 + [0]
[#false] = [0]
[#true] = [0]
[splitD#1](x1, x2) = [1] x1 + [0]
[splitD#2](x1, x2, x3) = [1] x1 + [1]
[splitD#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [0]
[quicksort#1^#](x1) = [0]
[quicksort#2^#](x1, x2) = [0]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [2] x1 + [0]
[quicksortD#1^#](x1) = [2] x1 + [0]
[quicksortD#2^#](x1, x2) = [2] x1 + [0]
[splitD^#](x1, x2) = [0]
[splitD#1^#](x1, x2) = [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
[c_1](x1, x2) = [0]
[c_2](x1, x2) = [0]
[c] = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [2] @x + [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[splitD(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [splitD#1(@l, @pivot)]
[splitD#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [splitD#2(splitD(@pivot, @xs), @pivot, @x)]
[splitD#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[splitD#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [splitD#3(#greater(@x, @pivot), @ls, @rs, @x)]
[splitD#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[splitD#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksortD^#(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [quicksortD#1^#(@l)]
[quicksortD#1^#(::(@z, @zs))] = [2] @zs + [2]
> [2] @zs + [0]
= [quicksortD#2^#(splitD(@z, @zs), @z)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [0]
>= [2] @xs + [2] @ys + [0]
= [c_1(quicksortD^#(@xs), quicksortD^#(@ys))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2}.
Here rules are labeled according to the (estimated) dependency
graph
1: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :2
2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) :3
3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
-->_2 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :1
- The rules {2} have known complexity. These cover all predecessors
of {3}, their complexity is equally bounded.
- The rules {2,3} 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,2,3}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,3,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 3: quicksortD#2^#(tuple#2(@xs, @ys), @z) ->
c_1(quicksortD^#(@xs), quicksortD^#(@ys))
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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: { splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) }
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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:
{ 3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 4: quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, 7: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#greater) = {}, Uargs(#compare) = {}, Uargs(#ckgt) = {},
Uargs(::) = {}, Uargs(tuple#2) = {}, Uargs(splitD) = {},
Uargs(splitD#1) = {}, Uargs(splitD#2) = {}, Uargs(splitD#3) = {},
Uargs(#abs^#) = {}, Uargs(#greater^#) = {}, Uargs(#ckgt^#) = {},
Uargs(#compare^#) = {}, Uargs(append^#) = {},
Uargs(append#1^#) = {}, Uargs(appendD^#) = {},
Uargs(appendD#1^#) = {}, Uargs(quicksort^#) = {},
Uargs(quicksort#1^#) = {}, Uargs(quicksort#2^#) = {},
Uargs(split^#) = {}, Uargs(split#1^#) = {},
Uargs(quicksortD^#) = {}, Uargs(quicksortD#1^#) = {},
Uargs(quicksortD#2^#) = {}, Uargs(splitD^#) = {},
Uargs(splitD#1^#) = {}, Uargs(split#2^#) = {},
Uargs(split#3^#) = {}, Uargs(splitD#2^#) = {},
Uargs(splitD#3^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#greater](x1, x2) = [2] x2 + [0]
[#compare](x1, x2) = [0]
[#ckgt](x1) = [0]
[::](x1, x2) = [1] x2 + [1]
[nil] = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[splitD](x1, x2) = [1] x2 + [0]
[#false] = [0]
[#true] = [0]
[splitD#1](x1, x2) = [1] x1 + [0]
[splitD#2](x1, x2, x3) = [1] x1 + [1]
[splitD#3](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1]
[#EQ] = [0]
[#GT] = [0]
[#LT] = [0]
[#abs^#](x1) = [0]
[#greater^#](x1, x2) = [0]
[#ckgt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[append^#](x1, x2) = [0]
[append#1^#](x1, x2) = [0]
[appendD^#](x1, x2) = [0]
[appendD#1^#](x1, x2) = [0]
[quicksort^#](x1) = [0]
[quicksort#1^#](x1) = [0]
[quicksort#2^#](x1, x2) = [0]
[split^#](x1, x2) = [0]
[split#1^#](x1, x2) = [0]
[quicksortD^#](x1) = [2] x1 + [0]
[quicksortD#1^#](x1) = [2] x1 + [0]
[quicksortD#2^#](x1, x2) = [2] x1 + [0]
[splitD^#](x1, x2) = [2] x2 + [0]
[splitD#1^#](x1, x2) = [2] x1 + [0]
[split#2^#](x1, x2, x3) = [0]
[split#3^#](x1, x2, x3, x4) = [0]
[splitD#2^#](x1, x2, x3) = [0]
[splitD#3^#](x1, x2, x3, x4) = [0]
This order satisfies following ordering constraints
[#greater(@x, @y)] = [2] @y + [0]
>= [0]
= [#ckgt(#compare(@x, @y))]
[#compare(#0(), #0())] = [0]
>= [0]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#0(), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#0(), #s(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #0())] = [0]
>= [0]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#LT()]
[#compare(#pos(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [0]
>= [0]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [0]
>= [0]
= [#compare(@x, @y)]
[#ckgt(#EQ())] = [0]
>= [0]
= [#false()]
[#ckgt(#GT())] = [0]
>= [0]
= [#true()]
[#ckgt(#LT())] = [0]
>= [0]
= [#false()]
[splitD(@pivot, @l)] = [1] @l + [0]
>= [1] @l + [0]
= [splitD#1(@l, @pivot)]
[splitD#1(::(@x, @xs), @pivot)] = [1] @xs + [1]
>= [1] @xs + [1]
= [splitD#2(splitD(@pivot, @xs), @pivot, @x)]
[splitD#1(nil(), @pivot)] = [0]
>= [0]
= [tuple#2(nil(), nil())]
[splitD#2(tuple#2(@ls, @rs), @pivot, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [splitD#3(#greater(@x, @pivot), @ls, @rs, @x)]
[splitD#3(#false(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(::(@x, @ls), @rs)]
[splitD#3(#true(), @ls, @rs, @x)] = [1] @ls + [1] @rs + [1]
>= [1] @ls + [1] @rs + [1]
= [tuple#2(@ls, ::(@x, @rs))]
[quicksortD^#(@l)] = [2] @l + [0]
>= [2] @l + [0]
= [quicksortD#1^#(@l)]
[quicksortD#1^#(::(@z, @zs))] = [2] @zs + [2]
> [2] @zs + [0]
= [quicksortD#2^#(splitD(@z, @zs), @z)]
[quicksortD#1^#(::(@z, @zs))] = [2] @zs + [2]
> [2] @zs + [0]
= [splitD^#(@z, @zs)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [0]
>= [2] @xs + [0]
= [quicksortD^#(@xs)]
[quicksortD#2^#(tuple#2(@xs, @ys), @z)] = [2] @xs + [2] @ys + [0]
>= [2] @ys + [0]
= [quicksortD^#(@ys)]
[splitD^#(@pivot, @l)] = [2] @l + [0]
>= [2] @l + [0]
= [splitD#1^#(@l, @pivot)]
[splitD#1^#(::(@x, @xs), @pivot)] = [2] @xs + [2]
> [2] @xs + [0]
= [splitD^#(@pivot, @xs)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{3,4,7}. Here rules are labeled according to the (estimated)
dependency graph
1: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
-->_1 splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) :7
2: quicksortD^#(@l) -> quicksortD#1^#(@l)
-->_1 quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs) :4
-->_1 quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z) :3
3: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys) :6
-->_1 quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs) :5
4: quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :1
5: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
6: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
-->_1 quicksortD^#(@l) -> quicksortD#1^#(@l) :2
7: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs)
-->_1 splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot) :1
- The rules {3,4,7} have known complexity. These cover all
predecessors of {1,5,6}, their complexity is equally bounded.
- The rules {1,3,4,5,6,7} 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,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ quicksortD^#(@l) -> quicksortD#1^#(@l)
, quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,5,2,4} Weak SCC
|
`->2:{3} Weak SCC
|
`->3:{6,7} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 3: quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, 4: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, 6: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, 7: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: quicksortD^#(@l) -> quicksortD#1^#(@l)
, 5: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@ys)
, 2: quicksortD#1^#(::(@z, @zs)) ->
quicksortD#2^#(splitD(@z, @zs), @z)
, 4: quicksortD#2^#(tuple#2(@xs, @ys), @z) -> quicksortD^#(@xs)
, 3: quicksortD#1^#(::(@z, @zs)) -> splitD^#(@z, @zs)
, 6: splitD^#(@pivot, @l) -> splitD#1^#(@l, @pivot)
, 7: splitD#1^#(::(@x, @xs), @pivot) -> splitD^#(@pivot, @xs) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #greater(@x, @y) -> #ckgt(#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)
, #ckgt(#EQ()) -> #false()
, #ckgt(#GT()) -> #true()
, #ckgt(#LT()) -> #false()
, splitD(@pivot, @l) -> splitD#1(@l, @pivot)
, splitD#1(::(@x, @xs), @pivot) ->
splitD#2(splitD(@pivot, @xs), @pivot, @x)
, splitD#1(nil(), @pivot) -> tuple#2(nil(), nil())
, splitD#2(tuple#2(@ls, @rs), @pivot, @x) ->
splitD#3(#greater(@x, @pivot), @ls, @rs, @x)
, splitD#3(#false(), @ls, @rs, @x) -> tuple#2(::(@x, @ls), @rs)
, splitD#3(#true(), @ls, @rs, @x) -> tuple#2(@ls, ::(@x, @rs)) }
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^2))