Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Frederiksen_Glenstrup/map0)

The relative rewrite relation R/S is considered where R is the following TRS

map(Cons(x,xs)) Cons(f(x),map(xs)) (1)
map(Nil) Nil (2)
goal(xs) map(xs) (3)
f(x) *(x,x) (4)
+Full(S(x),y) +Full(x,S(y)) (5)
+Full(0,y) y (6)

and S is the following TRS.

*(x,S(S(y))) +(x,*(x,S(y))) (7)
*(x,S(0)) x (8)
*(x,0) 0 (9)
*(0,y) 0 (10)
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:
map#(Cons(z0,z1)) c4(f#(z0),map#(z1)) (12)
originates from
map(Cons(z0,z1)) Cons(f(z0),map(z1)) (11)
map#(Nil) c5 (13)
originates from
map(Nil) Nil (2)
goal#(z0) c6(map#(z0)) (15)
originates from
goal(z0) map(z0) (14)
f#(z0) c7(*#(z0,z0)) (17)
originates from
f(z0) *(z0,z0) (16)
+Full#(S(z0),z1) c8(+Full#(z0,S(z1))) (19)
originates from
+Full(S(z0),z1) +Full(z0,S(z1)) (18)
+Full#(0,z0) c9 (21)
originates from
+Full(0,z0) z0 (20)
*#(z0,S(S(z1))) c(*#(z0,S(z1))) (23)
originates from
*(z0,S(S(z1))) +(z0,*(z0,S(z1))) (22)
*#(z0,S(0)) c1 (25)
originates from
*(z0,S(0)) z0 (24)
*#(z0,0) c2 (27)
originates from
*(z0,0) 0 (26)
*#(0,z0) c3 (29)
originates from
*(0,z0) 0 (28)
Moreover, we add the following terms to the innermost strategy.
*#(z0,S(S(z1)))
*#(z0,S(0))
*#(z0,0)
*#(0,z0)
map#(Cons(z0,z1))
map#(Nil)
goal#(z0)
f#(z0)
+Full#(S(z0),z1)
+Full#(0,z0)

1.1 Usable Rules

We remove the following rules since they are not usable.
*(z0,S(S(z1))) +(z0,*(z0,S(z1))) (22)
*(z0,S(0)) z0 (24)
*(z0,0) 0 (26)
*(0,z0) 0 (28)
map(Cons(z0,z1)) Cons(f(z0),map(z1)) (11)
map(Nil) Nil (2)
goal(z0) map(z0) (14)
f(z0) *(z0,z0) (16)
+Full(S(z0),z1) +Full(z0,S(z1)) (18)
+Full(0,z0) z0 (20)

1.1.1 Rule Shifting

The rules
map#(Cons(z0,z1)) c4(f#(z0),map#(z1)) (12)
goal#(z0) c6(map#(z0)) (15)
+Full#(S(z0),z1) c8(+Full#(z0,S(z1))) (19)
+Full#(0,z0) c9 (21)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1)] = 1 · x1 + 0
[c1] = 0
[c2] = 0
[c3] = 0
[c4(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c5] = 0
[c6(x1)] = 1 · x1 + 0
[c7(x1)] = 1 · x1 + 0
[c8(x1)] = 1 · x1 + 0
[c9] = 0
[*#(x1, x2)] = 1 · x2 + 0
[map#(x1)] = 1 · x1 + 0
[goal#(x1)] = 1 + 1 · x1
[f#(x1)] = 1 · x1 + 0
[+Full#(x1, x2)] = 1 + 1 · x1
[S(x1)] = 1 + 1 · x1
[0] = 1
[Cons(x1, x2)] = 1 + 1 · x1 + 1 · x2
[Nil] = 0
which has the intended complexity. Here, only the following usable rules have been considered:
*#(z0,S(S(z1))) c(*#(z0,S(z1))) (23)
*#(z0,S(0)) c1 (25)
*#(z0,0) c2 (27)
*#(0,z0) c3 (29)
map#(Cons(z0,z1)) c4(f#(z0),map#(z1)) (12)
map#(Nil) c5 (13)
goal#(z0) c6(map#(z0)) (15)
f#(z0) c7(*#(z0,z0)) (17)
+Full#(S(z0),z1) c8(+Full#(z0,S(z1))) (19)
+Full#(0,z0) c9 (21)

1.1.1.1 Rule Shifting

The rules
map#(Nil) c5 (13)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1)] = 1 · x1 + 0
[c1] = 0
[c2] = 0
[c3] = 0
[c4(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c5] = 0
[c6(x1)] = 1 · x1 + 0
[c7(x1)] = 1 · x1 + 0
[c8(x1)] = 1 · x1 + 0
[c9] = 0
[*#(x1, x2)] = 1 + 1 · x2
[map#(x1)] = 1 · x1 + 0
[goal#(x1)] = 1 · x1 + 0
[f#(x1)] = 1 + 1 · x1
[+Full#(x1, x2)] = 1 · x2 + 0
[S(x1)] = 0
[0] = 0
[Cons(x1, x2)] = 1 + 1 · x1 + 1 · x2
[Nil] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
*#(z0,S(S(z1))) c(*#(z0,S(z1))) (23)
*#(z0,S(0)) c1 (25)
*#(z0,0) c2 (27)
*#(0,z0) c3 (29)
map#(Cons(z0,z1)) c4(f#(z0),map#(z1)) (12)
map#(Nil) c5 (13)
goal#(z0) c6(map#(z0)) (15)
f#(z0) c7(*#(z0,z0)) (17)
+Full#(S(z0),z1) c8(+Full#(z0,S(z1))) (19)
+Full#(0,z0) c9 (21)

1.1.1.1.1 Rule Shifting

The rules
f#(z0) c7(*#(z0,z0)) (17)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1)] = 1 · x1 + 0
[c1] = 0
[c2] = 0
[c3] = 0
[c4(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c5] = 0
[c6(x1)] = 1 · x1 + 0
[c7(x1)] = 1 · x1 + 0
[c8(x1)] = 1 · x1 + 0
[c9] = 0
[*#(x1, x2)] = 2 + 1 · x1 + 1 · x2
[map#(x1)] = 3 + 3 · x1
[goal#(x1)] = 3 + 3 · x1
[f#(x1)] = 3 + 2 · x1
[+Full#(x1, x2)] = 2 · x1 + 0
[S(x1)] = 1 + 1 · x1
[0] = 0
[Cons(x1, x2)] = 2 + 1 · x1 + 1 · x2
[Nil] = 0
which has the intended complexity. Here, only the following usable rules have been considered:
*#(z0,S(S(z1))) c(*#(z0,S(z1))) (23)
*#(z0,S(0)) c1 (25)
*#(z0,0) c2 (27)
*#(0,z0) c3 (29)
map#(Cons(z0,z1)) c4(f#(z0),map#(z1)) (12)
map#(Nil) c5 (13)
goal#(z0) c6(map#(z0)) (15)
f#(z0) c7(*#(z0,z0)) (17)
+Full#(S(z0),z1) c8(+Full#(z0,S(z1))) (19)
+Full#(0,z0) c9 (21)

1.1.1.1.1.1 R is empty

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