Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Frederiksen_Glenstrup/duplicate)

The rewrite relation of the following TRS is considered.

duplicate(Cons(x,xs)) Cons(x,Cons(x,duplicate(xs))) (1)
duplicate(Nil) Nil (2)
goal(x) duplicate(x) (3)
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:
duplicate#(Cons(z0,z1)) c(duplicate#(z1)) (5)
originates from
duplicate(Cons(z0,z1)) Cons(z0,Cons(z0,duplicate(z1))) (4)
duplicate#(Nil) c1 (6)
originates from
duplicate(Nil) Nil (2)
goal#(z0) c2(duplicate#(z0)) (8)
originates from
goal(z0) duplicate(z0) (7)
Moreover, we add the following terms to the innermost strategy.
duplicate#(Cons(z0,z1))
duplicate#(Nil)
goal#(z0)

1.1 Usable Rules

We remove the following rules since they are not usable.
duplicate(Cons(z0,z1)) Cons(z0,Cons(z0,duplicate(z1))) (4)
duplicate(Nil) Nil (2)
goal(z0) duplicate(z0) (7)

1.1.1 Rule Shifting

The rules
duplicate#(Cons(z0,z1)) c(duplicate#(z1)) (5)
duplicate#(Nil) c1 (6)
goal#(z0) c2(duplicate#(z0)) (8)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1)] = 1 · x1 + 0
[c1] = 0
[c2(x1)] = 1 · x1 + 0
[duplicate#(x1)] = 1 · x1 + 0
[goal#(x1)] = 1 + 1 · x1
[Cons(x1, x2)] = 1 + 1 · x2
[Nil] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
duplicate#(Cons(z0,z1)) c(duplicate#(z1)) (5)
duplicate#(Nil) c1 (6)
goal#(z0) c2(duplicate#(z0)) (8)

1.1.1.1 R is empty

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