tct
Execution Time (secs) | 7.477 |
Answer | YES(?,O(n^1)) |
Input | bfs.raml |
YES(?,O(n^1))
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We add following dependency tuples
Strict DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, appendreverse#1^#(nil(), @sofar) -> c_4()
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, bfs#2^#(nil(), @x) -> c_11()
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) -> c_14()
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#1^#(nil(), @x) -> c_20()
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#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_27()
, #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, #eq^#(nil(), nil()) -> c_31()
, #eq^#(nil(), leaf()) -> c_32()
, #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, #eq^#(leaf(), nil()) -> c_35()
, #eq^#(leaf(), leaf()) -> c_36()
, #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, #eq^#(#0(), #0()) -> c_42()
, #eq^#(#0(), #neg(@y)) -> c_43()
, #eq^#(#0(), #pos(@y)) -> c_44()
, #eq^#(#0(), #s(@y)) -> c_45()
, #eq^#(#neg(@x), #0()) -> c_46()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_48()
, #eq^#(#pos(@x), #0()) -> c_49()
, #eq^#(#pos(@x), #neg(@y)) -> c_50()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_52()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #and^#(#false(), #false()) -> c_54()
, #and^#(#false(), #true()) -> c_55()
, #and^#(#true(), #false()) -> c_56()
, #and^#(#true(), #true()) -> c_57() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, appendreverse#1^#(nil(), @sofar) -> c_4()
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, bfs#2^#(nil(), @x) -> c_11()
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) -> c_14()
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#1^#(nil(), @x) -> c_20()
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#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_27()
, #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, #eq^#(nil(), nil()) -> c_31()
, #eq^#(nil(), leaf()) -> c_32()
, #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, #eq^#(leaf(), nil()) -> c_35()
, #eq^#(leaf(), leaf()) -> c_36()
, #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, #eq^#(#0(), #0()) -> c_42()
, #eq^#(#0(), #neg(@y)) -> c_43()
, #eq^#(#0(), #pos(@y)) -> c_44()
, #eq^#(#0(), #s(@y)) -> c_45()
, #eq^#(#neg(@x), #0()) -> c_46()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_48()
, #eq^#(#pos(@x), #0()) -> c_49()
, #eq^#(#pos(@x), #neg(@y)) -> c_50()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_52()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #and^#(#false(), #false()) -> c_54()
, #and^#(#false(), #true()) -> c_55()
, #and^#(#true(), #false()) -> c_56()
, #and^#(#true(), #true()) -> c_57() }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We consider the (estimated) dependency graph
1: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_1 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
-->_1 #eq^#(#s(@x), #0()) -> c_52() :52
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_1 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_1 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_1 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_1 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_1 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #0()) -> c_42() :42
-->_1 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_1 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_1 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_1 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_1 #eq^#(leaf(), leaf()) -> c_36() :36
-->_1 #eq^#(leaf(), nil()) -> c_35() :35
-->_1 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_1 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_1 #eq^#(nil(), leaf()) -> c_32() :32
-->_1 #eq^#(nil(), nil()) -> c_31() :31
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_1 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_1 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
2: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :3
-->_1 appendreverse#1^#(nil(), @sofar) -> c_4() :4
3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :2
4: appendreverse#1^#(nil(), @sofar) -> c_4()
5: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :7
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :6
6: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y)) :9
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :8
7: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :10
-->_1 bfs#2^#(nil(), @x) -> c_11() :11
8: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :5
9: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
-->_1 bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
c_14() :13
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :1
10: bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :14
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :5
11: bfs#2^#(nil(), @x) -> c_11()
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :5
13: bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) -> c_14()
14: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :2
15: bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :17
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :16
16: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :17
17: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :5
18: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :19
-->_1 dfs#1^#(nil(), @x) -> c_20() :20
19: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x)) :22
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :21
20: dfs#1^#(nil(), @x) -> c_20()
21: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :18
22: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :23
-->_1 dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24() :24
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :1
23: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :18
24: dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
25: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :18
26: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#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) :53
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_3 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_2 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #and^#(#true(), #true()) -> c_57() :57
-->_1 #and^#(#true(), #false()) -> c_56() :56
-->_1 #and^#(#false(), #true()) -> c_55() :55
-->_1 #and^#(#false(), #false()) -> c_54() :54
-->_3 #eq^#(#s(@x), #0()) -> c_52() :52
-->_2 #eq^#(#s(@x), #0()) -> c_52() :52
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_3 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_2 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_3 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_2 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_3 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_2 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_3 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_2 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_3 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_2 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_3 #eq^#(#0(), #0()) -> c_42() :42
-->_2 #eq^#(#0(), #0()) -> c_42() :42
-->_3 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_2 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_3 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_2 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_3 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_2 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_3 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_2 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_3 #eq^#(leaf(), leaf()) -> c_36() :36
-->_2 #eq^#(leaf(), leaf()) -> c_36() :36
-->_3 #eq^#(leaf(), nil()) -> c_35() :35
-->_2 #eq^#(leaf(), nil()) -> c_35() :35
-->_3 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_2 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_3 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_2 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_3 #eq^#(nil(), leaf()) -> c_32() :32
-->_2 #eq^#(nil(), leaf()) -> c_32() :32
-->_3 #eq^#(nil(), nil()) -> c_31() :31
-->_2 #eq^#(nil(), nil()) -> c_31() :31
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_3 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_2 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_3 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_2 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
27: #eq^#(::(@x_1, @x_2), nil()) -> c_27()
28: #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
29: #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
30: #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
31: #eq^#(nil(), nil()) -> c_31()
32: #eq^#(nil(), leaf()) -> c_32()
33: #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
34: #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
35: #eq^#(leaf(), nil()) -> c_35()
36: #eq^#(leaf(), leaf()) -> c_36()
37: #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
38: #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
39: #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
40: #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
41: #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
-->_5 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_4 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_5 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_4 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_5 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_4 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_3 #and^#(#true(), #true()) -> c_57() :57
-->_1 #and^#(#true(), #true()) -> c_57() :57
-->_3 #and^#(#true(), #false()) -> c_56() :56
-->_1 #and^#(#true(), #false()) -> c_56() :56
-->_3 #and^#(#false(), #true()) -> c_55() :55
-->_1 #and^#(#false(), #true()) -> c_55() :55
-->_3 #and^#(#false(), #false()) -> c_54() :54
-->_1 #and^#(#false(), #false()) -> c_54() :54
-->_5 #eq^#(#s(@x), #0()) -> c_52() :52
-->_4 #eq^#(#s(@x), #0()) -> c_52() :52
-->_2 #eq^#(#s(@x), #0()) -> c_52() :52
-->_5 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_4 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_5 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_4 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_2 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_5 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_4 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_5 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_4 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_2 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_5 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_4 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_2 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_5 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_4 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_2 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_5 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_4 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_2 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_5 #eq^#(#0(), #0()) -> c_42() :42
-->_4 #eq^#(#0(), #0()) -> c_42() :42
-->_2 #eq^#(#0(), #0()) -> c_42() :42
-->_5 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_4 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_2 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_5 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_4 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_2 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_5 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_4 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_2 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_5 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_4 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_2 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_5 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_4 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_2 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_5 #eq^#(leaf(), leaf()) -> c_36() :36
-->_4 #eq^#(leaf(), leaf()) -> c_36() :36
-->_2 #eq^#(leaf(), leaf()) -> c_36() :36
-->_5 #eq^#(leaf(), nil()) -> c_35() :35
-->_4 #eq^#(leaf(), nil()) -> c_35() :35
-->_2 #eq^#(leaf(), nil()) -> c_35() :35
-->_5 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_4 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_2 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_5 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_4 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_2 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_5 #eq^#(nil(), leaf()) -> c_32() :32
-->_4 #eq^#(nil(), leaf()) -> c_32() :32
-->_2 #eq^#(nil(), leaf()) -> c_32() :32
-->_5 #eq^#(nil(), nil()) -> c_31() :31
-->_4 #eq^#(nil(), nil()) -> c_31() :31
-->_2 #eq^#(nil(), nil()) -> c_31() :31
-->_5 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_4 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_5 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_4 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_2 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_5 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_4 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_2 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_5 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_4 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_5 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
-->_4 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
42: #eq^#(#0(), #0()) -> c_42()
43: #eq^#(#0(), #neg(@y)) -> c_43()
44: #eq^#(#0(), #pos(@y)) -> c_44()
45: #eq^#(#0(), #s(@y)) -> c_45()
46: #eq^#(#neg(@x), #0()) -> c_46()
47: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#s(@x), #0()) -> c_52() :52
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_1 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_1 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_1 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_1 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_1 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #0()) -> c_42() :42
-->_1 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_1 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_1 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_1 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_1 #eq^#(leaf(), leaf()) -> c_36() :36
-->_1 #eq^#(leaf(), nil()) -> c_35() :35
-->_1 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_1 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_1 #eq^#(nil(), leaf()) -> c_32() :32
-->_1 #eq^#(nil(), nil()) -> c_31() :31
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_1 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_1 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
48: #eq^#(#neg(@x), #pos(@y)) -> c_48()
49: #eq^#(#pos(@x), #0()) -> c_49()
50: #eq^#(#pos(@x), #neg(@y)) -> c_50()
51: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_1 #eq^#(#s(@x), #0()) -> c_52() :52
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_1 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_1 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_1 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_1 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_1 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #0()) -> c_42() :42
-->_1 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_1 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_1 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_1 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_1 #eq^#(leaf(), leaf()) -> c_36() :36
-->_1 #eq^#(leaf(), nil()) -> c_35() :35
-->_1 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_1 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_1 #eq^#(nil(), leaf()) -> c_32() :32
-->_1 #eq^#(nil(), nil()) -> c_31() :31
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_1 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_1 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
52: #eq^#(#s(@x), #0()) -> c_52()
53: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_1 #eq^#(#s(@x), #0()) -> c_52() :52
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_1 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_1 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_1 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_1 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_1 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #0()) -> c_42() :42
-->_1 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_1 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_1 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_1 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_1 #eq^#(leaf(), leaf()) -> c_36() :36
-->_1 #eq^#(leaf(), nil()) -> c_35() :35
-->_1 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_1 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_1 #eq^#(nil(), leaf()) -> c_32() :32
-->_1 #eq^#(nil(), nil()) -> c_31() :31
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_1 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_1 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
54: #and^#(#false(), #false()) -> c_54()
55: #and^#(#false(), #true()) -> c_55()
56: #and^#(#true(), #false()) -> c_56()
57: #and^#(#true(), #true()) -> c_57()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {20} and add Pre({20}) = {18} to the strict component.
- We remove {24} and add Pre({24}) = {22} to the strict component.
- We remove {13} and add Pre({13}) = {9} to the strict component.
- We remove {11} and add Pre({11}) = {7} to the strict component.
- We remove {4} and add Pre({4}) = {2} to the strict component.
- We remove {1} and add Pre({1}) = {22,9} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#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_27()
, #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, #eq^#(nil(), nil()) -> c_31()
, #eq^#(nil(), leaf()) -> c_32()
, #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, #eq^#(leaf(), nil()) -> c_35()
, #eq^#(leaf(), leaf()) -> c_36()
, #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, #eq^#(#0(), #0()) -> c_42()
, #eq^#(#0(), #neg(@y)) -> c_43()
, #eq^#(#0(), #pos(@y)) -> c_44()
, #eq^#(#0(), #s(@y)) -> c_45()
, #eq^#(#neg(@x), #0()) -> c_46()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_48()
, #eq^#(#pos(@x), #0()) -> c_49()
, #eq^#(#pos(@x), #neg(@y)) -> c_50()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_52()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, appendreverse#1^#(nil(), @sofar) -> c_4()
, bfs#2^#(nil(), @x) -> c_11()
, bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) -> c_14()
, dfs#1^#(nil(), @x) -> c_20()
, dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, #and^#(#false(), #false()) -> c_54()
, #and^#(#false(), #true()) -> c_55()
, #and^#(#true(), #false()) -> c_56()
, #and^#(#true(), #true()) -> c_57() }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We consider the the dependency graph
->5:{11}
|
|->6:{12}
| |
| `->7:{13}
| |
| `->8:{3,9,7,4,8,5,6}
| |
| |->40:{10}
| | |
| | `->41:{1,2}
| | |
| | `->42:{49} Weak SCC
| |
| |->10:{20} Weak SCC
| | |
| | |->12:{22} Weak SCC
| | |
| | |->13:{23} Weak SCC
| | |
| | |->14:{24} Weak SCC
| | |
| | |->15:{25} Weak SCC
| | |
| | |->16:{26} Weak SCC
| | |
| | |->17:{27} Weak SCC
| | |
| | |->18:{28} Weak SCC
| | |
| | |->19:{29} Weak SCC
| | |
| | |->20:{30} Weak SCC
| | |
| | |->21:{31} Weak SCC
| | |
| | |->22:{32} Weak SCC
| | |
| | |->23:{33} Weak SCC
| | |
| | |->24:{34} Weak SCC
| | |
| | |->25:{35} Weak SCC
| | |
| | |->30:{37} Weak SCC
| | |
| | |->31:{38} Weak SCC
| | |
| | |->32:{39} Weak SCC
| | |
| | |->33:{40} Weak SCC
| | |
| | |->34:{41} Weak SCC
| | |
| | |->35:{43} Weak SCC
| | |
| | |->36:{44} Weak SCC
| | |
| | |->37:{45} Weak SCC
| | |
| | |->38:{47} Weak SCC
| | |
| | `->11:{48,46,42,36,21} Weak SCC
| | |
| | |->12:{22} Weak SCC
| | |
| | |->13:{23} Weak SCC
| | |
| | |->14:{24} Weak SCC
| | |
| | |->15:{25} Weak SCC
| | |
| | |->16:{26} Weak SCC
| | |
| | |->17:{27} Weak SCC
| | |
| | |->18:{28} Weak SCC
| | |
| | |->19:{29} Weak SCC
| | |
| | |->20:{30} Weak SCC
| | |
| | |->21:{31} Weak SCC
| | |
| | |->22:{32} Weak SCC
| | |
| | |->23:{33} Weak SCC
| | |
| | |->24:{34} Weak SCC
| | |
| | |->25:{35} Weak SCC
| | |
| | |->30:{37} Weak SCC
| | |
| | |->31:{38} Weak SCC
| | |
| | |->32:{39} Weak SCC
| | |
| | |->33:{40} Weak SCC
| | |
| | |->34:{41} Weak SCC
| | |
| | |->35:{43} Weak SCC
| | |
| | |->36:{44} Weak SCC
| | |
| | |->37:{45} Weak SCC
| | |
| | |->38:{47} Weak SCC
| | |
| | |->26:{54} Weak SCC
| | |
| | |->27:{55} Weak SCC
| | |
| | |->28:{56} Weak SCC
| | |
| | `->29:{57} Weak SCC
| |
| |->39:{50} Weak SCC
| |
| `->9:{51} Weak SCC
|
`->7:{13}
|
`->8:{3,9,7,4,8,5,6}
|
|->40:{10}
| |
| `->41:{1,2}
| |
| `->42:{49} Weak SCC
|
|->10:{20} Weak SCC
| |
| |->12:{22} Weak SCC
| |
| |->13:{23} Weak SCC
| |
| |->14:{24} Weak SCC
| |
| |->15:{25} Weak SCC
| |
| |->16:{26} Weak SCC
| |
| |->17:{27} Weak SCC
| |
| |->18:{28} Weak SCC
| |
| |->19:{29} Weak SCC
| |
| |->20:{30} Weak SCC
| |
| |->21:{31} Weak SCC
| |
| |->22:{32} Weak SCC
| |
| |->23:{33} Weak SCC
| |
| |->24:{34} Weak SCC
| |
| |->25:{35} Weak SCC
| |
| |->30:{37} Weak SCC
| |
| |->31:{38} Weak SCC
| |
| |->32:{39} Weak SCC
| |
| |->33:{40} Weak SCC
| |
| |->34:{41} Weak SCC
| |
| |->35:{43} Weak SCC
| |
| |->36:{44} Weak SCC
| |
| |->37:{45} Weak SCC
| |
| |->38:{47} Weak SCC
| |
| `->11:{48,46,42,36,21} Weak SCC
| |
| |->12:{22} Weak SCC
| |
| |->13:{23} Weak SCC
| |
| |->14:{24} Weak SCC
| |
| |->15:{25} Weak SCC
| |
| |->16:{26} Weak SCC
| |
| |->17:{27} Weak SCC
| |
| |->18:{28} Weak SCC
| |
| |->19:{29} Weak SCC
| |
| |->20:{30} Weak SCC
| |
| |->21:{31} Weak SCC
| |
| |->22:{32} Weak SCC
| |
| |->23:{33} Weak SCC
| |
| |->24:{34} Weak SCC
| |
| |->25:{35} Weak SCC
| |
| |->30:{37} Weak SCC
| |
| |->31:{38} Weak SCC
| |
| |->32:{39} Weak SCC
| |
| |->33:{40} Weak SCC
| |
| |->34:{41} Weak SCC
| |
| |->35:{43} Weak SCC
| |
| |->36:{44} Weak SCC
| |
| |->37:{45} Weak SCC
| |
| |->38:{47} Weak SCC
| |
| |->26:{54} Weak SCC
| |
| |->27:{55} Weak SCC
| |
| |->28:{56} Weak SCC
| |
| `->29:{57} Weak SCC
|
|->39:{50} Weak SCC
|
`->9:{51} Weak SCC
->1:{19}
|
`->2:{14,18,17,15,16}
|
|->10:{20} Weak SCC
| |
| |->12:{22} Weak SCC
| |
| |->13:{23} Weak SCC
| |
| |->14:{24} Weak SCC
| |
| |->15:{25} Weak SCC
| |
| |->16:{26} Weak SCC
| |
| |->17:{27} Weak SCC
| |
| |->18:{28} Weak SCC
| |
| |->19:{29} Weak SCC
| |
| |->20:{30} Weak SCC
| |
| |->21:{31} Weak SCC
| |
| |->22:{32} Weak SCC
| |
| |->23:{33} Weak SCC
| |
| |->24:{34} Weak SCC
| |
| |->25:{35} Weak SCC
| |
| |->30:{37} Weak SCC
| |
| |->31:{38} Weak SCC
| |
| |->32:{39} Weak SCC
| |
| |->33:{40} Weak SCC
| |
| |->34:{41} Weak SCC
| |
| |->35:{43} Weak SCC
| |
| |->36:{44} Weak SCC
| |
| |->37:{45} Weak SCC
| |
| |->38:{47} Weak SCC
| |
| `->11:{48,46,42,36,21} Weak SCC
| |
| |->12:{22} Weak SCC
| |
| |->13:{23} Weak SCC
| |
| |->14:{24} Weak SCC
| |
| |->15:{25} Weak SCC
| |
| |->16:{26} Weak SCC
| |
| |->17:{27} Weak SCC
| |
| |->18:{28} Weak SCC
| |
| |->19:{29} Weak SCC
| |
| |->20:{30} Weak SCC
| |
| |->21:{31} Weak SCC
| |
| |->22:{32} Weak SCC
| |
| |->23:{33} Weak SCC
| |
| |->24:{34} Weak SCC
| |
| |->25:{35} Weak SCC
| |
| |->30:{37} Weak SCC
| |
| |->31:{38} Weak SCC
| |
| |->32:{39} Weak SCC
| |
| |->33:{40} Weak SCC
| |
| |->34:{41} Weak SCC
| |
| |->35:{43} Weak SCC
| |
| |->36:{44} Weak SCC
| |
| |->37:{45} Weak SCC
| |
| |->38:{47} Weak SCC
| |
| |->26:{54} Weak SCC
| |
| |->27:{55} Weak SCC
| |
| |->28:{56} Weak SCC
| |
| `->29:{57} Weak SCC
|
|->3:{52} Weak SCC
|
`->4:{53} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, 2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, 3: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, 4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, 8: bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, 9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 11: bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, 14: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, 15: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 16: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, 17: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, 18: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 19: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ 20: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 21: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 22: #eq^#(::(@x_1, @x_2), nil()) -> c_27()
, 23: #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, 24: #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, 25: #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, 26: #eq^#(nil(), nil()) -> c_31()
, 27: #eq^#(nil(), leaf()) -> c_32()
, 28: #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, 29: #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, 30: #eq^#(leaf(), nil()) -> c_35()
, 31: #eq^#(leaf(), leaf()) -> c_36()
, 32: #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, 33: #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, 34: #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, 35: #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, 36: #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, 37: #eq^#(#0(), #0()) -> c_42()
, 38: #eq^#(#0(), #neg(@y)) -> c_43()
, 39: #eq^#(#0(), #pos(@y)) -> c_44()
, 40: #eq^#(#0(), #s(@y)) -> c_45()
, 41: #eq^#(#neg(@x), #0()) -> c_46()
, 42: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 43: #eq^#(#neg(@x), #pos(@y)) -> c_48()
, 44: #eq^#(#pos(@x), #0()) -> c_49()
, 45: #eq^#(#pos(@x), #neg(@y)) -> c_50()
, 46: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 47: #eq^#(#s(@x), #0()) -> c_52()
, 48: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 49: appendreverse#1^#(nil(), @sofar) -> c_4()
, 50: bfs#2^#(nil(), @x) -> c_11()
, 51: bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
c_14()
, 52: dfs#1^#(nil(), @x) -> c_20()
, 53: dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, 54: #and^#(#false(), #false()) -> c_54()
, 55: #and^#(#false(), #true()) -> c_55()
, 56: #and^#(#true(), #false()) -> c_56()
, 57: #and^#(#true(), #true()) -> c_57() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 52: dfs#1^#(nil(), @x) -> c_20()
, 53: dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, 51: bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
c_14()
, 20: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 48: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 46: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 42: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 36: #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, 21: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 22: #eq^#(::(@x_1, @x_2), nil()) -> c_27()
, 23: #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, 24: #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, 25: #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, 26: #eq^#(nil(), nil()) -> c_31()
, 27: #eq^#(nil(), leaf()) -> c_32()
, 28: #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, 29: #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, 30: #eq^#(leaf(), nil()) -> c_35()
, 31: #eq^#(leaf(), leaf()) -> c_36()
, 32: #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, 33: #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, 34: #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, 35: #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, 54: #and^#(#false(), #false()) -> c_54()
, 55: #and^#(#false(), #true()) -> c_55()
, 56: #and^#(#true(), #false()) -> c_56()
, 57: #and^#(#true(), #true()) -> c_57()
, 37: #eq^#(#0(), #0()) -> c_42()
, 38: #eq^#(#0(), #neg(@y)) -> c_43()
, 39: #eq^#(#0(), #pos(@y)) -> c_44()
, 40: #eq^#(#0(), #s(@y)) -> c_45()
, 41: #eq^#(#neg(@x), #0()) -> c_46()
, 43: #eq^#(#neg(@x), #pos(@y)) -> c_48()
, 44: #eq^#(#pos(@x), #0()) -> c_49()
, 45: #eq^#(#pos(@x), #neg(@y)) -> c_50()
, 47: #eq^#(#s(@x), #0()) -> c_52()
, 50: bfs#2^#(nil(), @x) -> c_11()
, 49: appendreverse#1^#(nil(), @sofar) -> c_4() }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We consider the following dependency-graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :2
2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
3: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :5
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :4
4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y)) :7
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :6
5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :8
6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :9
8: bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :10
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :12
12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
14: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :15
15: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x)) :17
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :16
16: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :14
17: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :18
18: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :14
19: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :14
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x)) }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We employ 'linear path analysis' using the following approximated
dependency graph:
->3:{11} [ ? ]
|
|->4:{12} [ ? ]
| |
| `->5:{13} [ ? ]
| |
| `->6:{3,9,7,4,8,5,6} [ ? ]
| |
| `->7:{10} [ ? ]
| |
| `->8:{1,2} [ YES(O(1),O(n^1)) ]
|
`->5:{13} [ ? ]
|
`->6:{3,9,7,4,8,5,6} [ ? ]
|
`->7:{10} [ ? ]
|
`->8:{1,2} [ subsumed ]
->1:{19} [ ? ]
|
`->2:{14,18,17,15,16} [ YES(O(1),O(n^1)) ]
Here dependency-pairs are as follows:
Strict DPs:
{ 1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, 2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, 3: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, 4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 8: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, 9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 11: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, 14: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, 15: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 16: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, 17: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, 18: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 19: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
* Path 3:{11}->4:{12}->5:{13}->6:{3,9,7,4,8,5,6}->7:{10}->8:{1,2}: YES(O(1),O(n^1))
---------------------------------------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :2
2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
3: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :5
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :4
4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :7
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :6
5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :8
6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :9
8: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :10
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :12
12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :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^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :13
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :4
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :6
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :5
4: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :7
5: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
6: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :8
7: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :9
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
10: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :12
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :11
11: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :12
12: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {9} and add Pre({9}) = {7} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :12
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :4
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :6
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :5
4: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :7
5: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
6: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :8
7: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :11
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :10
10: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :11
11: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :11
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :4
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :6
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :5
4: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :12
5: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
6: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :7
7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :9
9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
11: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
12: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :10
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :11
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :5
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :6
6: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
7: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :9
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :8
8: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :9
9: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :12
12: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :9
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :10
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :5
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
6: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :8
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :7
7: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :8
8: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
10: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :11
11: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :8
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :9
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :10
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
5: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :7
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :6
6: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :7
7: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
9: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :11
10: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
11: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :7
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :8
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :10
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :9
4: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :6
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :5
5: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :6
6: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
7: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
8: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :11
9: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
11: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :6
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :8
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :7
3: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :5
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :4
4: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :5
5: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
6: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
7: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :10
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :9
8: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :11
9: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
11: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4,3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :5
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :7
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :6
3: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :4
4: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
5: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
6: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :9
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :8
7: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :10
8: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :11
10: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :12
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
11: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :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^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :4
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :6
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :5
3: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :12
4: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
5: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :8
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :7
6: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :9
7: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :10
9: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :11
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
11: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 2' to
orient following rules strictly.
DPs:
{ 3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, 10: reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Trs:
{ bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(appendreverse) = {},
Uargs(appendreverse#1) = {}, Uargs(::) = {}, Uargs(bfs) = {},
Uargs(bfs#1) = {}, Uargs(bfs#3) = {}, Uargs(bfs#2) = {},
Uargs(reverse) = {}, Uargs(node) = {}, Uargs(bfs#4) = {},
Uargs(dobfs) = {}, Uargs(#and) = {}, Uargs(#neg) = {},
Uargs(#pos) = {}, Uargs(#s) = {}, Uargs(#equal^#) = {},
Uargs(#eq^#) = {}, Uargs(appendreverse^#) = {},
Uargs(appendreverse#1^#) = {}, Uargs(bfs^#) = {},
Uargs(bfs#1^#) = {}, Uargs(bfs#3^#) = {}, Uargs(bfs#2^#) = {},
Uargs(bfs#4^#) = {}, Uargs(reverse^#) = {}, Uargs(bfs2^#) = {},
Uargs(bfs2#1^#) = {}, Uargs(dobfs^#) = {}, Uargs(dfs^#) = {},
Uargs(dfs#1^#) = {}, Uargs(dfs#2^#) = {}, Uargs(dfs#3^#) = {},
Uargs(dodfs^#) = {}, Uargs(#and^#) = {}, Uargs(c_1) = {1, 2},
Uargs(c_2) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA) and not(IDA(1)).
[#equal](x1, x2) = [1]
[1]
[#eq](x1, x2) = [1]
[1]
[appendreverse](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [0]
[appendreverse#1](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [0]
[::](x1, x2) = [1 1] x1 + [1 0] x2 + [0]
[0 0] [0 1] [1]
[nil] = [0]
[0]
[bfs](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [0]
[1 0] [1 1] [1]
[bfs#1](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [0]
[1 0] [1 1] [1]
[bfs#3](x1, x2, x3, x4) = [1 1] x1 + [1 0] x2 + [1
0] x3 + [0]
[1 1] [1 1] [1
0] [1]
[bfs#2](x1, x2) = [1 0] x1 + [0]
[1 1] [0]
[reverse](x1) = [1 0] x1 + [0]
[0 1] [3]
[leaf] = [0]
[0]
[node](x1, x2, x3) = [1 1] x2 + [1 1] x3 + [2]
[0 0] [0 0] [2]
[bfs#4](x1, x2, x3, x4, x5, x6, x7) = [3 0] x1 + [1 0] x2 + [1
1] x3 + [1 1] x4 + [1
0] x5 + [0]
[0 1] [1 1] [1
1] [1 1] [1
0] [2]
[#false] = [1]
[1]
[#true] = [1]
[1]
[dobfs](x1, x2) = [1 1] x1 + [0 0] x2 + [0]
[1 1] [2 0] [1]
[#and](x1, x2) = [1]
[1]
[#0] = [0]
[2]
[#neg](x1) = [1 0] x1 + [3]
[0 0] [2]
[#pos](x1) = [1 0] x1 + [0]
[0 1] [2]
[#s](x1) = [0 1] x1 + [0]
[0 1] [0]
[#equal^#](x1, x2) = [0]
[0]
[#eq^#](x1, x2) = [0]
[0]
[appendreverse^#](x1, x2) = [0 1] x1 + [0]
[0 0] [0]
[appendreverse#1^#](x1, x2) = [0 1] x1 + [0]
[0 0] [0]
[bfs^#](x1, x2, x3) = [1 0] x1 + [1 2] x2 + [1]
[0 1] [0 0] [0]
[bfs#1^#](x1, x2, x3) = [1 0] x1 + [1 2] x2 + [1]
[0 1] [0 0] [0]
[bfs#3^#](x1, x2, x3, x4) = [1 1] x1 + [1 2] x2 + [1
0] x3 + [1]
[0 0] [0 0] [0
1] [0]
[bfs#2^#](x1, x2) = [1 2] x1 + [1]
[0 0] [0]
[bfs#4^#](x1, x2, x3, x4, x5, x6, x7) = [1 3] x1 + [1 2] x2 + [1
1] x3 + [1 1] x4 + [1
0] x5 + [1]
[0 0] [0 0] [0
0] [0 0] [0
1] [0]
[reverse^#](x1) = [0 1] x1 + [1]
[0 0] [0]
[bfs2^#](x1, x2) = [3 3] x1 + [3 3] x2 + [3]
[3 3] [3 3] [3]
[bfs2#1^#](x1, x2) = [1 1] x1 + [1]
[2 2] [3]
[dobfs^#](x1, x2) = [1 1] x1 + [1]
[1 1] [1]
[dfs^#](x1, x2) = [0]
[0]
[dfs#1^#](x1, x2) = [0]
[0]
[dfs#2^#](x1, x2, x3, x4) = [0]
[0]
[dfs#3^#](x1, x2, x3, x4, x5, x6) = [0]
[0]
[dodfs^#](x1, x2) = [0]
[0]
[#and^#](x1, x2) = [0]
[0]
[c_1](x1, x2) = [1 0] x1 + [1 1] x2 + [0]
[0 0] [0 0] [0]
[c_2](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 0] [0 0] [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [1]
[1]
>= [1]
[1]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [1]
[1]
>= [1]
[1]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(::(@x_1, @x_2), leaf())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(nil(), nil())] = [1]
[1]
>= [1]
[1]
= [#true()]
[#eq(nil(), leaf())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(nil(), node(@y_1, @y_2, @y_3))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(leaf(), ::(@y_1, @y_2))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(leaf(), nil())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(leaf(), leaf())] = [1]
[1]
>= [1]
[1]
= [#true()]
[#eq(leaf(), node(@y_1, @y_2, @y_3))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), nil())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), leaf())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3))] = [1]
[1]
>= [1]
[1]
= [#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))]
[#eq(#0(), #0())] = [1]
[1]
>= [1]
[1]
= [#true()]
[#eq(#0(), #neg(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#0(), #pos(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#0(), #s(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#neg(@x), #0())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [1]
[1]
>= [1]
[1]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#pos(@x), #0())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [1]
[1]
>= [1]
[1]
= [#eq(@x, @y)]
[#eq(#s(@x), #0())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#s(@x), #s(@y))] = [1]
[1]
>= [1]
[1]
= [#eq(@x, @y)]
[appendreverse(@toreverse, @sofar)] = [1 0] @sofar + [1 0] @toreverse + [0]
[0 1] [0 1] [0]
>= [1 0] @sofar + [1 0] @toreverse + [0]
[0 1] [0 1] [0]
= [appendreverse#1(@toreverse, @sofar)]
[appendreverse#1(::(@a, @as), @sofar)] = [1 1] @a + [1 0] @as + [1 0] @sofar + [0]
[0 0] [0 1] [0 1] [1]
>= [1 1] @a + [1 0] @as + [1 0] @sofar + [0]
[0 0] [0 1] [0 1] [1]
= [appendreverse(@as, ::(@a, @sofar))]
[appendreverse#1(nil(), @sofar)] = [1 0] @sofar + [0]
[0 1] [0]
>= [1 0] @sofar + [0]
[0 1] [0]
= [@sofar]
[bfs(@queue, @futurequeue, @x)] = [1 0] @futurequeue + [1 0] @queue + [0]
[1 1] [1 0] [1]
>= [1 0] @futurequeue + [1 0] @queue + [0]
[1 1] [1 0] [1]
= [bfs#1(@queue, @futurequeue, @x)]
[bfs#1(::(@t, @ts), @futurequeue, @x)] = [1 0] @futurequeue + [1 1] @t + [1 0] @ts + [0]
[1 1] [1 1] [1 0] [1]
>= [1 0] @futurequeue + [1 1] @t + [1 0] @ts + [0]
[1 1] [1 1] [1 0] [1]
= [bfs#3(@t, @futurequeue, @ts, @x)]
[bfs#1(nil(), @futurequeue, @x)] = [1 0] @futurequeue + [0]
[1 1] [1]
>= [1 0] @futurequeue + [0]
[1 1] [0]
= [bfs#2(@futurequeue, @x)]
[bfs#3(leaf(), @futurequeue, @ts, @x)] = [1 0] @futurequeue + [1 0] @ts + [0]
[1 1] [1 0] [1]
>= [1 0] @futurequeue + [1 0] @ts + [0]
[1 1] [1 0] [1]
= [bfs(@ts, @futurequeue, @x)]
[bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [4]
[1 1] [1 1] [1 1] [1 0] [5]
> [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [3]
[1 1] [1 1] [1 1] [1 0] [3]
= [bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)]
[bfs#2(::(@t, @ts), @x)] = [1 1] @t + [1 0] @ts + [0]
[1 1] [1 1] [1]
>= [1 1] @t + [1 0] @ts + [0]
[1 1] [1 0] [1]
= [bfs(reverse(::(@t, @ts)), nil(), @x)]
[bfs#2(nil(), @x)] = [0]
[0]
>= [0]
[0]
= [leaf()]
[reverse(@xs)] = [1 0] @xs + [0]
[0 1] [3]
>= [1 0] @xs + [0]
[0 1] [0]
= [appendreverse(@xs, nil())]
[bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [3]
[1 1] [1 1] [1 1] [1 0] [3]
> [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0]
[1 1] [1 1] [1 1] [1 0] [3]
= [bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)]
[bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [3]
[1 1] [1 1] [1 1] [1 0] [3]
> [1 1] @t1 + [1 1] @t2 + [2]
[0 0] [0 0] [2]
= [node(@y, @t1, @t2)]
[dobfs(@t, @x)] = [1 1] @t + [0 0] @x + [0]
[1 1] [2 0] [1]
>= [1 1] @t + [0]
[1 1] [1]
= [bfs(::(@t, nil()), nil(), @x)]
[#and(#false(), #false())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#and(#false(), #true())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#and(#true(), #false())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#and(#true(), #true())] = [1]
[1]
>= [1]
[1]
= [#true()]
[appendreverse^#(@toreverse, @sofar)] = [0 1] @toreverse + [0]
[0 0] [0]
>= [0 1] @toreverse + [0]
[0 0] [0]
= [appendreverse#1^#(@toreverse, @sofar)]
[appendreverse#1^#(::(@a, @as), @sofar)] = [0 1] @as + [1]
[0 0] [0]
> [0 1] @as + [0]
[0 0] [0]
= [appendreverse^#(@as, ::(@a, @sofar))]
[bfs^#(@queue, @futurequeue, @x)] = [1 2] @futurequeue + [1 0] @queue + [1]
[0 0] [0 1] [0]
>= [1 2] @futurequeue + [1 0] @queue + [1]
[0 0] [0 1] [0]
= [bfs#1^#(@queue, @futurequeue, @x)]
[bfs#1^#(::(@t, @ts), @futurequeue, @x)] = [1 2] @futurequeue + [1 1] @t + [1 0] @ts + [1]
[0 0] [0 0] [0 1] [1]
>= [1 2] @futurequeue + [1 1] @t + [1 0] @ts + [1]
[0 0] [0 0] [0 1] [0]
= [bfs#3^#(@t, @futurequeue, @ts, @x)]
[bfs#1^#(nil(), @futurequeue, @x)] = [1 2] @futurequeue + [1]
[0 0] [0]
>= [1 2] @futurequeue + [1]
[0 0] [0]
= [bfs#2^#(@futurequeue, @x)]
[bfs#3^#(leaf(), @futurequeue, @ts, @x)] = [1 2] @futurequeue + [1 0] @ts + [1]
[0 0] [0 1] [0]
>= [1 2] @futurequeue + [1 0] @ts + [1]
[0 0] [0 1] [0]
= [bfs^#(@ts, @futurequeue, @x)]
[bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x)] = [1 2] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [5]
[0 0] [0 0] [0 0] [0 1] [0]
>= [1 2] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [5]
[0 0] [0 0] [0 0] [0 1] [0]
= [bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)]
[bfs#2^#(::(@t, @ts), @x)] = [1 1] @t + [1 2] @ts + [3]
[0 0] [0 0] [0]
>= [1 1] @t + [1 1] @ts + [3]
[0 0] [0 0] [0]
= [c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))]
[bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 2] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [5]
[0 0] [0 0] [0 0] [0 1] [0]
>= [1 2] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [5]
[0 0] [0 0] [0 0] [0 1] [0]
= [bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)]
[reverse^#(@xs)] = [0 1] @xs + [1]
[0 0] [0]
> [0 1] @xs + [0]
[0 0] [0]
= [appendreverse^#(@xs, nil())]
[bfs2^#(@t, @x)] = [3 3] @t + [3 3] @x + [3]
[3 3] [3 3] [3]
>= [3 3] @t + [2 0] @x + [3]
[0 0] [0 0] [0]
= [c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))]
[bfs2#1^#(@t', @x)] = [1 1] @t' + [1]
[2 2] [3]
>= [1 1] @t' + [1]
[1 1] [1]
= [dobfs^#(@t', @x)]
[dobfs^#(@t, @x)] = [1 1] @t + [1]
[1 1] [1]
>= [1 1] @t + [1]
[0 0] [1]
= [bfs^#(::(@t, nil()), nil(), @x)]
Processor 'matrix interpretation of dimension 2' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{3,10}. Here rules are labeled according to the (estimated)
dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :3
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :5
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :4
3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :7
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :6
5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :8
6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :9
8: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :10
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :12
12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
- The rules {3,10} have known complexity. These cover all
predecessors of {1,11}, their complexity is equally bounded.
- The rules {1,3,10,11} have known complexity. These cover all
predecessors of {12}, their complexity is equally bounded.
- The rules {1,3,10,11,12} have known complexity. These cover all
predecessors of {13}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,3,10,11,12,13} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Strict DPs:
{ bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{11} Weak SCC
|
|->2:{12} Weak SCC
| |
| `->3:{13} Weak SCC
| |
| `->4:{1,9,7,4,8,5,6}
| |
| `->5:{10} Weak SCC
| |
| `->6:{2,3} Weak SCC
|
`->3:{13} Weak SCC
|
`->4:{1,9,7,4,8,5,6}
|
`->5:{10} Weak SCC
|
`->6:{2,3} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ 2: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, 3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, 4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 8: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, 9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 11: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 2: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, 3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) }
We apply the transformation 'simpDPRHS' on the sub-problem:
Strict DPs:
{ bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the following dependency-graph
1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :3
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :2
2: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :5
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
3: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :6
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :7
6: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
8: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :9
9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) }
We apply the transformation 'simpKP' on the sub-problem:
Strict DPs:
{ bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We use the processor 'matrix interpretation of dimension 2' to
orient following rules strictly.
DPs:
{ 4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 6: bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, 8: bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x)) }
Trs:
{ #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false() }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(appendreverse) = {},
Uargs(appendreverse#1) = {}, Uargs(::) = {}, Uargs(bfs) = {},
Uargs(bfs#1) = {}, Uargs(bfs#3) = {}, Uargs(bfs#2) = {},
Uargs(reverse) = {}, Uargs(node) = {}, Uargs(bfs#4) = {},
Uargs(dobfs) = {}, Uargs(#and) = {}, Uargs(#neg) = {},
Uargs(#pos) = {}, Uargs(#s) = {}, Uargs(#equal^#) = {},
Uargs(#eq^#) = {}, Uargs(appendreverse^#) = {},
Uargs(appendreverse#1^#) = {}, Uargs(bfs^#) = {},
Uargs(bfs#1^#) = {}, Uargs(bfs#3^#) = {}, Uargs(bfs#2^#) = {},
Uargs(bfs#4^#) = {}, Uargs(reverse^#) = {}, Uargs(bfs2^#) = {},
Uargs(bfs2#1^#) = {}, Uargs(dobfs^#) = {}, Uargs(dfs^#) = {},
Uargs(dfs#1^#) = {}, Uargs(dfs#2^#) = {}, Uargs(dfs#3^#) = {},
Uargs(dodfs^#) = {}, Uargs(#and^#) = {}, Uargs(c_1) = {},
Uargs(c_2) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA) and not(IDA(1)).
[#equal](x1, x2) = [3]
[3]
[#eq](x1, x2) = [3]
[3]
[appendreverse](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [0]
[appendreverse#1](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [0]
[::](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [1]
[nil] = [0]
[0]
[bfs](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [0
1] x3 + [1]
[3 1] [3 2] [0
0] [1]
[bfs#1](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [0
1] x3 + [1]
[3 1] [3 2] [0
0] [1]
[bfs#3](x1, x2, x3, x4) = [1 0] x1 + [1 0] x2 + [1
0] x3 + [0 1] x4 + [1]
[3 1] [3 2] [3
1] [0 0] [0]
[bfs#2](x1, x2) = [1 0] x1 + [0 1] x2 + [1]
[3 2] [0 0] [1]
[reverse](x1) = [1 0] x1 + [0]
[0 1] [1]
[leaf] = [1]
[1]
[node](x1, x2, x3) = [0 0] x1 + [1 1] x2 + [1
1] x3 + [3]
[1 1] [0 0] [0
0] [2]
[bfs#4](x1, x2, x3, x4, x5, x6, x7) = [1 0] x1 + [1 0] x2 + [1
1] x3 + [1 1] x4 + [1
0] x5 + [0
1] x6 + [0
0] x7 + [0]
[0 2] [3 2] [3
3] [3 2] [3
1] [0
0] [1
1] [1]
[#false] = [2]
[3]
[#true] = [3]
[3]
[dobfs](x1, x2) = [1 0] x1 + [0 1] x2 + [1]
[3 1] [0 0] [3]
[#and](x1, x2) = [0 1] x1 + [0]
[0 0] [3]
[#0] = [0]
[0]
[#neg](x1) = [1 0] x1 + [0]
[0 1] [2]
[#pos](x1) = [1 0] x1 + [0]
[0 1] [0]
[#s](x1) = [1 0] x1 + [0]
[0 1] [0]
[#equal^#](x1, x2) = [0]
[0]
[#eq^#](x1, x2) = [0]
[0]
[appendreverse^#](x1, x2) = [0]
[0]
[appendreverse#1^#](x1, x2) = [0]
[0]
[bfs^#](x1, x2, x3) = [1 0] x1 + [1 1] x2 + [0]
[0 0] [0 0] [0]
[bfs#1^#](x1, x2, x3) = [1 0] x1 + [1 1] x2 + [0]
[0 0] [0 0] [0]
[bfs#3^#](x1, x2, x3, x4) = [1 0] x1 + [1 1] x2 + [1
0] x3 + [0]
[0 0] [0 0] [0
0] [0]
[bfs#2^#](x1, x2) = [1 1] x1 + [0]
[0 0] [0]
[bfs#4^#](x1, x2, x3, x4, x5, x6, x7) = [1 1] x2 + [1 1] x3 + [1
1] x4 + [1 0] x5 + [2]
[0 0] [0 0] [0
0] [0 0] [0]
[reverse^#](x1) = [0]
[0]
[bfs2^#](x1, x2) = [3 3] x1 + [3 3] x2 + [3]
[3 3] [3 3] [3]
[bfs2#1^#](x1, x2) = [1 0] x1 + [0]
[0 1] [0]
[dobfs^#](x1, x2) = [1 0] x1 + [0]
[0 0] [0]
[dfs^#](x1, x2) = [0]
[0]
[dfs#1^#](x1, x2) = [0]
[0]
[dfs#2^#](x1, x2, x3, x4) = [0]
[0]
[dfs#3^#](x1, x2, x3, x4, x5, x6) = [0]
[0]
[dodfs^#](x1, x2) = [0]
[0]
[#and^#](x1, x2) = [0]
[0]
[c_1](x1, x2) = [0]
[0]
[c_2](x1, x2) = [0]
[0]
[c] = [0]
[0]
[c_1](x1, x2) = [2 0] x1 + [1 0] x2 + [0]
[0 0] [0 0] [2]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [3]
[3]
>= [3]
[3]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [3]
[3]
>= [3]
[3]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(::(@x_1, @x_2), leaf())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(nil(), nil())] = [3]
[3]
>= [3]
[3]
= [#true()]
[#eq(nil(), leaf())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(nil(), node(@y_1, @y_2, @y_3))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(leaf(), ::(@y_1, @y_2))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(leaf(), nil())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(leaf(), leaf())] = [3]
[3]
>= [3]
[3]
= [#true()]
[#eq(leaf(), node(@y_1, @y_2, @y_3))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), nil())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), leaf())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3))] = [3]
[3]
>= [3]
[3]
= [#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))]
[#eq(#0(), #0())] = [3]
[3]
>= [3]
[3]
= [#true()]
[#eq(#0(), #neg(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#0(), #pos(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#0(), #s(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#neg(@x), #0())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [3]
[3]
>= [3]
[3]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#pos(@x), #0())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [3]
[3]
>= [3]
[3]
= [#eq(@x, @y)]
[#eq(#s(@x), #0())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#s(@x), #s(@y))] = [3]
[3]
>= [3]
[3]
= [#eq(@x, @y)]
[appendreverse(@toreverse, @sofar)] = [1 0] @sofar + [1 0] @toreverse + [0]
[0 1] [0 1] [0]
>= [1 0] @sofar + [1 0] @toreverse + [0]
[0 1] [0 1] [0]
= [appendreverse#1(@toreverse, @sofar)]
[appendreverse#1(::(@a, @as), @sofar)] = [1 0] @a + [1 0] @as + [1 0] @sofar + [0]
[0 1] [0 1] [0 1] [1]
>= [1 0] @a + [1 0] @as + [1 0] @sofar + [0]
[0 1] [0 1] [0 1] [1]
= [appendreverse(@as, ::(@a, @sofar))]
[appendreverse#1(nil(), @sofar)] = [1 0] @sofar + [0]
[0 1] [0]
>= [1 0] @sofar + [0]
[0 1] [0]
= [@sofar]
[bfs(@queue, @futurequeue, @x)] = [1 0] @futurequeue + [1 0] @queue + [0 1] @x + [1]
[3 2] [3 1] [0 0] [1]
>= [1 0] @futurequeue + [1 0] @queue + [0 1] @x + [1]
[3 2] [3 1] [0 0] [1]
= [bfs#1(@queue, @futurequeue, @x)]
[bfs#1(::(@t, @ts), @futurequeue, @x)] = [1 0] @futurequeue + [1 0] @t + [1 0] @ts + [0 1] @x + [1]
[3 2] [3 1] [3 1] [0 0] [2]
>= [1 0] @futurequeue + [1 0] @t + [1 0] @ts + [0 1] @x + [1]
[3 2] [3 1] [3 1] [0 0] [0]
= [bfs#3(@t, @futurequeue, @ts, @x)]
[bfs#1(nil(), @futurequeue, @x)] = [1 0] @futurequeue + [0 1] @x + [1]
[3 2] [0 0] [1]
>= [1 0] @futurequeue + [0 1] @x + [1]
[3 2] [0 0] [1]
= [bfs#2(@futurequeue, @x)]
[bfs#3(leaf(), @futurequeue, @ts, @x)] = [1 0] @futurequeue + [1 0] @ts + [0 1] @x + [2]
[3 2] [3 1] [0 0] [4]
> [1 0] @futurequeue + [1 0] @ts + [0 1] @x + [1]
[3 2] [3 1] [0 0] [1]
= [bfs(@ts, @futurequeue, @x)]
[bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0
1] @x + [0 0] @y + [4]
[3 2] [3 3] [3 3] [3 1] [0
0] [1 1] [11]
> [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0
1] @x + [0 0] @y + [3]
[3 2] [3 3] [3 2] [3 1] [0
0] [1 1] [7]
= [bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)]
[bfs#2(::(@t, @ts), @x)] = [1 0] @t + [1 0] @ts + [0 1] @x + [1]
[3 2] [3 2] [0 0] [3]
>= [1 0] @t + [1 0] @ts + [0 1] @x + [1]
[3 1] [3 1] [0 0] [3]
= [bfs(reverse(::(@t, @ts)), nil(), @x)]
[bfs#2(nil(), @x)] = [0 1] @x + [1]
[0 0] [1]
>= [1]
[1]
= [leaf()]
[reverse(@xs)] = [1 0] @xs + [0]
[0 1] [1]
>= [1 0] @xs + [0]
[0 1] [0]
= [appendreverse(@xs, nil())]
[bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0
1] @x + [0 0] @y + [2]
[3 2] [3 3] [3 2] [3 1] [0
0] [1 1] [7]
> [1 0] @futurequeue + [1 0] @t1 + [1 0] @t2 + [1 0] @ts + [0
1] @x + [1]
[3 2] [3 2] [3 2] [3 1] [0
0] [5]
= [bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)]
[bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0
1] @x + [0 0] @y + [3]
[3 2] [3 3] [3 2] [3 1] [0
0] [1 1] [7]
>= [1 1] @t1 + [1 1] @t2 + [0 0] @y + [3]
[0 0] [0 0] [1 1] [2]
= [node(@y, @t1, @t2)]
[dobfs(@t, @x)] = [1 0] @t + [0 1] @x + [1]
[3 1] [0 0] [3]
>= [1 0] @t + [0 1] @x + [1]
[3 1] [0 0] [2]
= [bfs(::(@t, nil()), nil(), @x)]
[#and(#false(), #false())] = [3]
[3]
> [2]
[3]
= [#false()]
[#and(#false(), #true())] = [3]
[3]
> [2]
[3]
= [#false()]
[#and(#true(), #false())] = [3]
[3]
> [2]
[3]
= [#false()]
[#and(#true(), #true())] = [3]
[3]
>= [3]
[3]
= [#true()]
[bfs^#(@queue, @futurequeue, @x)] = [1 1] @futurequeue + [1 0] @queue + [0]
[0 0] [0 0] [0]
>= [1 1] @futurequeue + [1 0] @queue + [0]
[0 0] [0 0] [0]
= [bfs#1^#(@queue, @futurequeue, @x)]
[bfs#1^#(::(@t, @ts), @futurequeue, @x)] = [1 1] @futurequeue + [1 0] @t + [1 0] @ts + [0]
[0 0] [0 0] [0 0] [0]
>= [1 1] @futurequeue + [1 0] @t + [1 0] @ts + [0]
[0 0] [0 0] [0 0] [0]
= [bfs#3^#(@t, @futurequeue, @ts, @x)]
[bfs#1^#(nil(), @futurequeue, @x)] = [1 1] @futurequeue + [0]
[0 0] [0]
>= [1 1] @futurequeue + [0]
[0 0] [0]
= [bfs#2^#(@futurequeue, @x)]
[bfs#3^#(leaf(), @futurequeue, @ts, @x)] = [1 1] @futurequeue + [1 0] @ts + [1]
[0 0] [0 0] [0]
> [1 1] @futurequeue + [1 0] @ts + [0]
[0 0] [0 0] [0]
= [bfs^#(@ts, @futurequeue, @x)]
[bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x)] = [1 1] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [3]
[0 0] [0 0] [0 0] [0 0] [0]
> [1 1] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [2]
[0 0] [0 0] [0 0] [0 0] [0]
= [bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)]
[bfs#2^#(::(@t, @ts), @x)] = [1 1] @t + [1 1] @ts + [1]
[0 0] [0 0] [0]
> [1 0] @t + [1 0] @ts + [0]
[0 0] [0 0] [0]
= [bfs^#(reverse(::(@t, @ts)), nil(), @x)]
[bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 1] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [2]
[0 0] [0 0] [0 0] [0 0] [0]
>= [1 1] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [2]
[0 0] [0 0] [0 0] [0 0] [0]
= [bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)]
[bfs2^#(@t, @x)] = [3 3] @t + [3 3] @x + [3]
[3 3] [3 3] [3]
> [3 0] @t + [0 2] @x + [2]
[0 0] [0 0] [2]
= [c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))]
[bfs2#1^#(@t', @x)] = [1 0] @t' + [0]
[0 1] [0]
>= [1 0] @t' + [0]
[0 0] [0]
= [dobfs^#(@t', @x)]
[dobfs^#(@t, @x)] = [1 0] @t + [0]
[0 0] [0]
>= [1 0] @t + [0]
[0 0] [0]
= [bfs^#(::(@t, nil()), nil(), @x)]
Processor 'matrix interpretation of dimension 2' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{4,5,6,8}. Here rules are labeled according to the (estimated)
dependency graph
1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :3
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :2
2: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :5
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
3: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x) :6
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :7
6: bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
8: bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :9
9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
- The rules {4,5,6,8} have known complexity. These cover all
predecessors of {7,9}, their complexity is equally bounded.
- The rules {4,5,6,7,8,9} have known complexity. These cover all
predecessors of {10}, their complexity is equally bounded.
- The rules {4,5,6,7,8,9,10} have known complexity. These cover all
predecessors of {1}, their complexity is equally bounded.
- The rules {1,4,5,6,7,8,9,10} have known complexity. These cover
all predecessors of {2,3}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7,8,9,10} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{8} Weak SCC
|
|->2:{9} Weak SCC
| |
| `->3:{10} Weak SCC
| |
| `->4:{1,7,5,2,6,3,4} Weak SCC
|
`->3:{10} Weak SCC
|
`->4:{1,7,5,2,6,3,4} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, 2: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 3: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 6: bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, 7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 8: bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 8: bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, 1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, 7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 2: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 6: bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, 3: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#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
* Path 3:{11}->5:{13}->6:{3,9,7,4,8,5,6}->7:{10}->8:{1,2}: subsumed
-----------------------------------------------------------------
This path is subsumed by the proof of paths 3:{11}->4:{12}->5:{13}->6:{3,9,7,4,8,5,6}->7:{10}->8:{1,2}.
* Path 1:{19}->2:{14,18,17,15,16}: YES(O(1),O(n^1))
-------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :4
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :3
3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :5
5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :4
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :3
3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :6
5: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
6: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :5
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :3
3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
5: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :6
6: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :5
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :4
3: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
5: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :6
6: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :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:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :3
2: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
3: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :5
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :4
4: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
5: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :6
6: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) }
Weak DPs:
{ dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) }
Weak DPs:
{ dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#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:
{ 2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, 5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Trs: { #equal(@x, @y) -> #eq(@x, @y) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(::) = {},
Uargs(node) = {}, Uargs(#and) = {}, Uargs(#neg) = {},
Uargs(#pos) = {}, Uargs(#s) = {}, Uargs(#equal^#) = {},
Uargs(#eq^#) = {}, Uargs(appendreverse^#) = {},
Uargs(appendreverse#1^#) = {}, Uargs(bfs^#) = {},
Uargs(bfs#1^#) = {}, Uargs(bfs#3^#) = {}, Uargs(bfs#2^#) = {},
Uargs(bfs#4^#) = {}, Uargs(reverse^#) = {}, Uargs(bfs2^#) = {},
Uargs(bfs2#1^#) = {}, Uargs(dobfs^#) = {}, Uargs(dfs^#) = {},
Uargs(dfs#1^#) = {}, Uargs(dfs#2^#) = {}, Uargs(dfs#3^#) = {},
Uargs(dodfs^#) = {}, Uargs(#and^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#equal](x1, x2) = [2] x1 + [2] x2 + [2]
[#eq](x1, x2) = [0]
[::](x1, x2) = [1] x1 + [1] x2 + [1]
[nil] = [0]
[leaf] = [2]
[node](x1, x2, x3) = [1] x1 + [1] x2 + [1] x3 + [3]
[#false] = [0]
[#true] = [0]
[#and](x1, x2) = [0]
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[appendreverse^#](x1, x2) = [0]
[appendreverse#1^#](x1, x2) = [0]
[bfs^#](x1, x2, x3) = [0]
[bfs#1^#](x1, x2, x3) = [0]
[bfs#3^#](x1, x2, x3, x4) = [0]
[bfs#2^#](x1, x2) = [0]
[bfs#4^#](x1, x2, x3, x4, x5, x6, x7) = [0]
[reverse^#](x1) = [0]
[bfs2^#](x1, x2) = [0]
[bfs2#1^#](x1, x2) = [0]
[dobfs^#](x1, x2) = [0]
[dfs^#](x1, x2) = [1] x1 + [0]
[dfs#1^#](x1, x2) = [1] x1 + [0]
[dfs#2^#](x1, x2, x3, x4) = [1] x1 + [1] x3 + [0]
[dfs#3^#](x1, x2, x3, x4, x5, x6) = [1] x3 + [1] x4 + [1] x5 + [3]
[dodfs^#](x1, x2) = [3] x1 + [3] x2 + [3]
[#and^#](x1, x2) = [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [2] @x + [2] @y + [2]
> [0]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0]
>= [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [0]
>= [0]
= [#false()]
[#eq(::(@x_1, @x_2), leaf())] = [0]
>= [0]
= [#false()]
[#eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3))] = [0]
>= [0]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(nil(), nil())] = [0]
>= [0]
= [#true()]
[#eq(nil(), leaf())] = [0]
>= [0]
= [#false()]
[#eq(nil(), node(@y_1, @y_2, @y_3))] = [0]
>= [0]
= [#false()]
[#eq(leaf(), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(leaf(), nil())] = [0]
>= [0]
= [#false()]
[#eq(leaf(), leaf())] = [0]
>= [0]
= [#true()]
[#eq(leaf(), node(@y_1, @y_2, @y_3))] = [0]
>= [0]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), nil())] = [0]
>= [0]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), leaf())] = [0]
>= [0]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3))] = [0]
>= [0]
= [#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))]
[#eq(#0(), #0())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #s(@y))] = [0]
>= [0]
= [#false()]
[#eq(#neg(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#eq(#s(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#s(@x), #s(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#and(#false(), #false())] = [0]
>= [0]
= [#false()]
[#and(#false(), #true())] = [0]
>= [0]
= [#false()]
[#and(#true(), #false())] = [0]
>= [0]
= [#false()]
[#and(#true(), #true())] = [0]
>= [0]
= [#true()]
[dfs^#(@queue, @x)] = [1] @queue + [0]
>= [1] @queue + [0]
= [dfs#1^#(@queue, @x)]
[dfs#1^#(::(@t, @ts), @x)] = [1] @t + [1] @ts + [1]
> [1] @t + [1] @ts + [0]
= [dfs#2^#(@t, @t, @ts, @x)]
[dfs#2^#(leaf(), @t, @ts, @x)] = [1] @ts + [2]
> [1] @ts + [0]
= [dfs^#(@ts, @x)]
[dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x)] = [1] @a + [1] @t1 + [1] @t2 + [1] @ts + [3]
>= [1] @t1 + [1] @t2 + [1] @ts + [3]
= [dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)]
[dfs#3^#(#false(), @t, @t1, @t2, @ts, @x)] = [1] @t1 + [1] @t2 + [1] @ts + [3]
> [1] @t1 + [1] @t2 + [1] @ts + [2]
= [dfs^#(::(@t1, ::(@t2, @ts)), @x)]
[dodfs^#(@t, @x)] = [3] @t + [3] @x + [3]
> [1] @t + [1]
= [dfs^#(::(@t, nil()), @x)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{2,3,5,6}. Here rules are labeled according to the (estimated)
dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :4
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :3
3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :5
5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
- The rules {2,3,5,6} have known complexity. These cover all
predecessors of {1,4}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{6} Weak SCC
|
`->2:{1,5,4,2,3} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, 2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, 4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, 5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
, 1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, 5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, 2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#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(n^1))
tct-popstar
Execution Time (secs) | 9.253 |
Answer | YES(?,O(n^1)) |
Input | bfs.raml |
YES(?,O(n^1))
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict Trs:
{ #equal(@x, @y) -> #eq(@x, @y)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We add following dependency tuples
Strict DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, appendreverse#1^#(nil(), @sofar) -> c_4()
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, bfs#2^#(nil(), @x) -> c_11()
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) -> c_14()
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#1^#(nil(), @x) -> c_20()
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#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_27()
, #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, #eq^#(nil(), nil()) -> c_31()
, #eq^#(nil(), leaf()) -> c_32()
, #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, #eq^#(leaf(), nil()) -> c_35()
, #eq^#(leaf(), leaf()) -> c_36()
, #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, #eq^#(#0(), #0()) -> c_42()
, #eq^#(#0(), #neg(@y)) -> c_43()
, #eq^#(#0(), #pos(@y)) -> c_44()
, #eq^#(#0(), #s(@y)) -> c_45()
, #eq^#(#neg(@x), #0()) -> c_46()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_48()
, #eq^#(#pos(@x), #0()) -> c_49()
, #eq^#(#pos(@x), #neg(@y)) -> c_50()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_52()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #and^#(#false(), #false()) -> c_54()
, #and^#(#false(), #true()) -> c_55()
, #and^#(#true(), #false()) -> c_56()
, #and^#(#true(), #true()) -> c_57() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, appendreverse#1^#(nil(), @sofar) -> c_4()
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, bfs#2^#(nil(), @x) -> c_11()
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) -> c_14()
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#1^#(nil(), @x) -> c_20()
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#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_27()
, #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, #eq^#(nil(), nil()) -> c_31()
, #eq^#(nil(), leaf()) -> c_32()
, #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, #eq^#(leaf(), nil()) -> c_35()
, #eq^#(leaf(), leaf()) -> c_36()
, #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, #eq^#(#0(), #0()) -> c_42()
, #eq^#(#0(), #neg(@y)) -> c_43()
, #eq^#(#0(), #pos(@y)) -> c_44()
, #eq^#(#0(), #s(@y)) -> c_45()
, #eq^#(#neg(@x), #0()) -> c_46()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_48()
, #eq^#(#pos(@x), #0()) -> c_49()
, #eq^#(#pos(@x), #neg(@y)) -> c_50()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_52()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, #and^#(#false(), #false()) -> c_54()
, #and^#(#false(), #true()) -> c_55()
, #and^#(#true(), #false()) -> c_56()
, #and^#(#true(), #true()) -> c_57() }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We consider the (estimated) dependency graph
1: #equal^#(@x, @y) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_1 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
-->_1 #eq^#(#s(@x), #0()) -> c_52() :52
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_1 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_1 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_1 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_1 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_1 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #0()) -> c_42() :42
-->_1 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_1 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_1 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_1 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_1 #eq^#(leaf(), leaf()) -> c_36() :36
-->_1 #eq^#(leaf(), nil()) -> c_35() :35
-->_1 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_1 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_1 #eq^#(nil(), leaf()) -> c_32() :32
-->_1 #eq^#(nil(), nil()) -> c_31() :31
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_1 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_1 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
2: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :3
-->_1 appendreverse#1^#(nil(), @sofar) -> c_4() :4
3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :2
4: appendreverse#1^#(nil(), @sofar) -> c_4()
5: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :7
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :6
6: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y)) :9
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :8
7: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :10
-->_1 bfs#2^#(nil(), @x) -> c_11() :11
8: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :5
9: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
-->_1 bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
c_14() :13
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :1
10: bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :14
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :5
11: bfs#2^#(nil(), @x) -> c_11()
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :5
13: bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) -> c_14()
14: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :2
15: bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :17
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :16
16: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :17
17: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :5
18: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :19
-->_1 dfs#1^#(nil(), @x) -> c_20() :20
19: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x)) :22
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :21
20: dfs#1^#(nil(), @x) -> c_20()
21: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :18
22: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :23
-->_1 dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24() :24
-->_2 #equal^#(@x, @y) -> #eq^#(@x, @y) :1
23: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :18
24: dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
25: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :18
26: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#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) :53
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_3 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_3 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_3 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_2 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #and^#(#true(), #true()) -> c_57() :57
-->_1 #and^#(#true(), #false()) -> c_56() :56
-->_1 #and^#(#false(), #true()) -> c_55() :55
-->_1 #and^#(#false(), #false()) -> c_54() :54
-->_3 #eq^#(#s(@x), #0()) -> c_52() :52
-->_2 #eq^#(#s(@x), #0()) -> c_52() :52
-->_3 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_3 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_2 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_3 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_3 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_2 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_3 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_2 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_3 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_2 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_3 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_2 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_3 #eq^#(#0(), #0()) -> c_42() :42
-->_2 #eq^#(#0(), #0()) -> c_42() :42
-->_3 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_2 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_3 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_2 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_3 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_2 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_3 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_2 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_3 #eq^#(leaf(), leaf()) -> c_36() :36
-->_2 #eq^#(leaf(), leaf()) -> c_36() :36
-->_3 #eq^#(leaf(), nil()) -> c_35() :35
-->_2 #eq^#(leaf(), nil()) -> c_35() :35
-->_3 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_2 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_3 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_2 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_3 #eq^#(nil(), leaf()) -> c_32() :32
-->_2 #eq^#(nil(), leaf()) -> c_32() :32
-->_3 #eq^#(nil(), nil()) -> c_31() :31
-->_2 #eq^#(nil(), nil()) -> c_31() :31
-->_3 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_3 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_2 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_3 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_2 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_3 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_3 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
27: #eq^#(::(@x_1, @x_2), nil()) -> c_27()
28: #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
29: #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
30: #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
31: #eq^#(nil(), nil()) -> c_31()
32: #eq^#(nil(), leaf()) -> c_32()
33: #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
34: #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
35: #eq^#(leaf(), nil()) -> c_35()
36: #eq^#(leaf(), leaf()) -> c_36()
37: #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
38: #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
39: #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
40: #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
41: #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
-->_5 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_4 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_2 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_5 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_4 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_2 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_5 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_4 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_2 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_3 #and^#(#true(), #true()) -> c_57() :57
-->_1 #and^#(#true(), #true()) -> c_57() :57
-->_3 #and^#(#true(), #false()) -> c_56() :56
-->_1 #and^#(#true(), #false()) -> c_56() :56
-->_3 #and^#(#false(), #true()) -> c_55() :55
-->_1 #and^#(#false(), #true()) -> c_55() :55
-->_3 #and^#(#false(), #false()) -> c_54() :54
-->_1 #and^#(#false(), #false()) -> c_54() :54
-->_5 #eq^#(#s(@x), #0()) -> c_52() :52
-->_4 #eq^#(#s(@x), #0()) -> c_52() :52
-->_2 #eq^#(#s(@x), #0()) -> c_52() :52
-->_5 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_4 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_2 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_5 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_4 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_2 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_5 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_4 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_2 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_5 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_4 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_2 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_5 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_4 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_2 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_5 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_4 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_2 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_5 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_4 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_2 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_5 #eq^#(#0(), #0()) -> c_42() :42
-->_4 #eq^#(#0(), #0()) -> c_42() :42
-->_2 #eq^#(#0(), #0()) -> c_42() :42
-->_5 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_4 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_2 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_5 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_4 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_2 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_5 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_4 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_2 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_5 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_4 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_2 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_5 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_4 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_2 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_5 #eq^#(leaf(), leaf()) -> c_36() :36
-->_4 #eq^#(leaf(), leaf()) -> c_36() :36
-->_2 #eq^#(leaf(), leaf()) -> c_36() :36
-->_5 #eq^#(leaf(), nil()) -> c_35() :35
-->_4 #eq^#(leaf(), nil()) -> c_35() :35
-->_2 #eq^#(leaf(), nil()) -> c_35() :35
-->_5 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_4 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_2 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_5 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_4 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_2 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_5 #eq^#(nil(), leaf()) -> c_32() :32
-->_4 #eq^#(nil(), leaf()) -> c_32() :32
-->_2 #eq^#(nil(), leaf()) -> c_32() :32
-->_5 #eq^#(nil(), nil()) -> c_31() :31
-->_4 #eq^#(nil(), nil()) -> c_31() :31
-->_2 #eq^#(nil(), nil()) -> c_31() :31
-->_5 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_4 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_2 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_5 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_4 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_2 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_5 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_4 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_2 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_5 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_4 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_2 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_5 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
-->_4 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
-->_2 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
42: #eq^#(#0(), #0()) -> c_42()
43: #eq^#(#0(), #neg(@y)) -> c_43()
44: #eq^#(#0(), #pos(@y)) -> c_44()
45: #eq^#(#0(), #s(@y)) -> c_45()
46: #eq^#(#neg(@x), #0()) -> c_46()
47: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#s(@x), #0()) -> c_52() :52
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_1 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_1 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_1 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_1 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_1 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #0()) -> c_42() :42
-->_1 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_1 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_1 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_1 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_1 #eq^#(leaf(), leaf()) -> c_36() :36
-->_1 #eq^#(leaf(), nil()) -> c_35() :35
-->_1 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_1 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_1 #eq^#(nil(), leaf()) -> c_32() :32
-->_1 #eq^#(nil(), nil()) -> c_31() :31
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_1 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_1 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
48: #eq^#(#neg(@x), #pos(@y)) -> c_48()
49: #eq^#(#pos(@x), #0()) -> c_49()
50: #eq^#(#pos(@x), #neg(@y)) -> c_50()
51: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_1 #eq^#(#s(@x), #0()) -> c_52() :52
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_1 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_1 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_1 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_1 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_1 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #0()) -> c_42() :42
-->_1 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_1 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_1 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_1 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_1 #eq^#(leaf(), leaf()) -> c_36() :36
-->_1 #eq^#(leaf(), nil()) -> c_35() :35
-->_1 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_1 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_1 #eq^#(nil(), leaf()) -> c_32() :32
-->_1 #eq^#(nil(), nil()) -> c_31() :31
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_1 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_1 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
52: #eq^#(#s(@x), #0()) -> c_52()
53: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
-->_1 #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y) :53
-->_1 #eq^#(#s(@x), #0()) -> c_52() :52
-->_1 #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y) :51
-->_1 #eq^#(#pos(@x), #neg(@y)) -> c_50() :50
-->_1 #eq^#(#pos(@x), #0()) -> c_49() :49
-->_1 #eq^#(#neg(@x), #pos(@y)) -> c_48() :48
-->_1 #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y) :47
-->_1 #eq^#(#neg(@x), #0()) -> c_46() :46
-->_1 #eq^#(#0(), #s(@y)) -> c_45() :45
-->_1 #eq^#(#0(), #pos(@y)) -> c_44() :44
-->_1 #eq^#(#0(), #neg(@y)) -> c_43() :43
-->_1 #eq^#(#0(), #0()) -> c_42() :42
-->_1 #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3)) :41
-->_1 #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40() :40
-->_1 #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39() :39
-->_1 #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38() :38
-->_1 #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37() :37
-->_1 #eq^#(leaf(), leaf()) -> c_36() :36
-->_1 #eq^#(leaf(), nil()) -> c_35() :35
-->_1 #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34() :34
-->_1 #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33() :33
-->_1 #eq^#(nil(), leaf()) -> c_32() :32
-->_1 #eq^#(nil(), nil()) -> c_31() :31
-->_1 #eq^#(nil(), ::(@y_1, @y_2)) -> c_30() :30
-->_1 #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29() :29
-->_1 #eq^#(::(@x_1, @x_2), leaf()) -> c_28() :28
-->_1 #eq^#(::(@x_1, @x_2), nil()) -> c_27() :27
-->_1 #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2)) :26
54: #and^#(#false(), #false()) -> c_54()
55: #and^#(#false(), #true()) -> c_55()
56: #and^#(#true(), #false()) -> c_56()
57: #and^#(#true(), #true()) -> c_57()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {20} and add Pre({20}) = {18} to the strict component.
- We remove {24} and add Pre({24}) = {22} to the strict component.
- We remove {13} and add Pre({13}) = {9} to the strict component.
- We remove {11} and add Pre({11}) = {7} to the strict component.
- We remove {4} and add Pre({4}) = {2} to the strict component.
- We remove {1} and add Pre({1}) = {22,9} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ #equal^#(@x, @y) -> #eq^#(@x, @y)
, #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#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_27()
, #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, #eq^#(nil(), nil()) -> c_31()
, #eq^#(nil(), leaf()) -> c_32()
, #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, #eq^#(leaf(), nil()) -> c_35()
, #eq^#(leaf(), leaf()) -> c_36()
, #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, #eq^#(#0(), #0()) -> c_42()
, #eq^#(#0(), #neg(@y)) -> c_43()
, #eq^#(#0(), #pos(@y)) -> c_44()
, #eq^#(#0(), #s(@y)) -> c_45()
, #eq^#(#neg(@x), #0()) -> c_46()
, #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, #eq^#(#neg(@x), #pos(@y)) -> c_48()
, #eq^#(#pos(@x), #0()) -> c_49()
, #eq^#(#pos(@x), #neg(@y)) -> c_50()
, #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, #eq^#(#s(@x), #0()) -> c_52()
, #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, appendreverse#1^#(nil(), @sofar) -> c_4()
, bfs#2^#(nil(), @x) -> c_11()
, bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) -> c_14()
, dfs#1^#(nil(), @x) -> c_20()
, dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, #and^#(#false(), #false()) -> c_54()
, #and^#(#false(), #true()) -> c_55()
, #and^#(#true(), #false()) -> c_56()
, #and^#(#true(), #true()) -> c_57() }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We consider the the dependency graph
->5:{11}
|
|->6:{12}
| |
| `->7:{13}
| |
| `->8:{3,9,7,4,8,5,6}
| |
| |->40:{10}
| | |
| | `->41:{1,2}
| | |
| | `->42:{49} Weak SCC
| |
| |->10:{20} Weak SCC
| | |
| | |->12:{22} Weak SCC
| | |
| | |->13:{23} Weak SCC
| | |
| | |->14:{24} Weak SCC
| | |
| | |->15:{25} Weak SCC
| | |
| | |->16:{26} Weak SCC
| | |
| | |->17:{27} Weak SCC
| | |
| | |->18:{28} Weak SCC
| | |
| | |->19:{29} Weak SCC
| | |
| | |->20:{30} Weak SCC
| | |
| | |->21:{31} Weak SCC
| | |
| | |->22:{32} Weak SCC
| | |
| | |->23:{33} Weak SCC
| | |
| | |->24:{34} Weak SCC
| | |
| | |->25:{35} Weak SCC
| | |
| | |->30:{37} Weak SCC
| | |
| | |->31:{38} Weak SCC
| | |
| | |->32:{39} Weak SCC
| | |
| | |->33:{40} Weak SCC
| | |
| | |->34:{41} Weak SCC
| | |
| | |->35:{43} Weak SCC
| | |
| | |->36:{44} Weak SCC
| | |
| | |->37:{45} Weak SCC
| | |
| | |->38:{47} Weak SCC
| | |
| | `->11:{48,46,42,36,21} Weak SCC
| | |
| | |->12:{22} Weak SCC
| | |
| | |->13:{23} Weak SCC
| | |
| | |->14:{24} Weak SCC
| | |
| | |->15:{25} Weak SCC
| | |
| | |->16:{26} Weak SCC
| | |
| | |->17:{27} Weak SCC
| | |
| | |->18:{28} Weak SCC
| | |
| | |->19:{29} Weak SCC
| | |
| | |->20:{30} Weak SCC
| | |
| | |->21:{31} Weak SCC
| | |
| | |->22:{32} Weak SCC
| | |
| | |->23:{33} Weak SCC
| | |
| | |->24:{34} Weak SCC
| | |
| | |->25:{35} Weak SCC
| | |
| | |->30:{37} Weak SCC
| | |
| | |->31:{38} Weak SCC
| | |
| | |->32:{39} Weak SCC
| | |
| | |->33:{40} Weak SCC
| | |
| | |->34:{41} Weak SCC
| | |
| | |->35:{43} Weak SCC
| | |
| | |->36:{44} Weak SCC
| | |
| | |->37:{45} Weak SCC
| | |
| | |->38:{47} Weak SCC
| | |
| | |->26:{54} Weak SCC
| | |
| | |->27:{55} Weak SCC
| | |
| | |->28:{56} Weak SCC
| | |
| | `->29:{57} Weak SCC
| |
| |->39:{50} Weak SCC
| |
| `->9:{51} Weak SCC
|
`->7:{13}
|
`->8:{3,9,7,4,8,5,6}
|
|->40:{10}
| |
| `->41:{1,2}
| |
| `->42:{49} Weak SCC
|
|->10:{20} Weak SCC
| |
| |->12:{22} Weak SCC
| |
| |->13:{23} Weak SCC
| |
| |->14:{24} Weak SCC
| |
| |->15:{25} Weak SCC
| |
| |->16:{26} Weak SCC
| |
| |->17:{27} Weak SCC
| |
| |->18:{28} Weak SCC
| |
| |->19:{29} Weak SCC
| |
| |->20:{30} Weak SCC
| |
| |->21:{31} Weak SCC
| |
| |->22:{32} Weak SCC
| |
| |->23:{33} Weak SCC
| |
| |->24:{34} Weak SCC
| |
| |->25:{35} Weak SCC
| |
| |->30:{37} Weak SCC
| |
| |->31:{38} Weak SCC
| |
| |->32:{39} Weak SCC
| |
| |->33:{40} Weak SCC
| |
| |->34:{41} Weak SCC
| |
| |->35:{43} Weak SCC
| |
| |->36:{44} Weak SCC
| |
| |->37:{45} Weak SCC
| |
| |->38:{47} Weak SCC
| |
| `->11:{48,46,42,36,21} Weak SCC
| |
| |->12:{22} Weak SCC
| |
| |->13:{23} Weak SCC
| |
| |->14:{24} Weak SCC
| |
| |->15:{25} Weak SCC
| |
| |->16:{26} Weak SCC
| |
| |->17:{27} Weak SCC
| |
| |->18:{28} Weak SCC
| |
| |->19:{29} Weak SCC
| |
| |->20:{30} Weak SCC
| |
| |->21:{31} Weak SCC
| |
| |->22:{32} Weak SCC
| |
| |->23:{33} Weak SCC
| |
| |->24:{34} Weak SCC
| |
| |->25:{35} Weak SCC
| |
| |->30:{37} Weak SCC
| |
| |->31:{38} Weak SCC
| |
| |->32:{39} Weak SCC
| |
| |->33:{40} Weak SCC
| |
| |->34:{41} Weak SCC
| |
| |->35:{43} Weak SCC
| |
| |->36:{44} Weak SCC
| |
| |->37:{45} Weak SCC
| |
| |->38:{47} Weak SCC
| |
| |->26:{54} Weak SCC
| |
| |->27:{55} Weak SCC
| |
| |->28:{56} Weak SCC
| |
| `->29:{57} Weak SCC
|
|->39:{50} Weak SCC
|
`->9:{51} Weak SCC
->1:{19}
|
`->2:{14,18,17,15,16}
|
|->10:{20} Weak SCC
| |
| |->12:{22} Weak SCC
| |
| |->13:{23} Weak SCC
| |
| |->14:{24} Weak SCC
| |
| |->15:{25} Weak SCC
| |
| |->16:{26} Weak SCC
| |
| |->17:{27} Weak SCC
| |
| |->18:{28} Weak SCC
| |
| |->19:{29} Weak SCC
| |
| |->20:{30} Weak SCC
| |
| |->21:{31} Weak SCC
| |
| |->22:{32} Weak SCC
| |
| |->23:{33} Weak SCC
| |
| |->24:{34} Weak SCC
| |
| |->25:{35} Weak SCC
| |
| |->30:{37} Weak SCC
| |
| |->31:{38} Weak SCC
| |
| |->32:{39} Weak SCC
| |
| |->33:{40} Weak SCC
| |
| |->34:{41} Weak SCC
| |
| |->35:{43} Weak SCC
| |
| |->36:{44} Weak SCC
| |
| |->37:{45} Weak SCC
| |
| |->38:{47} Weak SCC
| |
| `->11:{48,46,42,36,21} Weak SCC
| |
| |->12:{22} Weak SCC
| |
| |->13:{23} Weak SCC
| |
| |->14:{24} Weak SCC
| |
| |->15:{25} Weak SCC
| |
| |->16:{26} Weak SCC
| |
| |->17:{27} Weak SCC
| |
| |->18:{28} Weak SCC
| |
| |->19:{29} Weak SCC
| |
| |->20:{30} Weak SCC
| |
| |->21:{31} Weak SCC
| |
| |->22:{32} Weak SCC
| |
| |->23:{33} Weak SCC
| |
| |->24:{34} Weak SCC
| |
| |->25:{35} Weak SCC
| |
| |->30:{37} Weak SCC
| |
| |->31:{38} Weak SCC
| |
| |->32:{39} Weak SCC
| |
| |->33:{40} Weak SCC
| |
| |->34:{41} Weak SCC
| |
| |->35:{43} Weak SCC
| |
| |->36:{44} Weak SCC
| |
| |->37:{45} Weak SCC
| |
| |->38:{47} Weak SCC
| |
| |->26:{54} Weak SCC
| |
| |->27:{55} Weak SCC
| |
| |->28:{56} Weak SCC
| |
| `->29:{57} Weak SCC
|
|->3:{52} Weak SCC
|
`->4:{53} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, 2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, 3: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, 4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, 8: bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, 9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 11: bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, 14: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, 15: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 16: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, 17: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, 18: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 19: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ 20: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 21: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 22: #eq^#(::(@x_1, @x_2), nil()) -> c_27()
, 23: #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, 24: #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, 25: #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, 26: #eq^#(nil(), nil()) -> c_31()
, 27: #eq^#(nil(), leaf()) -> c_32()
, 28: #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, 29: #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, 30: #eq^#(leaf(), nil()) -> c_35()
, 31: #eq^#(leaf(), leaf()) -> c_36()
, 32: #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, 33: #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, 34: #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, 35: #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, 36: #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, 37: #eq^#(#0(), #0()) -> c_42()
, 38: #eq^#(#0(), #neg(@y)) -> c_43()
, 39: #eq^#(#0(), #pos(@y)) -> c_44()
, 40: #eq^#(#0(), #s(@y)) -> c_45()
, 41: #eq^#(#neg(@x), #0()) -> c_46()
, 42: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 43: #eq^#(#neg(@x), #pos(@y)) -> c_48()
, 44: #eq^#(#pos(@x), #0()) -> c_49()
, 45: #eq^#(#pos(@x), #neg(@y)) -> c_50()
, 46: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 47: #eq^#(#s(@x), #0()) -> c_52()
, 48: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 49: appendreverse#1^#(nil(), @sofar) -> c_4()
, 50: bfs#2^#(nil(), @x) -> c_11()
, 51: bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
c_14()
, 52: dfs#1^#(nil(), @x) -> c_20()
, 53: dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, 54: #and^#(#false(), #false()) -> c_54()
, 55: #and^#(#false(), #true()) -> c_55()
, 56: #and^#(#true(), #false()) -> c_56()
, 57: #and^#(#true(), #true()) -> c_57() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 52: dfs#1^#(nil(), @x) -> c_20()
, 53: dfs#3^#(#true(), @t, @t1, @t2, @ts, @x) -> c_24()
, 51: bfs#4^#(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
c_14()
, 20: #equal^#(@x, @y) -> #eq^#(@x, @y)
, 48: #eq^#(#s(@x), #s(@y)) -> #eq^#(@x, @y)
, 46: #eq^#(#pos(@x), #pos(@y)) -> #eq^#(@x, @y)
, 42: #eq^#(#neg(@x), #neg(@y)) -> #eq^#(@x, @y)
, 36: #eq^#(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
c_41(#and^#(#eq(@x_1, @y_1),
#and(#eq(@x_2, @y_2), #eq(@x_3, @y_3))),
#eq^#(@x_1, @y_1),
#and^#(#eq(@x_2, @y_2), #eq(@x_3, @y_3)),
#eq^#(@x_2, @y_2),
#eq^#(@x_3, @y_3))
, 21: #eq^#(::(@x_1, @x_2), ::(@y_1, @y_2)) ->
c_26(#and^#(#eq(@x_1, @y_1), #eq(@x_2, @y_2)),
#eq^#(@x_1, @y_1),
#eq^#(@x_2, @y_2))
, 22: #eq^#(::(@x_1, @x_2), nil()) -> c_27()
, 23: #eq^#(::(@x_1, @x_2), leaf()) -> c_28()
, 24: #eq^#(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> c_29()
, 25: #eq^#(nil(), ::(@y_1, @y_2)) -> c_30()
, 26: #eq^#(nil(), nil()) -> c_31()
, 27: #eq^#(nil(), leaf()) -> c_32()
, 28: #eq^#(nil(), node(@y_1, @y_2, @y_3)) -> c_33()
, 29: #eq^#(leaf(), ::(@y_1, @y_2)) -> c_34()
, 30: #eq^#(leaf(), nil()) -> c_35()
, 31: #eq^#(leaf(), leaf()) -> c_36()
, 32: #eq^#(leaf(), node(@y_1, @y_2, @y_3)) -> c_37()
, 33: #eq^#(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> c_38()
, 34: #eq^#(node(@x_1, @x_2, @x_3), nil()) -> c_39()
, 35: #eq^#(node(@x_1, @x_2, @x_3), leaf()) -> c_40()
, 54: #and^#(#false(), #false()) -> c_54()
, 55: #and^#(#false(), #true()) -> c_55()
, 56: #and^#(#true(), #false()) -> c_56()
, 57: #and^#(#true(), #true()) -> c_57()
, 37: #eq^#(#0(), #0()) -> c_42()
, 38: #eq^#(#0(), #neg(@y)) -> c_43()
, 39: #eq^#(#0(), #pos(@y)) -> c_44()
, 40: #eq^#(#0(), #s(@y)) -> c_45()
, 41: #eq^#(#neg(@x), #0()) -> c_46()
, 43: #eq^#(#neg(@x), #pos(@y)) -> c_48()
, 44: #eq^#(#pos(@x), #0()) -> c_49()
, 45: #eq^#(#pos(@x), #neg(@y)) -> c_50()
, 47: #eq^#(#s(@x), #0()) -> c_52()
, 50: bfs#2^#(nil(), @x) -> c_11()
, 49: appendreverse#1^#(nil(), @sofar) -> c_4() }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We consider the following dependency-graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :2
2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
3: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :5
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :4
4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y)) :7
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :6
5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :8
6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :9
8: bfs#2^#(::(@t, @ts), @x) ->
c_10(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :10
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: bfs2^#(@t, @x) ->
c_15(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :12
12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
14: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :15
15: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x)) :17
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :16
16: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :14
17: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x))
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :18
18: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :14
19: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :14
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
c_9(bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y),
#equal^#(@x, @y))
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
c_22(dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x),
#equal^#(@a, @x)) }
We are left with following problem, upon which TcT provides the
certificate YES(?,O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(?,O(n^1))
We employ 'linear path analysis' using the following approximated
dependency graph:
->3:{11} [ ? ]
|
|->4:{12} [ ? ]
| |
| `->5:{13} [ ? ]
| |
| `->6:{3,9,7,4,8,5,6} [ ? ]
| |
| `->7:{10} [ ? ]
| |
| `->8:{1,2} [ YES(O(1),O(n^1)) ]
|
`->5:{13} [ ? ]
|
`->6:{3,9,7,4,8,5,6} [ ? ]
|
`->7:{10} [ ? ]
|
`->8:{1,2} [ subsumed ]
->1:{19} [ ? ]
|
`->2:{14,18,17,15,16} [ YES(O(1),O(n^1)) ]
Here dependency-pairs are as follows:
Strict DPs:
{ 1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, 2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, 3: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, 4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 8: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, 9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 11: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, 14: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, 15: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 16: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, 17: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, 18: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 19: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
* Path 3:{11}->4:{12}->5:{13}->6:{3,9,7,4,8,5,6}->7:{10}->8:{1,2}: YES(O(1),O(n^1))
---------------------------------------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :2
2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
3: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :5
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :4
4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :7
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :6
5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :8
6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :9
8: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :10
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :3
10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :12
12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :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^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :13
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :4
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :6
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :5
4: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :7
5: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
6: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :8
7: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :9
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
10: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :12
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :11
11: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :12
12: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {9} and add Pre({9}) = {7} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :12
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :4
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :6
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :5
4: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :7
5: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
6: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :8
7: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :11
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :10
10: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :11
11: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :11
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :4
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :6
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :5
4: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :12
5: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
6: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :7
7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :9
9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
11: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
12: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :10
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :11
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :5
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :6
6: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
7: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :9
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :8
8: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :9
9: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :12
12: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :9
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :10
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :5
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
6: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :8
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :7
7: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :8
8: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
10: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :11
11: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :8
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :9
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :10
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
5: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :7
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :6
6: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :7
7: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
9: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :11
10: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
11: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :7
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :8
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :3
3: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :10
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :9
4: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :6
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :5
5: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :6
6: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
7: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
8: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :11
9: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
11: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :6
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :8
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :7
3: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :5
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :4
4: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :5
5: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
6: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
7: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :10
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :9
8: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :11
9: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :12
11: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4,3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :5
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :7
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :6
3: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :4
4: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
5: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
6: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :9
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :8
7: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :10
8: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :11
10: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :12
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
11: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
12: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :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^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :4
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :6
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :5
3: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :12
4: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
5: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :8
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :7
6: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :9
7: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
8: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :10
9: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :11
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
11: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 2' to
orient following rules strictly.
DPs:
{ 3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, 10: reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Trs:
{ bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(appendreverse) = {},
Uargs(appendreverse#1) = {}, Uargs(::) = {}, Uargs(bfs) = {},
Uargs(bfs#1) = {}, Uargs(bfs#3) = {}, Uargs(bfs#2) = {},
Uargs(reverse) = {}, Uargs(node) = {}, Uargs(bfs#4) = {},
Uargs(dobfs) = {}, Uargs(#and) = {}, Uargs(#neg) = {},
Uargs(#pos) = {}, Uargs(#s) = {}, Uargs(#equal^#) = {},
Uargs(#eq^#) = {}, Uargs(appendreverse^#) = {},
Uargs(appendreverse#1^#) = {}, Uargs(bfs^#) = {},
Uargs(bfs#1^#) = {}, Uargs(bfs#3^#) = {}, Uargs(bfs#2^#) = {},
Uargs(bfs#4^#) = {}, Uargs(reverse^#) = {}, Uargs(bfs2^#) = {},
Uargs(bfs2#1^#) = {}, Uargs(dobfs^#) = {}, Uargs(dfs^#) = {},
Uargs(dfs#1^#) = {}, Uargs(dfs#2^#) = {}, Uargs(dfs#3^#) = {},
Uargs(dodfs^#) = {}, Uargs(#and^#) = {}, Uargs(c_1) = {1, 2},
Uargs(c_2) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA) and not(IDA(1)).
[#equal](x1, x2) = [1]
[1]
[#eq](x1, x2) = [1]
[1]
[appendreverse](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [0]
[appendreverse#1](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [0]
[::](x1, x2) = [1 1] x1 + [1 0] x2 + [0]
[0 0] [0 1] [1]
[nil] = [0]
[0]
[bfs](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [0]
[1 0] [1 1] [1]
[bfs#1](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [0]
[1 0] [1 1] [1]
[bfs#3](x1, x2, x3, x4) = [1 1] x1 + [1 0] x2 + [1
0] x3 + [0]
[1 1] [1 1] [1
0] [1]
[bfs#2](x1, x2) = [1 0] x1 + [0]
[1 1] [0]
[reverse](x1) = [1 0] x1 + [0]
[0 1] [3]
[leaf] = [0]
[0]
[node](x1, x2, x3) = [1 1] x2 + [1 1] x3 + [2]
[0 0] [0 0] [2]
[bfs#4](x1, x2, x3, x4, x5, x6, x7) = [3 0] x1 + [1 0] x2 + [1
1] x3 + [1 1] x4 + [1
0] x5 + [0]
[0 1] [1 1] [1
1] [1 1] [1
0] [2]
[#false] = [1]
[1]
[#true] = [1]
[1]
[dobfs](x1, x2) = [1 1] x1 + [0 0] x2 + [0]
[1 1] [2 0] [1]
[#and](x1, x2) = [1]
[1]
[#0] = [0]
[2]
[#neg](x1) = [1 0] x1 + [3]
[0 0] [2]
[#pos](x1) = [1 0] x1 + [0]
[0 1] [2]
[#s](x1) = [0 1] x1 + [0]
[0 1] [0]
[#equal^#](x1, x2) = [0]
[0]
[#eq^#](x1, x2) = [0]
[0]
[appendreverse^#](x1, x2) = [0 1] x1 + [0]
[0 0] [0]
[appendreverse#1^#](x1, x2) = [0 1] x1 + [0]
[0 0] [0]
[bfs^#](x1, x2, x3) = [1 0] x1 + [1 2] x2 + [1]
[0 1] [0 0] [0]
[bfs#1^#](x1, x2, x3) = [1 0] x1 + [1 2] x2 + [1]
[0 1] [0 0] [0]
[bfs#3^#](x1, x2, x3, x4) = [1 1] x1 + [1 2] x2 + [1
0] x3 + [1]
[0 0] [0 0] [0
1] [0]
[bfs#2^#](x1, x2) = [1 2] x1 + [1]
[0 0] [0]
[bfs#4^#](x1, x2, x3, x4, x5, x6, x7) = [1 3] x1 + [1 2] x2 + [1
1] x3 + [1 1] x4 + [1
0] x5 + [1]
[0 0] [0 0] [0
0] [0 0] [0
1] [0]
[reverse^#](x1) = [0 1] x1 + [1]
[0 0] [0]
[bfs2^#](x1, x2) = [3 3] x1 + [3 3] x2 + [3]
[3 3] [3 3] [3]
[bfs2#1^#](x1, x2) = [1 1] x1 + [1]
[2 2] [3]
[dobfs^#](x1, x2) = [1 1] x1 + [1]
[1 1] [1]
[dfs^#](x1, x2) = [0]
[0]
[dfs#1^#](x1, x2) = [0]
[0]
[dfs#2^#](x1, x2, x3, x4) = [0]
[0]
[dfs#3^#](x1, x2, x3, x4, x5, x6) = [0]
[0]
[dodfs^#](x1, x2) = [0]
[0]
[#and^#](x1, x2) = [0]
[0]
[c_1](x1, x2) = [1 0] x1 + [1 1] x2 + [0]
[0 0] [0 0] [0]
[c_2](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 0] [0 0] [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [1]
[1]
>= [1]
[1]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [1]
[1]
>= [1]
[1]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(::(@x_1, @x_2), leaf())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(nil(), nil())] = [1]
[1]
>= [1]
[1]
= [#true()]
[#eq(nil(), leaf())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(nil(), node(@y_1, @y_2, @y_3))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(leaf(), ::(@y_1, @y_2))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(leaf(), nil())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(leaf(), leaf())] = [1]
[1]
>= [1]
[1]
= [#true()]
[#eq(leaf(), node(@y_1, @y_2, @y_3))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), nil())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), leaf())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3))] = [1]
[1]
>= [1]
[1]
= [#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))]
[#eq(#0(), #0())] = [1]
[1]
>= [1]
[1]
= [#true()]
[#eq(#0(), #neg(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#0(), #pos(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#0(), #s(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#neg(@x), #0())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [1]
[1]
>= [1]
[1]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#pos(@x), #0())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [1]
[1]
>= [1]
[1]
= [#eq(@x, @y)]
[#eq(#s(@x), #0())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#eq(#s(@x), #s(@y))] = [1]
[1]
>= [1]
[1]
= [#eq(@x, @y)]
[appendreverse(@toreverse, @sofar)] = [1 0] @sofar + [1 0] @toreverse + [0]
[0 1] [0 1] [0]
>= [1 0] @sofar + [1 0] @toreverse + [0]
[0 1] [0 1] [0]
= [appendreverse#1(@toreverse, @sofar)]
[appendreverse#1(::(@a, @as), @sofar)] = [1 1] @a + [1 0] @as + [1 0] @sofar + [0]
[0 0] [0 1] [0 1] [1]
>= [1 1] @a + [1 0] @as + [1 0] @sofar + [0]
[0 0] [0 1] [0 1] [1]
= [appendreverse(@as, ::(@a, @sofar))]
[appendreverse#1(nil(), @sofar)] = [1 0] @sofar + [0]
[0 1] [0]
>= [1 0] @sofar + [0]
[0 1] [0]
= [@sofar]
[bfs(@queue, @futurequeue, @x)] = [1 0] @futurequeue + [1 0] @queue + [0]
[1 1] [1 0] [1]
>= [1 0] @futurequeue + [1 0] @queue + [0]
[1 1] [1 0] [1]
= [bfs#1(@queue, @futurequeue, @x)]
[bfs#1(::(@t, @ts), @futurequeue, @x)] = [1 0] @futurequeue + [1 1] @t + [1 0] @ts + [0]
[1 1] [1 1] [1 0] [1]
>= [1 0] @futurequeue + [1 1] @t + [1 0] @ts + [0]
[1 1] [1 1] [1 0] [1]
= [bfs#3(@t, @futurequeue, @ts, @x)]
[bfs#1(nil(), @futurequeue, @x)] = [1 0] @futurequeue + [0]
[1 1] [1]
>= [1 0] @futurequeue + [0]
[1 1] [0]
= [bfs#2(@futurequeue, @x)]
[bfs#3(leaf(), @futurequeue, @ts, @x)] = [1 0] @futurequeue + [1 0] @ts + [0]
[1 1] [1 0] [1]
>= [1 0] @futurequeue + [1 0] @ts + [0]
[1 1] [1 0] [1]
= [bfs(@ts, @futurequeue, @x)]
[bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [4]
[1 1] [1 1] [1 1] [1 0] [5]
> [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [3]
[1 1] [1 1] [1 1] [1 0] [3]
= [bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)]
[bfs#2(::(@t, @ts), @x)] = [1 1] @t + [1 0] @ts + [0]
[1 1] [1 1] [1]
>= [1 1] @t + [1 0] @ts + [0]
[1 1] [1 0] [1]
= [bfs(reverse(::(@t, @ts)), nil(), @x)]
[bfs#2(nil(), @x)] = [0]
[0]
>= [0]
[0]
= [leaf()]
[reverse(@xs)] = [1 0] @xs + [0]
[0 1] [3]
>= [1 0] @xs + [0]
[0 1] [0]
= [appendreverse(@xs, nil())]
[bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [3]
[1 1] [1 1] [1 1] [1 0] [3]
> [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0]
[1 1] [1 1] [1 1] [1 0] [3]
= [bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)]
[bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [3]
[1 1] [1 1] [1 1] [1 0] [3]
> [1 1] @t1 + [1 1] @t2 + [2]
[0 0] [0 0] [2]
= [node(@y, @t1, @t2)]
[dobfs(@t, @x)] = [1 1] @t + [0 0] @x + [0]
[1 1] [2 0] [1]
>= [1 1] @t + [0]
[1 1] [1]
= [bfs(::(@t, nil()), nil(), @x)]
[#and(#false(), #false())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#and(#false(), #true())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#and(#true(), #false())] = [1]
[1]
>= [1]
[1]
= [#false()]
[#and(#true(), #true())] = [1]
[1]
>= [1]
[1]
= [#true()]
[appendreverse^#(@toreverse, @sofar)] = [0 1] @toreverse + [0]
[0 0] [0]
>= [0 1] @toreverse + [0]
[0 0] [0]
= [appendreverse#1^#(@toreverse, @sofar)]
[appendreverse#1^#(::(@a, @as), @sofar)] = [0 1] @as + [1]
[0 0] [0]
> [0 1] @as + [0]
[0 0] [0]
= [appendreverse^#(@as, ::(@a, @sofar))]
[bfs^#(@queue, @futurequeue, @x)] = [1 2] @futurequeue + [1 0] @queue + [1]
[0 0] [0 1] [0]
>= [1 2] @futurequeue + [1 0] @queue + [1]
[0 0] [0 1] [0]
= [bfs#1^#(@queue, @futurequeue, @x)]
[bfs#1^#(::(@t, @ts), @futurequeue, @x)] = [1 2] @futurequeue + [1 1] @t + [1 0] @ts + [1]
[0 0] [0 0] [0 1] [1]
>= [1 2] @futurequeue + [1 1] @t + [1 0] @ts + [1]
[0 0] [0 0] [0 1] [0]
= [bfs#3^#(@t, @futurequeue, @ts, @x)]
[bfs#1^#(nil(), @futurequeue, @x)] = [1 2] @futurequeue + [1]
[0 0] [0]
>= [1 2] @futurequeue + [1]
[0 0] [0]
= [bfs#2^#(@futurequeue, @x)]
[bfs#3^#(leaf(), @futurequeue, @ts, @x)] = [1 2] @futurequeue + [1 0] @ts + [1]
[0 0] [0 1] [0]
>= [1 2] @futurequeue + [1 0] @ts + [1]
[0 0] [0 1] [0]
= [bfs^#(@ts, @futurequeue, @x)]
[bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x)] = [1 2] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [5]
[0 0] [0 0] [0 0] [0 1] [0]
>= [1 2] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [5]
[0 0] [0 0] [0 0] [0 1] [0]
= [bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)]
[bfs#2^#(::(@t, @ts), @x)] = [1 1] @t + [1 2] @ts + [3]
[0 0] [0 0] [0]
>= [1 1] @t + [1 1] @ts + [3]
[0 0] [0 0] [0]
= [c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts)))]
[bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 2] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [5]
[0 0] [0 0] [0 0] [0 1] [0]
>= [1 2] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [5]
[0 0] [0 0] [0 0] [0 1] [0]
= [bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)]
[reverse^#(@xs)] = [0 1] @xs + [1]
[0 0] [0]
> [0 1] @xs + [0]
[0 0] [0]
= [appendreverse^#(@xs, nil())]
[bfs2^#(@t, @x)] = [3 3] @t + [3 3] @x + [3]
[3 3] [3 3] [3]
>= [3 3] @t + [2 0] @x + [3]
[0 0] [0 0] [0]
= [c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))]
[bfs2#1^#(@t', @x)] = [1 1] @t' + [1]
[2 2] [3]
>= [1 1] @t' + [1]
[1 1] [1]
= [dobfs^#(@t', @x)]
[dobfs^#(@t, @x)] = [1 1] @t + [1]
[1 1] [1]
>= [1 1] @t + [1]
[0 0] [1]
= [bfs^#(::(@t, nil()), nil(), @x)]
Processor 'matrix interpretation of dimension 2' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{3,10}. Here rules are labeled according to the (estimated)
dependency graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :3
2: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :5
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :4
3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :7
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :6
5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :8
6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :9
8: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :10
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :12
12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :13
13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :2
- The rules {3,10} have known complexity. These cover all
predecessors of {1,11}, their complexity is equally bounded.
- The rules {1,3,10,11} have known complexity. These cover all
predecessors of {12}, their complexity is equally bounded.
- The rules {1,3,10,11,12} have known complexity. These cover all
predecessors of {13}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,3,10,11,12,13} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Strict DPs:
{ bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{11} Weak SCC
|
|->2:{12} Weak SCC
| |
| `->3:{13} Weak SCC
| |
| `->4:{1,9,7,4,8,5,6}
| |
| `->5:{10} Weak SCC
| |
| `->6:{2,3} Weak SCC
|
`->3:{13} Weak SCC
|
`->4:{1,9,7,4,8,5,6}
|
`->5:{10} Weak SCC
|
`->6:{2,3} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ 2: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, 3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, 4: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 5: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 6: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 7: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 8: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, 9: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 11: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 12: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 13: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 10: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 2: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, 3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) }
We apply the transformation 'simpDPRHS' on the sub-problem:
Strict DPs:
{ bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the following dependency-graph
1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :3
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :2
2: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :5
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
3: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) :6
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :7
6: bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x), reverse^#(::(@t, @ts)))
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
8: bfs2^#(@t, @x) ->
c_2(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :9
9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bfs#2^#(::(@t, @ts), @x) ->
c_1(bfs^#(reverse(::(@t, @ts)), nil(), @x),
reverse^#(::(@t, @ts))) }
We apply the transformation 'simpKP' on the sub-problem:
Strict DPs:
{ bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) }
Weak DPs:
{ bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We use the processor 'matrix interpretation of dimension 2' to
orient following rules strictly.
DPs:
{ 4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 6: bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, 8: bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x)) }
Trs:
{ #eq(::(@x_1, @x_2), nil()) -> #false()
, #eq(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(#0(), #neg(@y)) -> #false()
, #eq(#0(), #pos(@y)) -> #false()
, #eq(#0(), #s(@y)) -> #false()
, #eq(#neg(@x), #0()) -> #false()
, #eq(#neg(@x), #pos(@y)) -> #false()
, #eq(#pos(@x), #0()) -> #false()
, #eq(#pos(@x), #neg(@y)) -> #false()
, #eq(#s(@x), #0()) -> #false()
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false() }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(appendreverse) = {},
Uargs(appendreverse#1) = {}, Uargs(::) = {}, Uargs(bfs) = {},
Uargs(bfs#1) = {}, Uargs(bfs#3) = {}, Uargs(bfs#2) = {},
Uargs(reverse) = {}, Uargs(node) = {}, Uargs(bfs#4) = {},
Uargs(dobfs) = {}, Uargs(#and) = {}, Uargs(#neg) = {},
Uargs(#pos) = {}, Uargs(#s) = {}, Uargs(#equal^#) = {},
Uargs(#eq^#) = {}, Uargs(appendreverse^#) = {},
Uargs(appendreverse#1^#) = {}, Uargs(bfs^#) = {},
Uargs(bfs#1^#) = {}, Uargs(bfs#3^#) = {}, Uargs(bfs#2^#) = {},
Uargs(bfs#4^#) = {}, Uargs(reverse^#) = {}, Uargs(bfs2^#) = {},
Uargs(bfs2#1^#) = {}, Uargs(dobfs^#) = {}, Uargs(dfs^#) = {},
Uargs(dfs#1^#) = {}, Uargs(dfs#2^#) = {}, Uargs(dfs#3^#) = {},
Uargs(dodfs^#) = {}, Uargs(#and^#) = {}, Uargs(c_1) = {},
Uargs(c_2) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA) and not(IDA(1)).
[#equal](x1, x2) = [3]
[3]
[#eq](x1, x2) = [3]
[3]
[appendreverse](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [0]
[appendreverse#1](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [0]
[::](x1, x2) = [1 0] x1 + [1 0] x2 + [0]
[0 1] [0 1] [1]
[nil] = [0]
[0]
[bfs](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [0
1] x3 + [1]
[3 1] [3 2] [0
0] [1]
[bfs#1](x1, x2, x3) = [1 0] x1 + [1 0] x2 + [0
1] x3 + [1]
[3 1] [3 2] [0
0] [1]
[bfs#3](x1, x2, x3, x4) = [1 0] x1 + [1 0] x2 + [1
0] x3 + [0 1] x4 + [1]
[3 1] [3 2] [3
1] [0 0] [0]
[bfs#2](x1, x2) = [1 0] x1 + [0 1] x2 + [1]
[3 2] [0 0] [1]
[reverse](x1) = [1 0] x1 + [0]
[0 1] [1]
[leaf] = [1]
[1]
[node](x1, x2, x3) = [0 0] x1 + [1 1] x2 + [1
1] x3 + [3]
[1 1] [0 0] [0
0] [2]
[bfs#4](x1, x2, x3, x4, x5, x6, x7) = [1 0] x1 + [1 0] x2 + [1
1] x3 + [1 1] x4 + [1
0] x5 + [0
1] x6 + [0
0] x7 + [0]
[0 2] [3 2] [3
3] [3 2] [3
1] [0
0] [1
1] [1]
[#false] = [2]
[3]
[#true] = [3]
[3]
[dobfs](x1, x2) = [1 0] x1 + [0 1] x2 + [1]
[3 1] [0 0] [3]
[#and](x1, x2) = [0 1] x1 + [0]
[0 0] [3]
[#0] = [0]
[0]
[#neg](x1) = [1 0] x1 + [0]
[0 1] [2]
[#pos](x1) = [1 0] x1 + [0]
[0 1] [0]
[#s](x1) = [1 0] x1 + [0]
[0 1] [0]
[#equal^#](x1, x2) = [0]
[0]
[#eq^#](x1, x2) = [0]
[0]
[appendreverse^#](x1, x2) = [0]
[0]
[appendreverse#1^#](x1, x2) = [0]
[0]
[bfs^#](x1, x2, x3) = [1 0] x1 + [1 1] x2 + [0]
[0 0] [0 0] [0]
[bfs#1^#](x1, x2, x3) = [1 0] x1 + [1 1] x2 + [0]
[0 0] [0 0] [0]
[bfs#3^#](x1, x2, x3, x4) = [1 0] x1 + [1 1] x2 + [1
0] x3 + [0]
[0 0] [0 0] [0
0] [0]
[bfs#2^#](x1, x2) = [1 1] x1 + [0]
[0 0] [0]
[bfs#4^#](x1, x2, x3, x4, x5, x6, x7) = [1 1] x2 + [1 1] x3 + [1
1] x4 + [1 0] x5 + [2]
[0 0] [0 0] [0
0] [0 0] [0]
[reverse^#](x1) = [0]
[0]
[bfs2^#](x1, x2) = [3 3] x1 + [3 3] x2 + [3]
[3 3] [3 3] [3]
[bfs2#1^#](x1, x2) = [1 0] x1 + [0]
[0 1] [0]
[dobfs^#](x1, x2) = [1 0] x1 + [0]
[0 0] [0]
[dfs^#](x1, x2) = [0]
[0]
[dfs#1^#](x1, x2) = [0]
[0]
[dfs#2^#](x1, x2, x3, x4) = [0]
[0]
[dfs#3^#](x1, x2, x3, x4, x5, x6) = [0]
[0]
[dodfs^#](x1, x2) = [0]
[0]
[#and^#](x1, x2) = [0]
[0]
[c_1](x1, x2) = [0]
[0]
[c_2](x1, x2) = [0]
[0]
[c] = [0]
[0]
[c_1](x1, x2) = [2 0] x1 + [1 0] x2 + [0]
[0 0] [0 0] [2]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [3]
[3]
>= [3]
[3]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [3]
[3]
>= [3]
[3]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(::(@x_1, @x_2), leaf())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(nil(), nil())] = [3]
[3]
>= [3]
[3]
= [#true()]
[#eq(nil(), leaf())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(nil(), node(@y_1, @y_2, @y_3))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(leaf(), ::(@y_1, @y_2))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(leaf(), nil())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(leaf(), leaf())] = [3]
[3]
>= [3]
[3]
= [#true()]
[#eq(leaf(), node(@y_1, @y_2, @y_3))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), nil())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), leaf())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3))] = [3]
[3]
>= [3]
[3]
= [#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))]
[#eq(#0(), #0())] = [3]
[3]
>= [3]
[3]
= [#true()]
[#eq(#0(), #neg(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#0(), #pos(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#0(), #s(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#neg(@x), #0())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [3]
[3]
>= [3]
[3]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#pos(@x), #0())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [3]
[3]
>= [3]
[3]
= [#eq(@x, @y)]
[#eq(#s(@x), #0())] = [3]
[3]
> [2]
[3]
= [#false()]
[#eq(#s(@x), #s(@y))] = [3]
[3]
>= [3]
[3]
= [#eq(@x, @y)]
[appendreverse(@toreverse, @sofar)] = [1 0] @sofar + [1 0] @toreverse + [0]
[0 1] [0 1] [0]
>= [1 0] @sofar + [1 0] @toreverse + [0]
[0 1] [0 1] [0]
= [appendreverse#1(@toreverse, @sofar)]
[appendreverse#1(::(@a, @as), @sofar)] = [1 0] @a + [1 0] @as + [1 0] @sofar + [0]
[0 1] [0 1] [0 1] [1]
>= [1 0] @a + [1 0] @as + [1 0] @sofar + [0]
[0 1] [0 1] [0 1] [1]
= [appendreverse(@as, ::(@a, @sofar))]
[appendreverse#1(nil(), @sofar)] = [1 0] @sofar + [0]
[0 1] [0]
>= [1 0] @sofar + [0]
[0 1] [0]
= [@sofar]
[bfs(@queue, @futurequeue, @x)] = [1 0] @futurequeue + [1 0] @queue + [0 1] @x + [1]
[3 2] [3 1] [0 0] [1]
>= [1 0] @futurequeue + [1 0] @queue + [0 1] @x + [1]
[3 2] [3 1] [0 0] [1]
= [bfs#1(@queue, @futurequeue, @x)]
[bfs#1(::(@t, @ts), @futurequeue, @x)] = [1 0] @futurequeue + [1 0] @t + [1 0] @ts + [0 1] @x + [1]
[3 2] [3 1] [3 1] [0 0] [2]
>= [1 0] @futurequeue + [1 0] @t + [1 0] @ts + [0 1] @x + [1]
[3 2] [3 1] [3 1] [0 0] [0]
= [bfs#3(@t, @futurequeue, @ts, @x)]
[bfs#1(nil(), @futurequeue, @x)] = [1 0] @futurequeue + [0 1] @x + [1]
[3 2] [0 0] [1]
>= [1 0] @futurequeue + [0 1] @x + [1]
[3 2] [0 0] [1]
= [bfs#2(@futurequeue, @x)]
[bfs#3(leaf(), @futurequeue, @ts, @x)] = [1 0] @futurequeue + [1 0] @ts + [0 1] @x + [2]
[3 2] [3 1] [0 0] [4]
> [1 0] @futurequeue + [1 0] @ts + [0 1] @x + [1]
[3 2] [3 1] [0 0] [1]
= [bfs(@ts, @futurequeue, @x)]
[bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0
1] @x + [0 0] @y + [4]
[3 2] [3 3] [3 3] [3 1] [0
0] [1 1] [11]
> [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0
1] @x + [0 0] @y + [3]
[3 2] [3 3] [3 2] [3 1] [0
0] [1 1] [7]
= [bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)]
[bfs#2(::(@t, @ts), @x)] = [1 0] @t + [1 0] @ts + [0 1] @x + [1]
[3 2] [3 2] [0 0] [3]
>= [1 0] @t + [1 0] @ts + [0 1] @x + [1]
[3 1] [3 1] [0 0] [3]
= [bfs(reverse(::(@t, @ts)), nil(), @x)]
[bfs#2(nil(), @x)] = [0 1] @x + [1]
[0 0] [1]
>= [1]
[1]
= [leaf()]
[reverse(@xs)] = [1 0] @xs + [0]
[0 1] [1]
>= [1 0] @xs + [0]
[0 1] [0]
= [appendreverse(@xs, nil())]
[bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0
1] @x + [0 0] @y + [2]
[3 2] [3 3] [3 2] [3 1] [0
0] [1 1] [7]
> [1 0] @futurequeue + [1 0] @t1 + [1 0] @t2 + [1 0] @ts + [0
1] @x + [1]
[3 2] [3 2] [3 2] [3 1] [0
0] [5]
= [bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)]
[bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 0] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [0
1] @x + [0 0] @y + [3]
[3 2] [3 3] [3 2] [3 1] [0
0] [1 1] [7]
>= [1 1] @t1 + [1 1] @t2 + [0 0] @y + [3]
[0 0] [0 0] [1 1] [2]
= [node(@y, @t1, @t2)]
[dobfs(@t, @x)] = [1 0] @t + [0 1] @x + [1]
[3 1] [0 0] [3]
>= [1 0] @t + [0 1] @x + [1]
[3 1] [0 0] [2]
= [bfs(::(@t, nil()), nil(), @x)]
[#and(#false(), #false())] = [3]
[3]
> [2]
[3]
= [#false()]
[#and(#false(), #true())] = [3]
[3]
> [2]
[3]
= [#false()]
[#and(#true(), #false())] = [3]
[3]
> [2]
[3]
= [#false()]
[#and(#true(), #true())] = [3]
[3]
>= [3]
[3]
= [#true()]
[bfs^#(@queue, @futurequeue, @x)] = [1 1] @futurequeue + [1 0] @queue + [0]
[0 0] [0 0] [0]
>= [1 1] @futurequeue + [1 0] @queue + [0]
[0 0] [0 0] [0]
= [bfs#1^#(@queue, @futurequeue, @x)]
[bfs#1^#(::(@t, @ts), @futurequeue, @x)] = [1 1] @futurequeue + [1 0] @t + [1 0] @ts + [0]
[0 0] [0 0] [0 0] [0]
>= [1 1] @futurequeue + [1 0] @t + [1 0] @ts + [0]
[0 0] [0 0] [0 0] [0]
= [bfs#3^#(@t, @futurequeue, @ts, @x)]
[bfs#1^#(nil(), @futurequeue, @x)] = [1 1] @futurequeue + [0]
[0 0] [0]
>= [1 1] @futurequeue + [0]
[0 0] [0]
= [bfs#2^#(@futurequeue, @x)]
[bfs#3^#(leaf(), @futurequeue, @ts, @x)] = [1 1] @futurequeue + [1 0] @ts + [1]
[0 0] [0 0] [0]
> [1 1] @futurequeue + [1 0] @ts + [0]
[0 0] [0 0] [0]
= [bfs^#(@ts, @futurequeue, @x)]
[bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x)] = [1 1] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [3]
[0 0] [0 0] [0 0] [0 0] [0]
> [1 1] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [2]
[0 0] [0 0] [0 0] [0 0] [0]
= [bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)]
[bfs#2^#(::(@t, @ts), @x)] = [1 1] @t + [1 1] @ts + [1]
[0 0] [0 0] [0]
> [1 0] @t + [1 0] @ts + [0]
[0 0] [0 0] [0]
= [bfs^#(reverse(::(@t, @ts)), nil(), @x)]
[bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y)] = [1 1] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [2]
[0 0] [0 0] [0 0] [0 0] [0]
>= [1 1] @futurequeue + [1 1] @t1 + [1 1] @t2 + [1 0] @ts + [2]
[0 0] [0 0] [0 0] [0 0] [0]
= [bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)]
[bfs2^#(@t, @x)] = [3 3] @t + [3 3] @x + [3]
[3 3] [3 3] [3]
> [3 0] @t + [0 2] @x + [2]
[0 0] [0 0] [2]
= [c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))]
[bfs2#1^#(@t', @x)] = [1 0] @t' + [0]
[0 1] [0]
>= [1 0] @t' + [0]
[0 0] [0]
= [dobfs^#(@t', @x)]
[dobfs^#(@t, @x)] = [1 0] @t + [0]
[0 0] [0]
>= [1 0] @t + [0]
[0 0] [0]
= [bfs^#(::(@t, nil()), nil(), @x)]
Processor 'matrix interpretation of dimension 2' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{4,5,6,8}. Here rules are labeled according to the (estimated)
dependency graph
1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
-->_1 bfs#1^#(nil(), @futurequeue, @x) ->
bfs#2^#(@futurequeue, @x) :3
-->_1 bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x) :2
2: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
-->_1 bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y) :5
-->_1 bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) :4
3: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
-->_1 bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x) :6
4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
-->_1 bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x) :7
6: bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
8: bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
-->_2 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
-->_1 bfs2#1^#(@t', @x) -> dobfs^#(@t', @x) :9
9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
-->_1 dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) :10
10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
-->_1 bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x) :1
- The rules {4,5,6,8} have known complexity. These cover all
predecessors of {7,9}, their complexity is equally bounded.
- The rules {4,5,6,7,8,9} have known complexity. These cover all
predecessors of {10}, their complexity is equally bounded.
- The rules {4,5,6,7,8,9,10} have known complexity. These cover all
predecessors of {1}, their complexity is equally bounded.
- The rules {1,4,5,6,7,8,9,10} have known complexity. These cover
all predecessors of {2,3}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7,8,9,10} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{8} Weak SCC
|
|->2:{9} Weak SCC
| |
| `->3:{10} Weak SCC
| |
| `->4:{1,7,5,2,6,3,4} Weak SCC
|
`->3:{10} Weak SCC
|
`->4:{1,7,5,2,6,3,4} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, 2: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 3: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x)
, 5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 6: bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, 7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 8: bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 8: bfs2^#(@t, @x) ->
c_1(bfs2#1^#(dobfs(@t, @x), @x), dobfs^#(@t, @x))
, 9: bfs2#1^#(@t', @x) -> dobfs^#(@t', @x)
, 10: dobfs^#(@t, @x) -> bfs^#(::(@t, nil()), nil(), @x)
, 1: bfs^#(@queue, @futurequeue, @x) ->
bfs#1^#(@queue, @futurequeue, @x)
, 7: bfs#4^#(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs^#(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, 5: bfs#3^#(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4^#(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, 2: bfs#1^#(::(@t, @ts), @futurequeue, @x) ->
bfs#3^#(@t, @futurequeue, @ts, @x)
, 6: bfs#2^#(::(@t, @ts), @x) ->
bfs^#(reverse(::(@t, @ts)), nil(), @x)
, 3: bfs#1^#(nil(), @futurequeue, @x) -> bfs#2^#(@futurequeue, @x)
, 4: bfs#3^#(leaf(), @futurequeue, @ts, @x) ->
bfs^#(@ts, @futurequeue, @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#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
* Path 3:{11}->5:{13}->6:{3,9,7,4,8,5,6}->7:{10}->8:{1,2}: subsumed
-----------------------------------------------------------------
This path is subsumed by the proof of paths 3:{11}->4:{12}->5:{13}->6:{3,9,7,4,8,5,6}->7:{10}->8:{1,2}.
* Path 1:{19}->2:{14,18,17,15,16}: YES(O(1),O(n^1))
-------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :4
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :3
3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :5
5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :4
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :3
3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :6
5: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
6: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :5
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :3
3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
5: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :6
6: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :5
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :4
3: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
5: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :6
6: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :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:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Weak DPs:
{ dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the (estimated) dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :3
2: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
3: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :5
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :4
4: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
5: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :6
6: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) }
Weak DPs:
{ dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bfs(@queue, @futurequeue, @x) -> bfs#1(@queue, @futurequeue, @x)
, bfs#1(::(@t, @ts), @futurequeue, @x) ->
bfs#3(@t, @futurequeue, @ts, @x)
, bfs#1(nil(), @futurequeue, @x) -> bfs#2(@futurequeue, @x)
, bfs#3(leaf(), @futurequeue, @ts, @x) ->
bfs(@ts, @futurequeue, @x)
, bfs#3(node(@y, @t1, @t2), @futurequeue, @ts, @x) ->
bfs#4(#equal(@x, @y), @futurequeue, @t1, @t2, @ts, @x, @y)
, bfs#2(::(@t, @ts), @x) -> bfs(reverse(::(@t, @ts)), nil(), @x)
, bfs#2(nil(), @x) -> leaf()
, reverse(@xs) -> appendreverse(@xs, nil())
, bfs#4(#false(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
bfs(@ts, ::(@t2, ::(@t1, @futurequeue)), @x)
, bfs#4(#true(), @futurequeue, @t1, @t2, @ts, @x, @y) ->
node(@y, @t1, @t2)
, bfs2(@t, @x) -> bfs2#1(dobfs(@t, @x), @x)
, dobfs(@t, @x) -> bfs(::(@t, nil()), nil(), @x)
, bfs2#1(@t', @x) -> dobfs(@t', @x)
, dfs(@queue, @x) -> dfs#1(@queue, @x)
, dfs#1(::(@t, @ts), @x) -> dfs#2(@t, @t, @ts, @x)
, dfs#1(nil(), @x) -> leaf()
, dfs#2(leaf(), @t, @ts, @x) -> dfs(@ts, @x)
, dfs#2(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3(#false(), @t, @t1, @t2, @ts, @x) ->
dfs(::(@t1, ::(@t2, @ts)), @x)
, dfs#3(#true(), @t, @t1, @t2, @ts, @x) -> @t
, dodfs(@t, @x) -> dfs(::(@t, nil()), @x)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ #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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) }
Weak DPs:
{ dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#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:
{ 2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, 5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
Trs: { #equal(@x, @y) -> #eq(@x, @y) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(#equal) = {}, Uargs(#eq) = {}, Uargs(::) = {},
Uargs(node) = {}, Uargs(#and) = {}, Uargs(#neg) = {},
Uargs(#pos) = {}, Uargs(#s) = {}, Uargs(#equal^#) = {},
Uargs(#eq^#) = {}, Uargs(appendreverse^#) = {},
Uargs(appendreverse#1^#) = {}, Uargs(bfs^#) = {},
Uargs(bfs#1^#) = {}, Uargs(bfs#3^#) = {}, Uargs(bfs#2^#) = {},
Uargs(bfs#4^#) = {}, Uargs(reverse^#) = {}, Uargs(bfs2^#) = {},
Uargs(bfs2#1^#) = {}, Uargs(dobfs^#) = {}, Uargs(dfs^#) = {},
Uargs(dfs#1^#) = {}, Uargs(dfs#2^#) = {}, Uargs(dfs#3^#) = {},
Uargs(dodfs^#) = {}, Uargs(#and^#) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[#equal](x1, x2) = [2] x1 + [2] x2 + [2]
[#eq](x1, x2) = [0]
[::](x1, x2) = [1] x1 + [1] x2 + [1]
[nil] = [0]
[leaf] = [2]
[node](x1, x2, x3) = [1] x1 + [1] x2 + [1] x3 + [3]
[#false] = [0]
[#true] = [0]
[#and](x1, x2) = [0]
[#0] = [0]
[#neg](x1) = [1] x1 + [0]
[#pos](x1) = [1] x1 + [0]
[#s](x1) = [1] x1 + [0]
[#equal^#](x1, x2) = [0]
[#eq^#](x1, x2) = [0]
[appendreverse^#](x1, x2) = [0]
[appendreverse#1^#](x1, x2) = [0]
[bfs^#](x1, x2, x3) = [0]
[bfs#1^#](x1, x2, x3) = [0]
[bfs#3^#](x1, x2, x3, x4) = [0]
[bfs#2^#](x1, x2) = [0]
[bfs#4^#](x1, x2, x3, x4, x5, x6, x7) = [0]
[reverse^#](x1) = [0]
[bfs2^#](x1, x2) = [0]
[bfs2#1^#](x1, x2) = [0]
[dobfs^#](x1, x2) = [0]
[dfs^#](x1, x2) = [1] x1 + [0]
[dfs#1^#](x1, x2) = [1] x1 + [0]
[dfs#2^#](x1, x2, x3, x4) = [1] x1 + [1] x3 + [0]
[dfs#3^#](x1, x2, x3, x4, x5, x6) = [1] x3 + [1] x4 + [1] x5 + [3]
[dodfs^#](x1, x2) = [3] x1 + [3] x2 + [3]
[#and^#](x1, x2) = [0]
This order satisfies following ordering constraints
[#equal(@x, @y)] = [2] @x + [2] @y + [2]
> [0]
= [#eq(@x, @y)]
[#eq(::(@x_1, @x_2), ::(@y_1, @y_2))] = [0]
>= [0]
= [#and(#eq(@x_1, @y_1), #eq(@x_2, @y_2))]
[#eq(::(@x_1, @x_2), nil())] = [0]
>= [0]
= [#false()]
[#eq(::(@x_1, @x_2), leaf())] = [0]
>= [0]
= [#false()]
[#eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3))] = [0]
>= [0]
= [#false()]
[#eq(nil(), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(nil(), nil())] = [0]
>= [0]
= [#true()]
[#eq(nil(), leaf())] = [0]
>= [0]
= [#false()]
[#eq(nil(), node(@y_1, @y_2, @y_3))] = [0]
>= [0]
= [#false()]
[#eq(leaf(), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(leaf(), nil())] = [0]
>= [0]
= [#false()]
[#eq(leaf(), leaf())] = [0]
>= [0]
= [#true()]
[#eq(leaf(), node(@y_1, @y_2, @y_3))] = [0]
>= [0]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2))] = [0]
>= [0]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), nil())] = [0]
>= [0]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), leaf())] = [0]
>= [0]
= [#false()]
[#eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3))] = [0]
>= [0]
= [#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))]
[#eq(#0(), #0())] = [0]
>= [0]
= [#true()]
[#eq(#0(), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#0(), #s(@y))] = [0]
>= [0]
= [#false()]
[#eq(#neg(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#eq(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#false()]
[#eq(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#eq(#s(@x), #0())] = [0]
>= [0]
= [#false()]
[#eq(#s(@x), #s(@y))] = [0]
>= [0]
= [#eq(@x, @y)]
[#and(#false(), #false())] = [0]
>= [0]
= [#false()]
[#and(#false(), #true())] = [0]
>= [0]
= [#false()]
[#and(#true(), #false())] = [0]
>= [0]
= [#false()]
[#and(#true(), #true())] = [0]
>= [0]
= [#true()]
[dfs^#(@queue, @x)] = [1] @queue + [0]
>= [1] @queue + [0]
= [dfs#1^#(@queue, @x)]
[dfs#1^#(::(@t, @ts), @x)] = [1] @t + [1] @ts + [1]
> [1] @t + [1] @ts + [0]
= [dfs#2^#(@t, @t, @ts, @x)]
[dfs#2^#(leaf(), @t, @ts, @x)] = [1] @ts + [2]
> [1] @ts + [0]
= [dfs^#(@ts, @x)]
[dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x)] = [1] @a + [1] @t1 + [1] @t2 + [1] @ts + [3]
>= [1] @t1 + [1] @t2 + [1] @ts + [3]
= [dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)]
[dfs#3^#(#false(), @t, @t1, @t2, @ts, @x)] = [1] @t1 + [1] @t2 + [1] @ts + [3]
> [1] @t1 + [1] @t2 + [1] @ts + [2]
= [dfs^#(::(@t1, ::(@t2, @ts)), @x)]
[dodfs^#(@t, @x)] = [3] @t + [3] @x + [3]
> [1] @t + [1]
= [dfs^#(::(@t, nil()), @x)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{2,3,5,6}. Here rules are labeled according to the (estimated)
dependency graph
1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
-->_1 dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x) :2
2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
-->_1 dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x) :4
-->_1 dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) :3
3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
-->_1 dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x) :5
5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
-->_1 dfs^#(@queue, @x) -> dfs#1^#(@queue, @x) :1
- The rules {2,3,5,6} have known complexity. These cover all
predecessors of {1,4}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#true(), #true()) -> #true() }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{6} Weak SCC
|
`->2:{1,5,4,2,3} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, 2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x)
, 4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, 5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 6: dodfs^#(@t, @x) -> dfs^#(::(@t, nil()), @x)
, 1: dfs^#(@queue, @x) -> dfs#1^#(@queue, @x)
, 5: dfs#3^#(#false(), @t, @t1, @t2, @ts, @x) ->
dfs^#(::(@t1, ::(@t2, @ts)), @x)
, 4: dfs#2^#(node(@a, @t1, @t2), @t, @ts, @x) ->
dfs#3^#(#equal(@a, @x), @t, @t1, @t2, @ts, @x)
, 2: dfs#1^#(::(@t, @ts), @x) -> dfs#2^#(@t, @t, @ts, @x)
, 3: dfs#2^#(leaf(), @t, @ts, @x) -> dfs^#(@ts, @x) }
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(::(@x_1, @x_2), leaf()) -> #false()
, #eq(::(@x_1, @x_2), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(nil(), ::(@y_1, @y_2)) -> #false()
, #eq(nil(), nil()) -> #true()
, #eq(nil(), leaf()) -> #false()
, #eq(nil(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(leaf(), ::(@y_1, @y_2)) -> #false()
, #eq(leaf(), nil()) -> #false()
, #eq(leaf(), leaf()) -> #true()
, #eq(leaf(), node(@y_1, @y_2, @y_3)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), ::(@y_1, @y_2)) -> #false()
, #eq(node(@x_1, @x_2, @x_3), nil()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), leaf()) -> #false()
, #eq(node(@x_1, @x_2, @x_3), node(@y_1, @y_2, @y_3)) ->
#and(#eq(@x_1, @y_1), #and(#eq(@x_2, @y_2), #eq(@x_3, @y_3)))
, #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)
, #and(#false(), #false()) -> #false()
, #and(#false(), #true()) -> #false()
, #and(#true(), #false()) -> #false()
, #and(#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(n^1))