Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Rubio_04/gm)

The rewrite relation of the following TRS is considered.

minus(X,0) X (1)
minus(s(X),s(Y)) p(minus(X,Y)) (2)
p(s(X)) X (3)
div(0,s(Y)) 0 (4)
div(s(X),s(Y)) s(div(minus(X,Y),s(Y))) (5)
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:
minus#(z0,0) c (7)
originates from
minus(z0,0) z0 (6)
minus#(s(z0),s(z1)) c1(p#(minus(z0,z1)),minus#(z0,z1)) (9)
originates from
minus(s(z0),s(z1)) p(minus(z0,z1)) (8)
p#(s(z0)) c2 (11)
originates from
p(s(z0)) z0 (10)
div#(0,s(z0)) c3 (13)
originates from
div(0,s(z0)) 0 (12)
div#(s(z0),s(z1)) c4(div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (15)
originates from
div(s(z0),s(z1)) s(div(minus(z0,z1),s(z1))) (14)
Moreover, we add the following terms to the innermost strategy.
minus#(z0,0)
minus#(s(z0),s(z1))
p#(s(z0))
div#(0,s(z0))
div#(s(z0),s(z1))

1.1 Usable Rules

We remove the following rules since they are not usable.
div(0,s(z0)) 0 (12)
div(s(z0),s(z1)) s(div(minus(z0,z1),s(z1))) (14)

1.1.1 Rule Shifting

The rules
div#(0,s(z0)) c3 (13)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c2] = 0
[c3] = 0
[c4(x1, x2)] = 1 · x1 + 0 + 1 · x2
[minus(x1, x2)] = 1 · x1 + 0 + 1 · x2
[p(x1)] = 1 + 1 · x1
[minus#(x1, x2)] = 0
[p#(x1)] = 0
[div#(x1, x2)] = 1 · x2 + 0
[0] = 1
[s(x1)] = 1 + 1 · x1
which has the intended complexity. Here, only the following usable rules have been considered:
minus#(z0,0) c (7)
minus#(s(z0),s(z1)) c1(p#(minus(z0,z1)),minus#(z0,z1)) (9)
p#(s(z0)) c2 (11)
div#(0,s(z0)) c3 (13)
div#(s(z0),s(z1)) c4(div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (15)

1.1.1.1 Rule Shifting

The rules
minus#(z0,0) c (7)
div#(s(z0),s(z1)) c4(div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (15)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c2] = 0
[c3] = 0
[c4(x1, x2)] = 1 · x1 + 0 + 1 · x2
[minus(x1, x2)] = 1 · x1 + 0
[p(x1)] = 1 · x1 + 0
[minus#(x1, x2)] = 1
[p#(x1)] = 0
[div#(x1, x2)] = 1 · x1 + 0
[0] = 0
[s(x1)] = 2 + 1 · x1
which has the intended complexity. Here, only the following usable rules have been considered:
minus#(z0,0) c (7)
minus#(s(z0),s(z1)) c1(p#(minus(z0,z1)),minus#(z0,z1)) (9)
p#(s(z0)) c2 (11)
div#(0,s(z0)) c3 (13)
div#(s(z0),s(z1)) c4(div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (15)
p(s(z0)) z0 (10)
minus(z0,0) z0 (6)
minus(s(z0),s(z1)) p(minus(z0,z1)) (8)

1.1.1.1.1 Rule Shifting

The rules
minus#(s(z0),s(z1)) c1(p#(minus(z0,z1)),minus#(z0,z1)) (9)
p#(s(z0)) c2 (11)
are strictly oriented by the following non-linear polynomial interpretation over the naturals
[c] = 0
[c1(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c2] = 0
[c3] = 0
[c4(x1, x2)] = 1 · x1 + 0 + 1 · x2
[minus(x1, x2)] = 1 · x1 + 0
[p(x1)] = 1 · x1 + 0
[minus#(x1, x2)] = 1 + 2 · x1
[p#(x1)] = 1
[div#(x1, x2)] = 1 · x1 · x1 + 0
[0] = 2
[s(x1)] = 1 + 1 · x1
which has the intended complexity. Here, only the following usable rules have been considered:
minus#(z0,0) c (7)
minus#(s(z0),s(z1)) c1(p#(minus(z0,z1)),minus#(z0,z1)) (9)
p#(s(z0)) c2 (11)
div#(0,s(z0)) c3 (13)
div#(s(z0),s(z1)) c4(div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (15)
p(s(z0)) z0 (10)
minus(z0,0) z0 (6)
minus(s(z0),s(z1)) p(minus(z0,z1)) (8)

1.1.1.1.1.1 R is empty

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