Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/AG01/#3.1)

The rewrite relation of the following TRS is considered.

minus(x,0) x (1)
minus(s(x),s(y)) minus(x,y) (2)
quot(0,s(y)) 0 (3)
quot(s(x),s(y)) s(quot(minus(x,y),s(y))) (4)
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 (6)
originates from
minus(z0,0) z0 (5)
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (8)
originates from
minus(s(z0),s(z1)) minus(z0,z1) (7)
quot#(0,s(z0)) c2 (10)
originates from
quot(0,s(z0)) 0 (9)
quot#(s(z0),s(z1)) c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) (12)
originates from
quot(s(z0),s(z1)) s(quot(minus(z0,z1),s(z1))) (11)
Moreover, we add the following terms to the innermost strategy.
minus#(z0,0)
minus#(s(z0),s(z1))
quot#(0,s(z0))
quot#(s(z0),s(z1))

1.1 Usable Rules

We remove the following rules since they are not usable.
quot(0,s(z0)) 0 (9)
quot(s(z0),s(z1)) s(quot(minus(z0,z1),s(z1))) (11)

1.1.1 Rule Shifting

The rules
minus#(z0,0) c (6)
quot#(0,s(z0)) c2 (10)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1)] = 1 · x1 + 0
[c2] = 0
[c3(x1, x2)] = 1 · x1 + 0 + 1 · x2
[minus(x1, x2)] = 1 · x1 + 0
[minus#(x1, x2)] = 1
[quot#(x1, x2)] = 1 + 1 · x1 + 1 · x2
[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 (6)
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (8)
quot#(0,s(z0)) c2 (10)
quot#(s(z0),s(z1)) c3(quot#(minus(z0,z1),s(z1)),minus#(z0,z1)) (12)
minus(s(z0),s(z1)) minus(z0,z1) (7)
minus(z0,0) z0 (5)

1.1.1.1 Rule Shifting

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

1.1.1.1.1 Rule Shifting

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

1.1.1.1.1.1 R is empty

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