Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/SK90/2.39)

The rewrite relation of the following TRS is considered.

rev(nil) nil (1)
rev(.(x,y)) ++(rev(y),.(x,nil)) (2)
car(.(x,y)) x (3)
cdr(.(x,y)) y (4)
null(nil) true (5)
null(.(x,y)) false (6)
++(nil,y) y (7)
++(.(x,y),z) .(x,++(y,z)) (8)
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:
rev#(nil) c (9)
originates from
rev(nil) nil (1)
rev#(.(z0,z1)) c1(++#(rev(z1),.(z0,nil)),rev#(z1)) (11)
originates from
rev(.(z0,z1)) ++(rev(z1),.(z0,nil)) (10)
car#(.(z0,z1)) c2 (13)
originates from
car(.(z0,z1)) z0 (12)
cdr#(.(z0,z1)) c3 (15)
originates from
cdr(.(z0,z1)) z1 (14)
null#(nil) c4 (16)
originates from
null(nil) true (5)
null#(.(z0,z1)) c5 (18)
originates from
null(.(z0,z1)) false (17)
++#(nil,z0) c6 (20)
originates from
++(nil,z0) z0 (19)
++#(.(z0,z1),z2) c7(++#(z1,z2)) (22)
originates from
++(.(z0,z1),z2) .(z0,++(z1,z2)) (21)
Moreover, we add the following terms to the innermost strategy.
rev#(nil)
rev#(.(z0,z1))
car#(.(z0,z1))
cdr#(.(z0,z1))
null#(nil)
null#(.(z0,z1))
++#(nil,z0)
++#(.(z0,z1),z2)

1.1 Usable Rules

We remove the following rules since they are not usable.
car(.(z0,z1)) z0 (12)
cdr(.(z0,z1)) z1 (14)
null(nil) true (5)
null(.(z0,z1)) false (17)

1.1.1 Rule Shifting

The rules
rev#(nil) c (9)
car#(.(z0,z1)) c2 (13)
cdr#(.(z0,z1)) c3 (15)
null#(nil) c4 (16)
null#(.(z0,z1)) c5 (18)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c2] = 0
[c3] = 0
[c4] = 0
[c5] = 0
[c6] = 0
[c7(x1)] = 1 · x1 + 0
[rev(x1)] = 1 + 1 · x1
[++(x1, x2)] = 1 + 1 · x2
[rev#(x1)] = 1
[car#(x1)] = 1 · x1 + 0
[cdr#(x1)] = 1 · x1 + 0
[null#(x1)] = 1 + 1 · x1
[++#(x1, x2)] = 0
[nil] = 1
[.(x1, x2)] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
rev#(nil) c (9)
rev#(.(z0,z1)) c1(++#(rev(z1),.(z0,nil)),rev#(z1)) (11)
car#(.(z0,z1)) c2 (13)
cdr#(.(z0,z1)) c3 (15)
null#(nil) c4 (16)
null#(.(z0,z1)) c5 (18)
++#(nil,z0) c6 (20)
++#(.(z0,z1),z2) c7(++#(z1,z2)) (22)

1.1.1.1 Rule Shifting

The rules
rev#(.(z0,z1)) c1(++#(rev(z1),.(z0,nil)),rev#(z1)) (11)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c2] = 0
[c3] = 0
[c4] = 0
[c5] = 0
[c6] = 0
[c7(x1)] = 1 · x1 + 0
[rev(x1)] = 3
[++(x1, x2)] = 3
[rev#(x1)] = 1 · x1 + 0
[car#(x1)] = 0
[cdr#(x1)] = 0
[null#(x1)] = 0
[++#(x1, x2)] = 0
[nil] = 0
[.(x1, x2)] = 2 + 1 · x1 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
rev#(nil) c (9)
rev#(.(z0,z1)) c1(++#(rev(z1),.(z0,nil)),rev#(z1)) (11)
car#(.(z0,z1)) c2 (13)
cdr#(.(z0,z1)) c3 (15)
null#(nil) c4 (16)
null#(.(z0,z1)) c5 (18)
++#(nil,z0) c6 (20)
++#(.(z0,z1),z2) c7(++#(z1,z2)) (22)

1.1.1.1.1 Rule Shifting

The rules
++#(nil,z0) c6 (20)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c2] = 0
[c3] = 0
[c4] = 0
[c5] = 0
[c6] = 0
[c7(x1)] = 1 · x1 + 0
[rev(x1)] = 1 + 1 · x1
[++(x1, x2)] = 1 · x1 + 0 + 1 · x2
[rev#(x1)] = 1 · x1 + 0
[car#(x1)] = 0
[cdr#(x1)] = 0
[null#(x1)] = 0
[++#(x1, x2)] = 1
[nil] = 0
[.(x1, x2)] = 1 + 1 · x1 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
rev#(nil) c (9)
rev#(.(z0,z1)) c1(++#(rev(z1),.(z0,nil)),rev#(z1)) (11)
car#(.(z0,z1)) c2 (13)
cdr#(.(z0,z1)) c3 (15)
null#(nil) c4 (16)
null#(.(z0,z1)) c5 (18)
++#(nil,z0) c6 (20)
++#(.(z0,z1),z2) c7(++#(z1,z2)) (22)

1.1.1.1.1.1 Rule Shifting

The rules
++#(.(z0,z1),z2) c7(++#(z1,z2)) (22)
are strictly oriented by the following non-linear polynomial interpretation over the naturals
[c] = 0
[c1(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c2] = 0
[c3] = 0
[c4] = 0
[c5] = 0
[c6] = 0
[c7(x1)] = 1 · x1 + 0
[rev(x1)] = 1 · x1 + 0
[++(x1, x2)] = 1 · x1 + 0 + 1 · x2
[rev#(x1)] = 1 · x1 · x1 + 0
[car#(x1)] = 0
[cdr#(x1)] = 0
[null#(x1)] = 0
[++#(x1, x2)] = 1 · x1 + 0
[nil] = 0
[.(x1, x2)] = 2 + 1 · x1 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
rev#(nil) c (9)
rev#(.(z0,z1)) c1(++#(rev(z1),.(z0,nil)),rev#(z1)) (11)
car#(.(z0,z1)) c2 (13)
cdr#(.(z0,z1)) c3 (15)
null#(nil) c4 (16)
null#(.(z0,z1)) c5 (18)
++#(nil,z0) c6 (20)
++#(.(z0,z1),z2) c7(++#(z1,z2)) (22)
rev(.(z0,z1)) ++(rev(z1),.(z0,nil)) (10)
++(.(z0,z1),z2) .(z0,++(z1,z2)) (21)
rev(nil) nil (1)
++(nil,z0) z0 (19)

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