Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/hoca/mappplus)

The rewrite relation of the following TRS is considered.

plus_x#1(0,x8) x8 (1)
plus_x#1(S(x12),x14) S(plus_x#1(x12,x14)) (2)
map#2(plus_x(x2),Nil) Nil (3)
map#2(plus_x(x6),Cons(x4,x2)) Cons(plus_x#1(x6,x4),map#2(plus_x(x6),x2)) (4)
main(x5,x12) map#2(plus_x(x12),x5) (5)
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:
plus_x#1#(0,z0) c (7)
originates from
plus_x#1(0,z0) z0 (6)
plus_x#1#(S(z0),z1) c1(plus_x#1#(z0,z1)) (9)
originates from
plus_x#1(S(z0),z1) S(plus_x#1(z0,z1)) (8)
map#2#(plus_x(z0),Nil) c2 (11)
originates from
map#2(plus_x(z0),Nil) Nil (10)
map#2#(plus_x(z0),Cons(z1,z2)) c3(plus_x#1#(z0,z1),map#2#(plus_x(z0),z2)) (13)
originates from
map#2(plus_x(z0),Cons(z1,z2)) Cons(plus_x#1(z0,z1),map#2(plus_x(z0),z2)) (12)
main#(z0,z1) c4(map#2#(plus_x(z1),z0)) (15)
originates from
main(z0,z1) map#2(plus_x(z1),z0) (14)
Moreover, we add the following terms to the innermost strategy.
plus_x#1#(0,z0)
plus_x#1#(S(z0),z1)
map#2#(plus_x(z0),Nil)
map#2#(plus_x(z0),Cons(z1,z2))
main#(z0,z1)

1.1 Usable Rules

We remove the following rules since they are not usable.
plus_x#1(0,z0) z0 (6)
plus_x#1(S(z0),z1) S(plus_x#1(z0,z1)) (8)
map#2(plus_x(z0),Nil) Nil (10)
map#2(plus_x(z0),Cons(z1,z2)) Cons(plus_x#1(z0,z1),map#2(plus_x(z0),z2)) (12)
main(z0,z1) map#2(plus_x(z1),z0) (14)

1.1.1 Rule Shifting

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

1.1.1.1 Rule Shifting

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

1.1.1.1.1 Rule Shifting

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

1.1.1.1.1.1 R is empty

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