Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Strategy_removed_AG01/#4.34)

The rewrite relation of the following TRS is considered.

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

1.1 Rule Shifting

The rules
f#(0) c1 (8)
f#(1) c2 (9)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c1] = 0
[c2] = 0
[c3(x1)] = 1 · x1 + 0
[c4] = 0
[c5] = 0
[c6(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c7(x1, x2)] = 1 · x1 + 0 + 1 · x2
[f(x1)] = 0
[if(x1, x2, x3)] = 3
[g(x1, x2)] = 3
[f#(x1)] = 1 · x1 + 0
[if#(x1, x2, x3)] = 0
[g#(x1, x2)] = 2 · x1 + 0
[s(x1)] = 1 · x1 + 0
[c(x1)] = 0
[0] = 3
[true] = 3
[1] = 1
[false] = 3
which has the intended complexity. Here, only the following usable rules have been considered:
f#(0) c1 (8)
f#(1) c2 (9)
f#(s(z0)) c3(f#(z0)) (11)
if#(true,z0,z1) c4 (13)
if#(false,z0,z1) c5 (15)
g#(s(z0),s(z1)) c6(if#(f(z0),s(z0),s(z1)),f#(z0)) (17)
g#(z0,c(z1)) c7(g#(z0,g(s(c(z1)),z1)),g#(s(c(z1)),z1)) (19)

1.1.1 Rule Shifting

The rules
if#(true,z0,z1) c4 (13)
if#(false,z0,z1) c5 (15)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c1] = 0
[c2] = 0
[c3(x1)] = 1 · x1 + 0
[c4] = 0
[c5] = 0
[c6(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c7(x1, x2)] = 1 · x1 + 0 + 1 · x2
[f(x1)] = 1 · x1 + 0
[if(x1, x2, x3)] = 1 + 1 · x1 + 1 · x2 + 1 · x3
[g(x1, x2)] = 1 + 1 · x1 + 1 · x2
[f#(x1)] = 0
[if#(x1, x2, x3)] = 1 · x1 + 0
[g#(x1, x2)] = 1 · x1 + 0
[s(x1)] = 1 · x1 + 0
[c(x1)] = 0
[0] = 1
[true] = 1
[1] = 1
[false] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
f#(0) c1 (8)
f#(1) c2 (9)
f#(s(z0)) c3(f#(z0)) (11)
if#(true,z0,z1) c4 (13)
if#(false,z0,z1) c5 (15)
g#(s(z0),s(z1)) c6(if#(f(z0),s(z0),s(z1)),f#(z0)) (17)
g#(z0,c(z1)) c7(g#(z0,g(s(c(z1)),z1)),g#(s(c(z1)),z1)) (19)
f(1) false (2)
f(0) true (1)
f(s(z0)) f(z0) (10)

1.1.1.1 Rule Shifting

The rules
g#(s(z0),s(z1)) c6(if#(f(z0),s(z0),s(z1)),f#(z0)) (17)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c1] = 0
[c2] = 0
[c3(x1)] = 1 · x1 + 0
[c4] = 0
[c5] = 0
[c6(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c7(x1, x2)] = 1 · x1 + 0 + 1 · x2
[f(x1)] = 0
[if(x1, x2, x3)] = 2 · x2 + 0 + 2 · x3
[g(x1, x2)] = 0
[f#(x1)] = 0
[if#(x1, x2, x3)] = 3 · x2 + 0 + 3 · x3
[g#(x1, x2)] = 2 + 3 · x1 + 1 · x2
[s(x1)] = 0
[c(x1)] = 2 + 1 · x1
[0] = 3
[true] = 3
[1] = 3
[false] = 3
which has the intended complexity. Here, only the following usable rules have been considered:
f#(0) c1 (8)
f#(1) c2 (9)
f#(s(z0)) c3(f#(z0)) (11)
if#(true,z0,z1) c4 (13)
if#(false,z0,z1) c5 (15)
g#(s(z0),s(z1)) c6(if#(f(z0),s(z0),s(z1)),f#(z0)) (17)
g#(z0,c(z1)) c7(g#(z0,g(s(c(z1)),z1)),g#(s(c(z1)),z1)) (19)
g(s(z0),s(z1)) if(f(z0),s(z0),s(z1)) (16)
if(true,z0,z1) z0 (12)
g(z0,c(z1)) g(z0,g(s(c(z1)),z1)) (18)
if(false,z0,z1) z1 (14)

1.1.1.1.1 Rule Shifting

The rules
g#(z0,c(z1)) c7(g#(z0,g(s(c(z1)),z1)),g#(s(c(z1)),z1)) (19)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c1] = 0
[c2] = 0
[c3(x1)] = 1 · x1 + 0
[c4] = 0
[c5] = 0
[c6(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c7(x1, x2)] = 1 · x1 + 0 + 1 · x2
[f(x1)] = 1
[if(x1, x2, x3)] = 1 · x2 + 0 + 1 · x3
[g(x1, x2)] = 0
[f#(x1)] = 0
[if#(x1, x2, x3)] = 1 · x2 + 0 + 1 · x3
[g#(x1, x2)] = 1 · x1 + 0 + 1 · x2
[s(x1)] = 0
[c(x1)] = 1 + 1 · x1
[0] = 1
[true] = 1
[1] = 1
[false] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
f#(0) c1 (8)
f#(1) c2 (9)
f#(s(z0)) c3(f#(z0)) (11)
if#(true,z0,z1) c4 (13)
if#(false,z0,z1) c5 (15)
g#(s(z0),s(z1)) c6(if#(f(z0),s(z0),s(z1)),f#(z0)) (17)
g#(z0,c(z1)) c7(g#(z0,g(s(c(z1)),z1)),g#(s(c(z1)),z1)) (19)
g(s(z0),s(z1)) if(f(z0),s(z0),s(z1)) (16)
if(true,z0,z1) z0 (12)
g(z0,c(z1)) g(z0,g(s(c(z1)),z1)) (18)
if(false,z0,z1) z1 (14)

1.1.1.1.1.1 Rule Shifting

The rules
f#(s(z0)) c3(f#(z0)) (11)
are strictly oriented by the following linear polynomial interpretation over (2 x 2)-matrices with strict dimension 1 over the rationals with delta = 1
[g#(x1, x2)] =
0 0
0 0
+
1 0
0 0
· x1 +
0 0
0 0
· x2
[c1] =
0 0
0 0
[c5] =
0 0
0 0
[c6(x1, x2)] =
0 0
0 0
+
1 0
0 0
· x1 +
1 0
0 0
· x2
[c3(x1)] =
0 0
0 0
+
1 0
0 0
· x1
[if#(x1, x2, x3)] =
0 0
0 0
+
0 0
0 0
· x1 +
0 0
0 0
· x2 +
0 0
0 0
· x3
[c4] =
0 0
0 0
[f#(x1)] =
0 0
0 0
+
0 2
0 0
· x1
[c2] =
0 0
0 0
[c7(x1, x2)] =
0 0
0 0
+
1 0
0 0
· x1 +
1 0
0 0
· x2
[s(x1)] =
0 0
4 0
+
0 2
0 1
· x1
[true] =
0 0
0 0
[c(x1)] =
0 0
0 0
+
0 0
0 0
· x1
[f(x1)] =
0 0
0 0
+
0 0
0 0
· x1
[if(x1, x2, x3)] =
0 0
0 0
+
0 0
0 0
· x1 +
0 0
0 0
· x2 +
0 0
0 0
· x3
[0] =
0 0
0 0
[1] =
0 0
0 0
[g(x1, x2)] =
0 0
0 0
+
0 0
0 0
· x1 +
0 0
0 0
· x2
[false] =
0 0
0 0
which has the intended complexity. Here, only the following usable rules have been considered:
f#(0) c1 (8)
f#(1) c2 (9)
f#(s(z0)) c3(f#(z0)) (11)
if#(true,z0,z1) c4 (13)
if#(false,z0,z1) c5 (15)
g#(s(z0),s(z1)) c6(if#(f(z0),s(z0),s(z1)),f#(z0)) (17)
g#(z0,c(z1)) c7(g#(z0,g(s(c(z1)),z1)),g#(s(c(z1)),z1)) (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).