Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/SK90/2.19)

The rewrite relation of the following TRS is considered.

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

1.1 Rule Shifting

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

1.1.1 Rule Shifting

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

1.1.1.1 Rule Shifting

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

1.1.1.1.1 Rule Shifting

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

1.1.1.1.1.1 Rule Shifting

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

1.1.1.1.1.1.1 Rule Shifting

The rules
+#(z0,s(z1)) c6(+#(z0,z1)) (19)
are strictly oriented by the following non-linear polynomial interpretation over the naturals
[c] = 0
[c1(x1, x2, x3)] = 1 · x1 + 0 + 1 · x2 + 1 · x3
[c2(x1, x2, x3)] = 1 · x1 + 0 + 1 · x2 + 1 · x3
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[c5] = 0
[c6(x1)] = 1 · x1 + 0
[sqr(x1)] = 2 + 2 · x1 · x1
[double(x1)] = 2 · x1 + 0
[+(x1, x2)] = 2 + 2 · x2
[sqr#(x1)] = 1 · x1 · x1 + 0
[double#(x1)] = 0
[+#(x1, x2)] = 1 · x2 + 0
[0] = 0
[s(x1)] = 1 + 1 · x1
which has the intended complexity. Here, only the following usable rules have been considered:
sqr#(0) c (8)
sqr#(s(z0)) c1(+#(sqr(z0),s(double(z0))),sqr#(z0),double#(z0)) (10)
sqr#(s(z0)) c2(+#(sqr(z0),double(z0)),sqr#(z0),double#(z0)) (12)
double#(0) c3 (13)
double#(s(z0)) c4(double#(z0)) (15)
+#(z0,0) c5 (17)
+#(z0,s(z1)) c6(+#(z0,z1)) (19)
double(0) 0 (3)
double(s(z0)) s(s(double(z0))) (14)

1.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).