Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Transformed_CSR_04/Ex7_BLR02_Z)

The rewrite relation of the following TRS is considered.

from(X) cons(X,n__from(s(X))) (1)
head(cons(X,XS)) X (2)
2nd(cons(X,XS)) head(activate(XS)) (3)
take(0,XS) nil (4)
take(s(N),cons(X,XS)) cons(X,n__take(N,activate(XS))) (5)
sel(0,cons(X,XS)) X (6)
sel(s(N),cons(X,XS)) sel(N,activate(XS)) (7)
from(X) n__from(X) (8)
take(X1,X2) n__take(X1,X2) (9)
activate(n__from(X)) from(X) (10)
activate(n__take(X1,X2)) take(X1,X2) (11)
activate(X) X (12)
The evaluation strategy is innermost.

Property / Task

Determine bounds on the runtime complexity.

Answer / Result

An upperbound for the complexity is O(n2).

Proof (by AProVE @ termCOMP 2023)

1 Dependency Tuples

We get the following set of dependency tuples:
from#(z0) c (14)
originates from
from(z0) cons(z0,n__from(s(z0))) (13)
from#(z0) c1 (16)
originates from
from(z0) n__from(z0) (15)
head#(cons(z0,z1)) c2 (18)
originates from
head(cons(z0,z1)) z0 (17)
2nd#(cons(z0,z1)) c3(head#(activate(z1)),activate#(z1)) (20)
originates from
2nd(cons(z0,z1)) head(activate(z1)) (19)
take#(0,z0) c4 (22)
originates from
take(0,z0) nil (21)
take#(s(z0),cons(z1,z2)) c5(activate#(z2)) (24)
originates from
take(s(z0),cons(z1,z2)) cons(z1,n__take(z0,activate(z2))) (23)
take#(z0,z1) c6 (26)
originates from
take(z0,z1) n__take(z0,z1) (25)
sel#(0,cons(z0,z1)) c7 (28)
originates from
sel(0,cons(z0,z1)) z0 (27)
sel#(s(z0),cons(z1,z2)) c8(sel#(z0,activate(z2)),activate#(z2)) (30)
originates from
sel(s(z0),cons(z1,z2)) sel(z0,activate(z2)) (29)
activate#(n__from(z0)) c9(from#(z0)) (32)
originates from
activate(n__from(z0)) from(z0) (31)
activate#(n__take(z0,z1)) c10(take#(z0,z1)) (34)
originates from
activate(n__take(z0,z1)) take(z0,z1) (33)
activate#(z0) c11 (36)
originates from
activate(z0) z0 (35)
Moreover, we add the following terms to the innermost strategy.
from#(z0)
from#(z0)
head#(cons(z0,z1))
2nd#(cons(z0,z1))
take#(0,z0)
take#(s(z0),cons(z1,z2))
take#(z0,z1)
sel#(0,cons(z0,z1))
sel#(s(z0),cons(z1,z2))
activate#(n__from(z0))
activate#(n__take(z0,z1))
activate#(z0)

1.1 Usable Rules

We remove the following rules since they are not usable.
head(cons(z0,z1)) z0 (17)
2nd(cons(z0,z1)) head(activate(z1)) (19)
sel(0,cons(z0,z1)) z0 (27)
sel(s(z0),cons(z1,z2)) sel(z0,activate(z2)) (29)

1.1.1 Rule Shifting

The rules
2nd#(cons(z0,z1)) c3(head#(activate(z1)),activate#(z1)) (20)
sel#(0,cons(z0,z1)) c7 (28)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1] = 0
[c2] = 0
[c3(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c4] = 0
[c5(x1)] = 1 · x1 + 0
[c6] = 0
[c7] = 0
[c8(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c9(x1)] = 1 · x1 + 0
[c10(x1)] = 1 · x1 + 0
[c11] = 0
[activate(x1)] = 1 + 1 · x1
[from(x1)] = 1 + 1 · x1
[take(x1, x2)] = 1 + 1 · x1 + 1 · x2
[from#(x1)] = 0
[head#(x1)] = 0
[2nd#(x1)] = 1 + 1 · x1
[take#(x1, x2)] = 0
[sel#(x1, x2)] = 1
[activate#(x1)] = 0
[n__from(x1)] = 1 + 1 · x1
[n__take(x1, x2)] = 1 + 1 · x1 + 1 · x2
[0] = 1
[nil] = 1
[s(x1)] = 1 + 1 · x1
[cons(x1, x2)] = 1 · x1 + 0
which has the intended complexity. Here, only the following usable rules have been considered:
from#(z0) c (14)
from#(z0) c1 (16)
head#(cons(z0,z1)) c2 (18)
2nd#(cons(z0,z1)) c3(head#(activate(z1)),activate#(z1)) (20)
take#(0,z0) c4 (22)
take#(s(z0),cons(z1,z2)) c5(activate#(z2)) (24)
take#(z0,z1) c6 (26)
sel#(0,cons(z0,z1)) c7 (28)
sel#(s(z0),cons(z1,z2)) c8(sel#(z0,activate(z2)),activate#(z2)) (30)
activate#(n__from(z0)) c9(from#(z0)) (32)
activate#(n__take(z0,z1)) c10(take#(z0,z1)) (34)
activate#(z0) c11 (36)

1.1.1.1 Rule Shifting

The rules
head#(cons(z0,z1)) c2 (18)
sel#(s(z0),cons(z1,z2)) c8(sel#(z0,activate(z2)),activate#(z2)) (30)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1] = 0
[c2] = 0
[c3(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c4] = 0
[c5(x1)] = 1 · x1 + 0
[c6] = 0
[c7] = 0
[c8(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c9(x1)] = 1 · x1 + 0
[c10(x1)] = 1 · x1 + 0
[c11] = 0
[activate(x1)] = 1 + 1 · x1
[from(x1)] = 1 + 1 · x1
[take(x1, x2)] = 1 + 1 · x1 + 1 · x2
[from#(x1)] = 0
[head#(x1)] = 1
[2nd#(x1)] = 1 + 1 · x1
[take#(x1, x2)] = 0
[sel#(x1, x2)] = 1 · x1 + 0
[activate#(x1)] = 0
[n__from(x1)] = 1 + 1 · x1
[n__take(x1, x2)] = 1 + 1 · x1 + 1 · x2
[0] = 1
[nil] = 1
[s(x1)] = 1 + 1 · x1
[cons(x1, x2)] = 1 · x1 + 0
which has the intended complexity. Here, only the following usable rules have been considered:
from#(z0) c (14)
from#(z0) c1 (16)
head#(cons(z0,z1)) c2 (18)
2nd#(cons(z0,z1)) c3(head#(activate(z1)),activate#(z1)) (20)
take#(0,z0) c4 (22)
take#(s(z0),cons(z1,z2)) c5(activate#(z2)) (24)
take#(z0,z1) c6 (26)
sel#(0,cons(z0,z1)) c7 (28)
sel#(s(z0),cons(z1,z2)) c8(sel#(z0,activate(z2)),activate#(z2)) (30)
activate#(n__from(z0)) c9(from#(z0)) (32)
activate#(n__take(z0,z1)) c10(take#(z0,z1)) (34)
activate#(z0) c11 (36)

1.1.1.1.1 Rule Shifting

The rules
take#(0,z0) c4 (22)
take#(z0,z1) c6 (26)
activate#(n__from(z0)) c9(from#(z0)) (32)
activate#(z0) c11 (36)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1] = 0
[c2] = 0
[c3(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c4] = 0
[c5(x1)] = 1 · x1 + 0
[c6] = 0
[c7] = 0
[c8(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c9(x1)] = 1 · x1 + 0
[c10(x1)] = 1 · x1 + 0
[c11] = 0
[activate(x1)] = 1 + 1 · x1
[from(x1)] = 1
[take(x1, x2)] = 1 + 1 · x1 + 1 · x2
[from#(x1)] = 0
[head#(x1)] = 1 · x1 + 0
[2nd#(x1)] = 1 + 1 · x1
[take#(x1, x2)] = 1
[sel#(x1, x2)] = 1 · x1 + 0 + 1 · x2
[activate#(x1)] = 1
[n__from(x1)] = 0
[n__take(x1, x2)] = 1 + 1 · x1 + 1 · x2
[0] = 1
[nil] = 0
[s(x1)] = 1 + 1 · x1
[cons(x1, x2)] = 1 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
from#(z0) c (14)
from#(z0) c1 (16)
head#(cons(z0,z1)) c2 (18)
2nd#(cons(z0,z1)) c3(head#(activate(z1)),activate#(z1)) (20)
take#(0,z0) c4 (22)
take#(s(z0),cons(z1,z2)) c5(activate#(z2)) (24)
take#(z0,z1) c6 (26)
sel#(0,cons(z0,z1)) c7 (28)
sel#(s(z0),cons(z1,z2)) c8(sel#(z0,activate(z2)),activate#(z2)) (30)
activate#(n__from(z0)) c9(from#(z0)) (32)
activate#(n__take(z0,z1)) c10(take#(z0,z1)) (34)
activate#(z0) c11 (36)
take(z0,z1) n__take(z0,z1) (25)
from(z0) cons(z0,n__from(s(z0))) (13)
take(s(z0),cons(z1,z2)) cons(z1,n__take(z0,activate(z2))) (23)
activate(n__take(z0,z1)) take(z0,z1) (33)
take(0,z0) nil (21)
from(z0) n__from(z0) (15)
activate(n__from(z0)) from(z0) (31)
activate(z0) z0 (35)

1.1.1.1.1.1 Rule Shifting

The rules
from#(z0) c (14)
from#(z0) c1 (16)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1] = 0
[c2] = 0
[c3(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c4] = 0
[c5(x1)] = 1 · x1 + 0
[c6] = 0
[c7] = 0
[c8(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c9(x1)] = 1 · x1 + 0
[c10(x1)] = 1 · x1 + 0
[c11] = 0
[activate(x1)] = 1 + 1 · x1
[from(x1)] = 1
[take(x1, x2)] = 1 + 1 · x1 + 1 · x2
[from#(x1)] = 1
[head#(x1)] = 1 · x1 + 0
[2nd#(x1)] = 1 + 1 · x1
[take#(x1, x2)] = 1
[sel#(x1, x2)] = 1 · x1 + 0 + 1 · x2
[activate#(x1)] = 1
[n__from(x1)] = 0
[n__take(x1, x2)] = 1 + 1 · x1 + 1 · x2
[0] = 1
[nil] = 0
[s(x1)] = 1 + 1 · x1
[cons(x1, x2)] = 1 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
from#(z0) c (14)
from#(z0) c1 (16)
head#(cons(z0,z1)) c2 (18)
2nd#(cons(z0,z1)) c3(head#(activate(z1)),activate#(z1)) (20)
take#(0,z0) c4 (22)
take#(s(z0),cons(z1,z2)) c5(activate#(z2)) (24)
take#(z0,z1) c6 (26)
sel#(0,cons(z0,z1)) c7 (28)
sel#(s(z0),cons(z1,z2)) c8(sel#(z0,activate(z2)),activate#(z2)) (30)
activate#(n__from(z0)) c9(from#(z0)) (32)
activate#(n__take(z0,z1)) c10(take#(z0,z1)) (34)
activate#(z0) c11 (36)
take(z0,z1) n__take(z0,z1) (25)
from(z0) cons(z0,n__from(s(z0))) (13)
take(s(z0),cons(z1,z2)) cons(z1,n__take(z0,activate(z2))) (23)
activate(n__take(z0,z1)) take(z0,z1) (33)
take(0,z0) nil (21)
from(z0) n__from(z0) (15)
activate(n__from(z0)) from(z0) (31)
activate(z0) z0 (35)

1.1.1.1.1.1.1 Rule Shifting

The rules
take#(s(z0),cons(z1,z2)) c5(activate#(z2)) (24)
activate#(n__take(z0,z1)) c10(take#(z0,z1)) (34)
are strictly oriented by the following non-linear polynomial interpretation over the naturals
[c] = 0
[c1] = 0
[c2] = 0
[c3(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c4] = 0
[c5(x1)] = 1 · x1 + 0
[c6] = 0
[c7] = 0
[c8(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c9(x1)] = 1 · x1 + 0
[c10(x1)] = 1 · x1 + 0
[c11] = 0
[activate(x1)] = 1 · x1 + 0
[from(x1)] = 0
[take(x1, x2)] = 1 + 1 · x2
[from#(x1)] = 0
[head#(x1)] = 0
[2nd#(x1)] = 2 · x1 + 0
[take#(x1, x2)] = 1 + 2 · x2
[sel#(x1, x2)] = 2 · x1 · x2 + 0
[activate#(x1)] = 2 · x1 + 0
[n__from(x1)] = 0
[n__take(x1, x2)] = 1 + 1 · x2
[0] = 2
[nil] = 1
[s(x1)] = 1 + 1 · x1
[cons(x1, x2)] = 1 · x2 + 0
which has the intended complexity. Here, only the following usable rules have been considered:
from#(z0) c (14)
from#(z0) c1 (16)
head#(cons(z0,z1)) c2 (18)
2nd#(cons(z0,z1)) c3(head#(activate(z1)),activate#(z1)) (20)
take#(0,z0) c4 (22)
take#(s(z0),cons(z1,z2)) c5(activate#(z2)) (24)
take#(z0,z1) c6 (26)
sel#(0,cons(z0,z1)) c7 (28)
sel#(s(z0),cons(z1,z2)) c8(sel#(z0,activate(z2)),activate#(z2)) (30)
activate#(n__from(z0)) c9(from#(z0)) (32)
activate#(n__take(z0,z1)) c10(take#(z0,z1)) (34)
activate#(z0) c11 (36)
take(z0,z1) n__take(z0,z1) (25)
from(z0) cons(z0,n__from(s(z0))) (13)
take(s(z0),cons(z1,z2)) cons(z1,n__take(z0,activate(z2))) (23)
activate(n__take(z0,z1)) take(z0,z1) (33)
take(0,z0) nil (21)
from(z0) n__from(z0) (15)
activate(n__from(z0)) from(z0) (31)
activate(z0) z0 (35)

1.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).