Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/SK90/4.57)

The rewrite relation of the following TRS is considered.

f(x,y,z) g(<=(x,y),x,y,z) (1)
g(true,x,y,z) z (2)
g(false,x,y,z) f(f(p(x),y,z),f(p(y),z,x),f(p(z),x,y)) (3)
p(0) 0 (4)
p(s(x)) x (5)
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:
f#(z0,z1,z2) c(g#(<=(z0,z1),z0,z1,z2)) (7)
originates from
f(z0,z1,z2) g(<=(z0,z1),z0,z1,z2) (6)
g#(true,z0,z1,z2) c1 (9)
originates from
g(true,z0,z1,z2) z2 (8)
g#(false,z0,z1,z2) c2(f#(f(p(z0),z1,z2),f(p(z1),z2,z0),f(p(z2),z0,z1)),f#(p(z0),z1,z2),p#(z0),f#(p(z1),z2,z0),p#(z1),f#(p(z2),z0,z1),p#(z2)) (11)
originates from
g(false,z0,z1,z2) f(f(p(z0),z1,z2),f(p(z1),z2,z0),f(p(z2),z0,z1)) (10)
p#(0) c3 (12)
originates from
p(0) 0 (4)
p#(s(z0)) c4 (14)
originates from
p(s(z0)) z0 (13)
Moreover, we add the following terms to the innermost strategy.
f#(z0,z1,z2)
g#(true,z0,z1,z2)
g#(false,z0,z1,z2)
p#(0)
p#(s(z0))

1.1 Usable Rules

We remove the following rules since they are not usable.
g(true,z0,z1,z2) z2 (8)
g(false,z0,z1,z2) f(f(p(z0),z1,z2),f(p(z1),z2,z0),f(p(z2),z0,z1)) (10)

1.1.1 Rule Shifting

The rules
g#(true,z0,z1,z2) c1 (9)
g#(false,z0,z1,z2) c2(f#(f(p(z0),z1,z2),f(p(z1),z2,z0),f(p(z2),z0,z1)),f#(p(z0),z1,z2),p#(z0),f#(p(z1),z2,z0),p#(z1),f#(p(z2),z0,z1),p#(z2)) (11)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1)] = 1 · x1 + 0
[c1] = 0
[c2(x1,...,x7)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4 + 1 · x5 + 1 · x6 + 1 · x7
[c3] = 0
[c4] = 0
[f(x1, x2, x3)] = 1 + 1 · x1 + 1 · x2 + 1 · x3
[p(x1)] = 1 + 1 · x1
[f#(x1, x2, x3)] = 0
[g#(x1,...,x4)] = 1 · x1 + 0
[p#(x1)] = 0
[0] = 1
[s(x1)] = 1 + 1 · x1
[g(x1,...,x4)] = 1 + 1 · x1 + 1 · x2 + 1 · x3 + 1 · x4
[<=(x1, x2)] = 0
[true] = 1
[false] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
f#(z0,z1,z2) c(g#(<=(z0,z1),z0,z1,z2)) (7)
g#(true,z0,z1,z2) c1 (9)
g#(false,z0,z1,z2) c2(f#(f(p(z0),z1,z2),f(p(z1),z2,z0),f(p(z2),z0,z1)),f#(p(z0),z1,z2),p#(z0),f#(p(z1),z2,z0),p#(z1),f#(p(z2),z0,z1),p#(z2)) (11)
p#(0) c3 (12)
p#(s(z0)) c4 (14)

1.1.1.1 Rule Shifting

The rules
f#(z0,z1,z2) c(g#(<=(z0,z1),z0,z1,z2)) (7)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1)] = 1 · x1 + 0
[c1] = 0
[c2(x1,...,x7)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4 + 1 · x5 + 1 · x6 + 1 · x7
[c3] = 0
[c4] = 0
[f(x1, x2, x3)] = 0
[p(x1)] = 0
[f#(x1, x2, x3)] = 2
[g#(x1,...,x4)] = 1 + 3 · x1
[p#(x1)] = 0
[0] = 3
[s(x1)] = 3 + 1 · x1
[g(x1,...,x4)] = 1 · x1 + 0
[<=(x1, x2)] = 0
[true] = 0
[false] = 3
which has the intended complexity. Here, only the following usable rules have been considered:
f#(z0,z1,z2) c(g#(<=(z0,z1),z0,z1,z2)) (7)
g#(true,z0,z1,z2) c1 (9)
g#(false,z0,z1,z2) c2(f#(f(p(z0),z1,z2),f(p(z1),z2,z0),f(p(z2),z0,z1)),f#(p(z0),z1,z2),p#(z0),f#(p(z1),z2,z0),p#(z1),f#(p(z2),z0,z1),p#(z2)) (11)
p#(0) c3 (12)
p#(s(z0)) c4 (14)

1.1.1.1.1 Rule Shifting

The rules
p#(0) c3 (12)
p#(s(z0)) c4 (14)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1)] = 1 · x1 + 0
[c1] = 0
[c2(x1,...,x7)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4 + 1 · x5 + 1 · x6 + 1 · x7
[c3] = 0
[c4] = 0
[f(x1, x2, x3)] = 0
[p(x1)] = 0
[f#(x1, x2, x3)] = 0
[g#(x1,...,x4)] = 3 · x1 + 0
[p#(x1)] = 1
[0] = 3
[s(x1)] = 3 + 1 · x1
[g(x1,...,x4)] = 1 · x1 + 0
[<=(x1, x2)] = 0
[true] = 0
[false] = 3
which has the intended complexity. Here, only the following usable rules have been considered:
f#(z0,z1,z2) c(g#(<=(z0,z1),z0,z1,z2)) (7)
g#(true,z0,z1,z2) c1 (9)
g#(false,z0,z1,z2) c2(f#(f(p(z0),z1,z2),f(p(z1),z2,z0),f(p(z2),z0,z1)),f#(p(z0),z1,z2),p#(z0),f#(p(z1),z2,z0),p#(z1),f#(p(z2),z0,z1),p#(z2)) (11)
p#(0) c3 (12)
p#(s(z0)) c4 (14)

1.1.1.1.1.1 R is empty

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