tct
Execution Time (secs) | 18.117 |
Answer | YES(O(1),O(n^2)) |
Input | listsort.raml |
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 Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, and(@x, @y) -> #and(@x, @y)
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y) }
Weak Trs:
{ #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We add following dependency tuples
Strict DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, and^#(@x, @y) -> #and^#(@x, @y)
, insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#1^#(nil(), @x) -> c_6()
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, insert#2^#(#true(), @x, @y, @ys) -> c_9()
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#1^#(nil(), @l2) -> c_14()
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, isortlist#1^#(nil()) -> c_12()
, leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys))
, leq#2^#(nil(), @x, @xs) -> c_16()
, or^#(@x, @y) -> #or^#(@x, @y) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, #eq^#(nil(), nil()) -> c_21()
, #eq^#(#0(), #0()) -> c_22()
, #eq^#(#0(), #neg(@y)) -> c_23()
, #eq^#(#0(), #pos(@y)) -> c_24()
, #eq^#(#0(), #s(@y)) -> c_25()
, #eq^#(#neg(@x), #0()) -> c_26()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_28()
, #eq^#(#pos(@x), #0()) -> c_29()
, #eq^#(#pos(@x), #neg(@y)) -> c_30()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_32()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #cklt^#(#EQ()) -> c_46()
, #cklt^#(#GT()) -> c_47()
, #cklt^#(#LT()) -> c_48()
, #compare^#(#0(), #0()) -> c_34()
, #compare^#(#0(), #neg(@y)) -> c_35()
, #compare^#(#0(), #pos(@y)) -> c_36()
, #compare^#(#0(), #s(@y)) -> c_37()
, #compare^#(#neg(@x), #0()) -> c_38()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_40()
, #compare^#(#pos(@x), #0()) -> c_41()
, #compare^#(#pos(@x), #neg(@y)) -> c_42()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_44()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, #and^#(#false(), #false()) -> c_49()
, #and^#(#false(), #true()) -> c_50()
, #and^#(#true(), #false()) -> c_51()
, #and^#(#true(), #true()) -> c_52()
, #or^#(#false(), #false()) -> c_53()
, #or^#(#false(), #true()) -> c_54()
, #or^#(#true(), #false()) -> c_55()
, #or^#(#true(), #true()) -> c_56() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, and^#(@x, @y) -> #and^#(@x, @y)
, insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#1^#(nil(), @x) -> c_6()
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, insert#2^#(#true(), @x, @y, @ys) -> c_9()
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#1^#(nil(), @l2) -> c_14()
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, isortlist#1^#(nil()) -> c_12()
, leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys))
, leq#2^#(nil(), @x, @xs) -> c_16()
, or^#(@x, @y) -> #or^#(@x, @y) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, #eq^#(nil(), nil()) -> c_21()
, #eq^#(#0(), #0()) -> c_22()
, #eq^#(#0(), #neg(@y)) -> c_23()
, #eq^#(#0(), #pos(@y)) -> c_24()
, #eq^#(#0(), #s(@y)) -> c_25()
, #eq^#(#neg(@x), #0()) -> c_26()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_28()
, #eq^#(#pos(@x), #0()) -> c_29()
, #eq^#(#pos(@x), #neg(@y)) -> c_30()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_32()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #cklt^#(#EQ()) -> c_46()
, #cklt^#(#GT()) -> c_47()
, #cklt^#(#LT()) -> c_48()
, #compare^#(#0(), #0()) -> c_34()
, #compare^#(#0(), #neg(@y)) -> c_35()
, #compare^#(#0(), #pos(@y)) -> c_36()
, #compare^#(#0(), #s(@y)) -> c_37()
, #compare^#(#neg(@x), #0()) -> c_38()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_40()
, #compare^#(#pos(@x), #0()) -> c_41()
, #compare^#(#pos(@x), #neg(@y)) -> c_42()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_44()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, #and^#(#false(), #false()) -> c_49()
, #and^#(#false(), #true()) -> c_50()
, #and^#(#true(), #false()) -> c_51()
, #and^#(#true(), #true()) -> c_52()
, #or^#(#false(), #false()) -> c_53()
, #or^#(#false(), #true()) -> c_54()
, #or^#(#true(), #false()) -> c_55()
, #or^#(#true(), #true()) -> c_56() }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
-->_1 #eq^#(#s(@x), #0()) -> c_32() :32
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_1 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_1 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_1 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_1 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_1 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_1 #eq^#(#0(), #0()) -> c_22() :22
-->_1 #eq^#(nil(), nil()) -> c_21() :21
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
2: #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :48
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :46
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :42
-->_2 #compare^#(#s(@x), #0()) -> c_44() :47
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_42() :45
-->_2 #compare^#(#pos(@x), #0()) -> c_41() :44
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_40() :43
-->_2 #compare^#(#neg(@x), #0()) -> c_38() :41
-->_2 #compare^#(#0(), #s(@y)) -> c_37() :40
-->_2 #compare^#(#0(), #pos(@y)) -> c_36() :39
-->_2 #compare^#(#0(), #neg(@y)) -> c_35() :38
-->_2 #compare^#(#0(), #0()) -> c_34() :37
-->_1 #cklt^#(#LT()) -> c_48() :36
-->_1 #cklt^#(#GT()) -> c_47() :35
-->_1 #cklt^#(#EQ()) -> c_46() :34
3: and^#(@x, @y) -> #and^#(@x, @y)
-->_1 #and^#(#true(), #true()) -> c_52() :52
-->_1 #and^#(#true(), #false()) -> c_51() :51
-->_1 #and^#(#false(), #true()) -> c_50() :50
-->_1 #and^#(#false(), #false()) -> c_49() :49
4: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :5
-->_1 insert#1^#(nil(), @x) -> c_6() :6
5: insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :9
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :7
-->_1 insert#2^#(#true(), @x, @y, @ys) -> c_9() :8
6: insert#1^#(nil(), @x) -> c_6()
7: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :4
8: insert#2^#(#true(), @x, @y, @ys) -> c_9()
9: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :10
-->_1 leq#1^#(nil(), @l2) -> c_14() :11
10: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) :15
-->_1 leq#2^#(nil(), @x, @xs) -> c_16() :16
11: leq#1^#(nil(), @l2) -> c_14()
12: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :13
-->_1 isortlist#1^#(nil()) -> c_12() :14
13: isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :12
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :4
14: isortlist#1^#(nil()) -> c_12()
15: leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys))
-->_1 or^#(@x, @y) -> #or^#(@x, @y) :17
-->_5 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :9
-->_3 and^#(@x, @y) -> #and^#(@x, @y) :3
-->_2 #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) :2
-->_4 #equal^#(@x, @y) -> #eq^#(@x, @y) :1
16: leq#2^#(nil(), @x, @xs) -> c_16()
17: or^#(@x, @y) -> #or^#(@x, @y)
-->_1 #or^#(#true(), #true()) -> c_56() :56
-->_1 #or^#(#true(), #false()) -> c_55() :55
-->_1 #or^#(#false(), #true()) -> c_54() :54
-->_1 #or^#(#false(), #false()) -> c_53() :53
18: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #and^#(#true(), #true()) -> c_52() :52
-->_1 #and^#(#true(), #false()) -> c_51() :51
-->_1 #and^#(#false(), #true()) -> c_50() :50
-->_1 #and^#(#false(), #false()) -> c_49() :49
-->_3 #eq^#(#s(@x), #0()) -> c_32() :32
-->_2 #eq^#(#s(@x), #0()) -> c_32() :32
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_3 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_2 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_3 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_2 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_3 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_2 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_3 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_2 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_3 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_2 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_3 #eq^#(#0(), #0()) -> c_22() :22
-->_2 #eq^#(#0(), #0()) -> c_22() :22
-->_3 #eq^#(nil(), nil()) -> c_21() :21
-->_2 #eq^#(nil(), nil()) -> c_21() :21
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
19: #eq^#(::(@x_1, @x_2), nil()) -> c_19()
20: #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
21: #eq^#(nil(), nil()) -> c_21()
22: #eq^#(#0(), #0()) -> c_22()
23: #eq^#(#0(), #neg(@y)) -> c_23()
24: #eq^#(#0(), #pos(@y)) -> c_24()
25: #eq^#(#0(), #s(@y)) -> c_25()
26: #eq^#(#neg(@x), #0()) -> c_26()
27: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_1 #eq^#(#s(@x), #0()) -> c_32() :32
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_1 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_1 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_1 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_1 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_1 #eq^#(#0(), #0()) -> c_22() :22
-->_1 #eq^#(nil(), nil()) -> c_21() :21
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
28: #eq^#(#neg(@x), #pos(@y)) -> c_28()
29: #eq^#(#pos(@x), #0()) -> c_29()
30: #eq^#(#pos(@x), #neg(@y)) -> c_30()
31: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#s(@x), #0()) -> c_32() :32
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_1 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_1 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_1 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_1 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_1 #eq^#(#0(), #0()) -> c_22() :22
-->_1 #eq^#(nil(), nil()) -> c_21() :21
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
32: #eq^#(#s(@x), #0()) -> c_32()
33: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#s(@x), #0()) -> c_32() :32
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_1 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_1 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_1 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_1 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_1 #eq^#(#0(), #0()) -> c_22() :22
-->_1 #eq^#(nil(), nil()) -> c_21() :21
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
34: #cklt^#(#EQ()) -> c_46()
35: #cklt^#(#GT()) -> c_47()
36: #cklt^#(#LT()) -> c_48()
37: #compare^#(#0(), #0()) -> c_34()
38: #compare^#(#0(), #neg(@y)) -> c_35()
39: #compare^#(#0(), #pos(@y)) -> c_36()
40: #compare^#(#0(), #s(@y)) -> c_37()
41: #compare^#(#neg(@x), #0()) -> c_38()
42: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#s(@x), #0()) -> c_44() :47
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_42() :45
-->_1 #compare^#(#pos(@x), #0()) -> c_41() :44
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_40() :43
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :42
-->_1 #compare^#(#neg(@x), #0()) -> c_38() :41
-->_1 #compare^#(#0(), #s(@y)) -> c_37() :40
-->_1 #compare^#(#0(), #pos(@y)) -> c_36() :39
-->_1 #compare^#(#0(), #neg(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #0()) -> c_34() :37
43: #compare^#(#neg(@x), #pos(@y)) -> c_40()
44: #compare^#(#pos(@x), #0()) -> c_41()
45: #compare^#(#pos(@x), #neg(@y)) -> c_42()
46: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#s(@x), #0()) -> c_44() :47
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_42() :45
-->_1 #compare^#(#pos(@x), #0()) -> c_41() :44
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_40() :43
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :42
-->_1 #compare^#(#neg(@x), #0()) -> c_38() :41
-->_1 #compare^#(#0(), #s(@y)) -> c_37() :40
-->_1 #compare^#(#0(), #pos(@y)) -> c_36() :39
-->_1 #compare^#(#0(), #neg(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #0()) -> c_34() :37
47: #compare^#(#s(@x), #0()) -> c_44()
48: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#s(@x), #0()) -> c_44() :47
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_42() :45
-->_1 #compare^#(#pos(@x), #0()) -> c_41() :44
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_40() :43
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :42
-->_1 #compare^#(#neg(@x), #0()) -> c_38() :41
-->_1 #compare^#(#0(), #s(@y)) -> c_37() :40
-->_1 #compare^#(#0(), #pos(@y)) -> c_36() :39
-->_1 #compare^#(#0(), #neg(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #0()) -> c_34() :37
49: #and^#(#false(), #false()) -> c_49()
50: #and^#(#false(), #true()) -> c_50()
51: #and^#(#true(), #false()) -> c_51()
52: #and^#(#true(), #true()) -> c_52()
53: #or^#(#false(), #false()) -> c_53()
54: #or^#(#false(), #true()) -> c_54()
55: #or^#(#true(), #false()) -> c_55()
56: #or^#(#true(), #true()) -> c_56()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {14} and add Pre({14}) = {12} to the strict component.
- We remove {6} and add Pre({6}) = {4} to the strict component.
- We remove {8} and add Pre({8}) = {5} to the strict component.
- We remove {11} and add Pre({11}) = {9} to the strict component.
- We remove {16} and add Pre({16}) = {10} to the strict component.
- We remove {17} and add Pre({17}) = {15} to the strict component.
- We remove {3} and add Pre({3}) = {15} to the strict component.
- We remove {2} and add Pre({2}) = {15} to the strict component.
- We remove {1} and add Pre({1}) = {15} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, #eq^#(nil(), nil()) -> c_21()
, #eq^#(#0(), #0()) -> c_22()
, #eq^#(#0(), #neg(@y)) -> c_23()
, #eq^#(#0(), #pos(@y)) -> c_24()
, #eq^#(#0(), #s(@y)) -> c_25()
, #eq^#(#neg(@x), #0()) -> c_26()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_28()
, #eq^#(#pos(@x), #0()) -> c_29()
, #eq^#(#pos(@x), #neg(@y)) -> c_30()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_32()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #cklt^#(#EQ()) -> c_46()
, #cklt^#(#GT()) -> c_47()
, #cklt^#(#LT()) -> c_48()
, #compare^#(#0(), #0()) -> c_34()
, #compare^#(#0(), #neg(@y)) -> c_35()
, #compare^#(#0(), #pos(@y)) -> c_36()
, #compare^#(#0(), #s(@y)) -> c_37()
, #compare^#(#neg(@x), #0()) -> c_38()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_40()
, #compare^#(#pos(@x), #0()) -> c_41()
, #compare^#(#pos(@x), #neg(@y)) -> c_42()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_44()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, and^#(@x, @y) -> #and^#(@x, @y)
, #and^#(#false(), #false()) -> c_49()
, #and^#(#false(), #true()) -> c_50()
, #and^#(#true(), #false()) -> c_51()
, #and^#(#true(), #true()) -> c_52()
, insert#1^#(nil(), @x) -> c_6()
, insert#2^#(#true(), @x, @y, @ys) -> c_9()
, leq#1^#(nil(), @l2) -> c_14()
, isortlist#1^#(nil()) -> c_12()
, leq#2^#(nil(), @x, @xs) -> c_16()
, or^#(@x, @y) -> #or^#(@x, @y)
, #or^#(#false(), #false()) -> c_53()
, #or^#(#false(), #true()) -> c_54()
, #or^#(#true(), #false()) -> c_55()
, #or^#(#true(), #true()) -> c_56() }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the the dependency graph
->1:{6,7}
|
|->3:{1,3,2}
| |
| |->6:{4,8,5}
| | |
| | |->9:{9} Weak SCC
| | | |
| | | |->11:{11} Weak SCC
| | | |
| | | |->12:{12} Weak SCC
| | | |
| | | |->13:{13} Weak SCC
| | | |
| | | |->14:{14} Weak SCC
| | | |
| | | |->15:{15} Weak SCC
| | | |
| | | |->16:{16} Weak SCC
| | | |
| | | |->17:{17} Weak SCC
| | | |
| | | |->18:{18} Weak SCC
| | | |
| | | |->19:{20} Weak SCC
| | | |
| | | |->20:{21} Weak SCC
| | | |
| | | |->21:{22} Weak SCC
| | | |
| | | |->22:{24} Weak SCC
| | | |
| | | `->10:{25,23,19,10} Weak SCC
| | | |
| | | |->11:{11} Weak SCC
| | | |
| | | |->12:{12} Weak SCC
| | | |
| | | |->13:{13} Weak SCC
| | | |
| | | |->14:{14} Weak SCC
| | | |
| | | |->15:{15} Weak SCC
| | | |
| | | |->16:{16} Weak SCC
| | | |
| | | |->17:{17} Weak SCC
| | | |
| | | |->18:{18} Weak SCC
| | | |
| | | |->19:{20} Weak SCC
| | | |
| | | |->20:{21} Weak SCC
| | | |
| | | |->21:{22} Weak SCC
| | | |
| | | |->22:{24} Weak SCC
| | | |
| | | |->38:{43} Weak SCC
| | | |
| | | |->39:{44} Weak SCC
| | | |
| | | |->40:{45} Weak SCC
| | | |
| | | `->41:{46} Weak SCC
| | |
| | |->23:{26} Weak SCC
| | | |
| | | |->24:{27} Weak SCC
| | | |
| | | |->25:{28} Weak SCC
| | | |
| | | |->26:{29} Weak SCC
| | | |
| | | |->28:{30} Weak SCC
| | | |
| | | |->29:{31} Weak SCC
| | | |
| | | |->30:{32} Weak SCC
| | | |
| | | |->31:{33} Weak SCC
| | | |
| | | |->32:{34} Weak SCC
| | | |
| | | |->33:{36} Weak SCC
| | | |
| | | |->34:{37} Weak SCC
| | | |
| | | |->35:{38} Weak SCC
| | | |
| | | |->36:{40} Weak SCC
| | | |
| | | `->27:{41,39,35} Weak SCC
| | | |
| | | |->28:{30} Weak SCC
| | | |
| | | |->29:{31} Weak SCC
| | | |
| | | |->30:{32} Weak SCC
| | | |
| | | |->31:{33} Weak SCC
| | | |
| | | |->32:{34} Weak SCC
| | | |
| | | |->33:{36} Weak SCC
| | | |
| | | |->34:{37} Weak SCC
| | | |
| | | |->35:{38} Weak SCC
| | | |
| | | `->36:{40} Weak SCC
| | |
| | |->37:{42} Weak SCC
| | | |
| | | |->38:{43} Weak SCC
| | | |
| | | |->39:{44} Weak SCC
| | | |
| | | |->40:{45} Weak SCC
| | | |
| | | `->41:{46} Weak SCC
| | |
| | |->7:{49} Weak SCC
| | |
| | |->8:{51} Weak SCC
| | |
| | `->42:{52} Weak SCC
| | |
| | |->43:{53} Weak SCC
| | |
| | |->44:{54} Weak SCC
| | |
| | |->45:{55} Weak SCC
| | |
| | `->46:{56} Weak SCC
| |
| |->4:{47} Weak SCC
| |
| `->5:{48} Weak SCC
|
`->2:{50} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: insert^#(@x, @l) -> insert#1^#(@l, @x)
, 2: insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, 3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, 4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, 5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, 6: isortlist^#(@l) -> isortlist#1^#(@l)
, 7: isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, 8: leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) }
Weak DPs:
{ 9: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 10: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 11: #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, 12: #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, 13: #eq^#(nil(), nil()) -> c_21()
, 14: #eq^#(#0(), #0()) -> c_22()
, 15: #eq^#(#0(), #neg(@y)) -> c_23()
, 16: #eq^#(#0(), #pos(@y)) -> c_24()
, 17: #eq^#(#0(), #s(@y)) -> c_25()
, 18: #eq^#(#neg(@x), #0()) -> c_26()
, 19: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 20: #eq^#(#neg(@x), #pos(@y)) -> c_28()
, 21: #eq^#(#pos(@x), #0()) -> c_29()
, 22: #eq^#(#pos(@x), #neg(@y)) -> c_30()
, 23: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 24: #eq^#(#s(@x), #0()) -> c_32()
, 25: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 26: #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 27: #cklt^#(#EQ()) -> c_46()
, 28: #cklt^#(#GT()) -> c_47()
, 29: #cklt^#(#LT()) -> c_48()
, 30: #compare^#(#0(), #0()) -> c_34()
, 31: #compare^#(#0(), #neg(@y)) -> c_35()
, 32: #compare^#(#0(), #pos(@y)) -> c_36()
, 33: #compare^#(#0(), #s(@y)) -> c_37()
, 34: #compare^#(#neg(@x), #0()) -> c_38()
, 35: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 36: #compare^#(#neg(@x), #pos(@y)) -> c_40()
, 37: #compare^#(#pos(@x), #0()) -> c_41()
, 38: #compare^#(#pos(@x), #neg(@y)) -> c_42()
, 39: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 40: #compare^#(#s(@x), #0()) -> c_44()
, 41: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 42: and^#(@x, @y) -> #and^#(@x, @y)
, 43: #and^#(#false(), #false()) -> c_49()
, 44: #and^#(#false(), #true()) -> c_50()
, 45: #and^#(#true(), #false()) -> c_51()
, 46: #and^#(#true(), #true()) -> c_52()
, 47: insert#1^#(nil(), @x) -> c_6()
, 48: insert#2^#(#true(), @x, @y, @ys) -> c_9()
, 49: leq#1^#(nil(), @l2) -> c_14()
, 50: isortlist#1^#(nil()) -> c_12()
, 51: leq#2^#(nil(), @x, @xs) -> c_16()
, 52: or^#(@x, @y) -> #or^#(@x, @y)
, 53: #or^#(#false(), #false()) -> c_53()
, 54: #or^#(#false(), #true()) -> c_54()
, 55: #or^#(#true(), #false()) -> c_55()
, 56: #or^#(#true(), #true()) -> c_56() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 50: isortlist#1^#(nil()) -> c_12()
, 47: insert#1^#(nil(), @x) -> c_6()
, 48: insert#2^#(#true(), @x, @y, @ys) -> c_9()
, 49: leq#1^#(nil(), @l2) -> c_14()
, 51: leq#2^#(nil(), @x, @xs) -> c_16()
, 9: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 25: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 23: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 19: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 10: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 11: #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, 12: #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, 13: #eq^#(nil(), nil()) -> c_21()
, 14: #eq^#(#0(), #0()) -> c_22()
, 15: #eq^#(#0(), #neg(@y)) -> c_23()
, 16: #eq^#(#0(), #pos(@y)) -> c_24()
, 17: #eq^#(#0(), #s(@y)) -> c_25()
, 18: #eq^#(#neg(@x), #0()) -> c_26()
, 20: #eq^#(#neg(@x), #pos(@y)) -> c_28()
, 21: #eq^#(#pos(@x), #0()) -> c_29()
, 22: #eq^#(#pos(@x), #neg(@y)) -> c_30()
, 24: #eq^#(#s(@x), #0()) -> c_32()
, 26: #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 27: #cklt^#(#EQ()) -> c_46()
, 28: #cklt^#(#GT()) -> c_47()
, 29: #cklt^#(#LT()) -> c_48()
, 41: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 39: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 35: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 30: #compare^#(#0(), #0()) -> c_34()
, 31: #compare^#(#0(), #neg(@y)) -> c_35()
, 32: #compare^#(#0(), #pos(@y)) -> c_36()
, 33: #compare^#(#0(), #s(@y)) -> c_37()
, 34: #compare^#(#neg(@x), #0()) -> c_38()
, 36: #compare^#(#neg(@x), #pos(@y)) -> c_40()
, 37: #compare^#(#pos(@x), #0()) -> c_41()
, 38: #compare^#(#pos(@x), #neg(@y)) -> c_42()
, 40: #compare^#(#s(@x), #0()) -> c_44()
, 42: and^#(@x, @y) -> #and^#(@x, @y)
, 43: #and^#(#false(), #false()) -> c_49()
, 44: #and^#(#false(), #true()) -> c_50()
, 45: #and^#(#true(), #false()) -> c_51()
, 46: #and^#(#true(), #true()) -> c_52()
, 52: or^#(@x, @y) -> #or^#(@x, @y)
, 53: #or^#(#false(), #false()) -> c_53()
, 54: #or^#(#false(), #true()) -> c_54()
, 55: #or^#(#true(), #false()) -> c_55()
, 56: #or^#(#true(), #true()) -> c_56() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :3
3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :5
5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) :8
6: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :7
7: isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :6
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
8: leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys))
-->_5 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :3
3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :5
5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
6: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :7
7: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :6
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {8} and add Pre({8}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak DPs: { leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :3
3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :5
5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
6: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :7
7: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :6
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak DPs:
{ leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :3
3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :7
5: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :6
6: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :5
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
7: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak DPs:
{ insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :6
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :3
3: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :7
4: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :5
5: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :4
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
6: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
7: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak DPs:
{ insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :5
2: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :7
3: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :4
4: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :3
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
5: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :6
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :2
6: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
7: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :2
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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, isortlist^#(@l) -> isortlist#1^#(@l) }
Weak DPs:
{ insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
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):
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Remaining Rules (B):
{ isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) }
Weak DPs:
{ insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
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:
{ isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :2
2: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#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: { isortlist^#(@l) -> isortlist#1^#(@l) }
Weak DPs:
{ isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :2
2: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { isortlist^#(@l) -> isortlist#1^#(@l) }
Weak DPs: { isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
No rule is usable.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { isortlist^#(@l) -> isortlist#1^#(@l) }
Weak DPs: { isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'Small Polynomial Path Order (PS,1-bounded)'
to orient following rules strictly.
DPs:
{ 2: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
Sub-proof:
----------
The input was oriented with the instance of 'Small Polynomial Path
Order (PS,1-bounded)' as induced by the safe mapping
safe(#equal) = {}, safe(#eq) = {}, safe(#less) = {},
safe(#compare) = {}, safe(#cklt) = {}, safe(and) = {},
safe(#and) = {}, safe(insert) = {}, safe(insert#1) = {},
safe(::) = {1, 2}, safe(leq) = {}, safe(insert#2) = {},
safe(nil) = {}, safe(#false) = {}, safe(#true) = {},
safe(isortlist) = {}, safe(isortlist#1) = {}, safe(leq#1) = {},
safe(leq#2) = {}, safe(or) = {}, safe(#or) = {}, safe(#EQ) = {},
safe(#GT) = {}, safe(#LT) = {}, safe(#0) = {}, safe(#neg) = {1},
safe(#pos) = {1}, safe(#s) = {1}, safe(#equal^#) = {},
safe(#eq^#) = {}, safe(#less^#) = {}, safe(#cklt^#) = {},
safe(#compare^#) = {}, safe(and^#) = {}, safe(#and^#) = {},
safe(insert^#) = {}, safe(insert#1^#) = {}, safe(insert#2^#) = {},
safe(leq^#) = {}, safe(leq#1^#) = {}, safe(isortlist^#) = {},
safe(isortlist#1^#) = {}, safe(leq#2^#) = {}, safe(or^#) = {},
safe(#or^#) = {}, safe(c_2) = {}, safe(c) = {}
and precedence
isortlist^# ~ isortlist#1^# .
Following symbols are considered recursive:
{}
The recursion depth is 0.
Further, following argument filtering is employed:
pi(#equal) = [], pi(#eq) = [], pi(#less) = [], pi(#compare) = [],
pi(#cklt) = [], pi(and) = [], pi(#and) = [], pi(insert) = [],
pi(insert#1) = [], pi(::) = [2], pi(leq) = [], pi(insert#2) = [],
pi(nil) = [], pi(#false) = [], pi(#true) = [], pi(isortlist) = [],
pi(isortlist#1) = [], pi(leq#1) = [], pi(leq#2) = [], pi(or) = [],
pi(#or) = [], pi(#EQ) = [], pi(#GT) = [], pi(#LT) = [],
pi(#0) = [], pi(#neg) = [], pi(#pos) = [], pi(#s) = [],
pi(#equal^#) = [], pi(#eq^#) = [], pi(#less^#) = [],
pi(#cklt^#) = [], pi(#compare^#) = [], pi(and^#) = [],
pi(#and^#) = [], pi(insert^#) = [], pi(insert#1^#) = [],
pi(insert#2^#) = [], pi(leq^#) = [], pi(leq#1^#) = [],
pi(isortlist^#) = 1, pi(isortlist#1^#) = 1, pi(leq#2^#) = [],
pi(or^#) = [], pi(#or^#) = [], pi(c_2) = [], pi(c) = []
Usable defined function symbols are a subset of:
{}
For your convenience, here are the satisfied ordering constraints:
pi(isortlist^#(@l)) = @l
>= @l
= pi(isortlist#1^#(@l))
pi(isortlist#1^#(::(@x, @xs))) = ::(; @xs)
> @xs
= pi(isortlist^#(@xs))
Processor 'Small Polynomial Path Order (PS,1-bounded)' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2}.
Here rules are labeled according to the (estimated) dependency
graph
1: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) :2
2: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
-->_1 isortlist^#(@l) -> isortlist#1^#(@l) :1
- The rules {2} 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}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: isortlist^#(@l) -> isortlist#1^#(@l)
, 2: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: isortlist^#(@l) -> isortlist#1^#(@l)
, 2: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
We apply the transformation 'usablerules' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) }
Weak DPs:
{ insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
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: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, 5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, 7: isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, 8: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, 9: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Trs:
{ #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#s(@x), #0()) -> #GT()
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(#less) = {},
Uargs(#compare) = {}, Uargs(#cklt) = {}, Uargs(and) = {},
Uargs(#and) = {}, Uargs(insert) = {}, Uargs(insert#1) = {},
Uargs(::) = {}, Uargs(leq) = {}, Uargs(insert#2) = {},
Uargs(isortlist) = {}, Uargs(isortlist#1) = {}, Uargs(leq#1) = {},
Uargs(leq#2) = {}, Uargs(or) = {}, Uargs(#or) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#equal^#) = {}, Uargs(#eq^#) = {}, Uargs(#less^#) = {},
Uargs(#cklt^#) = {}, Uargs(#compare^#) = {}, Uargs(and^#) = {},
Uargs(#and^#) = {}, Uargs(insert^#) = {}, Uargs(insert#1^#) = {},
Uargs(insert#2^#) = {}, Uargs(leq^#) = {}, Uargs(leq#1^#) = {},
Uargs(isortlist^#) = {}, Uargs(isortlist#1^#) = {},
Uargs(leq#2^#) = {}, Uargs(or^#) = {}, Uargs(#or^#) = {},
Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#equal](x1, x2) = [2] x1 + [0]
[#eq](x1, x2) = [2] x1 + [0]
[#less](x1, x2) = [2] x1 + [2] x2 + [3]
[#compare](x1, x2) = [3]
[#cklt](x1) = [3]
[and](x1, x2) = [1] x2 + [2]
[#and](x1, x2) = [1] x2 + [0]
[insert](x1, x2) = [1] x1 + [1] x2 + [3]
[insert#1](x1, x2) = [1] x1 + [1] x2 + [3]
[::](x1, x2) = [1] x1 + [1] x2 + [3]
[leq](x1, x2) = [2]
[insert#2](x1, x2, x3, x4) = [2] x1 + [1] x2 + [1] x3 + [1] x4 + [2]
[nil] = [2]
[#false] = [2]
[#true] = [2]
[isortlist](x1) = [1] x1 + [0]
[isortlist#1](x1) = [1] x1 + [0]
[leq#1](x1, x2) = [2]
[leq#2](x1, x2, x3) = [2]
[or](x1, x2) = [2]
[#or](x1, x2) = [2]
[#EQ] = [3]
[#GT] = [1]
[#LT] = [1]
[#0] = [1]
[#neg](x1) = [1] x1 + [2]
[#pos](x1) = [1] x1 + [2]
[#s](x1) = [1] x1 + [2]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[#less^#](x1, x2) = [0]
[#cklt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[and^#](x1, x2) = [0]
[#and^#](x1, x2) = [0]
[insert^#](x1, x2) = [2] x1 + [3] x2 + [0]
[insert#1^#](x1, x2) = [3] x1 + [2] x2 + [0]
[insert#2^#](x1, x2, x3, x4) = [2] x2 + [3] x4 + [0]
[leq^#](x1, x2) = [2] x2 + [3]
[leq#1^#](x1, x2) = [2] x2 + [3]
[isortlist^#](x1) = [3] x1 + [0]
[isortlist#1^#](x1) = [3] x1 + [0]
[leq#2^#](x1, x2, x3) = [2] x1 + [1]
[or^#](x1, x2) = [0]
[#or^#](x1, x2) = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [2] @x + [0]
>= [2] @x + [0]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [2] @x_1 + [2] @x_2 + [6]
> [2] @x_2 + [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [2] @x_1 + [2] @x_2 + [6]
> [2]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [4]
> [2]
= [#false()]
[#eq(nil(), nil())] = [4]
> [2]
= [#true()]
[#eq(#0(), #0())] = [2]
>= [2]
= [#true()]
[#eq(#0(), #neg(@y))] = [2]
>= [2]
= [#false()]
[#eq(#0(), #pos(@y))] = [2]
>= [2]
= [#false()]
[#eq(#0(), #s(@y))] = [2]
>= [2]
= [#false()]
[#eq(#neg(@x), #0())] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [2] @x + [4]
> [2] @x + [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#pos(@x), #0())] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [2] @x + [4]
> [2] @x + [0]
= [#eq(@x, @y)]
[#eq(#s(@x), #0())] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#s(@x), #s(@y))] = [2] @x + [4]
> [2] @x + [0]
= [#eq(@x, @y)]
[#less(@x, @y)] = [2] @x + [2] @y + [3]
>= [3]
= [#cklt(#compare(@x, @y))]
[#compare(#0(), #0())] = [3]
>= [3]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [3]
> [1]
= [#GT()]
[#compare(#0(), #pos(@y))] = [3]
> [1]
= [#LT()]
[#compare(#0(), #s(@y))] = [3]
> [1]
= [#LT()]
[#compare(#neg(@x), #0())] = [3]
> [1]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [3]
>= [3]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [3]
> [1]
= [#LT()]
[#compare(#pos(@x), #0())] = [3]
> [1]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [3]
> [1]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [3]
>= [3]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [3]
> [1]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [3]
>= [3]
= [#compare(@x, @y)]
[#cklt(#EQ())] = [3]
> [2]
= [#false()]
[#cklt(#GT())] = [3]
> [2]
= [#false()]
[#cklt(#LT())] = [3]
> [2]
= [#true()]
[and(@x, @y)] = [1] @y + [2]
> [1] @y + [0]
= [#and(@x, @y)]
[#and(#false(), #false())] = [2]
>= [2]
= [#false()]
[#and(#false(), #true())] = [2]
>= [2]
= [#false()]
[#and(#true(), #false())] = [2]
>= [2]
= [#false()]
[#and(#true(), #true())] = [2]
>= [2]
= [#true()]
[insert(@x, @l)] = [1] @l + [1] @x + [3]
>= [1] @l + [1] @x + [3]
= [insert#1(@l, @x)]
[insert#1(::(@y, @ys), @x)] = [1] @x + [1] @y + [1] @ys + [6]
>= [1] @x + [1] @y + [1] @ys + [6]
= [insert#2(leq(@x, @y), @x, @y, @ys)]
[insert#1(nil(), @x)] = [1] @x + [5]
>= [1] @x + [5]
= [::(@x, nil())]
[leq(@l1, @l2)] = [2]
>= [2]
= [leq#1(@l1, @l2)]
[insert#2(#false(), @x, @y, @ys)] = [1] @x + [1] @y + [1] @ys + [6]
>= [1] @x + [1] @y + [1] @ys + [6]
= [::(@y, insert(@x, @ys))]
[insert#2(#true(), @x, @y, @ys)] = [1] @x + [1] @y + [1] @ys + [6]
>= [1] @x + [1] @y + [1] @ys + [6]
= [::(@x, ::(@y, @ys))]
[isortlist(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [isortlist#1(@l)]
[isortlist#1(::(@x, @xs))] = [1] @x + [1] @xs + [3]
>= [1] @x + [1] @xs + [3]
= [insert(@x, isortlist(@xs))]
[isortlist#1(nil())] = [2]
>= [2]
= [nil()]
[leq#1(::(@x, @xs), @l2)] = [2]
>= [2]
= [leq#2(@l2, @x, @xs)]
[leq#1(nil(), @l2)] = [2]
>= [2]
= [#true()]
[leq#2(::(@y, @ys), @x, @xs)] = [2]
>= [2]
= [or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))]
[leq#2(nil(), @x, @xs)] = [2]
>= [2]
= [#false()]
[or(@x, @y)] = [2]
>= [2]
= [#or(@x, @y)]
[#or(#false(), #false())] = [2]
>= [2]
= [#false()]
[#or(#false(), #true())] = [2]
>= [2]
= [#true()]
[#or(#true(), #false())] = [2]
>= [2]
= [#true()]
[#or(#true(), #true())] = [2]
>= [2]
= [#true()]
[insert^#(@x, @l)] = [3] @l + [2] @x + [0]
>= [3] @l + [2] @x + [0]
= [insert#1^#(@l, @x)]
[insert#1^#(::(@y, @ys), @x)] = [2] @x + [3] @y + [3] @ys + [9]
> [2] @x + [2] @y + [3] @ys + [3]
= [c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))]
[insert#2^#(#false(), @x, @y, @ys)] = [2] @x + [3] @ys + [0]
>= [2] @x + [3] @ys + [0]
= [insert^#(@x, @ys)]
[leq^#(@l1, @l2)] = [2] @l2 + [3]
>= [2] @l2 + [3]
= [leq#1^#(@l1, @l2)]
[leq#1^#(::(@x, @xs), @l2)] = [2] @l2 + [3]
> [2] @l2 + [1]
= [leq#2^#(@l2, @x, @xs)]
[isortlist^#(@l)] = [3] @l + [0]
>= [3] @l + [0]
= [isortlist#1^#(@l)]
[isortlist#1^#(::(@x, @xs))] = [3] @x + [3] @xs + [9]
> [2] @x + [3] @xs + [0]
= [insert^#(@x, isortlist(@xs))]
[isortlist#1^#(::(@x, @xs))] = [3] @x + [3] @xs + [9]
> [3] @xs + [0]
= [isortlist^#(@xs)]
[leq#2^#(::(@y, @ys), @x, @xs)] = [2] @y + [2] @ys + [7]
> [2] @ys + [3]
= [leq^#(@xs, @ys)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{3,5,7,8,9}. Here rules are labeled according to the (estimated)
dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :3
2: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :5
3: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :4
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :2
4: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :9
6: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) :8
-->_1 isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs)) :7
7: isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
8: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
-->_1 isortlist^#(@l) -> isortlist#1^#(@l) :6
9: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :2
- The rules {3,5,7,8,9} have known complexity. These cover all
predecessors of {2,4,6}, their complexity is equally bounded.
- The rules {2,3,4,5,6,7,8,9} have known complexity. These cover
all predecessors of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7,8,9} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{6,8} Weak SCC
|
`->2:{7} Weak SCC
|
`->3:{1,3,2} Weak SCC
|
`->4:{4,9,5} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: insert^#(@x, @l) -> insert#1^#(@l, @x)
, 2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, 3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, 4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, 5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, 6: isortlist^#(@l) -> isortlist#1^#(@l)
, 7: isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, 8: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, 9: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 6: isortlist^#(@l) -> isortlist#1^#(@l)
, 8: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, 7: isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, 1: insert^#(@x, @l) -> insert#1^#(@l, @x)
, 3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, 2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, 4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, 9: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
, 5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
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(1),O(n^2))
tct-popstar
Execution Time (secs) | 19.155 |
Answer | YES(O(1),O(n^2)) |
Input | listsort.raml |
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 Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, and(@x, @y) -> #and(@x, @y)
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y) }
Weak Trs:
{ #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We add following dependency tuples
Strict DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, and^#(@x, @y) -> #and^#(@x, @y)
, insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#1^#(nil(), @x) -> c_6()
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, insert#2^#(#true(), @x, @y, @ys) -> c_9()
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#1^#(nil(), @l2) -> c_14()
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, isortlist#1^#(nil()) -> c_12()
, leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys))
, leq#2^#(nil(), @x, @xs) -> c_16()
, or^#(@x, @y) -> #or^#(@x, @y) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, #eq^#(nil(), nil()) -> c_21()
, #eq^#(#0(), #0()) -> c_22()
, #eq^#(#0(), #neg(@y)) -> c_23()
, #eq^#(#0(), #pos(@y)) -> c_24()
, #eq^#(#0(), #s(@y)) -> c_25()
, #eq^#(#neg(@x), #0()) -> c_26()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_28()
, #eq^#(#pos(@x), #0()) -> c_29()
, #eq^#(#pos(@x), #neg(@y)) -> c_30()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_32()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #cklt^#(#EQ()) -> c_46()
, #cklt^#(#GT()) -> c_47()
, #cklt^#(#LT()) -> c_48()
, #compare^#(#0(), #0()) -> c_34()
, #compare^#(#0(), #neg(@y)) -> c_35()
, #compare^#(#0(), #pos(@y)) -> c_36()
, #compare^#(#0(), #s(@y)) -> c_37()
, #compare^#(#neg(@x), #0()) -> c_38()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_40()
, #compare^#(#pos(@x), #0()) -> c_41()
, #compare^#(#pos(@x), #neg(@y)) -> c_42()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_44()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, #and^#(#false(), #false()) -> c_49()
, #and^#(#false(), #true()) -> c_50()
, #and^#(#true(), #false()) -> c_51()
, #and^#(#true(), #true()) -> c_52()
, #or^#(#false(), #false()) -> c_53()
, #or^#(#false(), #true()) -> c_54()
, #or^#(#true(), #false()) -> c_55()
, #or^#(#true(), #true()) -> c_56() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, and^#(@x, @y) -> #and^#(@x, @y)
, insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#1^#(nil(), @x) -> c_6()
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, insert#2^#(#true(), @x, @y, @ys) -> c_9()
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#1^#(nil(), @l2) -> c_14()
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, isortlist#1^#(nil()) -> c_12()
, leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys))
, leq#2^#(nil(), @x, @xs) -> c_16()
, or^#(@x, @y) -> #or^#(@x, @y) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, #eq^#(nil(), nil()) -> c_21()
, #eq^#(#0(), #0()) -> c_22()
, #eq^#(#0(), #neg(@y)) -> c_23()
, #eq^#(#0(), #pos(@y)) -> c_24()
, #eq^#(#0(), #s(@y)) -> c_25()
, #eq^#(#neg(@x), #0()) -> c_26()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_28()
, #eq^#(#pos(@x), #0()) -> c_29()
, #eq^#(#pos(@x), #neg(@y)) -> c_30()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_32()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #cklt^#(#EQ()) -> c_46()
, #cklt^#(#GT()) -> c_47()
, #cklt^#(#LT()) -> c_48()
, #compare^#(#0(), #0()) -> c_34()
, #compare^#(#0(), #neg(@y)) -> c_35()
, #compare^#(#0(), #pos(@y)) -> c_36()
, #compare^#(#0(), #s(@y)) -> c_37()
, #compare^#(#neg(@x), #0()) -> c_38()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_40()
, #compare^#(#pos(@x), #0()) -> c_41()
, #compare^#(#pos(@x), #neg(@y)) -> c_42()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_44()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, #and^#(#false(), #false()) -> c_49()
, #and^#(#false(), #true()) -> c_50()
, #and^#(#true(), #false()) -> c_51()
, #and^#(#true(), #true()) -> c_52()
, #or^#(#false(), #false()) -> c_53()
, #or^#(#false(), #true()) -> c_54()
, #or^#(#true(), #false()) -> c_55()
, #or^#(#true(), #true()) -> c_56() }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
-->_1 #eq^#(#s(@x), #0()) -> c_32() :32
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_1 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_1 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_1 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_1 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_1 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_1 #eq^#(#0(), #0()) -> c_22() :22
-->_1 #eq^#(nil(), nil()) -> c_21() :21
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
2: #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
-->_2 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :48
-->_2 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :46
-->_2 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :42
-->_2 #compare^#(#s(@x), #0()) -> c_44() :47
-->_2 #compare^#(#pos(@x), #neg(@y)) -> c_42() :45
-->_2 #compare^#(#pos(@x), #0()) -> c_41() :44
-->_2 #compare^#(#neg(@x), #pos(@y)) -> c_40() :43
-->_2 #compare^#(#neg(@x), #0()) -> c_38() :41
-->_2 #compare^#(#0(), #s(@y)) -> c_37() :40
-->_2 #compare^#(#0(), #pos(@y)) -> c_36() :39
-->_2 #compare^#(#0(), #neg(@y)) -> c_35() :38
-->_2 #compare^#(#0(), #0()) -> c_34() :37
-->_1 #cklt^#(#LT()) -> c_48() :36
-->_1 #cklt^#(#GT()) -> c_47() :35
-->_1 #cklt^#(#EQ()) -> c_46() :34
3: and^#(@x, @y) -> #and^#(@x, @y)
-->_1 #and^#(#true(), #true()) -> c_52() :52
-->_1 #and^#(#true(), #false()) -> c_51() :51
-->_1 #and^#(#false(), #true()) -> c_50() :50
-->_1 #and^#(#false(), #false()) -> c_49() :49
4: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :5
-->_1 insert#1^#(nil(), @x) -> c_6() :6
5: insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :9
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :7
-->_1 insert#2^#(#true(), @x, @y, @ys) -> c_9() :8
6: insert#1^#(nil(), @x) -> c_6()
7: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :4
8: insert#2^#(#true(), @x, @y, @ys) -> c_9()
9: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :10
-->_1 leq#1^#(nil(), @l2) -> c_14() :11
10: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) :15
-->_1 leq#2^#(nil(), @x, @xs) -> c_16() :16
11: leq#1^#(nil(), @l2) -> c_14()
12: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :13
-->_1 isortlist#1^#(nil()) -> c_12() :14
13: isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :12
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :4
14: isortlist#1^#(nil()) -> c_12()
15: leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys))
-->_1 or^#(@x, @y) -> #or^#(@x, @y) :17
-->_5 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :9
-->_3 and^#(@x, @y) -> #and^#(@x, @y) :3
-->_2 #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) :2
-->_4 #equal^#(@x, @y) -> #eq^#(@x, @y) :1
16: leq#2^#(nil(), @x, @xs) -> c_16()
17: or^#(@x, @y) -> #or^#(@x, @y)
-->_1 #or^#(#true(), #true()) -> c_56() :56
-->_1 #or^#(#true(), #false()) -> c_55() :55
-->_1 #or^#(#false(), #true()) -> c_54() :54
-->_1 #or^#(#false(), #false()) -> c_53() :53
18: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
-->_3 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #and^#(#true(), #true()) -> c_52() :52
-->_1 #and^#(#true(), #false()) -> c_51() :51
-->_1 #and^#(#false(), #true()) -> c_50() :50
-->_1 #and^#(#false(), #false()) -> c_49() :49
-->_3 #eq^#(#s(@x), #0()) -> c_32() :32
-->_2 #eq^#(#s(@x), #0()) -> c_32() :32
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_3 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_2 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_3 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_2 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_3 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_2 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_3 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_2 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_3 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_2 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_3 #eq^#(#0(), #0()) -> c_22() :22
-->_2 #eq^#(#0(), #0()) -> c_22() :22
-->_3 #eq^#(nil(), nil()) -> c_21() :21
-->_2 #eq^#(nil(), nil()) -> c_21() :21
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
19: #eq^#(::(@x_1, @x_2), nil()) -> c_19()
20: #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
21: #eq^#(nil(), nil()) -> c_21()
22: #eq^#(#0(), #0()) -> c_22()
23: #eq^#(#0(), #neg(@y)) -> c_23()
24: #eq^#(#0(), #pos(@y)) -> c_24()
25: #eq^#(#0(), #s(@y)) -> c_25()
26: #eq^#(#neg(@x), #0()) -> c_26()
27: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_1 #eq^#(#s(@x), #0()) -> c_32() :32
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_1 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_1 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_1 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_1 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_1 #eq^#(#0(), #0()) -> c_22() :22
-->_1 #eq^#(nil(), nil()) -> c_21() :21
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
28: #eq^#(#neg(@x), #pos(@y)) -> c_28()
29: #eq^#(#pos(@x), #0()) -> c_29()
30: #eq^#(#pos(@x), #neg(@y)) -> c_30()
31: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#s(@x), #0()) -> c_32() :32
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_1 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_1 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_1 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_1 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_1 #eq^#(#0(), #0()) -> c_22() :22
-->_1 #eq^#(nil(), nil()) -> c_21() :21
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
32: #eq^#(#s(@x), #0()) -> c_32()
33: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :33
-->_1 #eq^#(#s(@x), #0()) -> c_32() :32
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :31
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_30() :30
-->_1 #eq^#(#pos(@x), #0()) -> c_29() :29
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_28() :28
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :27
-->_1 #eq^#(#neg(@x), #0()) -> c_26() :26
-->_1 #eq^#(#0(), #s(@y)) -> c_25() :25
-->_1 #eq^#(#0(), #pos(@y)) -> c_24() :24
-->_1 #eq^#(#0(), #neg(@y)) -> c_23() :23
-->_1 #eq^#(#0(), #0()) -> c_22() :22
-->_1 #eq^#(nil(), nil()) -> c_21() :21
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_20() :20
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_19() :19
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :18
34: #cklt^#(#EQ()) -> c_46()
35: #cklt^#(#GT()) -> c_47()
36: #cklt^#(#LT()) -> c_48()
37: #compare^#(#0(), #0()) -> c_34()
38: #compare^#(#0(), #neg(@y)) -> c_35()
39: #compare^#(#0(), #pos(@y)) -> c_36()
40: #compare^#(#0(), #s(@y)) -> c_37()
41: #compare^#(#neg(@x), #0()) -> c_38()
42: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#s(@x), #0()) -> c_44() :47
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_42() :45
-->_1 #compare^#(#pos(@x), #0()) -> c_41() :44
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_40() :43
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :42
-->_1 #compare^#(#neg(@x), #0()) -> c_38() :41
-->_1 #compare^#(#0(), #s(@y)) -> c_37() :40
-->_1 #compare^#(#0(), #pos(@y)) -> c_36() :39
-->_1 #compare^#(#0(), #neg(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #0()) -> c_34() :37
43: #compare^#(#neg(@x), #pos(@y)) -> c_40()
44: #compare^#(#pos(@x), #0()) -> c_41()
45: #compare^#(#pos(@x), #neg(@y)) -> c_42()
46: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#s(@x), #0()) -> c_44() :47
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_42() :45
-->_1 #compare^#(#pos(@x), #0()) -> c_41() :44
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_40() :43
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :42
-->_1 #compare^#(#neg(@x), #0()) -> c_38() :41
-->_1 #compare^#(#0(), #s(@y)) -> c_37() :40
-->_1 #compare^#(#0(), #pos(@y)) -> c_36() :39
-->_1 #compare^#(#0(), #neg(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #0()) -> c_34() :37
47: #compare^#(#s(@x), #0()) -> c_44()
48: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
-->_1 #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y) :48
-->_1 #compare^#(#s(@x), #0()) -> c_44() :47
-->_1 #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y) :46
-->_1 #compare^#(#pos(@x), #neg(@y)) -> c_42() :45
-->_1 #compare^#(#pos(@x), #0()) -> c_41() :44
-->_1 #compare^#(#neg(@x), #pos(@y)) -> c_40() :43
-->_1 #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x) :42
-->_1 #compare^#(#neg(@x), #0()) -> c_38() :41
-->_1 #compare^#(#0(), #s(@y)) -> c_37() :40
-->_1 #compare^#(#0(), #pos(@y)) -> c_36() :39
-->_1 #compare^#(#0(), #neg(@y)) -> c_35() :38
-->_1 #compare^#(#0(), #0()) -> c_34() :37
49: #and^#(#false(), #false()) -> c_49()
50: #and^#(#false(), #true()) -> c_50()
51: #and^#(#true(), #false()) -> c_51()
52: #and^#(#true(), #true()) -> c_52()
53: #or^#(#false(), #false()) -> c_53()
54: #or^#(#false(), #true()) -> c_54()
55: #or^#(#true(), #false()) -> c_55()
56: #or^#(#true(), #true()) -> c_56()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {14} and add Pre({14}) = {12} to the strict component.
- We remove {6} and add Pre({6}) = {4} to the strict component.
- We remove {8} and add Pre({8}) = {5} to the strict component.
- We remove {11} and add Pre({11}) = {9} to the strict component.
- We remove {16} and add Pre({16}) = {10} to the strict component.
- We remove {17} and add Pre({17}) = {15} to the strict component.
- We remove {3} and add Pre({3}) = {15} to the strict component.
- We remove {2} and add Pre({2}) = {15} to the strict component.
- We remove {1} and add Pre({1}) = {15} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, #eq^#(nil(), nil()) -> c_21()
, #eq^#(#0(), #0()) -> c_22()
, #eq^#(#0(), #neg(@y)) -> c_23()
, #eq^#(#0(), #pos(@y)) -> c_24()
, #eq^#(#0(), #s(@y)) -> c_25()
, #eq^#(#neg(@x), #0()) -> c_26()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_28()
, #eq^#(#pos(@x), #0()) -> c_29()
, #eq^#(#pos(@x), #neg(@y)) -> c_30()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_32()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #cklt^#(#EQ()) -> c_46()
, #cklt^#(#GT()) -> c_47()
, #cklt^#(#LT()) -> c_48()
, #compare^#(#0(), #0()) -> c_34()
, #compare^#(#0(), #neg(@y)) -> c_35()
, #compare^#(#0(), #pos(@y)) -> c_36()
, #compare^#(#0(), #s(@y)) -> c_37()
, #compare^#(#neg(@x), #0()) -> c_38()
, #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, #compare^#(#neg(@x), #pos(@y)) -> c_40()
, #compare^#(#pos(@x), #0()) -> c_41()
, #compare^#(#pos(@x), #neg(@y)) -> c_42()
, #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, #compare^#(#s(@x), #0()) -> c_44()
, #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, and^#(@x, @y) -> #and^#(@x, @y)
, #and^#(#false(), #false()) -> c_49()
, #and^#(#false(), #true()) -> c_50()
, #and^#(#true(), #false()) -> c_51()
, #and^#(#true(), #true()) -> c_52()
, insert#1^#(nil(), @x) -> c_6()
, insert#2^#(#true(), @x, @y, @ys) -> c_9()
, leq#1^#(nil(), @l2) -> c_14()
, isortlist#1^#(nil()) -> c_12()
, leq#2^#(nil(), @x, @xs) -> c_16()
, or^#(@x, @y) -> #or^#(@x, @y)
, #or^#(#false(), #false()) -> c_53()
, #or^#(#false(), #true()) -> c_54()
, #or^#(#true(), #false()) -> c_55()
, #or^#(#true(), #true()) -> c_56() }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the the dependency graph
->1:{6,7}
|
|->3:{1,3,2}
| |
| |->6:{4,8,5}
| | |
| | |->9:{9} Weak SCC
| | | |
| | | |->11:{11} Weak SCC
| | | |
| | | |->12:{12} Weak SCC
| | | |
| | | |->13:{13} Weak SCC
| | | |
| | | |->14:{14} Weak SCC
| | | |
| | | |->15:{15} Weak SCC
| | | |
| | | |->16:{16} Weak SCC
| | | |
| | | |->17:{17} Weak SCC
| | | |
| | | |->18:{18} Weak SCC
| | | |
| | | |->19:{20} Weak SCC
| | | |
| | | |->20:{21} Weak SCC
| | | |
| | | |->21:{22} Weak SCC
| | | |
| | | |->22:{24} Weak SCC
| | | |
| | | `->10:{25,23,19,10} Weak SCC
| | | |
| | | |->11:{11} Weak SCC
| | | |
| | | |->12:{12} Weak SCC
| | | |
| | | |->13:{13} Weak SCC
| | | |
| | | |->14:{14} Weak SCC
| | | |
| | | |->15:{15} Weak SCC
| | | |
| | | |->16:{16} Weak SCC
| | | |
| | | |->17:{17} Weak SCC
| | | |
| | | |->18:{18} Weak SCC
| | | |
| | | |->19:{20} Weak SCC
| | | |
| | | |->20:{21} Weak SCC
| | | |
| | | |->21:{22} Weak SCC
| | | |
| | | |->22:{24} Weak SCC
| | | |
| | | |->38:{43} Weak SCC
| | | |
| | | |->39:{44} Weak SCC
| | | |
| | | |->40:{45} Weak SCC
| | | |
| | | `->41:{46} Weak SCC
| | |
| | |->23:{26} Weak SCC
| | | |
| | | |->24:{27} Weak SCC
| | | |
| | | |->25:{28} Weak SCC
| | | |
| | | |->26:{29} Weak SCC
| | | |
| | | |->28:{30} Weak SCC
| | | |
| | | |->29:{31} Weak SCC
| | | |
| | | |->30:{32} Weak SCC
| | | |
| | | |->31:{33} Weak SCC
| | | |
| | | |->32:{34} Weak SCC
| | | |
| | | |->33:{36} Weak SCC
| | | |
| | | |->34:{37} Weak SCC
| | | |
| | | |->35:{38} Weak SCC
| | | |
| | | |->36:{40} Weak SCC
| | | |
| | | `->27:{41,39,35} Weak SCC
| | | |
| | | |->28:{30} Weak SCC
| | | |
| | | |->29:{31} Weak SCC
| | | |
| | | |->30:{32} Weak SCC
| | | |
| | | |->31:{33} Weak SCC
| | | |
| | | |->32:{34} Weak SCC
| | | |
| | | |->33:{36} Weak SCC
| | | |
| | | |->34:{37} Weak SCC
| | | |
| | | |->35:{38} Weak SCC
| | | |
| | | `->36:{40} Weak SCC
| | |
| | |->37:{42} Weak SCC
| | | |
| | | |->38:{43} Weak SCC
| | | |
| | | |->39:{44} Weak SCC
| | | |
| | | |->40:{45} Weak SCC
| | | |
| | | `->41:{46} Weak SCC
| | |
| | |->7:{49} Weak SCC
| | |
| | |->8:{51} Weak SCC
| | |
| | `->42:{52} Weak SCC
| | |
| | |->43:{53} Weak SCC
| | |
| | |->44:{54} Weak SCC
| | |
| | |->45:{55} Weak SCC
| | |
| | `->46:{56} Weak SCC
| |
| |->4:{47} Weak SCC
| |
| `->5:{48} Weak SCC
|
`->2:{50} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: insert^#(@x, @l) -> insert#1^#(@l, @x)
, 2: insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, 3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, 4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, 5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, 6: isortlist^#(@l) -> isortlist#1^#(@l)
, 7: isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, 8: leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) }
Weak DPs:
{ 9: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 10: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 11: #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, 12: #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, 13: #eq^#(nil(), nil()) -> c_21()
, 14: #eq^#(#0(), #0()) -> c_22()
, 15: #eq^#(#0(), #neg(@y)) -> c_23()
, 16: #eq^#(#0(), #pos(@y)) -> c_24()
, 17: #eq^#(#0(), #s(@y)) -> c_25()
, 18: #eq^#(#neg(@x), #0()) -> c_26()
, 19: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 20: #eq^#(#neg(@x), #pos(@y)) -> c_28()
, 21: #eq^#(#pos(@x), #0()) -> c_29()
, 22: #eq^#(#pos(@x), #neg(@y)) -> c_30()
, 23: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 24: #eq^#(#s(@x), #0()) -> c_32()
, 25: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 26: #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 27: #cklt^#(#EQ()) -> c_46()
, 28: #cklt^#(#GT()) -> c_47()
, 29: #cklt^#(#LT()) -> c_48()
, 30: #compare^#(#0(), #0()) -> c_34()
, 31: #compare^#(#0(), #neg(@y)) -> c_35()
, 32: #compare^#(#0(), #pos(@y)) -> c_36()
, 33: #compare^#(#0(), #s(@y)) -> c_37()
, 34: #compare^#(#neg(@x), #0()) -> c_38()
, 35: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 36: #compare^#(#neg(@x), #pos(@y)) -> c_40()
, 37: #compare^#(#pos(@x), #0()) -> c_41()
, 38: #compare^#(#pos(@x), #neg(@y)) -> c_42()
, 39: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 40: #compare^#(#s(@x), #0()) -> c_44()
, 41: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 42: and^#(@x, @y) -> #and^#(@x, @y)
, 43: #and^#(#false(), #false()) -> c_49()
, 44: #and^#(#false(), #true()) -> c_50()
, 45: #and^#(#true(), #false()) -> c_51()
, 46: #and^#(#true(), #true()) -> c_52()
, 47: insert#1^#(nil(), @x) -> c_6()
, 48: insert#2^#(#true(), @x, @y, @ys) -> c_9()
, 49: leq#1^#(nil(), @l2) -> c_14()
, 50: isortlist#1^#(nil()) -> c_12()
, 51: leq#2^#(nil(), @x, @xs) -> c_16()
, 52: or^#(@x, @y) -> #or^#(@x, @y)
, 53: #or^#(#false(), #false()) -> c_53()
, 54: #or^#(#false(), #true()) -> c_54()
, 55: #or^#(#true(), #false()) -> c_55()
, 56: #or^#(#true(), #true()) -> c_56() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 50: isortlist#1^#(nil()) -> c_12()
, 47: insert#1^#(nil(), @x) -> c_6()
, 48: insert#2^#(#true(), @x, @y, @ys) -> c_9()
, 49: leq#1^#(nil(), @l2) -> c_14()
, 51: leq#2^#(nil(), @x, @xs) -> c_16()
, 9: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 25: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 23: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 19: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 10: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_18(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 11: #eq^#(::(@x_1, @x_2), nil()) -> c_19()
, 12: #eq^#(nil(), ::(@y_1, @y_2)) -> c_20()
, 13: #eq^#(nil(), nil()) -> c_21()
, 14: #eq^#(#0(), #0()) -> c_22()
, 15: #eq^#(#0(), #neg(@y)) -> c_23()
, 16: #eq^#(#0(), #pos(@y)) -> c_24()
, 17: #eq^#(#0(), #s(@y)) -> c_25()
, 18: #eq^#(#neg(@x), #0()) -> c_26()
, 20: #eq^#(#neg(@x), #pos(@y)) -> c_28()
, 21: #eq^#(#pos(@x), #0()) -> c_29()
, 22: #eq^#(#pos(@x), #neg(@y)) -> c_30()
, 24: #eq^#(#s(@x), #0()) -> c_32()
, 26: #less^#(@x, @y) ->
c_2(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, 27: #cklt^#(#EQ()) -> c_46()
, 28: #cklt^#(#GT()) -> c_47()
, 29: #cklt^#(#LT()) -> c_48()
, 41: #compare^#(#s(@x), #s(@y)) -> #compare^#(@x, @y)
, 39: #compare^#(#pos(@x), #pos(@y)) -> #compare^#(@x, @y)
, 35: #compare^#(#neg(@x), #neg(@y)) -> #compare^#(@y, @x)
, 30: #compare^#(#0(), #0()) -> c_34()
, 31: #compare^#(#0(), #neg(@y)) -> c_35()
, 32: #compare^#(#0(), #pos(@y)) -> c_36()
, 33: #compare^#(#0(), #s(@y)) -> c_37()
, 34: #compare^#(#neg(@x), #0()) -> c_38()
, 36: #compare^#(#neg(@x), #pos(@y)) -> c_40()
, 37: #compare^#(#pos(@x), #0()) -> c_41()
, 38: #compare^#(#pos(@x), #neg(@y)) -> c_42()
, 40: #compare^#(#s(@x), #0()) -> c_44()
, 42: and^#(@x, @y) -> #and^#(@x, @y)
, 43: #and^#(#false(), #false()) -> c_49()
, 44: #and^#(#false(), #true()) -> c_50()
, 45: #and^#(#true(), #false()) -> c_51()
, 46: #and^#(#true(), #true()) -> c_52()
, 52: or^#(@x, @y) -> #or^#(@x, @y)
, 53: #or^#(#false(), #false()) -> c_53()
, 54: #or^#(#false(), #true()) -> c_54()
, 55: #or^#(#true(), #false()) -> c_55()
, 56: #or^#(#true(), #true()) -> c_56() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the following dependency-graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_5(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :3
3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :5
5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) :8
6: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :7
7: isortlist#1^#(::(@x, @xs)) ->
c_11(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :6
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
8: leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys))
-->_5 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ leq#2^#(::(@y, @ys), @x, @xs) ->
c_15(or^#(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys))),
#less^#(@x, @y),
and^#(#equal(@x, @y), leq(@xs, @ys)),
#equal^#(@x, @y),
leq^#(@xs, @ys)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :3
3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :5
5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
6: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :7
7: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :6
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {8} and add Pre({8}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak DPs: { leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :3
3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :5
5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
6: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :7
7: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :6
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak DPs:
{ leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :4
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :3
3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :7
5: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :6
6: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :5
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
7: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak DPs:
{ insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :2
2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :6
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :3
3: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :7
4: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :5
5: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :4
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
6: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
7: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak DPs:
{ insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^2))
We consider the (estimated) dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :5
2: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :7
3: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :4
4: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :3
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
5: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :6
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :2
6: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
7: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :8
8: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :2
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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, isortlist^#(@l) -> isortlist#1^#(@l) }
Weak DPs:
{ insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
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):
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Remaining Rules (B):
{ isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) }
Weak DPs:
{ insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
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:
{ isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :2
2: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#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: { isortlist^#(@l) -> isortlist#1^#(@l) }
Weak DPs:
{ isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) :2
2: isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs))
-->_2 isortlist^#(@l) -> isortlist#1^#(@l) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ isortlist#1^#(::(@x, @xs)) ->
c_2(insert^#(@x, isortlist(@xs)), isortlist^#(@xs)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { isortlist^#(@l) -> isortlist#1^#(@l) }
Weak DPs: { isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
No rule is usable.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { isortlist^#(@l) -> isortlist#1^#(@l) }
Weak DPs: { isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'Small Polynomial Path Order (PS,1-bounded)'
to orient following rules strictly.
DPs:
{ 2: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
Sub-proof:
----------
The input was oriented with the instance of 'Small Polynomial Path
Order (PS,1-bounded)' as induced by the safe mapping
safe(#equal) = {}, safe(#eq) = {}, safe(#less) = {},
safe(#compare) = {}, safe(#cklt) = {}, safe(and) = {},
safe(#and) = {}, safe(insert) = {}, safe(insert#1) = {},
safe(::) = {1, 2}, safe(leq) = {}, safe(insert#2) = {},
safe(nil) = {}, safe(#false) = {}, safe(#true) = {},
safe(isortlist) = {}, safe(isortlist#1) = {}, safe(leq#1) = {},
safe(leq#2) = {}, safe(or) = {}, safe(#or) = {}, safe(#EQ) = {},
safe(#GT) = {}, safe(#LT) = {}, safe(#0) = {}, safe(#neg) = {1},
safe(#pos) = {1}, safe(#s) = {1}, safe(#equal^#) = {},
safe(#eq^#) = {}, safe(#less^#) = {}, safe(#cklt^#) = {},
safe(#compare^#) = {}, safe(and^#) = {}, safe(#and^#) = {},
safe(insert^#) = {}, safe(insert#1^#) = {}, safe(insert#2^#) = {},
safe(leq^#) = {}, safe(leq#1^#) = {}, safe(isortlist^#) = {},
safe(isortlist#1^#) = {}, safe(leq#2^#) = {}, safe(or^#) = {},
safe(#or^#) = {}, safe(c_2) = {}, safe(c) = {}
and precedence
isortlist^# ~ isortlist#1^# .
Following symbols are considered recursive:
{}
The recursion depth is 0.
Further, following argument filtering is employed:
pi(#equal) = [], pi(#eq) = [], pi(#less) = [], pi(#compare) = [],
pi(#cklt) = [], pi(and) = [], pi(#and) = [], pi(insert) = [],
pi(insert#1) = [], pi(::) = [2], pi(leq) = [], pi(insert#2) = [],
pi(nil) = [], pi(#false) = [], pi(#true) = [], pi(isortlist) = [],
pi(isortlist#1) = [], pi(leq#1) = [], pi(leq#2) = [], pi(or) = [],
pi(#or) = [], pi(#EQ) = [], pi(#GT) = [], pi(#LT) = [],
pi(#0) = [], pi(#neg) = [], pi(#pos) = [], pi(#s) = [],
pi(#equal^#) = [], pi(#eq^#) = [], pi(#less^#) = [],
pi(#cklt^#) = [], pi(#compare^#) = [], pi(and^#) = [],
pi(#and^#) = [], pi(insert^#) = [], pi(insert#1^#) = [],
pi(insert#2^#) = [], pi(leq^#) = [], pi(leq#1^#) = [],
pi(isortlist^#) = 1, pi(isortlist#1^#) = 1, pi(leq#2^#) = [],
pi(or^#) = [], pi(#or^#) = [], pi(c_2) = [], pi(c) = []
Usable defined function symbols are a subset of:
{}
For your convenience, here are the satisfied ordering constraints:
pi(isortlist^#(@l)) = @l
>= @l
= pi(isortlist#1^#(@l))
pi(isortlist#1^#(::(@x, @xs))) = ::(; @xs)
> @xs
= pi(isortlist^#(@xs))
Processor 'Small Polynomial Path Order (PS,1-bounded)' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2}.
Here rules are labeled according to the (estimated) dependency
graph
1: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) :2
2: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
-->_1 isortlist^#(@l) -> isortlist#1^#(@l) :1
- The rules {2} 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}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: isortlist^#(@l) -> isortlist#1^#(@l)
, 2: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: isortlist^#(@l) -> isortlist#1^#(@l)
, 2: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) }
We apply the transformation 'usablerules' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
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:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) }
Weak DPs:
{ insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
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: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, 5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, 7: isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, 8: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, 9: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Trs:
{ #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#s(@x), #0()) -> #GT()
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(#less) = {},
Uargs(#compare) = {}, Uargs(#cklt) = {}, Uargs(and) = {},
Uargs(#and) = {}, Uargs(insert) = {}, Uargs(insert#1) = {},
Uargs(::) = {}, Uargs(leq) = {}, Uargs(insert#2) = {},
Uargs(isortlist) = {}, Uargs(isortlist#1) = {}, Uargs(leq#1) = {},
Uargs(leq#2) = {}, Uargs(or) = {}, Uargs(#or) = {},
Uargs(#neg) = {}, Uargs(#pos) = {}, Uargs(#s) = {},
Uargs(#equal^#) = {}, Uargs(#eq^#) = {}, Uargs(#less^#) = {},
Uargs(#cklt^#) = {}, Uargs(#compare^#) = {}, Uargs(and^#) = {},
Uargs(#and^#) = {}, Uargs(insert^#) = {}, Uargs(insert#1^#) = {},
Uargs(insert#2^#) = {}, Uargs(leq^#) = {}, Uargs(leq#1^#) = {},
Uargs(isortlist^#) = {}, Uargs(isortlist#1^#) = {},
Uargs(leq#2^#) = {}, Uargs(or^#) = {}, Uargs(#or^#) = {},
Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#equal](x1, x2) = [2] x1 + [0]
[#eq](x1, x2) = [2] x1 + [0]
[#less](x1, x2) = [2] x1 + [2] x2 + [3]
[#compare](x1, x2) = [3]
[#cklt](x1) = [3]
[and](x1, x2) = [1] x2 + [2]
[#and](x1, x2) = [1] x2 + [0]
[insert](x1, x2) = [1] x1 + [1] x2 + [3]
[insert#1](x1, x2) = [1] x1 + [1] x2 + [3]
[::](x1, x2) = [1] x1 + [1] x2 + [3]
[leq](x1, x2) = [2]
[insert#2](x1, x2, x3, x4) = [2] x1 + [1] x2 + [1] x3 + [1] x4 + [2]
[nil] = [2]
[#false] = [2]
[#true] = [2]
[isortlist](x1) = [1] x1 + [0]
[isortlist#1](x1) = [1] x1 + [0]
[leq#1](x1, x2) = [2]
[leq#2](x1, x2, x3) = [2]
[or](x1, x2) = [2]
[#or](x1, x2) = [2]
[#EQ] = [3]
[#GT] = [1]
[#LT] = [1]
[#0] = [1]
[#neg](x1) = [1] x1 + [2]
[#pos](x1) = [1] x1 + [2]
[#s](x1) = [1] x1 + [2]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[#less^#](x1, x2) = [0]
[#cklt^#](x1) = [0]
[#compare^#](x1, x2) = [0]
[and^#](x1, x2) = [0]
[#and^#](x1, x2) = [0]
[insert^#](x1, x2) = [2] x1 + [3] x2 + [0]
[insert#1^#](x1, x2) = [3] x1 + [2] x2 + [0]
[insert#2^#](x1, x2, x3, x4) = [2] x2 + [3] x4 + [0]
[leq^#](x1, x2) = [2] x2 + [3]
[leq#1^#](x1, x2) = [2] x2 + [3]
[isortlist^#](x1) = [3] x1 + [0]
[isortlist#1^#](x1) = [3] x1 + [0]
[leq#2^#](x1, x2, x3) = [2] x1 + [1]
[or^#](x1, x2) = [0]
[#or^#](x1, x2) = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [2] @x + [0]
>= [2] @x + [0]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [2] @x_1 + [2] @x_2 + [6]
> [2] @x_2 + [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [2] @x_1 + [2] @x_2 + [6]
> [2]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [4]
> [2]
= [#false()]
[#eq(nil(), nil())] = [4]
> [2]
= [#true()]
[#eq(#0(), #0())] = [2]
>= [2]
= [#true()]
[#eq(#0(), #neg(@y))] = [2]
>= [2]
= [#false()]
[#eq(#0(), #pos(@y))] = [2]
>= [2]
= [#false()]
[#eq(#0(), #s(@y))] = [2]
>= [2]
= [#false()]
[#eq(#neg(@x), #0())] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [2] @x + [4]
> [2] @x + [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#pos(@x), #0())] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [2] @x + [4]
> [2] @x + [0]
= [#eq(@x, @y)]
[#eq(#s(@x), #0())] = [2] @x + [4]
> [2]
= [#false()]
[#eq(#s(@x), #s(@y))] = [2] @x + [4]
> [2] @x + [0]
= [#eq(@x, @y)]
[#less(@x, @y)] = [2] @x + [2] @y + [3]
>= [3]
= [#cklt(#compare(@x, @y))]
[#compare(#0(), #0())] = [3]
>= [3]
= [#EQ()]
[#compare(#0(), #neg(@y))] = [3]
> [1]
= [#GT()]
[#compare(#0(), #pos(@y))] = [3]
> [1]
= [#LT()]
[#compare(#0(), #s(@y))] = [3]
> [1]
= [#LT()]
[#compare(#neg(@x), #0())] = [3]
> [1]
= [#LT()]
[#compare(#neg(@x), #neg(@y))] = [3]
>= [3]
= [#compare(@y, @x)]
[#compare(#neg(@x), #pos(@y))] = [3]
> [1]
= [#LT()]
[#compare(#pos(@x), #0())] = [3]
> [1]
= [#GT()]
[#compare(#pos(@x), #neg(@y))] = [3]
> [1]
= [#GT()]
[#compare(#pos(@x), #pos(@y))] = [3]
>= [3]
= [#compare(@x, @y)]
[#compare(#s(@x), #0())] = [3]
> [1]
= [#GT()]
[#compare(#s(@x), #s(@y))] = [3]
>= [3]
= [#compare(@x, @y)]
[#cklt(#EQ())] = [3]
> [2]
= [#false()]
[#cklt(#GT())] = [3]
> [2]
= [#false()]
[#cklt(#LT())] = [3]
> [2]
= [#true()]
[and(@x, @y)] = [1] @y + [2]
> [1] @y + [0]
= [#and(@x, @y)]
[#and(#false(), #false())] = [2]
>= [2]
= [#false()]
[#and(#false(), #true())] = [2]
>= [2]
= [#false()]
[#and(#true(), #false())] = [2]
>= [2]
= [#false()]
[#and(#true(), #true())] = [2]
>= [2]
= [#true()]
[insert(@x, @l)] = [1] @l + [1] @x + [3]
>= [1] @l + [1] @x + [3]
= [insert#1(@l, @x)]
[insert#1(::(@y, @ys), @x)] = [1] @x + [1] @y + [1] @ys + [6]
>= [1] @x + [1] @y + [1] @ys + [6]
= [insert#2(leq(@x, @y), @x, @y, @ys)]
[insert#1(nil(), @x)] = [1] @x + [5]
>= [1] @x + [5]
= [::(@x, nil())]
[leq(@l1, @l2)] = [2]
>= [2]
= [leq#1(@l1, @l2)]
[insert#2(#false(), @x, @y, @ys)] = [1] @x + [1] @y + [1] @ys + [6]
>= [1] @x + [1] @y + [1] @ys + [6]
= [::(@y, insert(@x, @ys))]
[insert#2(#true(), @x, @y, @ys)] = [1] @x + [1] @y + [1] @ys + [6]
>= [1] @x + [1] @y + [1] @ys + [6]
= [::(@x, ::(@y, @ys))]
[isortlist(@l)] = [1] @l + [0]
>= [1] @l + [0]
= [isortlist#1(@l)]
[isortlist#1(::(@x, @xs))] = [1] @x + [1] @xs + [3]
>= [1] @x + [1] @xs + [3]
= [insert(@x, isortlist(@xs))]
[isortlist#1(nil())] = [2]
>= [2]
= [nil()]
[leq#1(::(@x, @xs), @l2)] = [2]
>= [2]
= [leq#2(@l2, @x, @xs)]
[leq#1(nil(), @l2)] = [2]
>= [2]
= [#true()]
[leq#2(::(@y, @ys), @x, @xs)] = [2]
>= [2]
= [or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))]
[leq#2(nil(), @x, @xs)] = [2]
>= [2]
= [#false()]
[or(@x, @y)] = [2]
>= [2]
= [#or(@x, @y)]
[#or(#false(), #false())] = [2]
>= [2]
= [#false()]
[#or(#false(), #true())] = [2]
>= [2]
= [#true()]
[#or(#true(), #false())] = [2]
>= [2]
= [#true()]
[#or(#true(), #true())] = [2]
>= [2]
= [#true()]
[insert^#(@x, @l)] = [3] @l + [2] @x + [0]
>= [3] @l + [2] @x + [0]
= [insert#1^#(@l, @x)]
[insert#1^#(::(@y, @ys), @x)] = [2] @x + [3] @y + [3] @ys + [9]
> [2] @x + [2] @y + [3] @ys + [3]
= [c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))]
[insert#2^#(#false(), @x, @y, @ys)] = [2] @x + [3] @ys + [0]
>= [2] @x + [3] @ys + [0]
= [insert^#(@x, @ys)]
[leq^#(@l1, @l2)] = [2] @l2 + [3]
>= [2] @l2 + [3]
= [leq#1^#(@l1, @l2)]
[leq#1^#(::(@x, @xs), @l2)] = [2] @l2 + [3]
> [2] @l2 + [1]
= [leq#2^#(@l2, @x, @xs)]
[isortlist^#(@l)] = [3] @l + [0]
>= [3] @l + [0]
= [isortlist#1^#(@l)]
[isortlist#1^#(::(@x, @xs))] = [3] @x + [3] @xs + [9]
> [2] @x + [3] @xs + [0]
= [insert^#(@x, isortlist(@xs))]
[isortlist#1^#(::(@x, @xs))] = [3] @x + [3] @xs + [9]
> [3] @xs + [0]
= [isortlist^#(@xs)]
[leq#2^#(::(@y, @ys), @x, @xs)] = [2] @y + [2] @ys + [7]
> [2] @ys + [3]
= [leq^#(@xs, @ys)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{3,5,7,8,9}. Here rules are labeled according to the (estimated)
dependency graph
1: insert^#(@x, @l) -> insert#1^#(@l, @x)
-->_1 insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y)) :3
2: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
-->_1 leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) :5
3: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
-->_1 insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys) :4
-->_2 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :2
4: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
-->_1 leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) :9
6: isortlist^#(@l) -> isortlist#1^#(@l)
-->_1 isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs) :8
-->_1 isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs)) :7
7: isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
-->_1 insert^#(@x, @l) -> insert#1^#(@l, @x) :1
8: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
-->_1 isortlist^#(@l) -> isortlist#1^#(@l) :6
9: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
-->_1 leq^#(@l1, @l2) -> leq#1^#(@l1, @l2) :2
- The rules {3,5,7,8,9} have known complexity. These cover all
predecessors of {2,4,6}, their complexity is equally bounded.
- The rules {2,3,4,5,6,7,8,9} have known complexity. These cover
all predecessors of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7,8,9} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ insert^#(@x, @l) -> insert#1^#(@l, @x)
, insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, isortlist^#(@l) -> isortlist#1^#(@l)
, isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{6,8} Weak SCC
|
`->2:{7} Weak SCC
|
`->3:{1,3,2} Weak SCC
|
`->4:{4,9,5} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: insert^#(@x, @l) -> insert#1^#(@l, @x)
, 2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, 3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, 4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, 5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs)
, 6: isortlist^#(@l) -> isortlist#1^#(@l)
, 7: isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, 8: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, 9: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 6: isortlist^#(@l) -> isortlist#1^#(@l)
, 8: isortlist#1^#(::(@x, @xs)) -> isortlist^#(@xs)
, 7: isortlist#1^#(::(@x, @xs)) -> insert^#(@x, isortlist(@xs))
, 1: insert^#(@x, @l) -> insert#1^#(@l, @x)
, 3: insert#2^#(#false(), @x, @y, @ys) -> insert^#(@x, @ys)
, 2: insert#1^#(::(@y, @ys), @x) ->
c_1(insert#2^#(leq(@x, @y), @x, @y, @ys), leq^#(@x, @y))
, 4: leq^#(@l1, @l2) -> leq#1^#(@l1, @l2)
, 9: leq#2^#(::(@y, @ys), @x, @xs) -> leq^#(@xs, @ys)
, 5: leq#1^#(::(@x, @xs), @l2) -> leq#2^#(@l2, @x, @xs) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, #eq(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))
, #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(#0(), #0()) -> #true()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #neg(@y)) -> #eq(@x, @y)
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#pos(@x), #pos(@y)) -> #eq(@x, @y)
, #eq(#s(@x), #0()) -> #false()
, #eq(#s(@x), #s(@y)) -> #eq(@x, @y)
, #less(@x, @y) -> #cklt(#compare(@x, @y))
, #compare(#0(), #0()) -> #EQ()
, #compare(#0(), #neg(@y)) -> #GT()
, #compare(#0(), #pos(@y)) -> #LT()
, #compare(#0(), #s(@y)) -> #LT()
, #compare(#neg(@x), #0()) -> #LT()
, #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
, #compare(#neg(@x), #pos(@y)) -> #LT()
, #compare(#pos(@x), #0()) -> #GT()
, #compare(#pos(@x), #neg(@y)) -> #GT()
, #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
, #compare(#s(@x), #0()) -> #GT()
, #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
, #cklt(#EQ()) -> #false()
, #cklt(#GT()) -> #false()
, #cklt(#LT()) -> #true()
, and(@x, @y) -> #and(@x, @y)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true()
, insert(@x, @l) -> insert#1(@l, @x)
, insert#1(::(@y, @ys), @x) -> insert#2(leq(@x, @y), @x, @y, @ys)
, insert#1(nil(), @x) -> ::(@x, nil())
, leq(@l1, @l2) -> leq#1(@l1, @l2)
, insert#2(#false(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
, insert#2(#true(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
, isortlist(@l) -> isortlist#1(@l)
, isortlist#1(::(@x, @xs)) -> insert(@x, isortlist(@xs))
, isortlist#1(nil()) -> nil()
, leq#1(::(@x, @xs), @l2) -> leq#2(@l2, @x, @xs)
, leq#1(nil(), @l2) -> #true()
, leq#2(::(@y, @ys), @x, @xs) ->
or(#less(@x, @y), and(#equal(@x, @y), leq(@xs, @ys)))
, leq#2(nil(), @x, @xs) -> #false()
, or(@x, @y) -> #or(@x, @y)
, #or(#false(), #false()) -> #false()
, #or(#false(), #true()) -> #true()
, #or(#true(), #false()) -> #true()
, #or(#true(), #true()) -> #true() }
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(1),O(n^2))