Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Frederiksen_Glenstrup/mul_better)

The rewrite relation of the following TRS is considered.

mul0(C(x,y),y') add0(mul0(y,y'),y') (1)
mul0(Z,y) Z (2)
add0(C(x,y),y') add0(y,C(S,y')) (3)
add0(Z,y) y (4)
second(C(x,y)) y (5)
isZero(C(x,y)) False (6)
isZero(Z) True (7)
goal(xs,ys) mul0(xs,ys) (8)
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#(C(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (10)
originates from
mul0(C(z0,z1),z2) add0(mul0(z1,z2),z2) (9)
mul0#(Z,z0) c1 (12)
originates from
mul0(Z,z0) Z (11)
add0#(C(z0,z1),z2) c2(add0#(z1,C(S,z2))) (14)
originates from
add0(C(z0,z1),z2) add0(z1,C(S,z2)) (13)
add0#(Z,z0) c3 (16)
originates from
add0(Z,z0) z0 (15)
second#(C(z0,z1)) c4 (18)
originates from
second(C(z0,z1)) z1 (17)
isZero#(C(z0,z1)) c5 (20)
originates from
isZero(C(z0,z1)) False (19)
isZero#(Z) c6 (21)
originates from
isZero(Z) True (7)
goal#(z0,z1) c7(mul0#(z0,z1)) (23)
originates from
goal(z0,z1) mul0(z0,z1) (22)
Moreover, we add the following terms to the innermost strategy.
mul0#(C(z0,z1),z2)
mul0#(Z,z0)
add0#(C(z0,z1),z2)
add0#(Z,z0)
second#(C(z0,z1))
isZero#(C(z0,z1))
isZero#(Z)
goal#(z0,z1)

1.1 Usable Rules

We remove the following rules since they are not usable.
second(C(z0,z1)) z1 (17)
isZero(C(z0,z1)) False (19)
isZero(Z) True (7)
goal(z0,z1) mul0(z0,z1) (22)

1.1.1 Rule Shifting

The rules
mul0#(Z,z0) c1 (12)
add0#(Z,z0) c3 (16)
second#(C(z0,z1)) c4 (18)
isZero#(C(z0,z1)) c5 (20)
isZero#(Z) c6 (21)
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] = 0
[c5] = 0
[c6] = 0
[c7(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
[second#(x1)] = 1 · x1 + 0
[isZero#(x1)] = 1 · x1 + 0
[goal#(x1, x2)] = 1 + 1 · x1 + 1 · x2
[C(x1, x2)] = 1 + 1 · x1 + 1 · x2
[Z] = 1
[S] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
mul0#(C(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (10)
mul0#(Z,z0) c1 (12)
add0#(C(z0,z1),z2) c2(add0#(z1,C(S,z2))) (14)
add0#(Z,z0) c3 (16)
second#(C(z0,z1)) c4 (18)
isZero#(C(z0,z1)) c5 (20)
isZero#(Z) c6 (21)
goal#(z0,z1) c7(mul0#(z0,z1)) (23)

1.1.1.1 Rule Shifting

The rules
goal#(z0,z1) c7(mul0#(z0,z1)) (23)
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] = 0
[c5] = 0
[c6] = 0
[c7(x1)] = 1 · x1 + 0
[mul0(x1, x2)] = 1 · x1 + 0 + 1 · x2
[add0(x1, x2)] = 1 · x2 + 0
[mul0#(x1, x2)] = 1 · x1 + 0 + 1 · x2
[add0#(x1, x2)] = 0
[second#(x1)] = 0
[isZero#(x1)] = 0
[goal#(x1, x2)] = 1 + 1 · x1 + 1 · x2
[C(x1, x2)] = 1 · x1 + 0 + 1 · x2
[Z] = 1
[S] = 0
which has the intended complexity. Here, only the following usable rules have been considered:
mul0#(C(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (10)
mul0#(Z,z0) c1 (12)
add0#(C(z0,z1),z2) c2(add0#(z1,C(S,z2))) (14)
add0#(Z,z0) c3 (16)
second#(C(z0,z1)) c4 (18)
isZero#(C(z0,z1)) c5 (20)
isZero#(Z) c6 (21)
goal#(z0,z1) c7(mul0#(z0,z1)) (23)

1.1.1.1.1 Rule Shifting

The rules
mul0#(C(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (10)
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] = 0
[c5] = 0
[c6] = 0
[c7(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)] = 0
[second#(x1)] = 0
[isZero#(x1)] = 0
[goal#(x1, x2)] = 1 + 1 · x1 + 1 · x2
[C(x1, x2)] = 1 + 1 · x1 + 1 · x2
[Z] = 1
[S] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
mul0#(C(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (10)
mul0#(Z,z0) c1 (12)
add0#(C(z0,z1),z2) c2(add0#(z1,C(S,z2))) (14)
add0#(Z,z0) c3 (16)
second#(C(z0,z1)) c4 (18)
isZero#(C(z0,z1)) c5 (20)
isZero#(Z) c6 (21)
goal#(z0,z1) c7(mul0#(z0,z1)) (23)

1.1.1.1.1.1 Rule Shifting

The rules
add0#(C(z0,z1),z2) c2(add0#(z1,C(S,z2))) (14)
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] = 0
[c5] = 0
[c6] = 0
[c7(x1)] = 1 · x1 + 0
[mul0(x1, x2)] = 1 · x1 · x2 + 0
[add0(x1, x2)] = 1 · x1 + 0 + 1 · x2
[mul0#(x1, x2)] = 1 + 1 · x2 + 1 · x2 · x2 + 1 · x1 · x2 + 1 · x2 · x1 · x1 + 1 · x2 · x2 · x1 + 1 · x2 · x2 · x2
[add0#(x1, x2)] = 1 · x1 + 0
[second#(x1)] = 0
[isZero#(x1)] = 0
[goal#(x1, x2)] = 1 + 1 · x2 + 1 · x2 · x2 + 1 · x1 · x2 + 1 · x2 · x1 · x1 + 1 · x2 · x2 · x1 + 1 · x2 · x2 · x2
[C(x1, x2)] = 1 + 1 · x2
[Z] = 0
[S] = 0
which has the intended complexity. Here, only the following usable rules have been considered:
mul0#(C(z0,z1),z2) c(add0#(mul0(z1,z2),z2),mul0#(z1,z2)) (10)
mul0#(Z,z0) c1 (12)
add0#(C(z0,z1),z2) c2(add0#(z1,C(S,z2))) (14)
add0#(Z,z0) c3 (16)
second#(C(z0,z1)) c4 (18)
isZero#(C(z0,z1)) c5 (20)
isZero#(Z) c6 (21)
goal#(z0,z1) c7(mul0#(z0,z1)) (23)
mul0(Z,z0) Z (11)
add0(Z,z0) z0 (15)
add0(C(z0,z1),z2) add0(z1,C(S,z2)) (13)
mul0(C(z0,z1),z2) add0(mul0(z1,z2),z2) (9)

1.1.1.1.1.1.1 R is empty

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