tct
YES(O(1),O(n^2))
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict Trs:
{ *(@x, @y) -> #mult(@x, @y)
, +(@x, @y) -> #add(@x, @y)
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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:
YES(O(1),O(n^2))
We add following dependency tuples
Strict DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, 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_5()
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, 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_10()
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, matrixMult#1^#(nil(), @m2) -> c_15() }
Weak DPs:
{ #mult^#(#0(), #0()) -> c_16()
, #mult^#(#0(), #neg(@y)) -> c_17()
, #mult^#(#0(), #pos(@y)) -> c_18()
, #mult^#(#neg(@x), #0()) -> c_19()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_22()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #add^#(#0(), @y) -> c_25()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#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_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natmult^#(#0(), @y) -> c_38()
, #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_30()
, #pred^#(#neg(#s(@x))) -> c_31()
, #pred^#(#pos(#s(#0()))) -> c_32()
, #pred^#(#pos(#s(#s(@x)))) -> c_33()
, #succ^#(#0()) -> c_34()
, #succ^#(#neg(#s(#0()))) -> c_35()
, #succ^#(#neg(#s(#s(@x)))) -> c_36()
, #succ^#(#pos(#s(@x))) -> c_37() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, 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_5()
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, 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_10()
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, matrixMult#1^#(nil(), @m2) -> c_15() }
Weak DPs:
{ #mult^#(#0(), #0()) -> c_16()
, #mult^#(#0(), #neg(@y)) -> c_17()
, #mult^#(#0(), #pos(@y)) -> c_18()
, #mult^#(#neg(@x), #0()) -> c_19()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_22()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #add^#(#0(), @y) -> c_25()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#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_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natmult^#(#0(), @y) -> c_38()
, #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_30()
, #pred^#(#neg(#s(@x))) -> c_31()
, #pred^#(#pos(#s(#0()))) -> c_32()
, #pred^#(#pos(#s(#s(@x)))) -> c_33()
, #succ^#(#0()) -> c_34()
, #succ^#(#neg(#s(#0()))) -> c_35()
, #succ^#(#neg(#s(#s(@x)))) -> c_36()
, #succ^#(#pos(#s(@x))) -> c_37() }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :24
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :23
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :21
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :20
-->_1 #mult^#(#pos(@x), #0()) -> c_22() :22
-->_1 #mult^#(#neg(@x), #0()) -> c_19() :19
-->_1 #mult^#(#0(), #pos(@y)) -> c_18() :18
-->_1 #mult^#(#0(), #neg(@y)) -> c_17() :17
-->_1 #mult^#(#0(), #0()) -> c_16() :16
2: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :29
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :28
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :27
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :26
-->_1 #add^#(#0(), @y) -> c_25() :25
3: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :4
-->_1 computeLine#1^#(nil(), @acc, @m) -> c_5() :5
4: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :6
-->_1 computeLine#2^#(nil(), @acc, @x, @xs) -> c_7() :7
5: computeLine#1^#(nil(), @acc, @m) -> c_5()
6: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(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) :3
7: computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
8: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :9
-->_1 lineMult#1^#(nil(), @l2, @n) -> c_10() :10
9: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :12
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :11
10: lineMult#1^#(nil(), @l2, @n) -> c_10()
11: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :2
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :1
12: lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
-->_1 *^#(@x, @y) -> #mult^#(@x, @y) :1
13: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :14
-->_1 matrixMult#1^#(nil(), @m2) -> c_15() :15
14: matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :3
15: matrixMult#1^#(nil(), @m2) -> c_15()
16: #mult^#(#0(), #0()) -> c_16()
17: #mult^#(#0(), #neg(@y)) -> c_17()
18: #mult^#(#0(), #pos(@y)) -> c_18()
19: #mult^#(#neg(@x), #0()) -> c_19()
20: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_1 #natmult^#(#0(), @y) -> c_38() :30
21: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_1 #natmult^#(#0(), @y) -> c_38() :30
22: #mult^#(#pos(@x), #0()) -> c_22()
23: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_1 #natmult^#(#0(), @y) -> c_38() :30
24: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_1 #natmult^#(#0(), @y) -> c_38() :30
25: #add^#(#0(), @y) -> c_25()
26: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_33() :35
-->_1 #pred^#(#pos(#s(#0()))) -> c_32() :34
-->_1 #pred^#(#neg(#s(@x))) -> c_31() :33
-->_1 #pred^#(#0()) -> c_30() :32
27: #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :29
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :28
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_33() :35
-->_1 #pred^#(#pos(#s(#0()))) -> c_32() :34
-->_1 #pred^#(#neg(#s(@x))) -> c_31() :33
-->_1 #pred^#(#0()) -> c_30() :32
28: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_37() :39
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_36() :38
-->_1 #succ^#(#neg(#s(#0()))) -> c_35() :37
-->_1 #succ^#(#0()) -> c_34() :36
29: #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_37() :39
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_36() :38
-->_1 #succ^#(#neg(#s(#0()))) -> c_35() :37
-->_1 #succ^#(#0()) -> c_34() :36
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :29
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :28
30: #natmult^#(#0(), @y) -> c_38()
31: #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_2 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_2 #natmult^#(#0(), @y) -> c_38() :30
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :29
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :28
32: #pred^#(#0()) -> c_30()
33: #pred^#(#neg(#s(@x))) -> c_31()
34: #pred^#(#pos(#s(#0()))) -> c_32()
35: #pred^#(#pos(#s(#s(@x)))) -> c_33()
36: #succ^#(#0()) -> c_34()
37: #succ^#(#neg(#s(#0()))) -> c_35()
38: #succ^#(#neg(#s(#s(@x)))) -> c_36()
39: #succ^#(#pos(#s(@x))) -> c_37()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {15} and add Pre({15}) = {13} to the strict component.
- We remove {5} and add Pre({5}) = {3} to the strict component.
- We remove {7} and add Pre({7}) = {4} to the strict component.
- We remove {10} and add Pre({10}) = {8} to the strict component.
- We remove {2} and add Pre({2}) = {11} to the strict component.
- We remove {1} and add Pre({1}) = {12,11} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_6(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) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
Weak DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_16()
, #mult^#(#0(), #neg(@y)) -> c_17()
, #mult^#(#0(), #pos(@y)) -> c_18()
, #mult^#(#neg(@x), #0()) -> c_19()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_22()
, #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_25()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#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_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, computeLine#1^#(nil(), @acc, @m) -> c_5()
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, lineMult#1^#(nil(), @l2, @n) -> c_10()
, matrixMult#1^#(nil(), @m2) -> c_15()
, #natmult^#(#0(), @y) -> c_38()
, #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_30()
, #pred^#(#neg(#s(@x))) -> c_31()
, #pred^#(#pos(#s(#0()))) -> c_32()
, #pred^#(#pos(#s(#s(@x)))) -> c_33()
, #succ^#(#0()) -> c_34()
, #succ^#(#neg(#s(#0()))) -> c_35()
, #succ^#(#neg(#s(#s(@x)))) -> c_36()
, #succ^#(#pos(#s(@x))) -> c_37() }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the the dependency graph
->1:{8,9}
|
|->3:{1,3,2}
| |
| |->6:{4,7,5,6}
| | |
| | |->16:{10} Weak SCC
| | | |
| | | |->17:{11} Weak SCC
| | | |
| | | |->18:{12} Weak SCC
| | | |
| | | |->19:{13} Weak SCC
| | | |
| | | |->20:{14} Weak SCC
| | | |
| | | |->22:{15} Weak SCC
| | | | |
| | | | |->33:{30} Weak SCC
| | | | |
| | | | `->26:{31} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->27:{25} Weak SCC
| | | | | |
| | | | | |->28:{24} Weak SCC
| | | | | | |
| | | | | | |->29:{36} Weak SCC
| | | | | | |
| | | | | | |->30:{37} Weak SCC
| | | | | | |
| | | | | | |->31:{38} Weak SCC
| | | | | | |
| | | | | | `->32:{39} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | `->33:{30} Weak SCC
| | | |
| | | |->23:{16} Weak SCC
| | | | |
| | | | |->33:{30} Weak SCC
| | | | |
| | | | `->26:{31} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->27:{25} Weak SCC
| | | | | |
| | | | | |->28:{24} Weak SCC
| | | | | | |
| | | | | | |->29:{36} Weak SCC
| | | | | | |
| | | | | | |->30:{37} Weak SCC
| | | | | | |
| | | | | | |->31:{38} Weak SCC
| | | | | | |
| | | | | | `->32:{39} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | `->33:{30} Weak SCC
| | | |
| | | |->21:{17} Weak SCC
| | | |
| | | |->24:{18} Weak SCC
| | | | |
| | | | |->33:{30} Weak SCC
| | | | |
| | | | `->26:{31} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->27:{25} Weak SCC
| | | | | |
| | | | | |->28:{24} Weak SCC
| | | | | | |
| | | | | | |->29:{36} Weak SCC
| | | | | | |
| | | | | | |->30:{37} Weak SCC
| | | | | | |
| | | | | | |->31:{38} Weak SCC
| | | | | | |
| | | | | | `->32:{39} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | `->33:{30} Weak SCC
| | | |
| | | `->25:{19} Weak SCC
| | | |
| | | |->33:{30} Weak SCC
| | | |
| | | `->26:{31} Weak SCC
| | | |
| | | |->28:{24} Weak SCC
| | | | |
| | | | |->29:{36} Weak SCC
| | | | |
| | | | |->30:{37} Weak SCC
| | | | |
| | | | |->31:{38} Weak SCC
| | | | |
| | | | `->32:{39} Weak SCC
| | | |
| | | |->27:{25} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->29:{36} Weak SCC
| | | | |
| | | | |->30:{37} Weak SCC
| | | | |
| | | | |->31:{38} Weak SCC
| | | | |
| | | | `->32:{39} Weak SCC
| | | |
| | | `->33:{30} Weak SCC
| | |
| | |->8:{20} Weak SCC
| | | |
| | | |->9:{21} Weak SCC
| | | |
| | | |->10:{22} Weak SCC
| | | | |
| | | | |->12:{32} Weak SCC
| | | | |
| | | | |->13:{33} Weak SCC
| | | | |
| | | | |->14:{34} Weak SCC
| | | | |
| | | | `->15:{35} Weak SCC
| | | |
| | | |->11:{23} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->27:{25} Weak SCC
| | | | | |
| | | | | |->28:{24} Weak SCC
| | | | | | |
| | | | | | |->29:{36} Weak SCC
| | | | | | |
| | | | | | |->30:{37} Weak SCC
| | | | | | |
| | | | | | |->31:{38} Weak SCC
| | | | | | |
| | | | | | `->32:{39} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->12:{32} Weak SCC
| | | | |
| | | | |->13:{33} Weak SCC
| | | | |
| | | | |->14:{34} Weak SCC
| | | | |
| | | | `->15:{35} Weak SCC
| | | |
| | | |->28:{24} Weak SCC
| | | | |
| | | | |->29:{36} Weak SCC
| | | | |
| | | | |->30:{37} Weak SCC
| | | | |
| | | | |->31:{38} Weak SCC
| | | | |
| | | | `->32:{39} Weak SCC
| | | |
| | | `->27:{25} Weak SCC
| | | |
| | | |->28:{24} Weak SCC
| | | | |
| | | | |->29:{36} Weak SCC
| | | | |
| | | | |->30:{37} Weak SCC
| | | | |
| | | | |->31:{38} Weak SCC
| | | | |
| | | | `->32:{39} Weak SCC
| | | |
| | | |->29:{36} Weak SCC
| | | |
| | | |->30:{37} Weak SCC
| | | |
| | | |->31:{38} Weak SCC
| | | |
| | | `->32:{39} Weak SCC
| | |
| | `->7:{28} Weak SCC
| |
| |->4:{26} Weak SCC
| |
| `->5:{27} Weak SCC
|
`->2:{29} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, 7: lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, 8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
Weak DPs:
{ 10: *^#(@x, @y) -> #mult^#(@x, @y)
, 11: #mult^#(#0(), #0()) -> c_16()
, 12: #mult^#(#0(), #neg(@y)) -> c_17()
, 13: #mult^#(#0(), #pos(@y)) -> c_18()
, 14: #mult^#(#neg(@x), #0()) -> c_19()
, 15: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 16: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 17: #mult^#(#pos(@x), #0()) -> c_22()
, 18: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 19: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 20: +^#(@x, @y) -> #add^#(@x, @y)
, 21: #add^#(#0(), @y) -> c_25()
, 22: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 23: #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 24: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 25: #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 26: computeLine#1^#(nil(), @acc, @m) -> c_5()
, 27: computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, 28: lineMult#1^#(nil(), @l2, @n) -> c_10()
, 29: matrixMult#1^#(nil(), @m2) -> c_15()
, 30: #natmult^#(#0(), @y) -> c_38()
, 31: #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 32: #pred^#(#0()) -> c_30()
, 33: #pred^#(#neg(#s(@x))) -> c_31()
, 34: #pred^#(#pos(#s(#0()))) -> c_32()
, 35: #pred^#(#pos(#s(#s(@x)))) -> c_33()
, 36: #succ^#(#0()) -> c_34()
, 37: #succ^#(#neg(#s(#0()))) -> c_35()
, 38: #succ^#(#neg(#s(#s(@x)))) -> c_36()
, 39: #succ^#(#pos(#s(@x))) -> c_37() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 29: matrixMult#1^#(nil(), @m2) -> c_15()
, 26: computeLine#1^#(nil(), @acc, @m) -> c_5()
, 27: computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, 28: lineMult#1^#(nil(), @l2, @n) -> c_10()
, 20: +^#(@x, @y) -> #add^#(@x, @y)
, 21: #add^#(#0(), @y) -> c_25()
, 22: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 23: #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 32: #pred^#(#0()) -> c_30()
, 33: #pred^#(#neg(#s(@x))) -> c_31()
, 34: #pred^#(#pos(#s(#0()))) -> c_32()
, 35: #pred^#(#pos(#s(#s(@x)))) -> c_33()
, 10: *^#(@x, @y) -> #mult^#(@x, @y)
, 11: #mult^#(#0(), #0()) -> c_16()
, 12: #mult^#(#0(), #neg(@y)) -> c_17()
, 13: #mult^#(#0(), #pos(@y)) -> c_18()
, 14: #mult^#(#neg(@x), #0()) -> c_19()
, 17: #mult^#(#pos(@x), #0()) -> c_22()
, 15: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 16: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 18: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 19: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 31: #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 25: #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 24: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 36: #succ^#(#0()) -> c_34()
, 37: #succ^#(#neg(#s(#0()))) -> c_35()
, 38: #succ^#(#neg(#s(#s(@x)))) -> c_36()
, 39: #succ^#(#pos(#s(@x))) -> c_37()
, 30: #natmult^#(#0(), @y) -> c_38() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_6(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) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the following dependency-graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :7
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :6
6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
7: lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_1(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())
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :7
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :6
6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
7: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :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 YES(O(1),O(n^2)).
Strict DPs:
{ 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_1(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)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :6
6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
7: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :8
8: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :7
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_1(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)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :8
6: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :7
7: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :6
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
8: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :7
5: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :6
6: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :5
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
7: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :8
8: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
Weak DPs:
{ computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :6
3: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :7
4: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :5
5: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :4
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
6: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :3
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
7: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :8
8: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :3
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
Weak DPs:
{ computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :5
2: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :7
3: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :4
4: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :3
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
5: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :6
6: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
7: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :8
8: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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())
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
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))
, 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) -> 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()))
, #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 YES(O(1),O(n^2)).
Strict DPs:
{ computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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())
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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) -> 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()))
, #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^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ 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_1(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()) }
Remaining Rules (B):
{ matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs:
{ 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_1(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())
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) -> computeLine^#(@l, @m2, nil())
, matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
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))
, 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) -> 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()))
, #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:
{ matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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) -> 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()))
, #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:
{ matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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) -> 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()))
, #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 (estimated) dependency graph
1: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :2
2: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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) -> 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()))
, #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: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :2
2: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
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))
, 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) -> 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()))
, #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))
No rule is usable.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'Small Polynomial Path Order (PS,1-bounded)'
to orient following rules strictly.
DPs:
{ 2: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
Sub-proof:
----------
The input was oriented with the instance of 'Small Polynomial Path
Order (PS,1-bounded)' as induced by the safe mapping
safe(*) = {}, safe(#mult) = {}, safe(+) = {}, safe(#add) = {},
safe(::) = {1, 2}, safe(nil) = {}, safe(lineMult) = {},
safe(lineMult#1) = {}, safe(lineMult#2) = {}, safe(#0) = {},
safe(#s) = {1}, safe(#neg) = {1}, safe(#pred) = {},
safe(#pos) = {1}, safe(#succ) = {}, safe(#natmult) = {},
safe(*^#) = {}, safe(#mult^#) = {}, safe(+^#) = {},
safe(#add^#) = {}, safe(computeLine^#) = {},
safe(computeLine#1^#) = {}, safe(computeLine#2^#) = {},
safe(lineMult^#) = {}, safe(lineMult#1^#) = {},
safe(lineMult#2^#) = {}, safe(matrixMult^#) = {},
safe(matrixMult#1^#) = {}, safe(#natmult^#) = {},
safe(#pred^#) = {}, safe(#succ^#) = {}, safe(c_2) = {},
safe(c) = {}
and precedence
empty .
Following symbols are considered recursive:
{}
The recursion depth is 0.
Further, following argument filtering is employed:
pi(*) = [], pi(#mult) = [], pi(+) = [], pi(#add) = [],
pi(::) = [2], pi(nil) = [], pi(lineMult) = [], pi(lineMult#1) = [],
pi(lineMult#2) = [], pi(#0) = [], pi(#s) = [], pi(#neg) = [],
pi(#pred) = [], pi(#pos) = [], pi(#succ) = [], pi(#natmult) = [],
pi(*^#) = [], pi(#mult^#) = [], pi(+^#) = [], pi(#add^#) = [],
pi(computeLine^#) = [], pi(computeLine#1^#) = [],
pi(computeLine#2^#) = [], pi(lineMult^#) = [],
pi(lineMult#1^#) = [], pi(lineMult#2^#) = [], pi(matrixMult^#) = 1,
pi(matrixMult#1^#) = 1, pi(#natmult^#) = [], pi(#pred^#) = [],
pi(#succ^#) = [], pi(c_2) = [], pi(c) = []
Usable defined function symbols are a subset of:
{}
For your convenience, here are the satisfied ordering constraints:
pi(matrixMult^#(@m1, @m2)) = @m1
>= @m1
= pi(matrixMult#1^#(@m1, @m2))
pi(matrixMult#1^#(::(@l, @ls), @m2)) = ::(; @ls)
> @ls
= pi(matrixMult^#(@ls, @m2))
Processor 'Small Polynomial Path Order (PS,1-bounded)' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2}.
Here rules are labeled according to the (estimated) dependency
graph
1: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) :2
2: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2)
-->_1 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :1
- The rules {2} have known complexity. These cover all predecessors
of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules {1,2}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 2: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 2: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
We apply the transformation 'usablerules' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ 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_1(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())
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) -> computeLine^#(@l, @m2, nil())
, matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
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))
, 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) -> 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()))
, #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: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 4: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 9: matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil()) }
Trs:
{ +(@x, @y) -> #add(@x, @y)
, 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())) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(*) = {}, Uargs(#mult) = {}, Uargs(+) = {}, Uargs(#add) = {},
Uargs(::) = {}, Uargs(lineMult) = {}, Uargs(lineMult#1) = {},
Uargs(lineMult#2) = {}, Uargs(#s) = {}, Uargs(#neg) = {},
Uargs(#pred) = {}, Uargs(#pos) = {}, Uargs(#succ) = {},
Uargs(#natmult) = {}, Uargs(*^#) = {}, Uargs(#mult^#) = {},
Uargs(+^#) = {}, Uargs(#add^#) = {}, Uargs(computeLine^#) = {},
Uargs(computeLine#1^#) = {}, Uargs(computeLine#2^#) = {},
Uargs(lineMult^#) = {}, Uargs(lineMult#1^#) = {},
Uargs(lineMult#2^#) = {}, Uargs(matrixMult^#) = {},
Uargs(matrixMult#1^#) = {}, Uargs(#natmult^#) = {},
Uargs(#pred^#) = {}, Uargs(#succ^#) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[*](x1, x2) = [0]
[#mult](x1, x2) = [0]
[+](x1, x2) = [2] x2 + [2]
[#add](x1, x2) = [2] x2 + [0]
[::](x1, x2) = [1] x1 + [1] x2 + [2]
[nil] = [2]
[lineMult](x1, x2, x3) = [2] x2 + [2] x3 + [0]
[lineMult#1](x1, x2, x3) = [2] x1 + [2] x2 + [0]
[lineMult#2](x1, x2, x3, x4) = [2] x1 + [1] x3 + [2] x4 + [3]
[#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]
[computeLine^#](x1, x2, x3) = [3] x2 + [2]
[computeLine#1^#](x1, x2, x3) = [3] x3 + [1]
[computeLine#2^#](x1, x2, x3, x4) = [3] x1 + [1]
[lineMult^#](x1, x2, x3) = [3] x2 + [1]
[lineMult#1^#](x1, x2, x3) = [3] x1 + [1]
[lineMult#2^#](x1, x2, x3, x4) = [3] x4 + [1]
[matrixMult^#](x1, x2) = [3] x2 + [3]
[matrixMult#1^#](x1, x2) = [3] x2 + [3]
[#natmult^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [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)] = [2] @y + [2]
> [2] @y + [0]
= [#add(@x, @y)]
[#add(#0(), @y)] = [2] @y + [0]
>= [1] @y + [0]
= [@y]
[#add(#neg(#s(#0())), @y)] = [2] @y + [0]
>= [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [2] @y + [0]
>= [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [2] @y + [0]
>= [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [2] @y + [0]
>= [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[lineMult(@n, @l1, @l2)] = [2] @l1 + [2] @l2 + [0]
>= [2] @l1 + [2] @l2 + [0]
= [lineMult#1(@l1, @l2, @n)]
[lineMult#1(::(@x, @xs), @l2, @n)] = [2] @l2 + [2] @x + [2] @xs + [4]
> [2] @l2 + [1] @x + [2] @xs + [3]
= [lineMult#2(@l2, @n, @x, @xs)]
[lineMult#1(nil(), @l2, @n)] = [2] @l2 + [4]
> [2]
= [nil()]
[lineMult#2(::(@y, @ys), @n, @x, @xs)] = [1] @x + [2] @xs + [2] @y + [2] @ys + [7]
> [2] @xs + [2] @y + [2] @ys + [4]
= [::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))]
[lineMult#2(nil(), @n, @x, @xs)] = [1] @x + [2] @xs + [7]
> [2] @xs + [6]
= [::(*(@x, @n), lineMult(@n, @xs, 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))]
[computeLine^#(@line, @m, @acc)] = [3] @m + [2]
> [3] @m + [1]
= [computeLine#1^#(@line, @acc, @m)]
[computeLine#1^#(::(@x, @xs), @acc, @m)] = [3] @m + [1]
>= [3] @m + [1]
= [computeLine#2^#(@m, @acc, @x, @xs)]
[computeLine#2^#(::(@l, @ls), @acc, @x, @xs)] = [3] @l + [3] @ls + [7]
> [3] @l + [3] @ls + [3]
= [c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))]
[lineMult^#(@n, @l1, @l2)] = [3] @l1 + [1]
>= [3] @l1 + [1]
= [lineMult#1^#(@l1, @l2, @n)]
[lineMult#1^#(::(@x, @xs), @l2, @n)] = [3] @x + [3] @xs + [7]
> [3] @xs + [1]
= [lineMult#2^#(@l2, @n, @x, @xs)]
[lineMult#2^#(::(@y, @ys), @n, @x, @xs)] = [3] @xs + [1]
>= [3] @xs + [1]
= [lineMult^#(@n, @xs, @ys)]
[lineMult#2^#(nil(), @n, @x, @xs)] = [3] @xs + [1]
>= [3] @xs + [1]
= [lineMult^#(@n, @xs, nil())]
[matrixMult^#(@m1, @m2)] = [3] @m2 + [3]
>= [3] @m2 + [3]
= [matrixMult#1^#(@m1, @m2)]
[matrixMult#1^#(::(@l, @ls), @m2)] = [3] @m2 + [3]
> [3] @m2 + [2]
= [computeLine^#(@l, @m2, nil())]
[matrixMult#1^#(::(@l, @ls), @m2)] = [3] @m2 + [3]
>= [3] @m2 + [3]
= [matrixMult^#(@ls, @m2)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,4,5,9}. Here rules are labeled according to the (estimated)
dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :3
2: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
3: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :4
4: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :7
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :6
6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
7: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
matrixMult^#(@ls, @m2) :10
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil()) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil())
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
10: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2)
-->_1 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
- The rules {1,4,5,9} have known complexity. These cover all
predecessors of {3,6,7}, their complexity is equally bounded.
- The rules {1,3,4,5,6,7,9} have known complexity. These cover all
predecessors of {2}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7,9} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ 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_1(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())
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) -> computeLine^#(@l, @m2, nil())
, matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
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))
, 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) -> 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()))
, #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:{8,10} Weak SCC
|
`->2:{9} Weak SCC
|
`->3:{1,3,2} Weak SCC
|
`->4:{4,7,5,6} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, 7: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
, 8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 9: matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil())
, 10: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 10: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2)
, 9: matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil())
, 1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 7: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
, 5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) }
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))
, 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) -> 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()))
, #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
Hurray, we answered YES(O(1),O(n^2))
tct-popstar
YES(O(1),O(n^2))
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict Trs:
{ *(@x, @y) -> #mult(@x, @y)
, +(@x, @y) -> #add(@x, @y)
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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:
YES(O(1),O(n^2))
We add following dependency tuples
Strict DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, 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_5()
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, 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_10()
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, matrixMult#1^#(nil(), @m2) -> c_15() }
Weak DPs:
{ #mult^#(#0(), #0()) -> c_16()
, #mult^#(#0(), #neg(@y)) -> c_17()
, #mult^#(#0(), #pos(@y)) -> c_18()
, #mult^#(#neg(@x), #0()) -> c_19()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_22()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #add^#(#0(), @y) -> c_25()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#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_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natmult^#(#0(), @y) -> c_38()
, #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_30()
, #pred^#(#neg(#s(@x))) -> c_31()
, #pred^#(#pos(#s(#0()))) -> c_32()
, #pred^#(#pos(#s(#s(@x)))) -> c_33()
, #succ^#(#0()) -> c_34()
, #succ^#(#neg(#s(#0()))) -> c_35()
, #succ^#(#neg(#s(#s(@x)))) -> c_36()
, #succ^#(#pos(#s(@x))) -> c_37() }
and replace the set of basic marked basic terms accordingly.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, +^#(@x, @y) -> #add^#(@x, @y)
, 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_5()
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, 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_10()
, lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
, matrixMult#1^#(nil(), @m2) -> c_15() }
Weak DPs:
{ #mult^#(#0(), #0()) -> c_16()
, #mult^#(#0(), #neg(@y)) -> c_17()
, #mult^#(#0(), #pos(@y)) -> c_18()
, #mult^#(#neg(@x), #0()) -> c_19()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_22()
, #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #add^#(#0(), @y) -> c_25()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#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_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, #natmult^#(#0(), @y) -> c_38()
, #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_30()
, #pred^#(#neg(#s(@x))) -> c_31()
, #pred^#(#pos(#s(#0()))) -> c_32()
, #pred^#(#pos(#s(#s(@x)))) -> c_33()
, #succ^#(#0()) -> c_34()
, #succ^#(#neg(#s(#0()))) -> c_35()
, #succ^#(#neg(#s(#s(@x)))) -> c_36()
, #succ^#(#pos(#s(@x))) -> c_37() }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: *^#(@x, @y) -> #mult^#(@x, @y)
-->_1 #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y) :24
-->_1 #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y) :23
-->_1 #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y) :21
-->_1 #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y) :20
-->_1 #mult^#(#pos(@x), #0()) -> c_22() :22
-->_1 #mult^#(#neg(@x), #0()) -> c_19() :19
-->_1 #mult^#(#0(), #pos(@y)) -> c_18() :18
-->_1 #mult^#(#0(), #neg(@y)) -> c_17() :17
-->_1 #mult^#(#0(), #0()) -> c_16() :16
2: +^#(@x, @y) -> #add^#(@x, @y)
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :29
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :28
-->_1 #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :27
-->_1 #add^#(#neg(#s(#0())), @y) -> #pred^#(@y) :26
-->_1 #add^#(#0(), @y) -> c_25() :25
3: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :4
-->_1 computeLine#1^#(nil(), @acc, @m) -> c_5() :5
4: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :6
-->_1 computeLine#2^#(nil(), @acc, @x, @xs) -> c_7() :7
5: computeLine#1^#(nil(), @acc, @m) -> c_5()
6: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(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) :3
7: computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
8: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :9
-->_1 lineMult#1^#(nil(), @l2, @n) -> c_10() :10
9: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :12
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :11
10: lineMult#1^#(nil(), @l2, @n) -> c_10()
11: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
-->_1 +^#(@x, @y) -> #add^#(@x, @y) :2
-->_2 *^#(@x, @y) -> #mult^#(@x, @y) :1
12: lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :8
-->_1 *^#(@x, @y) -> #mult^#(@x, @y) :1
13: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :14
-->_1 matrixMult#1^#(nil(), @m2) -> c_15() :15
14: matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :13
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :3
15: matrixMult#1^#(nil(), @m2) -> c_15()
16: #mult^#(#0(), #0()) -> c_16()
17: #mult^#(#0(), #neg(@y)) -> c_17()
18: #mult^#(#0(), #pos(@y)) -> c_18()
19: #mult^#(#neg(@x), #0()) -> c_19()
20: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_1 #natmult^#(#0(), @y) -> c_38() :30
21: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_1 #natmult^#(#0(), @y) -> c_38() :30
22: #mult^#(#pos(@x), #0()) -> c_22()
23: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_1 #natmult^#(#0(), @y) -> c_38() :30
24: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
-->_1 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_1 #natmult^#(#0(), @y) -> c_38() :30
25: #add^#(#0(), @y) -> c_25()
26: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_33() :35
-->_1 #pred^#(#pos(#s(#0()))) -> c_32() :34
-->_1 #pred^#(#neg(#s(@x))) -> c_31() :33
-->_1 #pred^#(#0()) -> c_30() :32
27: #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :29
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :28
-->_1 #pred^#(#pos(#s(#s(@x)))) -> c_33() :35
-->_1 #pred^#(#pos(#s(#0()))) -> c_32() :34
-->_1 #pred^#(#neg(#s(@x))) -> c_31() :33
-->_1 #pred^#(#0()) -> c_30() :32
28: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
-->_1 #succ^#(#pos(#s(@x))) -> c_37() :39
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_36() :38
-->_1 #succ^#(#neg(#s(#0()))) -> c_35() :37
-->_1 #succ^#(#0()) -> c_34() :36
29: #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
-->_1 #succ^#(#pos(#s(@x))) -> c_37() :39
-->_1 #succ^#(#neg(#s(#s(@x)))) -> c_36() :38
-->_1 #succ^#(#neg(#s(#0()))) -> c_35() :37
-->_1 #succ^#(#0()) -> c_34() :36
-->_2 #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :29
-->_2 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :28
30: #natmult^#(#0(), @y) -> c_38()
31: #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
-->_2 #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y)) :31
-->_2 #natmult^#(#0(), @y) -> c_38() :30
-->_1 #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y)) :29
-->_1 #add^#(#pos(#s(#0())), @y) -> #succ^#(@y) :28
32: #pred^#(#0()) -> c_30()
33: #pred^#(#neg(#s(@x))) -> c_31()
34: #pred^#(#pos(#s(#0()))) -> c_32()
35: #pred^#(#pos(#s(#s(@x)))) -> c_33()
36: #succ^#(#0()) -> c_34()
37: #succ^#(#neg(#s(#0()))) -> c_35()
38: #succ^#(#neg(#s(#s(@x)))) -> c_36()
39: #succ^#(#pos(#s(@x))) -> c_37()
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {15} and add Pre({15}) = {13} to the strict component.
- We remove {5} and add Pre({5}) = {3} to the strict component.
- We remove {7} and add Pre({7}) = {4} to the strict component.
- We remove {10} and add Pre({10}) = {8} to the strict component.
- We remove {2} and add Pre({2}) = {11} to the strict component.
- We remove {1} and add Pre({1}) = {12,11} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_6(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) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
Weak DPs:
{ *^#(@x, @y) -> #mult^#(@x, @y)
, #mult^#(#0(), #0()) -> c_16()
, #mult^#(#0(), #neg(@y)) -> c_17()
, #mult^#(#0(), #pos(@y)) -> c_18()
, #mult^#(#neg(@x), #0()) -> c_19()
, #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, #mult^#(#pos(@x), #0()) -> c_22()
, #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_25()
, #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#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_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, computeLine#1^#(nil(), @acc, @m) -> c_5()
, computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, lineMult#1^#(nil(), @l2, @n) -> c_10()
, matrixMult#1^#(nil(), @m2) -> c_15()
, #natmult^#(#0(), @y) -> c_38()
, #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, #pred^#(#0()) -> c_30()
, #pred^#(#neg(#s(@x))) -> c_31()
, #pred^#(#pos(#s(#0()))) -> c_32()
, #pred^#(#pos(#s(#s(@x)))) -> c_33()
, #succ^#(#0()) -> c_34()
, #succ^#(#neg(#s(#0()))) -> c_35()
, #succ^#(#neg(#s(#s(@x)))) -> c_36()
, #succ^#(#pos(#s(@x))) -> c_37() }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the the dependency graph
->1:{8,9}
|
|->3:{1,3,2}
| |
| |->6:{4,7,5,6}
| | |
| | |->16:{10} Weak SCC
| | | |
| | | |->17:{11} Weak SCC
| | | |
| | | |->18:{12} Weak SCC
| | | |
| | | |->19:{13} Weak SCC
| | | |
| | | |->20:{14} Weak SCC
| | | |
| | | |->22:{15} Weak SCC
| | | | |
| | | | |->33:{30} Weak SCC
| | | | |
| | | | `->26:{31} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->27:{25} Weak SCC
| | | | | |
| | | | | |->28:{24} Weak SCC
| | | | | | |
| | | | | | |->29:{36} Weak SCC
| | | | | | |
| | | | | | |->30:{37} Weak SCC
| | | | | | |
| | | | | | |->31:{38} Weak SCC
| | | | | | |
| | | | | | `->32:{39} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | `->33:{30} Weak SCC
| | | |
| | | |->23:{16} Weak SCC
| | | | |
| | | | |->33:{30} Weak SCC
| | | | |
| | | | `->26:{31} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->27:{25} Weak SCC
| | | | | |
| | | | | |->28:{24} Weak SCC
| | | | | | |
| | | | | | |->29:{36} Weak SCC
| | | | | | |
| | | | | | |->30:{37} Weak SCC
| | | | | | |
| | | | | | |->31:{38} Weak SCC
| | | | | | |
| | | | | | `->32:{39} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | `->33:{30} Weak SCC
| | | |
| | | |->21:{17} Weak SCC
| | | |
| | | |->24:{18} Weak SCC
| | | | |
| | | | |->33:{30} Weak SCC
| | | | |
| | | | `->26:{31} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->27:{25} Weak SCC
| | | | | |
| | | | | |->28:{24} Weak SCC
| | | | | | |
| | | | | | |->29:{36} Weak SCC
| | | | | | |
| | | | | | |->30:{37} Weak SCC
| | | | | | |
| | | | | | |->31:{38} Weak SCC
| | | | | | |
| | | | | | `->32:{39} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | `->33:{30} Weak SCC
| | | |
| | | `->25:{19} Weak SCC
| | | |
| | | |->33:{30} Weak SCC
| | | |
| | | `->26:{31} Weak SCC
| | | |
| | | |->28:{24} Weak SCC
| | | | |
| | | | |->29:{36} Weak SCC
| | | | |
| | | | |->30:{37} Weak SCC
| | | | |
| | | | |->31:{38} Weak SCC
| | | | |
| | | | `->32:{39} Weak SCC
| | | |
| | | |->27:{25} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->29:{36} Weak SCC
| | | | |
| | | | |->30:{37} Weak SCC
| | | | |
| | | | |->31:{38} Weak SCC
| | | | |
| | | | `->32:{39} Weak SCC
| | | |
| | | `->33:{30} Weak SCC
| | |
| | |->8:{20} Weak SCC
| | | |
| | | |->9:{21} Weak SCC
| | | |
| | | |->10:{22} Weak SCC
| | | | |
| | | | |->12:{32} Weak SCC
| | | | |
| | | | |->13:{33} Weak SCC
| | | | |
| | | | |->14:{34} Weak SCC
| | | | |
| | | | `->15:{35} Weak SCC
| | | |
| | | |->11:{23} Weak SCC
| | | | |
| | | | |->28:{24} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->27:{25} Weak SCC
| | | | | |
| | | | | |->28:{24} Weak SCC
| | | | | | |
| | | | | | |->29:{36} Weak SCC
| | | | | | |
| | | | | | |->30:{37} Weak SCC
| | | | | | |
| | | | | | |->31:{38} Weak SCC
| | | | | | |
| | | | | | `->32:{39} Weak SCC
| | | | | |
| | | | | |->29:{36} Weak SCC
| | | | | |
| | | | | |->30:{37} Weak SCC
| | | | | |
| | | | | |->31:{38} Weak SCC
| | | | | |
| | | | | `->32:{39} Weak SCC
| | | | |
| | | | |->12:{32} Weak SCC
| | | | |
| | | | |->13:{33} Weak SCC
| | | | |
| | | | |->14:{34} Weak SCC
| | | | |
| | | | `->15:{35} Weak SCC
| | | |
| | | |->28:{24} Weak SCC
| | | | |
| | | | |->29:{36} Weak SCC
| | | | |
| | | | |->30:{37} Weak SCC
| | | | |
| | | | |->31:{38} Weak SCC
| | | | |
| | | | `->32:{39} Weak SCC
| | | |
| | | `->27:{25} Weak SCC
| | | |
| | | |->28:{24} Weak SCC
| | | | |
| | | | |->29:{36} Weak SCC
| | | | |
| | | | |->30:{37} Weak SCC
| | | | |
| | | | |->31:{38} Weak SCC
| | | | |
| | | | `->32:{39} Weak SCC
| | | |
| | | |->29:{36} Weak SCC
| | | |
| | | |->30:{37} Weak SCC
| | | |
| | | |->31:{38} Weak SCC
| | | |
| | | `->32:{39} Weak SCC
| | |
| | `->7:{28} Weak SCC
| |
| |->4:{26} Weak SCC
| |
| `->5:{27} Weak SCC
|
`->2:{29} Weak SCC
Here dependency-pairs are as follows:
Strict DPs:
{ 1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, 7: lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, 8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
Weak DPs:
{ 10: *^#(@x, @y) -> #mult^#(@x, @y)
, 11: #mult^#(#0(), #0()) -> c_16()
, 12: #mult^#(#0(), #neg(@y)) -> c_17()
, 13: #mult^#(#0(), #pos(@y)) -> c_18()
, 14: #mult^#(#neg(@x), #0()) -> c_19()
, 15: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 16: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 17: #mult^#(#pos(@x), #0()) -> c_22()
, 18: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 19: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 20: +^#(@x, @y) -> #add^#(@x, @y)
, 21: #add^#(#0(), @y) -> c_25()
, 22: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 23: #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 24: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 25: #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 26: computeLine#1^#(nil(), @acc, @m) -> c_5()
, 27: computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, 28: lineMult#1^#(nil(), @l2, @n) -> c_10()
, 29: matrixMult#1^#(nil(), @m2) -> c_15()
, 30: #natmult^#(#0(), @y) -> c_38()
, 31: #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 32: #pred^#(#0()) -> c_30()
, 33: #pred^#(#neg(#s(@x))) -> c_31()
, 34: #pred^#(#pos(#s(#0()))) -> c_32()
, 35: #pred^#(#pos(#s(#s(@x)))) -> c_33()
, 36: #succ^#(#0()) -> c_34()
, 37: #succ^#(#neg(#s(#0()))) -> c_35()
, 38: #succ^#(#neg(#s(#s(@x)))) -> c_36()
, 39: #succ^#(#pos(#s(@x))) -> c_37() }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 29: matrixMult#1^#(nil(), @m2) -> c_15()
, 26: computeLine#1^#(nil(), @acc, @m) -> c_5()
, 27: computeLine#2^#(nil(), @acc, @x, @xs) -> c_7()
, 28: lineMult#1^#(nil(), @l2, @n) -> c_10()
, 20: +^#(@x, @y) -> #add^#(@x, @y)
, 21: #add^#(#0(), @y) -> c_25()
, 22: #add^#(#neg(#s(#0())), @y) -> #pred^#(@y)
, 23: #add^#(#neg(#s(#s(@x))), @y) ->
c_27(#pred^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 32: #pred^#(#0()) -> c_30()
, 33: #pred^#(#neg(#s(@x))) -> c_31()
, 34: #pred^#(#pos(#s(#0()))) -> c_32()
, 35: #pred^#(#pos(#s(#s(@x)))) -> c_33()
, 10: *^#(@x, @y) -> #mult^#(@x, @y)
, 11: #mult^#(#0(), #0()) -> c_16()
, 12: #mult^#(#0(), #neg(@y)) -> c_17()
, 13: #mult^#(#0(), #pos(@y)) -> c_18()
, 14: #mult^#(#neg(@x), #0()) -> c_19()
, 17: #mult^#(#pos(@x), #0()) -> c_22()
, 15: #mult^#(#neg(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 16: #mult^#(#neg(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 18: #mult^#(#pos(@x), #neg(@y)) -> #natmult^#(@x, @y)
, 19: #mult^#(#pos(@x), #pos(@y)) -> #natmult^#(@x, @y)
, 31: #natmult^#(#s(@x), @y) ->
c_39(#add^#(#pos(@y), #natmult(@x, @y)), #natmult^#(@x, @y))
, 25: #add^#(#pos(#s(#s(@x))), @y) ->
c_29(#succ^#(#add(#pos(#s(@x)), @y)), #add^#(#pos(#s(@x)), @y))
, 24: #add^#(#pos(#s(#0())), @y) -> #succ^#(@y)
, 36: #succ^#(#0()) -> c_34()
, 37: #succ^#(#neg(#s(#0()))) -> c_35()
, 38: #succ^#(#neg(#s(#s(@x)))) -> c_36()
, 39: #succ^#(#pos(#s(@x))) -> c_37()
, 30: #natmult^#(#0(), @y) -> c_38() }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_6(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) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the following dependency-graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_6(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil())) :7
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys)) :6
6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
-->_3 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
7: lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil()))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_14(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
c_11(+^#(*(@x, @n), @y), *^#(@x, @n), lineMult^#(@n, @xs, @ys))
, lineMult#2^#(nil(), @n, @x, @xs) ->
c_12(*^#(@x, @n), lineMult^#(@n, @xs, nil())) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_1(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())
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :7
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :6
6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
7: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :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 YES(O(1),O(n^2)).
Strict DPs:
{ 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_1(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)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :6
6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
7: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :8
8: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :7
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {6} and add Pre({6}) = {5} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_1(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)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :8
6: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :7
7: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :6
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
8: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {5} and add Pre({5}) = {4} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :3
3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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) :1
4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :7
5: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :6
6: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :5
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
7: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :8
8: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :4
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {3} and add Pre({3}) = {2} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ 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)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
Weak DPs:
{ computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :2
2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :6
3: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :7
4: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :5
5: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :4
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
6: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :3
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
7: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :8
8: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :3
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :3
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
Weak DPs:
{ computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
We consider the (estimated) dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :5
2: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :7
3: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :4
4: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :3
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
5: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :6
6: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
7: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :9
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :8
8: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
9: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {4} and add Pre({4}) = {3} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).
Strict DPs:
{ computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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())
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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)
, 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(@m1, @m2) -> matrixMult#1(@m1, @m2)
, 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^2))
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))
, 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) -> 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()))
, #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 YES(O(1),O(n^2)).
Strict DPs:
{ computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(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())
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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) -> 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()))
, #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^2))
We measure the number of applications of following selected rules
relative to the remaining rules.
Selected Rules (A):
{ 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_1(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()) }
Remaining Rules (B):
{ matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
The length of a single A-subderivation is expressed by the
following problem.
Problem (A):
------------
Strict DPs:
{ 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_1(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())
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) -> computeLine^#(@l, @m2, nil())
, matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
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))
, 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) -> 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()))
, #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:
{ matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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) -> 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()))
, #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:
{ matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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) -> 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()))
, #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 (estimated) dependency graph
1: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :2
2: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :1
We estimate the application of rules based on the application of
their predecessors as follows:
- We remove {2} and add Pre({2}) = {1} to the strict component.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
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))
, 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) -> 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()))
, #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: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) :2
2: matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2))
-->_2 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :1
Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:
{ matrixMult#1^#(::(@l, @ls), @m2) ->
c_2(computeLine^#(@l, @m2, nil()), matrixMult^#(@ls, @m2)) }
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
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))
, 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) -> 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()))
, #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))
No rule is usable.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs: { matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) }
Weak DPs:
{ matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(n^1))
We use the processor 'Small Polynomial Path Order (PS,1-bounded)'
to orient following rules strictly.
DPs:
{ 2: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
Sub-proof:
----------
The input was oriented with the instance of 'Small Polynomial Path
Order (PS,1-bounded)' as induced by the safe mapping
safe(*) = {}, safe(#mult) = {}, safe(+) = {}, safe(#add) = {},
safe(::) = {1, 2}, safe(nil) = {}, safe(lineMult) = {},
safe(lineMult#1) = {}, safe(lineMult#2) = {}, safe(#0) = {},
safe(#s) = {1}, safe(#neg) = {1}, safe(#pred) = {},
safe(#pos) = {1}, safe(#succ) = {}, safe(#natmult) = {},
safe(*^#) = {}, safe(#mult^#) = {}, safe(+^#) = {},
safe(#add^#) = {}, safe(computeLine^#) = {},
safe(computeLine#1^#) = {}, safe(computeLine#2^#) = {},
safe(lineMult^#) = {}, safe(lineMult#1^#) = {},
safe(lineMult#2^#) = {}, safe(matrixMult^#) = {},
safe(matrixMult#1^#) = {}, safe(#natmult^#) = {},
safe(#pred^#) = {}, safe(#succ^#) = {}, safe(c_2) = {},
safe(c) = {}
and precedence
empty .
Following symbols are considered recursive:
{}
The recursion depth is 0.
Further, following argument filtering is employed:
pi(*) = [], pi(#mult) = [], pi(+) = [], pi(#add) = [],
pi(::) = [2], pi(nil) = [], pi(lineMult) = [], pi(lineMult#1) = [],
pi(lineMult#2) = [], pi(#0) = [], pi(#s) = [], pi(#neg) = [],
pi(#pred) = [], pi(#pos) = [], pi(#succ) = [], pi(#natmult) = [],
pi(*^#) = [], pi(#mult^#) = [], pi(+^#) = [], pi(#add^#) = [],
pi(computeLine^#) = [], pi(computeLine#1^#) = [],
pi(computeLine#2^#) = [], pi(lineMult^#) = [],
pi(lineMult#1^#) = [], pi(lineMult#2^#) = [], pi(matrixMult^#) = 1,
pi(matrixMult#1^#) = 1, pi(#natmult^#) = [], pi(#pred^#) = [],
pi(#succ^#) = [], pi(c_2) = [], pi(c) = []
Usable defined function symbols are a subset of:
{}
For your convenience, here are the satisfied ordering constraints:
pi(matrixMult^#(@m1, @m2)) = @m1
>= @m1
= pi(matrixMult#1^#(@m1, @m2))
pi(matrixMult#1^#(::(@l, @ls), @m2)) = ::(; @ls)
> @ls
= pi(matrixMult^#(@ls, @m2))
Processor 'Small Polynomial Path Order (PS,1-bounded)' induces the
complexity certificate YES(?,O(n^1)) on application of rules {2}.
Here rules are labeled according to the (estimated) dependency
graph
1: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) :2
2: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2)
-->_1 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :1
- The rules {2} have known complexity. These cover all predecessors
of {1}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules {1,2}
is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
StartTerms: basic terms
Strategy: innermost
We consider the the dependency graph
->1:{1,2} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 2: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 1: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 2: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
We apply the transformation 'usablerules' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We apply the transformation 'trivial' on the sub-problem:
Rules: Empty
StartTerms: basic terms
Strategy: innermost
We consider the dependency graph
empty
All SCCs are trivial and dependency pairs can be removed.
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(1)).
Rules: Empty
Obligation:
innermost runtime complexity
Answer:
YES(O(1),O(1))
Empty rules are trivially bounded
We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^1)).
Strict DPs:
{ 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_1(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())
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) -> computeLine^#(@l, @m2, nil())
, matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
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))
, 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) -> 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()))
, #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: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 4: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 9: matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil()) }
Trs:
{ +(@x, @y) -> #add(@x, @y)
, 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())) }
Sub-proof:
----------
The following argument positions are usable:
Uargs(*) = {}, Uargs(#mult) = {}, Uargs(+) = {}, Uargs(#add) = {},
Uargs(::) = {}, Uargs(lineMult) = {}, Uargs(lineMult#1) = {},
Uargs(lineMult#2) = {}, Uargs(#s) = {}, Uargs(#neg) = {},
Uargs(#pred) = {}, Uargs(#pos) = {}, Uargs(#succ) = {},
Uargs(#natmult) = {}, Uargs(*^#) = {}, Uargs(#mult^#) = {},
Uargs(+^#) = {}, Uargs(#add^#) = {}, Uargs(computeLine^#) = {},
Uargs(computeLine#1^#) = {}, Uargs(computeLine#2^#) = {},
Uargs(lineMult^#) = {}, Uargs(lineMult#1^#) = {},
Uargs(lineMult#2^#) = {}, Uargs(matrixMult^#) = {},
Uargs(matrixMult#1^#) = {}, Uargs(#natmult^#) = {},
Uargs(#pred^#) = {}, Uargs(#succ^#) = {}, Uargs(c_1) = {1, 2}
TcT has computed following constructor-based matrix interpretation
satisfying not(EDA).
[*](x1, x2) = [0]
[#mult](x1, x2) = [0]
[+](x1, x2) = [2] x2 + [2]
[#add](x1, x2) = [2] x2 + [0]
[::](x1, x2) = [1] x1 + [1] x2 + [2]
[nil] = [2]
[lineMult](x1, x2, x3) = [2] x2 + [2] x3 + [0]
[lineMult#1](x1, x2, x3) = [2] x1 + [2] x2 + [0]
[lineMult#2](x1, x2, x3, x4) = [2] x1 + [1] x3 + [2] x4 + [3]
[#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]
[computeLine^#](x1, x2, x3) = [3] x2 + [2]
[computeLine#1^#](x1, x2, x3) = [3] x3 + [1]
[computeLine#2^#](x1, x2, x3, x4) = [3] x1 + [1]
[lineMult^#](x1, x2, x3) = [3] x2 + [1]
[lineMult#1^#](x1, x2, x3) = [3] x1 + [1]
[lineMult#2^#](x1, x2, x3, x4) = [3] x4 + [1]
[matrixMult^#](x1, x2) = [3] x2 + [3]
[matrixMult#1^#](x1, x2) = [3] x2 + [3]
[#natmult^#](x1, x2) = [0]
[#pred^#](x1) = [0]
[#succ^#](x1) = [0]
[c_1](x1, x2) = [1] x1 + [1] x2 + [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)] = [2] @y + [2]
> [2] @y + [0]
= [#add(@x, @y)]
[#add(#0(), @y)] = [2] @y + [0]
>= [1] @y + [0]
= [@y]
[#add(#neg(#s(#0())), @y)] = [2] @y + [0]
>= [0]
= [#pred(@y)]
[#add(#neg(#s(#s(@x))), @y)] = [2] @y + [0]
>= [0]
= [#pred(#add(#pos(#s(@x)), @y))]
[#add(#pos(#s(#0())), @y)] = [2] @y + [0]
>= [0]
= [#succ(@y)]
[#add(#pos(#s(#s(@x))), @y)] = [2] @y + [0]
>= [0]
= [#succ(#add(#pos(#s(@x)), @y))]
[lineMult(@n, @l1, @l2)] = [2] @l1 + [2] @l2 + [0]
>= [2] @l1 + [2] @l2 + [0]
= [lineMult#1(@l1, @l2, @n)]
[lineMult#1(::(@x, @xs), @l2, @n)] = [2] @l2 + [2] @x + [2] @xs + [4]
> [2] @l2 + [1] @x + [2] @xs + [3]
= [lineMult#2(@l2, @n, @x, @xs)]
[lineMult#1(nil(), @l2, @n)] = [2] @l2 + [4]
> [2]
= [nil()]
[lineMult#2(::(@y, @ys), @n, @x, @xs)] = [1] @x + [2] @xs + [2] @y + [2] @ys + [7]
> [2] @xs + [2] @y + [2] @ys + [4]
= [::(+(*(@x, @n), @y), lineMult(@n, @xs, @ys))]
[lineMult#2(nil(), @n, @x, @xs)] = [1] @x + [2] @xs + [7]
> [2] @xs + [6]
= [::(*(@x, @n), lineMult(@n, @xs, 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))]
[computeLine^#(@line, @m, @acc)] = [3] @m + [2]
> [3] @m + [1]
= [computeLine#1^#(@line, @acc, @m)]
[computeLine#1^#(::(@x, @xs), @acc, @m)] = [3] @m + [1]
>= [3] @m + [1]
= [computeLine#2^#(@m, @acc, @x, @xs)]
[computeLine#2^#(::(@l, @ls), @acc, @x, @xs)] = [3] @l + [3] @ls + [7]
> [3] @l + [3] @ls + [3]
= [c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))]
[lineMult^#(@n, @l1, @l2)] = [3] @l1 + [1]
>= [3] @l1 + [1]
= [lineMult#1^#(@l1, @l2, @n)]
[lineMult#1^#(::(@x, @xs), @l2, @n)] = [3] @x + [3] @xs + [7]
> [3] @xs + [1]
= [lineMult#2^#(@l2, @n, @x, @xs)]
[lineMult#2^#(::(@y, @ys), @n, @x, @xs)] = [3] @xs + [1]
>= [3] @xs + [1]
= [lineMult^#(@n, @xs, @ys)]
[lineMult#2^#(nil(), @n, @x, @xs)] = [3] @xs + [1]
>= [3] @xs + [1]
= [lineMult^#(@n, @xs, nil())]
[matrixMult^#(@m1, @m2)] = [3] @m2 + [3]
>= [3] @m2 + [3]
= [matrixMult#1^#(@m1, @m2)]
[matrixMult#1^#(::(@l, @ls), @m2)] = [3] @m2 + [3]
> [3] @m2 + [2]
= [computeLine^#(@l, @m2, nil())]
[matrixMult#1^#(::(@l, @ls), @m2)] = [3] @m2 + [3]
>= [3] @m2 + [3]
= [matrixMult^#(@ls, @m2)]
Processor 'matrix interpretation of dimension 1' induces the
complexity certificate YES(?,O(n^1)) on application of rules
{1,4,5,9}. Here rules are labeled according to the (estimated)
dependency graph
1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
-->_1 computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs) :3
2: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
-->_1 lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs) :5
3: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
-->_1 computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc)) :4
4: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
-->_2 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
-->_1 lineMult#2^#(nil(), @n, @x, @xs) ->
lineMult^#(@n, @xs, nil()) :7
-->_1 lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) :6
6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
7: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
-->_1 lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n) :2
8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
matrixMult^#(@ls, @m2) :10
-->_1 matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil()) :9
9: matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil())
-->_1 computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m) :1
10: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2)
-->_1 matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2) :8
- The rules {1,4,5,9} have known complexity. These cover all
predecessors of {3,6,7}, their complexity is equally bounded.
- The rules {1,3,4,5,6,7,9} have known complexity. These cover all
predecessors of {2}, their complexity is equally bounded.
Overall, we obtain that the number of applications of rules
{1,2,3,4,5,6,7,9} is given by YES(?,O(n^1)).
We apply the transformation 'removetails' on the sub-problem:
Weak DPs:
{ 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_1(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())
, matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, matrixMult#1^#(::(@l, @ls), @m2) -> computeLine^#(@l, @m2, nil())
, matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
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))
, 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) -> 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()))
, #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:{8,10} Weak SCC
|
`->2:{9} Weak SCC
|
`->3:{1,3,2} Weak SCC
|
`->4:{4,7,5,6} Weak SCC
Here dependency-pairs are as follows:
Weak DPs:
{ 1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys)
, 7: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
, 8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 9: matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil())
, 10: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2) }
The following rules are part of trailing weak paths, and thus they
can be removed:
{ 8: matrixMult^#(@m1, @m2) -> matrixMult#1^#(@m1, @m2)
, 10: matrixMult#1^#(::(@l, @ls), @m2) -> matrixMult^#(@ls, @m2)
, 9: matrixMult#1^#(::(@l, @ls), @m2) ->
computeLine^#(@l, @m2, nil())
, 1: computeLine^#(@line, @m, @acc) ->
computeLine#1^#(@line, @acc, @m)
, 3: computeLine#2^#(::(@l, @ls), @acc, @x, @xs) ->
c_1(computeLine^#(@xs, @ls, lineMult(@x, @l, @acc)),
lineMult^#(@x, @l, @acc))
, 2: computeLine#1^#(::(@x, @xs), @acc, @m) ->
computeLine#2^#(@m, @acc, @x, @xs)
, 4: lineMult^#(@n, @l1, @l2) -> lineMult#1^#(@l1, @l2, @n)
, 7: lineMult#2^#(nil(), @n, @x, @xs) -> lineMult^#(@n, @xs, nil())
, 5: lineMult#1^#(::(@x, @xs), @l2, @n) ->
lineMult#2^#(@l2, @n, @x, @xs)
, 6: lineMult#2^#(::(@y, @ys), @n, @x, @xs) ->
lineMult^#(@n, @xs, @ys) }
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))
, 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) -> 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()))
, #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
Hurray, we answered YES(O(1),O(n^2))