Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Frederiksen_Glenstrup/mul)

The rewrite relation of the following TRS is considered.

mul0(Cons(x,xs),y) add0(mul0(xs,y),y) (1)
add0(Cons(x,xs),y) add0(xs,Cons(S,y)) (2)
mul0(Nil,y) Nil (3)
add0(Nil,y) y (4)
goal(xs,ys) mul0(xs,ys) (5)
The evaluation strategy is innermost.

Property / Task

Determine bounds on the runtime complexity.

Answer / Result

An upperbound for the complexity is O(n3).

Proof (by AProVE @ termCOMP 2023)

1 Dependency Tuples

We get the following set of dependency tuples:
mul0#(Cons(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (7)
originates from
mul0(Cons(z0,z1),z2) add0(mul0(z1,z2),z2) (6)
mul0#(Nil,z0) c1 (9)
originates from
mul0(Nil,z0) Nil (8)
add0#(Cons(z0,z1),z2) c2(add0#(z1,Cons(S,z2))) (11)
originates from
add0(Cons(z0,z1),z2) add0(z1,Cons(S,z2)) (10)
add0#(Nil,z0) c3 (13)
originates from
add0(Nil,z0) z0 (12)
goal#(z0,z1) c4(mul0#(z0,z1)) (15)
originates from
goal(z0,z1) mul0(z0,z1) (14)
Moreover, we add the following terms to the innermost strategy.
mul0#(Cons(z0,z1),z2)
mul0#(Nil,z0)
add0#(Cons(z0,z1),z2)
add0#(Nil,z0)
goal#(z0,z1)

1.1 Usable Rules

We remove the following rules since they are not usable.
goal(z0,z1) mul0(z0,z1) (14)

1.1.1 Rule Shifting

The rules
mul0#(Cons(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (7)
mul0#(Nil,z0) c1 (9)
goal#(z0,z1) c4(mul0#(z0,z1)) (15)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c1] = 0
[c2(x1)] = 1 · x1 + 0
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[mul0(x1, x2)] = 1 + 1 · x1 + 1 · x2
[add0(x1, x2)] = 1 + 1 · x1 + 1 · x2
[mul0#(x1, x2)] = 1 · x1 + 0 + 1 · x2
[add0#(x1, x2)] = 0
[goal#(x1, x2)] = 1 + 1 · x1 + 1 · x2
[Cons(x1, x2)] = 1 + 1 · x1 + 1 · x2
[Nil] = 1
[S] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
mul0#(Cons(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (7)
mul0#(Nil,z0) c1 (9)
add0#(Cons(z0,z1),z2) c2(add0#(z1,Cons(S,z2))) (11)
add0#(Nil,z0) c3 (13)
goal#(z0,z1) c4(mul0#(z0,z1)) (15)

1.1.1.1 Rule Shifting

The rules
add0#(Nil,z0) c3 (13)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c1] = 0
[c2(x1)] = 1 · x1 + 0
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[mul0(x1, x2)] = 1 + 1 · x1 + 1 · x2
[add0(x1, x2)] = 1 + 1 · x1 + 1 · x2
[mul0#(x1, x2)] = 1 + 1 · x1 + 1 · x2
[add0#(x1, x2)] = 1
[goal#(x1, x2)] = 1 + 1 · x1 + 1 · x2
[Cons(x1, x2)] = 1 + 1 · x1 + 1 · x2
[Nil] = 1
[S] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
mul0#(Cons(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (7)
mul0#(Nil,z0) c1 (9)
add0#(Cons(z0,z1),z2) c2(add0#(z1,Cons(S,z2))) (11)
add0#(Nil,z0) c3 (13)
goal#(z0,z1) c4(mul0#(z0,z1)) (15)

1.1.1.1.1 Rule Shifting

The rules
add0#(Cons(z0,z1),z2) c2(add0#(z1,Cons(S,z2))) (11)
are strictly oriented by the following non-linear polynomial interpretation over the naturals
[c(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c1] = 0
[c2(x1)] = 1 · x1 + 0
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[mul0(x1, x2)] = 1 · x2 + 0 + 1 · x1 · x2
[add0(x1, x2)] = 1 · x1 + 0 + 1 · x2
[mul0#(x1, x2)] = 1 + 1 · x2 + 1 · x2 · x2 + 1 · x2 · x1 · x1 + 1 · x2 · x2 · x1 + 1 · x2 · x2 · x2
[add0#(x1, x2)] = 1 · x1 + 0
[goal#(x1, x2)] = 1 + 1 · x2 + 1 · x2 · x2 + 1 · x2 · x1 · x1 + 1 · x2 · x2 · x1 + 1 · x2 · x2 · x2
[Cons(x1, x2)] = 1 + 1 · x2
[Nil] = 0
[S] = 0
which has the intended complexity. Here, only the following usable rules have been considered:
mul0#(Cons(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (7)
mul0#(Nil,z0) c1 (9)
add0#(Cons(z0,z1),z2) c2(add0#(z1,Cons(S,z2))) (11)
add0#(Nil,z0) c3 (13)
goal#(z0,z1) c4(mul0#(z0,z1)) (15)
mul0(Nil,z0) Nil (8)
add0(Cons(z0,z1),z2) add0(z1,Cons(S,z2)) (10)
add0(Nil,z0) z0 (12)
mul0(Cons(z0,z1),z2) add0(mul0(z1,z2),z2) (6)

1.1.1.1.1.1 R is empty

There are no rules in the TRS R. Hence, R/S has complexity O(1).