Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Transformed_CSR_04/Ex6_Luc98_Z)

The rewrite relation of the following TRS is considered.

first(0,X) nil (1)
first(s(X),cons(Y,Z)) cons(Y,n__first(X,activate(Z))) (2)
from(X) cons(X,n__from(s(X))) (3)
first(X1,X2) n__first(X1,X2) (4)
from(X) n__from(X) (5)
activate(n__first(X1,X2)) first(X1,X2) (6)
activate(n__from(X)) from(X) (7)
activate(X) X (8)
The evaluation strategy is innermost.

Property / Task

Determine bounds on the runtime complexity.

Answer / Result

An upperbound for the complexity is O(n).

Proof (by AProVE @ termCOMP 2023)

1 Dependency Tuples

We get the following set of dependency tuples:
first#(0,z0) c (10)
originates from
first(0,z0) nil (9)
first#(s(z0),cons(z1,z2)) c1(activate#(z2)) (12)
originates from
first(s(z0),cons(z1,z2)) cons(z1,n__first(z0,activate(z2))) (11)
first#(z0,z1) c2 (14)
originates from
first(z0,z1) n__first(z0,z1) (13)
from#(z0) c3 (16)
originates from
from(z0) cons(z0,n__from(s(z0))) (15)
from#(z0) c4 (18)
originates from
from(z0) n__from(z0) (17)
activate#(n__first(z0,z1)) c5(first#(z0,z1)) (20)
originates from
activate(n__first(z0,z1)) first(z0,z1) (19)
activate#(n__from(z0)) c6(from#(z0)) (22)
originates from
activate(n__from(z0)) from(z0) (21)
activate#(z0) c7 (24)
originates from
activate(z0) z0 (23)
Moreover, we add the following terms to the innermost strategy.
first#(0,z0)
first#(s(z0),cons(z1,z2))
first#(z0,z1)
from#(z0)
from#(z0)
activate#(n__first(z0,z1))
activate#(n__from(z0))
activate#(z0)

1.1 Usable Rules

We remove the following rules since they are not usable.
first(0,z0) nil (9)
first(s(z0),cons(z1,z2)) cons(z1,n__first(z0,activate(z2))) (11)
first(z0,z1) n__first(z0,z1) (13)
from(z0) cons(z0,n__from(s(z0))) (15)
from(z0) n__from(z0) (17)
activate(n__first(z0,z1)) first(z0,z1) (19)
activate(n__from(z0)) from(z0) (21)
activate(z0) z0 (23)

1.1.1 Rule Shifting

The rules
first#(0,z0) c (10)
first#(s(z0),cons(z1,z2)) c1(activate#(z2)) (12)
first#(z0,z1) c2 (14)
from#(z0) c3 (16)
from#(z0) c4 (18)
activate#(n__first(z0,z1)) c5(first#(z0,z1)) (20)
activate#(n__from(z0)) c6(from#(z0)) (22)
activate#(z0) c7 (24)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1)] = 1 · x1 + 0
[c2] = 0
[c3] = 0
[c4] = 0
[c5(x1)] = 1 · x1 + 0
[c6(x1)] = 1 · x1 + 0
[c7] = 0
[first#(x1, x2)] = 1 + 1 · x1 + 1 · x2
[from#(x1)] = 1 + 1 · x1
[activate#(x1)] = 1 + 1 · x1
[0] = 0
[s(x1)] = 1
[cons(x1, x2)] = 1 · x2 + 0
[n__first(x1, x2)] = 1 + 1 · x1 + 1 · x2
[n__from(x1)] = 1 + 1 · x1
which has the intended complexity. Here, only the following usable rules have been considered:
first#(0,z0) c (10)
first#(s(z0),cons(z1,z2)) c1(activate#(z2)) (12)
first#(z0,z1) c2 (14)
from#(z0) c3 (16)
from#(z0) c4 (18)
activate#(n__first(z0,z1)) c5(first#(z0,z1)) (20)
activate#(n__from(z0)) c6(from#(z0)) (22)
activate#(z0) c7 (24)

1.1.1.1 R is empty

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