tct
MAYBE
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict Trs:
{ *(@x, @y) -> #mult(@x, @y)
, +(@x, @y) -> #add(@x, @y)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil() }
Weak Trs:
{ #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We add following dependency tuples
Strict DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, appendreverse#1^#(nil(), @sofar) -> c_5()
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, matrixMult#1^#(nil(), @m2) -> c_35()
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#1^#(nil(), @acc, @m) -> c_20()
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#1^#(nil(), @l2, @n) -> c_31()
, dequeue#2^#(::(@t, @ts)) -> c_27()
, dequeue#2^#(nil()) -> c_28()
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ #mult^#(#0(), #0()) -> c_36()
, #mult^#(#0(), #neg(@y)) -> c_37()
, #mult^#(#0(), #pos(@y)) -> c_38()
, #mult^#(#neg(@x), #0()) -> c_39()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_42()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #add^#(#0(), @y) -> c_45()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natmult^#(#0(), @y) -> c_58()
, #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_50()
, #pred^#(#neg(#s(@x))) -> c_51()
, #pred^#(#pos(#s(#0()))) -> c_52()
, #pred^#(#pos(#s(#s(@x)))) -> c_53()
, #succ^#(#0()) -> c_54()
, #succ^#(#neg(#s(#0()))) -> c_55()
, #succ^#(#neg(#s(#s(@x)))) -> c_56()
, #succ^#(#pos(#s(@x))) -> c_57() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, appendreverse#1^#(nil(), @sofar) -> c_5()
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, matrixMult#1^#(nil(), @m2) -> c_35()
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#1^#(nil(), @acc, @m) -> c_20()
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#1^#(nil(), @l2, @n) -> c_31()
, dequeue#2^#(::(@t, @ts)) -> c_27()
, dequeue#2^#(nil()) -> c_28()
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ #mult^#(#0(), #0()) -> c_36()
, #mult^#(#0(), #neg(@y)) -> c_37()
, #mult^#(#0(), #pos(@y)) -> c_38()
, #mult^#(#neg(@x), #0()) -> c_39()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_42()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #add^#(#0(), @y) -> c_45()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natmult^#(#0(), @y) -> c_58()
, #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_50()
, #pred^#(#neg(#s(@x))) -> c_51()
, #pred^#(#pos(#s(#0()))) -> c_52()
, #pred^#(#pos(#s(#s(@x)))) -> c_53()
, #succ^#(#0()) -> c_54()
, #succ^#(#neg(#s(#0()))) -> c_55()
, #succ^#(#neg(#s(#s(@x)))) -> c_56()
, #succ^#(#pos(#s(@x))) -> c_57() }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :44
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :43
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :41
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :40
-->_1 #mult^#(#pos(@x), #0()) -> c_42() :42
-->_1 #mult^#(#neg(@x), #0()) -> c_39() :39
-->_1 #mult^#(#0(), #pos(@y)) -> c_38() :38
-->_1 #mult^#(#0(), #neg(@y)) -> c_37() :37
-->_1 #mult^#(#0(), #0()) -> c_36() :36
2: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :49
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :48
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :47
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :46
-->_1 #add^#(#0(), @y) -> c_45() :45
3: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :4
-->_1 appendreverse#1^#(nil(), @sofar) -> c_5() :5
4: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :3
5: appendreverse#1^#(nil(), @sofar) -> c_5()
6: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :7
7: bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :9
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :8
8: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :11
-->_1 bftMult'#3^#(nil(), @acc, @queue) -> c_11() :12
9: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :10
10: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq)) :16
-->_1 dequeue#1^#(::(@t, @ts), @inq) -> c_24() :15
11: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue)) :14
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :13
12: bftMult'#3^#(nil(), @acc, @queue) -> c_11()
13: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :7
14: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
-->_3 enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t) :18
-->_2 enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t) :18
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :17
15: dequeue#1^#(::(@t, @ts), @inq) -> c_24()
16: dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :33
-->_1 dequeue#2^#(nil()) -> c_28() :32
-->_1 dequeue#2^#(::(@t, @ts)) -> c_27() :31
17: bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :20
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :7
18: enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
-->_1 enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29() :19
19: enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
20: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :21
-->_1 matrixMult#1^#(nil(), @m2) -> c_35() :22
21: matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :23
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :20
22: matrixMult#1^#(nil(), @m2) -> c_35()
23: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :24
-->_1 computeLine#1^#(nil(), @acc, @m) -> c_20() :25
24: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :26
-->_1 computeLine#2^#(nil(), @acc, @x, @xs) -> c_22() :27
25: computeLine#1^#(nil(), @acc, @m) -> c_20()
26: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :28
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :23
27: computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
28: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :29
-->_1 lineMult#1^#(nil(), @l2, @n) -> c_31() :30
29: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :35
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :34
30: lineMult#1^#(nil(), @l2, @n) -> c_31()
31: dequeue#2^#(::(@t, @ts)) -> c_27()
32: dequeue#2^#(nil()) -> c_28()
33: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :3
34: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :28
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :2
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :1
35: lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :28
-->_1 *^#(@x, @y) -> #mult^#(@x, @y) :1
36: #mult^#(#0(), #0()) -> c_36()
37: #mult^#(#0(), #neg(@y)) -> c_37()
38: #mult^#(#0(), #pos(@y)) -> c_38()
39: #mult^#(#neg(@x), #0()) -> c_39()
40: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
41: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
42: #mult^#(#pos(@x), #0()) -> c_42()
43: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
44: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
45: #add^#(#0(), @y) -> c_45()
46: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_53() :55
-->_1 #pred^#(#pos(#s(#0()))) -> c_52() :54
-->_1 #pred^#(#neg(#s(@x))) -> c_51() :53
-->_1 #pred^#(#0()) -> c_50() :52
47: #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :49
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :48
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_53() :55
-->_1 #pred^#(#pos(#s(#0()))) -> c_52() :54
-->_1 #pred^#(#neg(#s(@x))) -> c_51() :53
-->_1 #pred^#(#0()) -> c_50() :52
48: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_57() :59
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_56() :58
-->_1 #succ^#(#neg(#s(#0()))) -> c_55() :57
-->_1 #succ^#(#0()) -> c_54() :56
49: #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_57() :59
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_56() :58
-->_1 #succ^#(#neg(#s(#0()))) -> c_55() :57
-->_1 #succ^#(#0()) -> c_54() :56
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :49
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :48
50: #natmult^#(#0(), @y) -> c_58()
51: #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_2 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_2 #natmult^#(#0(), @y) -> c_58() :50
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :49
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :48
52: #pred^#(#0()) -> c_50()
53: #pred^#(#neg(#s(@x))) -> c_51()
54: #pred^#(#pos(#s(#0()))) -> c_52()
55: #pred^#(#pos(#s(#s(@x)))) -> c_53()
56: #succ^#(#0()) -> c_54()
57: #succ^#(#neg(#s(#0()))) -> c_55()
58: #succ^#(#neg(#s(#s(@x)))) -> c_56()
59: #succ^#(#pos(#s(@x))) -> c_57()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {12} and add Pre({12}) = {8} to the strict component.
- We remove {22} and add Pre({22}) = {20} to the strict component.
- We remove {25} and add Pre({25}) = {23} to the strict component.
- We remove {27} and add Pre({27}) = {24} to the strict component.
- We remove {30} and add Pre({30}) = {28} to the strict component.
- We remove {19} and add Pre({19}) = {18} to the strict component.
- We remove {15} and add Pre({15}) = {10} to the strict component.
- We remove {31} and add Pre({31}) = {16} to the strict component.
- We remove {32} and add Pre({32}) = {16} to the strict component.
- We remove {5} and add Pre({5}) = {3} to the strict component.
- We remove {2} and add Pre({2}) = {34} to the strict component.
- We remove {1} and add Pre({1}) = {35,34} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_36()
, #mult^#(#0(), #neg(@y)) -> c_37()
, #mult^#(#0(), #pos(@y)) -> c_38()
, #mult^#(#neg(@x), #0()) -> c_39()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_42()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_45()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, appendreverse#1^#(nil(), @sofar) -> c_5()
, bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, matrixMult#1^#(nil(), @m2) -> c_35()
, computeLine#1^#(nil(), @acc, @m) -> c_20()
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, lineMult#1^#(nil(), @l2, @n) -> c_31()
, dequeue#2^#(::(@t, @ts)) -> c_27()
, dequeue#2^#(nil()) -> c_28()
, #natmult^#(#0(), @y) -> c_58()
, #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_50()
, #pred^#(#neg(#s(@x))) -> c_51()
, #pred^#(#pos(#s(#0()))) -> c_52()
, #pred^#(#pos(#s(#s(@x)))) -> c_53()
, #succ^#(#0()) -> c_54()
, #succ^#(#neg(#s(#0()))) -> c_55()
, #succ^#(#neg(#s(#s(@x)))) -> c_56()
, #succ^#(#pos(#s(@x))) -> c_57() }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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
-->_1 appendreverse#1^#(nil(), @sofar) -> c_5() :40
2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
3: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
4: bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
-->_1 bftMult'#3^#(nil(), @acc, @queue) -> c_11() :41
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq)) :11
-->_1 dequeue#1^#(::(@t, @ts), @inq) -> c_24() :42
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue)) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
-->_3 enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t) :13
-->_2 enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t) :13
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :21
-->_1 dequeue#2^#(nil()) -> c_28() :49
-->_1 dequeue#2^#(::(@t, @ts)) -> c_27() :48
12: bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :14
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
13: enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
-->_1 enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29() :43
14: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :15
-->_1 matrixMult#1^#(nil(), @m2) -> c_35() :44
15: matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :16
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :14
16: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :17
-->_1 computeLine#1^#(nil(), @acc, @m) -> c_20() :45
17: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :18
-->_1 computeLine#2^#(nil(), @acc, @x, @xs) -> c_22() :46
18: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :19
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :16
19: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :20
-->_1 lineMult#1^#(nil(), @l2, @n) -> c_31() :47
20: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :23
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :22
21: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
22: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :34
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :24
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :19
23: lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_1 *^#(@x, @y) -> #mult^#(@x, @y) :24
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :19
24: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :33
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :32
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :30
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :29
-->_1 #mult^#(#pos(@x), #0()) -> c_42() :31
-->_1 #mult^#(#neg(@x), #0()) -> c_39() :28
-->_1 #mult^#(#0(), #pos(@y)) -> c_38() :27
-->_1 #mult^#(#0(), #neg(@y)) -> c_37() :26
-->_1 #mult^#(#0(), #0()) -> c_36() :25
25: #mult^#(#0(), #0()) -> c_36()
26: #mult^#(#0(), #neg(@y)) -> c_37()
27: #mult^#(#0(), #pos(@y)) -> c_38()
28: #mult^#(#neg(@x), #0()) -> c_39()
29: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
30: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
31: #mult^#(#pos(@x), #0()) -> c_42()
32: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
33: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
34: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :39
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :38
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :37
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :36
-->_1 #add^#(#0(), @y) -> c_45() :35
35: #add^#(#0(), @y) -> c_45()
36: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_53() :55
-->_1 #pred^#(#pos(#s(#0()))) -> c_52() :54
-->_1 #pred^#(#neg(#s(@x))) -> c_51() :53
-->_1 #pred^#(#0()) -> c_50() :52
37: #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :39
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :38
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_53() :55
-->_1 #pred^#(#pos(#s(#0()))) -> c_52() :54
-->_1 #pred^#(#neg(#s(@x))) -> c_51() :53
-->_1 #pred^#(#0()) -> c_50() :52
38: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_57() :59
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_56() :58
-->_1 #succ^#(#neg(#s(#0()))) -> c_55() :57
-->_1 #succ^#(#0()) -> c_54() :56
39: #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_57() :59
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_56() :58
-->_1 #succ^#(#neg(#s(#0()))) -> c_55() :57
-->_1 #succ^#(#0()) -> c_54() :56
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :39
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :38
40: appendreverse#1^#(nil(), @sofar) -> c_5()
41: bftMult'#3^#(nil(), @acc, @queue) -> c_11()
42: dequeue#1^#(::(@t, @ts), @inq) -> c_24()
43: enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
44: matrixMult#1^#(nil(), @m2) -> c_35()
45: computeLine#1^#(nil(), @acc, @m) -> c_20()
46: computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
47: lineMult#1^#(nil(), @l2, @n) -> c_31()
48: dequeue#2^#(::(@t, @ts)) -> c_27()
49: dequeue#2^#(nil()) -> c_28()
50: #natmult^#(#0(), @y) -> c_58()
51: #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_2 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_2 #natmult^#(#0(), @y) -> c_58() :50
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :39
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :38
52: #pred^#(#0()) -> c_50()
53: #pred^#(#neg(#s(@x))) -> c_51()
54: #pred^#(#pos(#s(#0()))) -> c_52()
55: #pred^#(#pos(#s(#s(@x)))) -> c_53()
56: #succ^#(#0()) -> c_54()
57: #succ^#(#neg(#s(#0()))) -> c_55()
58: #succ^#(#neg(#s(#s(@x)))) -> c_56()
59: #succ^#(#pos(#s(@x))) -> c_57()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {13} and add Pre({13}) = {10,10} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_36()
, #mult^#(#0(), #neg(@y)) -> c_37()
, #mult^#(#0(), #pos(@y)) -> c_38()
, #mult^#(#neg(@x), #0()) -> c_39()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_42()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_45()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, appendreverse#1^#(nil(), @sofar) -> c_5()
, bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, matrixMult#1^#(nil(), @m2) -> c_35()
, computeLine#1^#(nil(), @acc, @m) -> c_20()
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, lineMult#1^#(nil(), @l2, @n) -> c_31()
, dequeue#2^#(::(@t, @ts)) -> c_27()
, dequeue#2^#(nil()) -> c_28()
, #natmult^#(#0(), @y) -> c_58()
, #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_50()
, #pred^#(#neg(#s(@x))) -> c_51()
, #pred^#(#pos(#s(#0()))) -> c_52()
, #pred^#(#pos(#s(#s(@x)))) -> c_53()
, #succ^#(#0()) -> c_54()
, #succ^#(#neg(#s(#0()))) -> c_55()
, #succ^#(#neg(#s(#s(@x)))) -> c_56()
, #succ^#(#pos(#s(@x))) -> c_57() }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the the dependency graph
->1:{3}
|
`->2:{4,12,10,8,5,9}
|
|->39:{6}
| |
| `->40:{7}
| |
| |->42:{11}
| | |
| | |->45:{20}
| | | |
| | | `->46:{1,2}
| | | |
| | | `->47:{39} Weak SCC
| | |
| | |->43:{48} Weak SCC
| | |
| | `->44:{49} Weak SCC
| |
| `->41:{41} Weak SCC
|
|->4:{13,14}
| |
| |->6:{15,17,16}
| | |
| | |->9:{18,22,19,21}
| | | |
| | | |->19:{23} Weak SCC
| | | | |
| | | | |->20:{24} Weak SCC
| | | | |
| | | | |->21:{25} Weak SCC
| | | | |
| | | | |->22:{26} Weak SCC
| | | | |
| | | | |->23:{27} Weak SCC
| | | | |
| | | | |->25:{28} Weak SCC
| | | | | |
| | | | | |->36:{50} Weak SCC
| | | | | |
| | | | | `->29:{51} Weak SCC
| | | | | |
| | | | | |->31:{37} Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | |->30:{38} Weak SCC
| | | | | | |
| | | | | | |->31:{37}
Weak SCC
| | | | | | | |
| | | | | | | |->32:{56}
Weak SCC
| | | | | | | |
| | | | | | | |->33:{57}
Weak SCC
| | | | | | | |
| | | | | | | |->34:{58}
Weak SCC
| | | | | | | |
| | | | | | | `->35:{59}
Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | `->36:{50} Weak SCC
| | | | |
| | | | |->26:{29} Weak SCC
| | | | | |
| | | | | |->36:{50} Weak SCC
| | | | | |
| | | | | `->29:{51} Weak SCC
| | | | | |
| | | | | |->31:{37} Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | |->30:{38} Weak SCC
| | | | | | |
| | | | | | |->31:{37}
Weak SCC
| | | | | | | |
| | | | | | | |->32:{56}
Weak SCC
| | | | | | | |
| | | | | | | |->33:{57}
Weak SCC
| | | | | | | |
| | | | | | | |->34:{58}
Weak SCC
| | | | | | | |
| | | | | | | `->35:{59}
Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | `->36:{50} Weak SCC
| | | | |
| | | | |->24:{30} Weak SCC
| | | | |
| | | | |->27:{31} Weak SCC
| | | | | |
| | | | | |->36:{50} Weak SCC
| | | | | |
| | | | | `->29:{51} Weak SCC
| | | | | |
| | | | | |->31:{37} Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | |->30:{38} Weak SCC
| | | | | | |
| | | | | | |->31:{37}
Weak SCC
| | | | | | | |
| | | | | | | |->32:{56}
Weak SCC
| | | | | | | |
| | | | | | | |->33:{57}
Weak SCC
| | | | | | | |
| | | | | | | |->34:{58}
Weak SCC
| | | | | | | |
| | | | | | | `->35:{59}
Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | `->36:{50} Weak SCC
| | | | |
| | | | `->28:{32} Weak SCC
| | | | |
| | | | |->36:{50} Weak SCC
| | | | |
| | | | `->29:{51} Weak SCC
| | | | |
| | | | |->31:{37} Weak SCC
| | | | | |
| | | | | |->32:{56}
Weak SCC
| | | | | |
| | | | | |->33:{57}
Weak SCC
| | | | | |
| | | | | |->34:{58}
Weak SCC
| | | | | |
| | | | | `->35:{59}
Weak SCC
| | | | |
| | | | |->30:{38} Weak SCC
| | | | | |
| | | | | |->31:{37}
Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | |->32:{56}
Weak SCC
| | | | | |
| | | | | |->33:{57}
Weak SCC
| | | | | |
| | | | | |->34:{58}
Weak SCC
| | | | | |
| | | | | `->35:{59}
Weak SCC
| | | | |
| | | | `->36:{50} Weak SCC
| | | |
| | | |->11:{33} Weak SCC
| | | | |
| | | | |->12:{34} Weak SCC
| | | | |
| | | | |->13:{35} Weak SCC
| | | | | |
| | | | | |->15:{52} Weak SCC
| | | | | |
| | | | | |->16:{53} Weak SCC
| | | | | |
| | | | | |->17:{54} Weak SCC
| | | | | |
| | | | | `->18:{55} Weak SCC
| | | | |
| | | | |->14:{36} Weak SCC
| | | | | |
| | | | | |->31:{37} Weak SCC
| | | | | | |
| | | | | | |->32:{56} Weak SCC
| | | | | | |
| | | | | | |->33:{57} Weak SCC
| | | | | | |
| | | | | | |->34:{58} Weak SCC
| | | | | | |
| | | | | | `->35:{59} Weak SCC
| | | | | |
| | | | | |->30:{38} Weak SCC
| | | | | | |
| | | | | | |->31:{37} Weak SCC
| | | | | | | |
| | | | | | | |->32:{56}
Weak SCC
| | | | | | | |
| | | | | | | |->33:{57}
Weak SCC
| | | | | | | |
| | | | | | | |->34:{58}
Weak SCC
| | | | | | | |
| | | | | | | `->35:{59}
Weak SCC
| | | | | | |
| | | | | | |->32:{56} Weak SCC
| | | | | | |
| | | | | | |->33:{57} Weak SCC
| | | | | | |
| | | | | | |->34:{58} Weak SCC
| | | | | | |
| | | | | | `->35:{59} Weak SCC
| | | | | |
| | | | | |->15:{52} Weak SCC
| | | | | |
| | | | | |->16:{53} Weak SCC
| | | | | |
| | | | | |->17:{54} Weak SCC
| | | | | |
| | | | | `->18:{55} Weak SCC
| | | | |
| | | | |->31:{37} Weak SCC
| | | | | |
| | | | | |->32:{56} Weak SCC
| | | | | |
| | | | | |->33:{57} Weak SCC
| | | | | |
| | | | | |->34:{58} Weak SCC
| | | | | |
| | | | | `->35:{59} Weak SCC
| | | | |
| | | | `->30:{38} Weak SCC
| | | | |
| | | | |->31:{37} Weak SCC
| | | | | |
| | | | | |->32:{56} Weak SCC
| | | | | |
| | | | | |->33:{57} Weak SCC
| | | | | |
| | | | | |->34:{58} Weak SCC
| | | | | |
| | | | | `->35:{59} Weak SCC
| | | | |
| | | | |->32:{56} Weak SCC
| | | | |
| | | | |->33:{57} Weak SCC
| | | | |
| | | | |->34:{58} Weak SCC
| | | | |
| | | | `->35:{59} Weak SCC
| | | |
| | | `->10:{47} Weak SCC
| | |
| | |->7:{45} Weak SCC
| | |
| | `->8:{46} Weak SCC
| |
| `->5:{44} Weak SCC
|
|->3:{40} Weak SCC
|
`->37:{42} Weak SCC
|
`->38:{43} 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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 4: bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, 5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, 6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, 7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, 8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, 9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, 10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, 11: dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, 12: bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, 13: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 14: matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, 15: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 16: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 17: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 18: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 19: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 20: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 21: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, 22: lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ 23: *^#(@x, @y) -> #mult^#(@x, @y)
, 24: #mult^#(#0(), #0()) -> c_36()
, 25: #mult^#(#0(), #neg(@y)) -> c_37()
, 26: #mult^#(#0(), #pos(@y)) -> c_38()
, 27: #mult^#(#neg(@x), #0()) -> c_39()
, 28: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 29: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 30: #mult^#(#pos(@x), #0()) -> c_42()
, 31: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 32: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 33: +^#(@x, @y) -> #add^#(@x, @y)
, 34: #add^#(#0(), @y) -> c_45()
, 35: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 36: #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 37: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 38: #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 39: appendreverse#1^#(nil(), @sofar) -> c_5()
, 40: bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, 41: dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, 42: enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, 43: enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, 44: matrixMult#1^#(nil(), @m2) -> c_35()
, 45: computeLine#1^#(nil(), @acc, @m) -> c_20()
, 46: computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, 47: lineMult#1^#(nil(), @l2, @n) -> c_31()
, 48: dequeue#2^#(::(@t, @ts)) -> c_27()
, 49: dequeue#2^#(nil()) -> c_28()
, 50: #natmult^#(#0(), @y) -> c_58()
, 51: #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 52: #pred^#(#0()) -> c_50()
, 53: #pred^#(#neg(#s(@x))) -> c_51()
, 54: #pred^#(#pos(#s(#0()))) -> c_52()
, 55: #pred^#(#pos(#s(#s(@x)))) -> c_53()
, 56: #succ^#(#0()) -> c_54()
, 57: #succ^#(#neg(#s(#0()))) -> c_55()
, 58: #succ^#(#neg(#s(#s(@x)))) -> c_56()
, 59: #succ^#(#pos(#s(@x))) -> c_57() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 40: bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, 44: matrixMult#1^#(nil(), @m2) -> c_35()
, 45: computeLine#1^#(nil(), @acc, @m) -> c_20()
, 46: computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, 47: lineMult#1^#(nil(), @l2, @n) -> c_31()
, 33: +^#(@x, @y) -> #add^#(@x, @y)
, 34: #add^#(#0(), @y) -> c_45()
, 35: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 36: #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 52: #pred^#(#0()) -> c_50()
, 53: #pred^#(#neg(#s(@x))) -> c_51()
, 54: #pred^#(#pos(#s(#0()))) -> c_52()
, 55: #pred^#(#pos(#s(#s(@x)))) -> c_53()
, 23: *^#(@x, @y) -> #mult^#(@x, @y)
, 24: #mult^#(#0(), #0()) -> c_36()
, 25: #mult^#(#0(), #neg(@y)) -> c_37()
, 26: #mult^#(#0(), #pos(@y)) -> c_38()
, 27: #mult^#(#neg(@x), #0()) -> c_39()
, 30: #mult^#(#pos(@x), #0()) -> c_42()
, 28: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 29: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 31: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 32: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 51: #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 38: #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 37: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 56: #succ^#(#0()) -> c_54()
, 57: #succ^#(#neg(#s(#0()))) -> c_55()
, 58: #succ^#(#neg(#s(#s(@x)))) -> c_56()
, 59: #succ^#(#pos(#s(@x))) -> c_57()
, 50: #natmult^#(#0(), @y) -> c_58()
, 42: enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, 43: enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, 41: dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, 48: dequeue#2^#(::(@t, @ts)) -> c_27()
, 49: dequeue#2^#(nil()) -> c_28()
, 39: appendreverse#1^#(nil(), @sofar) -> c_5() }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
4: bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq)) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue)) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :20
12: bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :13
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
13: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :14
14: matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :15
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :13
15: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :16
16: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :17
17: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :18
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :15
18: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :19
19: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :22
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :21
20: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
21: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :18
22: lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :18
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We employ 'linear path analysis' using the following approximated
dependency graph:
->1:{3} [ ? ]
|
`->2:{4,12,10,8,5,9} [ ? ]
|
|->6:{6} [ ? ]
| |
| `->7:{7} [ ? ]
| |
| `->8:{11} [ ? ]
| |
| `->9:{20} [ ? ]
| |
| `->10:{1,2} [ MAYBE ]
|
`->3:{13,14} [ ? ]
|
`->4:{15,17,16} [ ? ]
|
`->5:{18,22,19,21} [ MAYBE ]
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 4: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, 5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, 6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, 7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, 8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, 9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, 10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, 11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, 12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, 13: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 14: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, 15: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 16: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 17: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 18: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 19: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 20: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 21: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, 22: lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) }
* Path 1:{3}->2:{4,12,10,8,5,9}->6:{6}->7:{7}->8:{11}->9:{20}->10:{1,2}: MAYBE
----------------------------------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
4: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
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 {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :5
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
5: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :6
6: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :10
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :11
10: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :12
11: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
12: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
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 {12} and add Pre({12}) = {10} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :5
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
5: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :6
6: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :10
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :11
10: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
11: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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 {10} and add Pre({10}) = {6} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :5
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
5: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :6
6: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :12
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
11: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
12: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
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 MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :5
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :6
5: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :11
6: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :8
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :7
7: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
8: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :9
9: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
10: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :12
12: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
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 MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :10
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :5
5: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :7
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :6
6: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
7: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :8
8: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
9: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
10: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :11
11: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :12
12: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
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 {8} and add Pre({8}) = {7} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :9
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :5
5: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :7
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :6
6: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
7: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
8: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
9: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :10
10: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :8
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :5
5: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :6
6: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
7: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
8: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :9
9: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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 MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :7
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :5
5: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
6: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
7: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :8
8: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
5: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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 MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
4: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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 {2} and add Pre({2}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the following dependency-graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :3
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
4: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
None of the processors succeeded.
Details of failed attempt(s):
-----------------------------
1) 'empty' failed due to the following reason:
Empty strict component of the problem is NOT empty.
2) 'With Problem ...' failed due to the following reason:
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Remaining Rules (B):
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, bftMult'^#(@queue, @acc) -> bftMult'#2^#(@queue)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
2: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 1: bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, 2: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, 6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, 7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(*) = {}, Uargs(#mult) = {}, Uargs(+) = {}, Uargs(#add) = {},
Uargs(appendreverse) = {}, Uargs(appendreverse#1) = {},
Uargs(::) = {}, Uargs(tuple#2) = {}, Uargs(bftMult'#2) = {},
Uargs(dequeue) = {}, Uargs(node) = {}, Uargs(enqueue) = {},
Uargs(matrixMult) = {}, Uargs(computeLine) = {},
Uargs(computeLine#1) = {}, Uargs(computeLine#2) = {},
Uargs(lineMult) = {}, Uargs(dequeue#1) = {}, Uargs(reverse) = {},
Uargs(dequeue#2) = {}, Uargs(enqueue#1) = {},
Uargs(lineMult#1) = {}, Uargs(lineMult#2) = {},
Uargs(matrixMult#1) = {}, Uargs(#s) = {}, Uargs(#neg) = {},
Uargs(#pred) = {}, Uargs(#pos) = {}, Uargs(#succ) = {},
Uargs(#natmult) = {}, Uargs(*^#) = {}, Uargs(#mult^#) = {},
Uargs(+^#) = {}, Uargs(#add^#) = {}, Uargs(appendreverse^#) = {},
Uargs(appendreverse#1^#) = {}, Uargs(bftMult^#) = {},
Uargs(bftMult'^#) = {}, Uargs(bftMult'#1^#) = {},
Uargs(bftMult'#2^#) = {}, Uargs(dequeue^#) = {},
Uargs(bftMult'#3^#) = {}, Uargs(bftMult'#4^#) = {},
Uargs(dequeue#1^#) = {}, Uargs(bftMult'#5^#) = {},
Uargs(enqueue^#) = {}, Uargs(enqueue#1^#) = {},
Uargs(matrixMult^#) = {}, Uargs(matrixMult#1^#) = {},
Uargs(computeLine^#) = {}, Uargs(computeLine#1^#) = {},
Uargs(computeLine#2^#) = {}, Uargs(lineMult^#) = {},
Uargs(lineMult#1^#) = {}, Uargs(dequeue#2^#) = {},
Uargs(reverse^#) = {}, Uargs(lineMult#2^#) = {},
Uargs(#natmult^#) = {}, Uargs(#pred^#) = {}, Uargs(#succ^#) = {},
Uargs(c_1) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[*](x1, x2) = [0]
[#mult](x1, x2) = [0]
[+](x1, x2) = [1] x2 + [0]
[#add](x1, x2) = [1] x2 + [0]
[appendreverse](x1, x2) = [1] x1 + [1] x2 + [0]
[appendreverse#1](x1, x2) = [1] x1 + [1] x2 + [0]
[::](x1, x2) = [1] x1 + [1] x2 + [0]
[nil] = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[bftMult'#2](x1) = [1] x1 + [0]
[dequeue](x1, x2) = [1] x1 + [1] x2 + [0]
[leaf] = [2]
[node](x1, x2, x3) = [1] x1 + [1] x2 + [1] x3 + [2]
[enqueue](x1, x2) = [1] x1 + [1] x2 + [0]
[matrixMult](x1, x2) = [0]
[computeLine](x1, x2, x3) = [2] x3 + [0]
[computeLine#1](x1, x2, x3) = [2] x2 + [0]
[computeLine#2](x1, x2, x3, x4) = [2] x2 + [0]
[lineMult](x1, x2, x3) = [1] x3 + [0]
[dequeue#1](x1, x2) = [1] x1 + [1] x2 + [0]
[reverse](x1) = [1] x1 + [0]
[dequeue#2](x1) = [1] x1 + [0]
[enqueue#1](x1, x2) = [1] x1 + [1] x2 + [0]
[lineMult#1](x1, x2, x3) = [1] x2 + [0]
[lineMult#2](x1, x2, x3, x4) = [1] x1 + [0]
[matrixMult#1](x1, x2) = [0]
[#0] = [0]
[#s](x1) = [0]
[#neg](x1) = [0]
[#pred](x1) = [0]
[#pos](x1) = [0]
[#succ](x1) = [0]
[#natmult](x1, x2) = [0]
[*^#](x1, x2) = [0]
[#mult^#](x1, x2) = [0]
[+^#](x1, x2) = [0]
[#add^#](x1, x2) = [0]
[appendreverse^#](x1, x2) = [0]
[appendreverse#1^#](x1, x2) = [0]
[bftMult^#](x1, x2) = [3] x1 + [3] x2 + [3]
[bftMult'^#](x1, x2) = [2] x1 + [1]
[bftMult'#1^#](x1, x2) = [2] x1 + [0]
[bftMult'#2^#](x1) = [0]
[dequeue^#](x1, x2) = [0]
[bftMult'#3^#](x1, x2, x3) = [2] x1 + [2] x3 + [0]
[bftMult'#4^#](x1, x2, x3) = [2] x1 + [2] x3 + [0]
[dequeue#1^#](x1, x2) = [0]
[bftMult'#5^#](x1, x2, x3) = [2] x1 + [3]
[enqueue^#](x1, x2) = [0]
[enqueue#1^#](x1, x2) = [0]
[matrixMult^#](x1, x2) = [0]
[matrixMult#1^#](x1, x2) = [0]
[computeLine^#](x1, x2, x3) = [0]
[computeLine#1^#](x1, x2, x3) = [0]
[computeLine#2^#](x1, x2, x3, x4) = [0]
[lineMult^#](x1, x2, x3) = [0]
[lineMult#1^#](x1, x2, x3) = [0]
[dequeue#2^#](x1) = [0]
[reverse^#](x1) = [0]
[lineMult#2^#](x1, x2, x3, x4) = [0]
[#natmult^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
[c_1](x1, x2) = [0]
[c] = [0]
This order satisfies following ordering constraints
[*(@x, @y)] = [0]
>= [0]
= [#mult(@x, @y)]
[#mult(#0(), #0())] = [0]
>= [0]
= [#0()]
[#mult(#0(), #neg(@y))] = [0]
>= [0]
= [#0()]
[#mult(#0(), #pos(@y))] = [0]
>= [0]
= [#0()]
[#mult(#neg(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[#mult(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[+(@x, @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#add(@x, @y)]
[#add(#0(), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [@y]
[#add(#neg(#s(#0())), @y)] = [1] @y + [0]
>= [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [1] @y + [0]
>= [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [1] @y + [0]
>= [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [1] @y + [0]
>= [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[appendreverse(@toreverse, @sofar)] = [1] @sofar + [1] @toreverse + [0]
>= [1] @sofar + [1] @toreverse + [0]
= [appendreverse#1(@toreverse, @sofar)]
[appendreverse#1(::(@a, @as), @sofar)] = [1] @a + [1] @as + [1] @sofar + [0]
>= [1] @a + [1] @as + [1] @sofar + [0]
= [appendreverse(@as, ::(@a, @sofar))]
[appendreverse#1(nil(), @sofar)] = [1] @sofar + [0]
>= [1] @sofar + [0]
= [@sofar]
[bftMult'#2(tuple#2(@dequeue@1, @dequeue@2))] = [1] @dequeue@1 + [1] @dequeue@2 + [0]
>= [1] @dequeue@1 + [1] @dequeue@2 + [0]
= [dequeue(@dequeue@1, @dequeue@2)]
[dequeue(@outq, @inq)] = [1] @inq + [1] @outq + [0]
>= [1] @inq + [1] @outq + [0]
= [dequeue#1(@outq, @inq)]
[enqueue(@t, @queue)] = [1] @queue + [1] @t + [0]
>= [1] @queue + [1] @t + [0]
= [enqueue#1(@queue, @t)]
[matrixMult(@m1, @m2)] = [0]
>= [0]
= [matrixMult#1(@m1, @m2)]
[computeLine(@line, @m, @acc)] = [2] @acc + [0]
>= [2] @acc + [0]
= [computeLine#1(@line, @acc, @m)]
[computeLine#1(::(@x, @xs), @acc, @m)] = [2] @acc + [0]
>= [2] @acc + [0]
= [computeLine#2(@m, @acc, @x, @xs)]
[computeLine#1(nil(), @acc, @m)] = [2] @acc + [0]
>= [1] @acc + [0]
= [@acc]
[computeLine#2(::(@l, @ls), @acc, @x, @xs)] = [2] @acc + [0]
>= [2] @acc + [0]
= [computeLine(@xs, @ls, lineMult(@x, @l, @acc))]
[computeLine#2(nil(), @acc, @x, @xs)] = [2] @acc + [0]
>= [0]
= [nil()]
[lineMult(@n, @l1, @l2)] = [1] @l2 + [0]
>= [1] @l2 + [0]
= [lineMult#1(@l1, @l2, @n)]
[dequeue#1(::(@t, @ts), @inq)] = [1] @inq + [1] @t + [1] @ts + [0]
>= [1] @inq + [1] @t + [1] @ts + [0]
= [tuple#2(::(@t, nil()), tuple#2(@ts, @inq))]
[dequeue#1(nil(), @inq)] = [1] @inq + [0]
>= [1] @inq + [0]
= [dequeue#2(reverse(@inq))]
[reverse(@xs)] = [1] @xs + [0]
>= [1] @xs + [0]
= [appendreverse(@xs, nil())]
[dequeue#2(::(@t, @ts))] = [1] @t + [1] @ts + [0]
>= [1] @t + [1] @ts + [0]
= [tuple#2(::(@t, nil()), tuple#2(@ts, nil()))]
[dequeue#2(nil())] = [0]
>= [0]
= [tuple#2(nil(), tuple#2(nil(), nil()))]
[enqueue#1(tuple#2(@outq, @inq), @t)] = [1] @inq + [1] @outq + [1] @t + [0]
>= [1] @inq + [1] @outq + [1] @t + [0]
= [tuple#2(@outq, ::(@t, @inq))]
[lineMult#1(::(@x, @xs), @l2, @n)] = [1] @l2 + [0]
>= [1] @l2 + [0]
= [lineMult#2(@l2, @n, @x, @xs)]
[lineMult#1(nil(), @l2, @n)] = [1] @l2 + [0]
>= [0]
= [nil()]
[lineMult#2(::(@y, @ys), @n, @x, @xs)] = [1] @y + [1] @ys + [0]
>= [1] @y + [1] @ys + [0]
= [::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))]
[lineMult#2(nil(), @n, @x, @xs)] = [0]
>= [0]
= [::(*(@x, @n), lineMult(@n, @xs, nil()))]
[matrixMult#1(::(@l, @ls), @m2)] = [0]
>= [0]
= [::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))]
[matrixMult#1(nil(), @m2)] = [0]
>= [0]
= [nil()]
[#pred(#0())] = [0]
>= [0]
= [#neg(#s(#0()))]
[#pred(#neg(#s(@x)))] = [0]
>= [0]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [0]
>= [0]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [0]
>= [0]
= [#pos(#s(@x))]
[#succ(#0())] = [0]
>= [0]
= [#pos(#s(#0()))]
[#succ(#neg(#s(#0())))] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [0]
>= [0]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [0]
>= [0]
= [#pos(#s(#s(@x)))]
[#natmult(#0(), @y)] = [0]
>= [0]
= [#0()]
[#natmult(#s(@x), @y)] = [0]
>= [0]
= [#add(#pos(@y), #natmult(@x, @y))]
[bftMult^#(@t, @acc)] = [3] @acc + [3] @t + [3]
> [2] @t + [1]
= [bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)]
[bftMult'^#(@queue, @acc)] = [2] @queue + [1]
> [2] @queue + [0]
= [bftMult'#1^#(bftMult'#2(@queue), @acc)]
[bftMult'#1^#(tuple#2(@elem, @queue), @acc)] = [2] @elem + [2] @queue + [0]
>= [2] @elem + [2] @queue + [0]
= [bftMult'#3^#(@elem, @acc, @queue)]
[bftMult'#3^#(::(@t, @_@3), @acc, @queue)] = [2] @_@3 + [2] @queue + [2] @t + [0]
>= [2] @queue + [2] @t + [0]
= [bftMult'#4^#(@t, @acc, @queue)]
[bftMult'#4^#(leaf(), @acc, @queue)] = [2] @queue + [4]
> [2] @queue + [1]
= [bftMult'^#(@queue, @acc)]
[bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue)] = [2] @queue + [2] @t1 + [2] @t2 + [2] @y + [4]
> [2] @queue + [2] @t1 + [2] @t2 + [3]
= [bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)]
[bftMult'#5^#(@queue', @acc, @y)] = [2] @queue' + [3]
> [2] @queue' + [1]
= [bftMult'^#(@queue', matrixMult(@acc, @y))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,2,5,6,7}. Here rules are labeled according to the (estimated)
dependency graph
1: bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
2: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc) :1
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc) :1
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc) :1
- The rules {1,2,5,6,7} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
- The rules {1,2,3,5,6,7} have known complexity. These cover all
predecessors of {4}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1} Weak SCC
|
`->2:{2,7,6,4,3,5} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 2: bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, 3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, 4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, 5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, 6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, 7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 2: bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, 7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, 6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, 4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, 3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, 5: bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, bftMult'^#(@queue, @acc) -> bftMult'#2^#(@queue)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
None of the processors succeeded.
Details of failed attempt(s):
-----------------------------
1) 'empty' failed due to the following reason:
Empty strict component of the problem is NOT empty.
2) 'empty' failed due to the following reason:
Empty strict component of the problem is NOT empty.
* Path 1:{3}->2:{4,12,10,8,5,9}->3:{13,14}->4:{15,17,16}->5:{18,22,19,21}: MAYBE
------------------------------------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :12
12: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
13: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {16} and add Pre({16}) = {14} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) }
Weak DPs:
{ lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :12
12: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
13: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {15} and add Pre({15}) = {14} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) }
Weak DPs:
{ lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :12
12: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
13: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {14} and add Pre({14}) = {13} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :12
12: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
13: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {12} and add Pre({12}) = {11} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
12: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :12
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :12
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :12
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {11} and add Pre({11}) = {10} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
11: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :11
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :11
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :11
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {9} and add Pre({9}) = {8} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
9: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
10: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :9
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :10
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :9
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :10
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :10
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {6} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
7: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
8: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
9: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :7
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :8
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :7
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :9
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :8
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :9
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :9
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
7: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
8: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :6
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :7
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :6
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :7
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
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 MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
5: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
6: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
7: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :5
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :6
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :5
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :7
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :6
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :7
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :7
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 MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
4: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
5: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
6: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :4
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :5
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :4
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :6
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :5
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :6
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :6
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 MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :6
3: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
4: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
5: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
6: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :3
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :4
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :3
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :5
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :4
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :5
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {1} and add Pre({1}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the following dependency-graph
1: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :6
2: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
3: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
5: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
6: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :2
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :3
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :2
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :3
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_1(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_3(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
No subproblems were checked.
Arrrr..
tct-popstar
MAYBE
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict Trs:
{ *(@x, @y) -> #mult(@x, @y)
, +(@x, @y) -> #add(@x, @y)
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil() }
Weak Trs:
{ #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We add following dependency tuples
Strict DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, appendreverse#1^#(nil(), @sofar) -> c_5()
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, matrixMult#1^#(nil(), @m2) -> c_35()
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#1^#(nil(), @acc, @m) -> c_20()
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#1^#(nil(), @l2, @n) -> c_31()
, dequeue#2^#(::(@t, @ts)) -> c_27()
, dequeue#2^#(nil()) -> c_28()
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ #mult^#(#0(), #0()) -> c_36()
, #mult^#(#0(), #neg(@y)) -> c_37()
, #mult^#(#0(), #pos(@y)) -> c_38()
, #mult^#(#neg(@x), #0()) -> c_39()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_42()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #add^#(#0(), @y) -> c_45()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natmult^#(#0(), @y) -> c_58()
, #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_50()
, #pred^#(#neg(#s(@x))) -> c_51()
, #pred^#(#pos(#s(#0()))) -> c_52()
, #pred^#(#pos(#s(#s(@x)))) -> c_53()
, #succ^#(#0()) -> c_54()
, #succ^#(#neg(#s(#0()))) -> c_55()
, #succ^#(#neg(#s(#s(@x)))) -> c_56()
, #succ^#(#pos(#s(@x))) -> c_57() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, appendreverse#1^#(nil(), @sofar) -> c_5()
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, matrixMult#1^#(nil(), @m2) -> c_35()
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#1^#(nil(), @acc, @m) -> c_20()
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#1^#(nil(), @l2, @n) -> c_31()
, dequeue#2^#(::(@t, @ts)) -> c_27()
, dequeue#2^#(nil()) -> c_28()
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ #mult^#(#0(), #0()) -> c_36()
, #mult^#(#0(), #neg(@y)) -> c_37()
, #mult^#(#0(), #pos(@y)) -> c_38()
, #mult^#(#neg(@x), #0()) -> c_39()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_42()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #add^#(#0(), @y) -> c_45()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natmult^#(#0(), @y) -> c_58()
, #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_50()
, #pred^#(#neg(#s(@x))) -> c_51()
, #pred^#(#pos(#s(#0()))) -> c_52()
, #pred^#(#pos(#s(#s(@x)))) -> c_53()
, #succ^#(#0()) -> c_54()
, #succ^#(#neg(#s(#0()))) -> c_55()
, #succ^#(#neg(#s(#s(@x)))) -> c_56()
, #succ^#(#pos(#s(@x))) -> c_57() }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :44
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :43
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :41
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :40
-->_1 #mult^#(#pos(@x), #0()) -> c_42() :42
-->_1 #mult^#(#neg(@x), #0()) -> c_39() :39
-->_1 #mult^#(#0(), #pos(@y)) -> c_38() :38
-->_1 #mult^#(#0(), #neg(@y)) -> c_37() :37
-->_1 #mult^#(#0(), #0()) -> c_36() :36
2: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :49
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :48
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :47
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :46
-->_1 #add^#(#0(), @y) -> c_45() :45
3: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :4
-->_1 appendreverse#1^#(nil(), @sofar) -> c_5() :5
4: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :3
5: appendreverse#1^#(nil(), @sofar) -> c_5()
6: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :7
7: bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :9
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :8
8: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :11
-->_1 bftMult'#3^#(nil(), @acc, @queue) -> c_11() :12
9: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :10
10: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq)) :16
-->_1 dequeue#1^#(::(@t, @ts), @inq) -> c_24() :15
11: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue)) :14
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :13
12: bftMult'#3^#(nil(), @acc, @queue) -> c_11()
13: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :7
14: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
-->_3 enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t) :18
-->_2 enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t) :18
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :17
15: dequeue#1^#(::(@t, @ts), @inq) -> c_24()
16: dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :33
-->_1 dequeue#2^#(nil()) -> c_28() :32
-->_1 dequeue#2^#(::(@t, @ts)) -> c_27() :31
17: bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :20
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :7
18: enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
-->_1 enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29() :19
19: enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
20: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :21
-->_1 matrixMult#1^#(nil(), @m2) -> c_35() :22
21: matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :23
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :20
22: matrixMult#1^#(nil(), @m2) -> c_35()
23: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :24
-->_1 computeLine#1^#(nil(), @acc, @m) -> c_20() :25
24: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :26
-->_1 computeLine#2^#(nil(), @acc, @x, @xs) -> c_22() :27
25: computeLine#1^#(nil(), @acc, @m) -> c_20()
26: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :28
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :23
27: computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
28: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :29
-->_1 lineMult#1^#(nil(), @l2, @n) -> c_31() :30
29: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :35
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :34
30: lineMult#1^#(nil(), @l2, @n) -> c_31()
31: dequeue#2^#(::(@t, @ts)) -> c_27()
32: dequeue#2^#(nil()) -> c_28()
33: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :3
34: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :28
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :2
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :1
35: lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :28
-->_1 *^#(@x, @y) -> #mult^#(@x, @y) :1
36: #mult^#(#0(), #0()) -> c_36()
37: #mult^#(#0(), #neg(@y)) -> c_37()
38: #mult^#(#0(), #pos(@y)) -> c_38()
39: #mult^#(#neg(@x), #0()) -> c_39()
40: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
41: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
42: #mult^#(#pos(@x), #0()) -> c_42()
43: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
44: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
45: #add^#(#0(), @y) -> c_45()
46: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_53() :55
-->_1 #pred^#(#pos(#s(#0()))) -> c_52() :54
-->_1 #pred^#(#neg(#s(@x))) -> c_51() :53
-->_1 #pred^#(#0()) -> c_50() :52
47: #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :49
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :48
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_53() :55
-->_1 #pred^#(#pos(#s(#0()))) -> c_52() :54
-->_1 #pred^#(#neg(#s(@x))) -> c_51() :53
-->_1 #pred^#(#0()) -> c_50() :52
48: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_57() :59
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_56() :58
-->_1 #succ^#(#neg(#s(#0()))) -> c_55() :57
-->_1 #succ^#(#0()) -> c_54() :56
49: #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_57() :59
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_56() :58
-->_1 #succ^#(#neg(#s(#0()))) -> c_55() :57
-->_1 #succ^#(#0()) -> c_54() :56
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :49
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :48
50: #natmult^#(#0(), @y) -> c_58()
51: #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_2 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_2 #natmult^#(#0(), @y) -> c_58() :50
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :49
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :48
52: #pred^#(#0()) -> c_50()
53: #pred^#(#neg(#s(@x))) -> c_51()
54: #pred^#(#pos(#s(#0()))) -> c_52()
55: #pred^#(#pos(#s(#s(@x)))) -> c_53()
56: #succ^#(#0()) -> c_54()
57: #succ^#(#neg(#s(#0()))) -> c_55()
58: #succ^#(#neg(#s(#s(@x)))) -> c_56()
59: #succ^#(#pos(#s(@x))) -> c_57()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {12} and add Pre({12}) = {8} to the strict component.
- We remove {22} and add Pre({22}) = {20} to the strict component.
- We remove {25} and add Pre({25}) = {23} to the strict component.
- We remove {27} and add Pre({27}) = {24} to the strict component.
- We remove {30} and add Pre({30}) = {28} to the strict component.
- We remove {19} and add Pre({19}) = {18} to the strict component.
- We remove {15} and add Pre({15}) = {10} to the strict component.
- We remove {31} and add Pre({31}) = {16} to the strict component.
- We remove {32} and add Pre({32}) = {16} to the strict component.
- We remove {5} and add Pre({5}) = {3} to the strict component.
- We remove {2} and add Pre({2}) = {34} to the strict component.
- We remove {1} and add Pre({1}) = {35,34} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_36()
, #mult^#(#0(), #neg(@y)) -> c_37()
, #mult^#(#0(), #pos(@y)) -> c_38()
, #mult^#(#neg(@x), #0()) -> c_39()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_42()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_45()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, appendreverse#1^#(nil(), @sofar) -> c_5()
, bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, matrixMult#1^#(nil(), @m2) -> c_35()
, computeLine#1^#(nil(), @acc, @m) -> c_20()
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, lineMult#1^#(nil(), @l2, @n) -> c_31()
, dequeue#2^#(::(@t, @ts)) -> c_27()
, dequeue#2^#(nil()) -> c_28()
, #natmult^#(#0(), @y) -> c_58()
, #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_50()
, #pred^#(#neg(#s(@x))) -> c_51()
, #pred^#(#pos(#s(#0()))) -> c_52()
, #pred^#(#pos(#s(#s(@x)))) -> c_53()
, #succ^#(#0()) -> c_54()
, #succ^#(#neg(#s(#0()))) -> c_55()
, #succ^#(#neg(#s(#s(@x)))) -> c_56()
, #succ^#(#pos(#s(@x))) -> c_57() }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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
-->_1 appendreverse#1^#(nil(), @sofar) -> c_5() :40
2: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
3: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
4: bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
-->_1 bftMult'#3^#(nil(), @acc, @queue) -> c_11() :41
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq)) :11
-->_1 dequeue#1^#(::(@t, @ts), @inq) -> c_24() :42
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue)) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
-->_3 enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t) :13
-->_2 enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t) :13
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :21
-->_1 dequeue#2^#(nil()) -> c_28() :49
-->_1 dequeue#2^#(::(@t, @ts)) -> c_27() :48
12: bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :14
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
13: enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
-->_1 enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29() :43
14: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :15
-->_1 matrixMult#1^#(nil(), @m2) -> c_35() :44
15: matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :16
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :14
16: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :17
-->_1 computeLine#1^#(nil(), @acc, @m) -> c_20() :45
17: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :18
-->_1 computeLine#2^#(nil(), @acc, @x, @xs) -> c_22() :46
18: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :19
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :16
19: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :20
-->_1 lineMult#1^#(nil(), @l2, @n) -> c_31() :47
20: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :23
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :22
21: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
22: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :34
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :24
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :19
23: lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_1 *^#(@x, @y) -> #mult^#(@x, @y) :24
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :19
24: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :33
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :32
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :30
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :29
-->_1 #mult^#(#pos(@x), #0()) -> c_42() :31
-->_1 #mult^#(#neg(@x), #0()) -> c_39() :28
-->_1 #mult^#(#0(), #pos(@y)) -> c_38() :27
-->_1 #mult^#(#0(), #neg(@y)) -> c_37() :26
-->_1 #mult^#(#0(), #0()) -> c_36() :25
25: #mult^#(#0(), #0()) -> c_36()
26: #mult^#(#0(), #neg(@y)) -> c_37()
27: #mult^#(#0(), #pos(@y)) -> c_38()
28: #mult^#(#neg(@x), #0()) -> c_39()
29: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
30: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
31: #mult^#(#pos(@x), #0()) -> c_42()
32: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
33: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_1 #natmult^#(#0(), @y) -> c_58() :50
34: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :39
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :38
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :37
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :36
-->_1 #add^#(#0(), @y) -> c_45() :35
35: #add^#(#0(), @y) -> c_45()
36: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_53() :55
-->_1 #pred^#(#pos(#s(#0()))) -> c_52() :54
-->_1 #pred^#(#neg(#s(@x))) -> c_51() :53
-->_1 #pred^#(#0()) -> c_50() :52
37: #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :39
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :38
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_53() :55
-->_1 #pred^#(#pos(#s(#0()))) -> c_52() :54
-->_1 #pred^#(#neg(#s(@x))) -> c_51() :53
-->_1 #pred^#(#0()) -> c_50() :52
38: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_57() :59
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_56() :58
-->_1 #succ^#(#neg(#s(#0()))) -> c_55() :57
-->_1 #succ^#(#0()) -> c_54() :56
39: #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_57() :59
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_56() :58
-->_1 #succ^#(#neg(#s(#0()))) -> c_55() :57
-->_1 #succ^#(#0()) -> c_54() :56
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :39
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :38
40: appendreverse#1^#(nil(), @sofar) -> c_5()
41: bftMult'#3^#(nil(), @acc, @queue) -> c_11()
42: dequeue#1^#(::(@t, @ts), @inq) -> c_24()
43: enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
44: matrixMult#1^#(nil(), @m2) -> c_35()
45: computeLine#1^#(nil(), @acc, @m) -> c_20()
46: computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
47: lineMult#1^#(nil(), @l2, @n) -> c_31()
48: dequeue#2^#(::(@t, @ts)) -> c_27()
49: dequeue#2^#(nil()) -> c_28()
50: #natmult^#(#0(), @y) -> c_58()
51: #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_2 #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :51
-->_2 #natmult^#(#0(), @y) -> c_58() :50
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :39
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :38
52: #pred^#(#0()) -> c_50()
53: #pred^#(#neg(#s(@x))) -> c_51()
54: #pred^#(#pos(#s(#0()))) -> c_52()
55: #pred^#(#pos(#s(#s(@x)))) -> c_53()
56: #succ^#(#0()) -> c_54()
57: #succ^#(#neg(#s(#0()))) -> c_55()
58: #succ^#(#neg(#s(#s(@x)))) -> c_56()
59: #succ^#(#pos(#s(@x))) -> c_57()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {13} and add Pre({13}) = {10,10} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_36()
, #mult^#(#0(), #neg(@y)) -> c_37()
, #mult^#(#0(), #pos(@y)) -> c_38()
, #mult^#(#neg(@x), #0()) -> c_39()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_42()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, #add^#(#0(), @y) -> c_45()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, appendreverse#1^#(nil(), @sofar) -> c_5()
, bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, matrixMult#1^#(nil(), @m2) -> c_35()
, computeLine#1^#(nil(), @acc, @m) -> c_20()
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, lineMult#1^#(nil(), @l2, @n) -> c_31()
, dequeue#2^#(::(@t, @ts)) -> c_27()
, dequeue#2^#(nil()) -> c_28()
, #natmult^#(#0(), @y) -> c_58()
, #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_50()
, #pred^#(#neg(#s(@x))) -> c_51()
, #pred^#(#pos(#s(#0()))) -> c_52()
, #pred^#(#pos(#s(#s(@x)))) -> c_53()
, #succ^#(#0()) -> c_54()
, #succ^#(#neg(#s(#0()))) -> c_55()
, #succ^#(#neg(#s(#s(@x)))) -> c_56()
, #succ^#(#pos(#s(@x))) -> c_57() }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the the dependency graph
->1:{3}
|
`->2:{4,12,10,8,5,9}
|
|->39:{6}
| |
| `->40:{7}
| |
| |->42:{11}
| | |
| | |->45:{20}
| | | |
| | | `->46:{1,2}
| | | |
| | | `->47:{39} Weak SCC
| | |
| | |->43:{48} Weak SCC
| | |
| | `->44:{49} Weak SCC
| |
| `->41:{41} Weak SCC
|
|->4:{13,14}
| |
| |->6:{15,17,16}
| | |
| | |->9:{18,22,19,21}
| | | |
| | | |->19:{23} Weak SCC
| | | | |
| | | | |->20:{24} Weak SCC
| | | | |
| | | | |->21:{25} Weak SCC
| | | | |
| | | | |->22:{26} Weak SCC
| | | | |
| | | | |->23:{27} Weak SCC
| | | | |
| | | | |->25:{28} Weak SCC
| | | | | |
| | | | | |->36:{50} Weak SCC
| | | | | |
| | | | | `->29:{51} Weak SCC
| | | | | |
| | | | | |->31:{37} Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | |->30:{38} Weak SCC
| | | | | | |
| | | | | | |->31:{37}
Weak SCC
| | | | | | | |
| | | | | | | |->32:{56}
Weak SCC
| | | | | | | |
| | | | | | | |->33:{57}
Weak SCC
| | | | | | | |
| | | | | | | |->34:{58}
Weak SCC
| | | | | | | |
| | | | | | | `->35:{59}
Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | `->36:{50} Weak SCC
| | | | |
| | | | |->26:{29} Weak SCC
| | | | | |
| | | | | |->36:{50} Weak SCC
| | | | | |
| | | | | `->29:{51} Weak SCC
| | | | | |
| | | | | |->31:{37} Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | |->30:{38} Weak SCC
| | | | | | |
| | | | | | |->31:{37}
Weak SCC
| | | | | | | |
| | | | | | | |->32:{56}
Weak SCC
| | | | | | | |
| | | | | | | |->33:{57}
Weak SCC
| | | | | | | |
| | | | | | | |->34:{58}
Weak SCC
| | | | | | | |
| | | | | | | `->35:{59}
Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | `->36:{50} Weak SCC
| | | | |
| | | | |->24:{30} Weak SCC
| | | | |
| | | | |->27:{31} Weak SCC
| | | | | |
| | | | | |->36:{50} Weak SCC
| | | | | |
| | | | | `->29:{51} Weak SCC
| | | | | |
| | | | | |->31:{37} Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | |->30:{38} Weak SCC
| | | | | | |
| | | | | | |->31:{37}
Weak SCC
| | | | | | | |
| | | | | | | |->32:{56}
Weak SCC
| | | | | | | |
| | | | | | | |->33:{57}
Weak SCC
| | | | | | | |
| | | | | | | |->34:{58}
Weak SCC
| | | | | | | |
| | | | | | | `->35:{59}
Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | `->36:{50} Weak SCC
| | | | |
| | | | `->28:{32} Weak SCC
| | | | |
| | | | |->36:{50} Weak SCC
| | | | |
| | | | `->29:{51} Weak SCC
| | | | |
| | | | |->31:{37} Weak SCC
| | | | | |
| | | | | |->32:{56}
Weak SCC
| | | | | |
| | | | | |->33:{57}
Weak SCC
| | | | | |
| | | | | |->34:{58}
Weak SCC
| | | | | |
| | | | | `->35:{59}
Weak SCC
| | | | |
| | | | |->30:{38} Weak SCC
| | | | | |
| | | | | |->31:{37}
Weak SCC
| | | | | | |
| | | | | | |->32:{56}
Weak SCC
| | | | | | |
| | | | | | |->33:{57}
Weak SCC
| | | | | | |
| | | | | | |->34:{58}
Weak SCC
| | | | | | |
| | | | | | `->35:{59}
Weak SCC
| | | | | |
| | | | | |->32:{56}
Weak SCC
| | | | | |
| | | | | |->33:{57}
Weak SCC
| | | | | |
| | | | | |->34:{58}
Weak SCC
| | | | | |
| | | | | `->35:{59}
Weak SCC
| | | | |
| | | | `->36:{50} Weak SCC
| | | |
| | | |->11:{33} Weak SCC
| | | | |
| | | | |->12:{34} Weak SCC
| | | | |
| | | | |->13:{35} Weak SCC
| | | | | |
| | | | | |->15:{52} Weak SCC
| | | | | |
| | | | | |->16:{53} Weak SCC
| | | | | |
| | | | | |->17:{54} Weak SCC
| | | | | |
| | | | | `->18:{55} Weak SCC
| | | | |
| | | | |->14:{36} Weak SCC
| | | | | |
| | | | | |->31:{37} Weak SCC
| | | | | | |
| | | | | | |->32:{56} Weak SCC
| | | | | | |
| | | | | | |->33:{57} Weak SCC
| | | | | | |
| | | | | | |->34:{58} Weak SCC
| | | | | | |
| | | | | | `->35:{59} Weak SCC
| | | | | |
| | | | | |->30:{38} Weak SCC
| | | | | | |
| | | | | | |->31:{37} Weak SCC
| | | | | | | |
| | | | | | | |->32:{56}
Weak SCC
| | | | | | | |
| | | | | | | |->33:{57}
Weak SCC
| | | | | | | |
| | | | | | | |->34:{58}
Weak SCC
| | | | | | | |
| | | | | | | `->35:{59}
Weak SCC
| | | | | | |
| | | | | | |->32:{56} Weak SCC
| | | | | | |
| | | | | | |->33:{57} Weak SCC
| | | | | | |
| | | | | | |->34:{58} Weak SCC
| | | | | | |
| | | | | | `->35:{59} Weak SCC
| | | | | |
| | | | | |->15:{52} Weak SCC
| | | | | |
| | | | | |->16:{53} Weak SCC
| | | | | |
| | | | | |->17:{54} Weak SCC
| | | | | |
| | | | | `->18:{55} Weak SCC
| | | | |
| | | | |->31:{37} Weak SCC
| | | | | |
| | | | | |->32:{56} Weak SCC
| | | | | |
| | | | | |->33:{57} Weak SCC
| | | | | |
| | | | | |->34:{58} Weak SCC
| | | | | |
| | | | | `->35:{59} Weak SCC
| | | | |
| | | | `->30:{38} Weak SCC
| | | | |
| | | | |->31:{37} Weak SCC
| | | | | |
| | | | | |->32:{56} Weak SCC
| | | | | |
| | | | | |->33:{57} Weak SCC
| | | | | |
| | | | | |->34:{58} Weak SCC
| | | | | |
| | | | | `->35:{59} Weak SCC
| | | | |
| | | | |->32:{56} Weak SCC
| | | | |
| | | | |->33:{57} Weak SCC
| | | | |
| | | | |->34:{58} Weak SCC
| | | | |
| | | | `->35:{59} Weak SCC
| | | |
| | | `->10:{47} Weak SCC
| | |
| | |->7:{45} Weak SCC
| | |
| | `->8:{46} Weak SCC
| |
| `->5:{44} Weak SCC
|
|->3:{40} Weak SCC
|
`->37:{42} Weak SCC
|
`->38:{43} 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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 4: bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, 5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, 6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, 7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, 8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, 9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, 10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, 11: dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, 12: bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, 13: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 14: matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, 15: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 16: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 17: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 18: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 19: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 20: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 21: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, 22: lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak DPs:
{ 23: *^#(@x, @y) -> #mult^#(@x, @y)
, 24: #mult^#(#0(), #0()) -> c_36()
, 25: #mult^#(#0(), #neg(@y)) -> c_37()
, 26: #mult^#(#0(), #pos(@y)) -> c_38()
, 27: #mult^#(#neg(@x), #0()) -> c_39()
, 28: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 29: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 30: #mult^#(#pos(@x), #0()) -> c_42()
, 31: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 32: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 33: +^#(@x, @y) -> #add^#(@x, @y)
, 34: #add^#(#0(), @y) -> c_45()
, 35: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 36: #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 37: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 38: #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 39: appendreverse#1^#(nil(), @sofar) -> c_5()
, 40: bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, 41: dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, 42: enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, 43: enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, 44: matrixMult#1^#(nil(), @m2) -> c_35()
, 45: computeLine#1^#(nil(), @acc, @m) -> c_20()
, 46: computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, 47: lineMult#1^#(nil(), @l2, @n) -> c_31()
, 48: dequeue#2^#(::(@t, @ts)) -> c_27()
, 49: dequeue#2^#(nil()) -> c_28()
, 50: #natmult^#(#0(), @y) -> c_58()
, 51: #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 52: #pred^#(#0()) -> c_50()
, 53: #pred^#(#neg(#s(@x))) -> c_51()
, 54: #pred^#(#pos(#s(#0()))) -> c_52()
, 55: #pred^#(#pos(#s(#s(@x)))) -> c_53()
, 56: #succ^#(#0()) -> c_54()
, 57: #succ^#(#neg(#s(#0()))) -> c_55()
, 58: #succ^#(#neg(#s(#s(@x)))) -> c_56()
, 59: #succ^#(#pos(#s(@x))) -> c_57() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 40: bftMult'#3^#(nil(), @acc, @queue) -> c_11()
, 44: matrixMult#1^#(nil(), @m2) -> c_35()
, 45: computeLine#1^#(nil(), @acc, @m) -> c_20()
, 46: computeLine#2^#(nil(), @acc, @x, @xs) -> c_22()
, 47: lineMult#1^#(nil(), @l2, @n) -> c_31()
, 33: +^#(@x, @y) -> #add^#(@x, @y)
, 34: #add^#(#0(), @y) -> c_45()
, 35: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 36: #add^#(#neg(#s(#s(@x))), @y) ->
c_47(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 52: #pred^#(#0()) -> c_50()
, 53: #pred^#(#neg(#s(@x))) -> c_51()
, 54: #pred^#(#pos(#s(#0()))) -> c_52()
, 55: #pred^#(#pos(#s(#s(@x)))) -> c_53()
, 23: *^#(@x, @y) -> #mult^#(@x, @y)
, 24: #mult^#(#0(), #0()) -> c_36()
, 25: #mult^#(#0(), #neg(@y)) -> c_37()
, 26: #mult^#(#0(), #pos(@y)) -> c_38()
, 27: #mult^#(#neg(@x), #0()) -> c_39()
, 30: #mult^#(#pos(@x), #0()) -> c_42()
, 28: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 29: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 31: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 32: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 51: #natmult^#(#s(@x), @y) ->
c_59(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 38: #add^#(#pos(#s(#s(@x))), @y) ->
c_49(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 37: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 56: #succ^#(#0()) -> c_54()
, 57: #succ^#(#neg(#s(#0()))) -> c_55()
, 58: #succ^#(#neg(#s(#s(@x)))) -> c_56()
, 59: #succ^#(#pos(#s(@x))) -> c_57()
, 50: #natmult^#(#0(), @y) -> c_58()
, 42: enqueue^#(@t, @queue) -> enqueue#1^#(@queue, @t)
, 43: enqueue#1^#(tuple#2(@outq, @inq), @t) -> c_29()
, 41: dequeue#1^#(::(@t, @ts), @inq) -> c_24()
, 48: dequeue#2^#(::(@t, @ts)) -> c_27()
, 49: dequeue#2^#(nil()) -> c_28()
, 39: appendreverse#1^#(nil(), @sofar) -> c_5() }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
4: bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq)) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue)) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
-->_2 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :20
12: bftMult'#5^#(@queue', @acc, @y) ->
c_16(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :13
-->_1 bftMult'^#(@queue, @acc) ->
c_7(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
13: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :14
14: matrixMult#1^#(::(@l, @ls), @m2) ->
c_34(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :15
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :13
15: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :16
16: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :17
17: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_21(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :18
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :15
18: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :19
19: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :22
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :21
20: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
21: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :18
22: lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :18
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
c_14(bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y),
enqueue^#(@t2, enqueue(@t1, @queue)),
enqueue^#(@t1, @queue))
, dequeue#1^#(nil(), @inq) ->
c_25(dequeue#2^#(reverse(@inq)), reverse^#(@inq))
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_32(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_33(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, reverse^#(@xs) -> appendreverse^#(@xs, nil())
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We employ 'linear path analysis' using the following approximated
dependency graph:
->1:{3} [ ? ]
|
`->2:{4,12,10,8,5,9} [ ? ]
|
|->6:{6} [ ? ]
| |
| `->7:{7} [ ? ]
| |
| `->8:{11} [ ? ]
| |
| `->9:{20} [ ? ]
| |
| `->10:{1,2} [ MAYBE ]
|
`->3:{13,14} [ ? ]
|
`->4:{15,17,16} [ ? ]
|
`->5:{18,22,19,21} [ MAYBE ]
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 4: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, 5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, 6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, 7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, 8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, 9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, 10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, 11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, 12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, 13: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 14: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, 15: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 16: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 17: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 18: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 19: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 20: reverse^#(@xs) -> appendreverse^#(@xs, nil())
, 21: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, 22: lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) }
* Path 1:{3}->2:{4,12,10,8,5,9}->6:{6}->7:{7}->8:{11}->9:{20}->10:{1,2}: MAYBE
----------------------------------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
4: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :4
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 {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :5
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
5: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :6
6: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :10
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :11
10: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :12
11: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
12: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
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 {12} and add Pre({12}) = {10} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :5
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
5: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :6
6: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :10
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :11
10: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
11: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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 {10} and add Pre({10}) = {6} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :5
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
5: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :6
6: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :12
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
11: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
12: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
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 MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :5
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :6
5: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :11
6: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :8
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :7
7: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
8: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :9
9: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
10: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
11: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :12
12: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
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 MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :10
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :5
5: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :7
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :6
6: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
7: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :8
8: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
9: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
10: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :11
11: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :12
12: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
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 {8} and add Pre({8}) = {7} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :9
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :5
5: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :7
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :6
6: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
7: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
8: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
9: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :10
10: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :8
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :5
5: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :6
6: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
7: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
8: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :9
9: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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 MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :7
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :5
5: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
6: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
7: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :8
8: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :4
4: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
5: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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 MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
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: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
3: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
4: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :3
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 {2} and add Pre({2}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the following dependency-graph
1: appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
-->_1 appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar)) :3
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_2 bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2) :6
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :5
3: appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
4: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
5: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :8
6: bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
-->_1 dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq) :7
7: dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
-->_1 dequeue#1^#(nil(), @inq) -> reverse^#(@inq) :11
8: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :10
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :9
9: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
10: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :12
11: dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
-->_1 reverse^#(@xs) -> appendreverse^#(@xs, nil()) :13
12: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
13: reverse^#(@xs) -> appendreverse^#(@xs, nil())
-->_1 appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
None of the processors succeeded.
Details of failed attempt(s):
-----------------------------
1) 'empty' failed due to the following reason:
Empty strict component of the problem is NOT empty.
2) 'With Problem ...' failed due to the following reason:
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar)
, appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Remaining Rules (B):
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, bftMult'^#(@queue, @acc) -> bftMult'#2^#(@queue)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
StartTerms: basic terms
Strategy: innermost
The number of B-applications is expressed by the following problem.
Problem (B):
------------
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
StartTerms: basic terms
Strategy: innermost
TcT answers on problem (B) YES(O(1),O(n^1)).
Sub-proof:
----------
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We consider the following dependency-graph
1: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
2: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'matrix interpretation of dimension 1' to
orient following rules strictly.
DPs:
{ 1: bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, 2: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, 6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, 7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(*) = {}, Uargs(#mult) = {}, Uargs(+) = {}, Uargs(#add) = {},
Uargs(appendreverse) = {}, Uargs(appendreverse#1) = {},
Uargs(::) = {}, Uargs(tuple#2) = {}, Uargs(bftMult'#2) = {},
Uargs(dequeue) = {}, Uargs(node) = {}, Uargs(enqueue) = {},
Uargs(matrixMult) = {}, Uargs(computeLine) = {},
Uargs(computeLine#1) = {}, Uargs(computeLine#2) = {},
Uargs(lineMult) = {}, Uargs(dequeue#1) = {}, Uargs(reverse) = {},
Uargs(dequeue#2) = {}, Uargs(enqueue#1) = {},
Uargs(lineMult#1) = {}, Uargs(lineMult#2) = {},
Uargs(matrixMult#1) = {}, Uargs(#s) = {}, Uargs(#neg) = {},
Uargs(#pred) = {}, Uargs(#pos) = {}, Uargs(#succ) = {},
Uargs(#natmult) = {}, Uargs(*^#) = {}, Uargs(#mult^#) = {},
Uargs(+^#) = {}, Uargs(#add^#) = {}, Uargs(appendreverse^#) = {},
Uargs(appendreverse#1^#) = {}, Uargs(bftMult^#) = {},
Uargs(bftMult'^#) = {}, Uargs(bftMult'#1^#) = {},
Uargs(bftMult'#2^#) = {}, Uargs(dequeue^#) = {},
Uargs(bftMult'#3^#) = {}, Uargs(bftMult'#4^#) = {},
Uargs(dequeue#1^#) = {}, Uargs(bftMult'#5^#) = {},
Uargs(enqueue^#) = {}, Uargs(enqueue#1^#) = {},
Uargs(matrixMult^#) = {}, Uargs(matrixMult#1^#) = {},
Uargs(computeLine^#) = {}, Uargs(computeLine#1^#) = {},
Uargs(computeLine#2^#) = {}, Uargs(lineMult^#) = {},
Uargs(lineMult#1^#) = {}, Uargs(dequeue#2^#) = {},
Uargs(reverse^#) = {}, Uargs(lineMult#2^#) = {},
Uargs(#natmult^#) = {}, Uargs(#pred^#) = {}, Uargs(#succ^#) = {},
Uargs(c_1) = {}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[*](x1, x2) = [0]
[#mult](x1, x2) = [0]
[+](x1, x2) = [1] x2 + [0]
[#add](x1, x2) = [1] x2 + [0]
[appendreverse](x1, x2) = [1] x1 + [1] x2 + [0]
[appendreverse#1](x1, x2) = [1] x1 + [1] x2 + [0]
[::](x1, x2) = [1] x1 + [1] x2 + [0]
[nil] = [0]
[tuple#2](x1, x2) = [1] x1 + [1] x2 + [0]
[bftMult'#2](x1) = [1] x1 + [0]
[dequeue](x1, x2) = [1] x1 + [1] x2 + [0]
[leaf] = [2]
[node](x1, x2, x3) = [1] x1 + [1] x2 + [1] x3 + [2]
[enqueue](x1, x2) = [1] x1 + [1] x2 + [0]
[matrixMult](x1, x2) = [0]
[computeLine](x1, x2, x3) = [2] x3 + [0]
[computeLine#1](x1, x2, x3) = [2] x2 + [0]
[computeLine#2](x1, x2, x3, x4) = [2] x2 + [0]
[lineMult](x1, x2, x3) = [1] x3 + [0]
[dequeue#1](x1, x2) = [1] x1 + [1] x2 + [0]
[reverse](x1) = [1] x1 + [0]
[dequeue#2](x1) = [1] x1 + [0]
[enqueue#1](x1, x2) = [1] x1 + [1] x2 + [0]
[lineMult#1](x1, x2, x3) = [1] x2 + [0]
[lineMult#2](x1, x2, x3, x4) = [1] x1 + [0]
[matrixMult#1](x1, x2) = [0]
[#0] = [0]
[#s](x1) = [0]
[#neg](x1) = [0]
[#pred](x1) = [0]
[#pos](x1) = [0]
[#succ](x1) = [0]
[#natmult](x1, x2) = [0]
[*^#](x1, x2) = [0]
[#mult^#](x1, x2) = [0]
[+^#](x1, x2) = [0]
[#add^#](x1, x2) = [0]
[appendreverse^#](x1, x2) = [0]
[appendreverse#1^#](x1, x2) = [0]
[bftMult^#](x1, x2) = [3] x1 + [3] x2 + [3]
[bftMult'^#](x1, x2) = [2] x1 + [1]
[bftMult'#1^#](x1, x2) = [2] x1 + [0]
[bftMult'#2^#](x1) = [0]
[dequeue^#](x1, x2) = [0]
[bftMult'#3^#](x1, x2, x3) = [2] x1 + [2] x3 + [0]
[bftMult'#4^#](x1, x2, x3) = [2] x1 + [2] x3 + [0]
[dequeue#1^#](x1, x2) = [0]
[bftMult'#5^#](x1, x2, x3) = [2] x1 + [3]
[enqueue^#](x1, x2) = [0]
[enqueue#1^#](x1, x2) = [0]
[matrixMult^#](x1, x2) = [0]
[matrixMult#1^#](x1, x2) = [0]
[computeLine^#](x1, x2, x3) = [0]
[computeLine#1^#](x1, x2, x3) = [0]
[computeLine#2^#](x1, x2, x3, x4) = [0]
[lineMult^#](x1, x2, x3) = [0]
[lineMult#1^#](x1, x2, x3) = [0]
[dequeue#2^#](x1) = [0]
[reverse^#](x1) = [0]
[lineMult#2^#](x1, x2, x3, x4) = [0]
[#natmult^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
[c_1](x1, x2) = [0]
[c] = [0]
This order satisfies following ordering constraints
[*(@x, @y)] = [0]
>= [0]
= [#mult(@x, @y)]
[#mult(#0(), #0())] = [0]
>= [0]
= [#0()]
[#mult(#0(), #neg(@y))] = [0]
>= [0]
= [#0()]
[#mult(#0(), #pos(@y))] = [0]
>= [0]
= [#0()]
[#mult(#neg(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#neg(@x), #neg(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[#mult(#neg(@x), #pos(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #0())] = [0]
>= [0]
= [#0()]
[#mult(#pos(@x), #neg(@y))] = [0]
>= [0]
= [#neg(#natmult(@x, @y))]
[#mult(#pos(@x), #pos(@y))] = [0]
>= [0]
= [#pos(#natmult(@x, @y))]
[+(@x, @y)] = [1] @y + [0]
>= [1] @y + [0]
= [#add(@x, @y)]
[#add(#0(), @y)] = [1] @y + [0]
>= [1] @y + [0]
= [@y]
[#add(#neg(#s(#0())), @y)] = [1] @y + [0]
>= [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [1] @y + [0]
>= [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [1] @y + [0]
>= [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [1] @y + [0]
>= [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[appendreverse(@toreverse, @sofar)] = [1] @sofar + [1] @toreverse + [0]
>= [1] @sofar + [1] @toreverse + [0]
= [appendreverse#1(@toreverse, @sofar)]
[appendreverse#1(::(@a, @as), @sofar)] = [1] @a + [1] @as + [1] @sofar + [0]
>= [1] @a + [1] @as + [1] @sofar + [0]
= [appendreverse(@as, ::(@a, @sofar))]
[appendreverse#1(nil(), @sofar)] = [1] @sofar + [0]
>= [1] @sofar + [0]
= [@sofar]
[bftMult'#2(tuple#2(@dequeue@1, @dequeue@2))] = [1] @dequeue@1 + [1] @dequeue@2 + [0]
>= [1] @dequeue@1 + [1] @dequeue@2 + [0]
= [dequeue(@dequeue@1, @dequeue@2)]
[dequeue(@outq, @inq)] = [1] @inq + [1] @outq + [0]
>= [1] @inq + [1] @outq + [0]
= [dequeue#1(@outq, @inq)]
[enqueue(@t, @queue)] = [1] @queue + [1] @t + [0]
>= [1] @queue + [1] @t + [0]
= [enqueue#1(@queue, @t)]
[matrixMult(@m1, @m2)] = [0]
>= [0]
= [matrixMult#1(@m1, @m2)]
[computeLine(@line, @m, @acc)] = [2] @acc + [0]
>= [2] @acc + [0]
= [computeLine#1(@line, @acc, @m)]
[computeLine#1(::(@x, @xs), @acc, @m)] = [2] @acc + [0]
>= [2] @acc + [0]
= [computeLine#2(@m, @acc, @x, @xs)]
[computeLine#1(nil(), @acc, @m)] = [2] @acc + [0]
>= [1] @acc + [0]
= [@acc]
[computeLine#2(::(@l, @ls), @acc, @x, @xs)] = [2] @acc + [0]
>= [2] @acc + [0]
= [computeLine(@xs, @ls, lineMult(@x, @l, @acc))]
[computeLine#2(nil(), @acc, @x, @xs)] = [2] @acc + [0]
>= [0]
= [nil()]
[lineMult(@n, @l1, @l2)] = [1] @l2 + [0]
>= [1] @l2 + [0]
= [lineMult#1(@l1, @l2, @n)]
[dequeue#1(::(@t, @ts), @inq)] = [1] @inq + [1] @t + [1] @ts + [0]
>= [1] @inq + [1] @t + [1] @ts + [0]
= [tuple#2(::(@t, nil()), tuple#2(@ts, @inq))]
[dequeue#1(nil(), @inq)] = [1] @inq + [0]
>= [1] @inq + [0]
= [dequeue#2(reverse(@inq))]
[reverse(@xs)] = [1] @xs + [0]
>= [1] @xs + [0]
= [appendreverse(@xs, nil())]
[dequeue#2(::(@t, @ts))] = [1] @t + [1] @ts + [0]
>= [1] @t + [1] @ts + [0]
= [tuple#2(::(@t, nil()), tuple#2(@ts, nil()))]
[dequeue#2(nil())] = [0]
>= [0]
= [tuple#2(nil(), tuple#2(nil(), nil()))]
[enqueue#1(tuple#2(@outq, @inq), @t)] = [1] @inq + [1] @outq + [1] @t + [0]
>= [1] @inq + [1] @outq + [1] @t + [0]
= [tuple#2(@outq, ::(@t, @inq))]
[lineMult#1(::(@x, @xs), @l2, @n)] = [1] @l2 + [0]
>= [1] @l2 + [0]
= [lineMult#2(@l2, @n, @x, @xs)]
[lineMult#1(nil(), @l2, @n)] = [1] @l2 + [0]
>= [0]
= [nil()]
[lineMult#2(::(@y, @ys), @n, @x, @xs)] = [1] @y + [1] @ys + [0]
>= [1] @y + [1] @ys + [0]
= [::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))]
[lineMult#2(nil(), @n, @x, @xs)] = [0]
>= [0]
= [::(*(@x, @n), lineMult(@n, @xs, nil()))]
[matrixMult#1(::(@l, @ls), @m2)] = [0]
>= [0]
= [::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))]
[matrixMult#1(nil(), @m2)] = [0]
>= [0]
= [nil()]
[#pred(#0())] = [0]
>= [0]
= [#neg(#s(#0()))]
[#pred(#neg(#s(@x)))] = [0]
>= [0]
= [#neg(#s(#s(@x)))]
[#pred(#pos(#s(#0())))] = [0]
>= [0]
= [#0()]
[#pred(#pos(#s(#s(@x))))] = [0]
>= [0]
= [#pos(#s(@x))]
[#succ(#0())] = [0]
>= [0]
= [#pos(#s(#0()))]
[#succ(#neg(#s(#0())))] = [0]
>= [0]
= [#0()]
[#succ(#neg(#s(#s(@x))))] = [0]
>= [0]
= [#neg(#s(@x))]
[#succ(#pos(#s(@x)))] = [0]
>= [0]
= [#pos(#s(#s(@x)))]
[#natmult(#0(), @y)] = [0]
>= [0]
= [#0()]
[#natmult(#s(@x), @y)] = [0]
>= [0]
= [#add(#pos(@y), #natmult(@x, @y))]
[bftMult^#(@t, @acc)] = [3] @acc + [3] @t + [3]
> [2] @t + [1]
= [bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)]
[bftMult'^#(@queue, @acc)] = [2] @queue + [1]
> [2] @queue + [0]
= [bftMult'#1^#(bftMult'#2(@queue), @acc)]
[bftMult'#1^#(tuple#2(@elem, @queue), @acc)] = [2] @elem + [2] @queue + [0]
>= [2] @elem + [2] @queue + [0]
= [bftMult'#3^#(@elem, @acc, @queue)]
[bftMult'#3^#(::(@t, @_@3), @acc, @queue)] = [2] @_@3 + [2] @queue + [2] @t + [0]
>= [2] @queue + [2] @t + [0]
= [bftMult'#4^#(@t, @acc, @queue)]
[bftMult'#4^#(leaf(), @acc, @queue)] = [2] @queue + [4]
> [2] @queue + [1]
= [bftMult'^#(@queue, @acc)]
[bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue)] = [2] @queue + [2] @t1 + [2] @t2 + [2] @y + [4]
> [2] @queue + [2] @t1 + [2] @t2 + [3]
= [bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)]
[bftMult'#5^#(@queue', @acc, @y)] = [2] @queue' + [3]
> [2] @queue' + [1]
= [bftMult'^#(@queue', matrixMult(@acc, @y))]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,2,5,6,7}. Here rules are labeled according to the (estimated)
dependency graph
1: bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
2: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc) :1
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc) :1
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
-->_1 bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc) :1
- The rules {1,2,5,6,7} have known complexity. These cover all
predecessors of {3}, their complexity is equally bounded.
- The rules {1,2,3,5,6,7} have known complexity. These cover all
predecessors of {4}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1} Weak SCC
|
`->2:{2,7,6,4,3,5} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 2: bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, 3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, 4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, 5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, 6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, 7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y)) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, 2: bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, 7: bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, 6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, 4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, 3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, 5: bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) }
We apply the transformation 'usablerules' on the sub-problem:
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
StartTerms: basic terms
Strategy: innermost
No rule is usable.
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ appendreverse^#(@toreverse, @sofar) ->
appendreverse#1^#(@toreverse, @sofar) }
Weak DPs:
{ appendreverse#1^#(::(@a, @as), @sofar) ->
appendreverse^#(@as, ::(@a, @sofar))
, bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, bftMult'^#(@queue, @acc) -> bftMult'#2^#(@queue)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#2^#(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue^#(@dequeue@1, @dequeue@2)
, dequeue^#(@outq, @inq) -> dequeue#1^#(@outq, @inq)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, dequeue#1^#(nil(), @inq) -> reverse^#(@inq)
, bftMult'#5^#(@queue', @acc, @y) ->
bftMult'^#(@queue', matrixMult(@acc, @y))
, reverse^#(@xs) -> appendreverse^#(@xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
None of the processors succeeded.
Details of failed attempt(s):
-----------------------------
1) 'empty' failed due to the following reason:
Empty strict component of the problem is NOT empty.
2) 'empty' failed due to the following reason:
Empty strict component of the problem is NOT empty.
* Path 1:{3}->2:{4,12,10,8,5,9}->3:{13,14}->4:{15,17,16}->5:{18,22,19,21}: MAYBE
------------------------------------------------------------------------------
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :12
12: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
13: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {16} and add Pre({16}) = {14} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) }
Weak DPs:
{ lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :12
12: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
13: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {15} and add Pre({15}) = {14} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) }
Weak DPs:
{ lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :12
12: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
13: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {14} and add Pre({14}) = {13} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :12
12: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
13: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :13
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {12} and add Pre({12}) = {11} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :11
11: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
12: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :12
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :12
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :12
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {11} and add Pre({11}) = {10} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
10: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
11: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :11
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :10
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :11
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :11
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {9} and add Pre({9}) = {8} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :7
7: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
9: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
10: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :9
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :10
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :9
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :10
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :10
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {7} and add Pre({7}) = {6} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :6
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
7: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
8: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
9: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :7
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :8
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :7
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :9
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :8
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :9
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :9
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :5
5: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
6: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
7: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
8: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :6
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :7
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :6
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :7
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
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 MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :4
4: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
5: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
6: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
7: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :5
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :6
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :5
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :7
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :6
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :7
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :7
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 MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :3
3: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
4: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
5: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
6: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :4
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :5
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :4
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :6
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :5
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :6
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :6
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 MAYBE.
Strict DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the (estimated) dependency graph
1: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
2: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :6
3: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
4: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
5: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
6: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :3
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :2
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :4
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :3
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :5
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :4
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :5
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :5
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {1} and add Pre({1}) = {} to the strict component.
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We consider the following dependency-graph
1: bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue))
-->_1 bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue) :6
2: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :11
3: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :12
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :14
5: bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
6: bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
-->_1 bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue) :7
7: bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
-->_1 bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y) :9
-->_1 bftMult'#4^#(leaf(), @acc, @queue) ->
bftMult'^#(@queue, @acc) :8
8: bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
9: bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
-->_1 bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y)) :10
10: bftMult'#5^#(@queue', @acc, @y) ->
c_2(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :2
-->_1 bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc),
bftMult'#2^#(@queue)) :1
11: matrixMult#1^#(::(@l, @ls), @m2) ->
c_3(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :3
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :2
12: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :13
13: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_4(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :3
14: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :16
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :15
15: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
16: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ bftMult'^#(@queue, @acc) ->
c_1(bftMult'#1^#(bftMult'#2(@queue), @acc), bftMult'#2^#(@queue)) }
We are left with following problem, upon which TcT provides the
certificate MAYBE.
Strict DPs:
{ bftMult'^#(@queue, @acc) ->
bftMult'#1^#(bftMult'#2(@queue), @acc)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) }
Weak DPs:
{ bftMult^#(@t, @acc) ->
bftMult'^#(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'#1^#(tuple#2(@elem, @queue), @acc) ->
bftMult'#3^#(@elem, @acc, @queue)
, bftMult'#3^#(::(@t, @_@3), @acc, @queue) ->
bftMult'#4^#(@t, @acc, @queue)
, bftMult'#4^#(leaf(), @acc, @queue) -> bftMult'^#(@queue, @acc)
, bftMult'#4^#(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5^#(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, bftMult'#5^#(@queue', @acc, @y) ->
c_1(bftMult'^#(@queue', matrixMult(@acc, @y)),
matrixMult^#(@acc, @y))
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_3(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil()) }
Weak Trs:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult(@t, @acc) ->
bftMult'(tuple#2(::(@t, nil()), nil()), @acc)
, bftMult'(@queue, @acc) -> bftMult'#1(bftMult'#2(@queue), @acc)
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, bftMult'#1(tuple#2(@elem, @queue), @acc) ->
bftMult'#3(@elem, @acc, @queue)
, bftMult'#3(::(@t, @_@3), @acc, @queue) ->
bftMult'#4(@t, @acc, @queue)
, bftMult'#3(nil(), @acc, @queue) -> @acc
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, bftMult'#4(leaf(), @acc, @queue) -> bftMult'(@queue, @acc)
, bftMult'#4(node(@y, @t1, @t2), @acc, @queue) ->
bftMult'#5(enqueue(@t2, enqueue(@t1, @queue)), @acc, @y)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, bftMult'#5(@queue', @acc, @y) ->
bftMult'(@queue', matrixMult(@acc, @y))
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
Obligation:
innermost runtime complexity
Answer:
MAYBE
We replace strict/weak-rules by the corresponding usable rules:
Weak Usable Rules:
{ *(@x, @y) -> #mult(@x, @y)
, #mult(#0(), #0()) -> #0()
, #mult(#0(), #neg(@y)) -> #0()
, #mult(#0(), #pos(@y)) -> #0()
, #mult(#neg(@x), #0()) -> #0()
, #mult(#neg(@x), #neg(@y)) -> #pos(#natmult(@x, @y))
, #mult(#neg(@x), #pos(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #0()) -> #0()
, #mult(#pos(@x), #neg(@y)) -> #neg(#natmult(@x, @y))
, #mult(#pos(@x), #pos(@y)) -> #pos(#natmult(@x, @y))
, +(@x, @y) -> #add(@x, @y)
, #add(#0(), @y) -> @y
, #add(#neg(#s(#0())), @y) -> #pred(@y)
, #add(#neg(#s(#s(@x))), @y) -> #pred(#add(#pos(#s(@x)), @y))
, #add(#pos(#s(#0())), @y) -> #succ(@y)
, #add(#pos(#s(#s(@x))), @y) -> #succ(#add(#pos(#s(@x)), @y))
, appendreverse(@toreverse, @sofar) ->
appendreverse#1(@toreverse, @sofar)
, appendreverse#1(::(@a, @as), @sofar) ->
appendreverse(@as, ::(@a, @sofar))
, appendreverse#1(nil(), @sofar) -> @sofar
, bftMult'#2(tuple#2(@dequeue@1, @dequeue@2)) ->
dequeue(@dequeue@1, @dequeue@2)
, dequeue(@outq, @inq) -> dequeue#1(@outq, @inq)
, enqueue(@t, @queue) -> enqueue#1(@queue, @t)
, matrixMult(@m1, @m2) -> matrixMult#1(@m1, @m2)
, computeLine(@line, @m, @acc) -> computeLine#1(@line, @acc, @m)
, computeLine#1(::(@x, @xs), @acc, @m) ->
computeLine#2(@m, @acc, @x, @xs)
, computeLine#1(nil(), @acc, @m) -> @acc
, computeLine#2(::(@l, @ls), @acc, @x, @xs) ->
computeLine(@xs, @ls, lineMult(@x, @l, @acc))
, computeLine#2(nil(), @acc, @x, @xs) -> nil()
, lineMult(@n, @l1, @l2) -> lineMult#1(@l1, @l2, @n)
, dequeue#1(::(@t, @ts), @inq) ->
tuple#2(::(@t, nil()), tuple#2(@ts, @inq))
, dequeue#1(nil(), @inq) -> dequeue#2(reverse(@inq))
, reverse(@xs) -> appendreverse(@xs, nil())
, dequeue#2(::(@t, @ts)) ->
tuple#2(::(@t, nil()), tuple#2(@ts, nil()))
, dequeue#2(nil()) -> tuple#2(nil(), tuple#2(nil(), nil()))
, enqueue#1(tuple#2(@outq, @inq), @t) ->
tuple#2(@outq, ::(@t, @inq))
, lineMult#1(::(@x, @xs), @l2, @n) -> lineMult#2(@l2, @n, @x, @xs)
, lineMult#1(nil(), @l2, @n) -> nil()
, lineMult#2(::(@y, @ys), @n, @x, @xs) ->
::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))
, lineMult#2(nil(), @n, @x, @xs) ->
::(*(@x, @n), lineMult(@n, @xs, nil()))
, matrixMult#1(::(@l, @ls), @m2) ->
::(computeLine(@l, @m2, nil()), matrixMult(@ls, @m2))
, matrixMult#1(nil(), @m2) -> nil()
, #pred(#0()) -> #neg(#s(#0()))
, #pred(#neg(#s(@x))) -> #neg(#s(#s(@x)))
, #pred(#pos(#s(#0()))) -> #0()
, #pred(#pos(#s(#s(@x)))) -> #pos(#s(@x))
, #succ(#0()) -> #pos(#s(#0()))
, #succ(#neg(#s(#0()))) -> #0()
, #succ(#neg(#s(#s(@x)))) -> #neg(#s(@x))
, #succ(#pos(#s(@x))) -> #pos(#s(#s(@x)))
, #natmult(#0(), @y) -> #0()
, #natmult(#s(@x), @y) -> #add(#pos(@y), #natmult(@x, @y)) }
No subproblems were checked.
Arrrr..