Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Strategy_removed_CSR_05/Ex49_GM04)

The rewrite relation of the following TRS is considered.

minus(0,Y) 0 (1)
minus(s(X),s(Y)) minus(X,Y) (2)
geq(X,0) true (3)
geq(0,s(Y)) false (4)
geq(s(X),s(Y)) geq(X,Y) (5)
div(0,s(Y)) 0 (6)
div(s(X),s(Y)) if(geq(X,Y),s(div(minus(X,Y),s(Y))),0) (7)
if(true,X,Y) X (8)
if(false,X,Y) Y (9)
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:
minus#(0,z0) c (11)
originates from
minus(0,z0) 0 (10)
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (13)
originates from
minus(s(z0),s(z1)) minus(z0,z1) (12)
geq#(z0,0) c2 (15)
originates from
geq(z0,0) true (14)
geq#(0,s(z0)) c3 (17)
originates from
geq(0,s(z0)) false (16)
geq#(s(z0),s(z1)) c4(geq#(z0,z1)) (19)
originates from
geq(s(z0),s(z1)) geq(z0,z1) (18)
div#(0,s(z0)) c5 (21)
originates from
div(0,s(z0)) 0 (20)
div#(s(z0),s(z1)) c6(if#(geq(z0,z1),s(div(minus(z0,z1),s(z1))),0),geq#(z0,z1),div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (23)
originates from
div(s(z0),s(z1)) if(geq(z0,z1),s(div(minus(z0,z1),s(z1))),0) (22)
if#(true,z0,z1) c7 (25)
originates from
if(true,z0,z1) z0 (24)
if#(false,z0,z1) c8 (27)
originates from
if(false,z0,z1) z1 (26)
Moreover, we add the following terms to the innermost strategy.
minus#(0,z0)
minus#(s(z0),s(z1))
geq#(z0,0)
geq#(0,s(z0))
geq#(s(z0),s(z1))
div#(0,s(z0))
div#(s(z0),s(z1))
if#(true,z0,z1)
if#(false,z0,z1)

1.1 Rule Shifting

The rules
div#(0,s(z0)) c5 (21)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1)] = 1 · x1 + 0
[c2] = 0
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[c5] = 0
[c6(x1,...,x4)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4
[c7] = 0
[c8] = 0
[minus(x1, x2)] = 0
[geq(x1, x2)] = 0
[div(x1, x2)] = 1
[if(x1, x2, x3)] = 1 + 1 · x1 + 1 · x2 + 1 · x3
[minus#(x1, x2)] = 0
[geq#(x1, x2)] = 0
[div#(x1, x2)] = 1 + 1 · x2
[if#(x1, x2, x3)] = 1 · x2 + 0 + 1 · x3
[0] = 0
[true] = 1
[s(x1)] = 0
[false] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
minus#(0,z0) c (11)
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (13)
geq#(z0,0) c2 (15)
geq#(0,s(z0)) c3 (17)
geq#(s(z0),s(z1)) c4(geq#(z0,z1)) (19)
div#(0,s(z0)) c5 (21)
div#(s(z0),s(z1)) c6(if#(geq(z0,z1),s(div(minus(z0,z1),s(z1))),0),geq#(z0,z1),div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (23)
if#(true,z0,z1) c7 (25)
if#(false,z0,z1) c8 (27)

1.1.1 Rule Shifting

The rules
geq#(z0,0) c2 (15)
geq#(0,s(z0)) c3 (17)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1)] = 1 · x1 + 0
[c2] = 0
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[c5] = 0
[c6(x1,...,x4)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4
[c7] = 0
[c8] = 0
[minus(x1, x2)] = 0
[geq(x1, x2)] = 0
[div(x1, x2)] = 1
[if(x1, x2, x3)] = 1 + 1 · x1 + 1 · x2 + 1 · x3
[minus#(x1, x2)] = 0
[geq#(x1, x2)] = 1
[div#(x1, x2)] = 1 · x1 + 0
[if#(x1, x2, x3)] = 1 · x3 + 0
[0] = 0
[true] = 1
[s(x1)] = 1
[false] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
minus#(0,z0) c (11)
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (13)
geq#(z0,0) c2 (15)
geq#(0,s(z0)) c3 (17)
geq#(s(z0),s(z1)) c4(geq#(z0,z1)) (19)
div#(0,s(z0)) c5 (21)
div#(s(z0),s(z1)) c6(if#(geq(z0,z1),s(div(minus(z0,z1),s(z1))),0),geq#(z0,z1),div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (23)
if#(true,z0,z1) c7 (25)
if#(false,z0,z1) c8 (27)
minus(s(z0),s(z1)) minus(z0,z1) (12)
minus(0,z0) 0 (10)

1.1.1.1 Rule Shifting

The rules
geq#(s(z0),s(z1)) c4(geq#(z0,z1)) (19)
div#(s(z0),s(z1)) c6(if#(geq(z0,z1),s(div(minus(z0,z1),s(z1))),0),geq#(z0,z1),div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (23)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1)] = 1 · x1 + 0
[c2] = 0
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[c5] = 0
[c6(x1,...,x4)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4
[c7] = 0
[c8] = 0
[minus(x1, x2)] = 0
[geq(x1, x2)] = 1 · x1 + 0
[div(x1, x2)] = 1
[if(x1, x2, x3)] = 1 + 1 · x1 + 1 · x2 + 1 · x3
[minus#(x1, x2)] = 0
[geq#(x1, x2)] = 1 · x1 + 0
[div#(x1, x2)] = 1 · x1 + 0
[if#(x1, x2, x3)] = 1 · x3 + 0
[0] = 0
[true] = 1
[s(x1)] = 1 + 1 · x1
[false] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
minus#(0,z0) c (11)
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (13)
geq#(z0,0) c2 (15)
geq#(0,s(z0)) c3 (17)
geq#(s(z0),s(z1)) c4(geq#(z0,z1)) (19)
div#(0,s(z0)) c5 (21)
div#(s(z0),s(z1)) c6(if#(geq(z0,z1),s(div(minus(z0,z1),s(z1))),0),geq#(z0,z1),div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (23)
if#(true,z0,z1) c7 (25)
if#(false,z0,z1) c8 (27)
minus(s(z0),s(z1)) minus(z0,z1) (12)
minus(0,z0) 0 (10)

1.1.1.1.1 Rule Shifting

The rules
minus#(0,z0) c (11)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1)] = 1 · x1 + 0
[c2] = 0
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[c5] = 0
[c6(x1,...,x4)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4
[c7] = 0
[c8] = 0
[minus(x1, x2)] = 0
[geq(x1, x2)] = 1 · x1 + 0
[div(x1, x2)] = 1 + 1 · x1
[if(x1, x2, x3)] = 1 + 1 · x1 + 1 · x2 + 1 · x3
[minus#(x1, x2)] = 1
[geq#(x1, x2)] = 0
[div#(x1, x2)] = 1 · x1 + 0
[if#(x1, x2, x3)] = 1 · x3 + 0
[0] = 0
[true] = 1
[s(x1)] = 1
[false] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
minus#(0,z0) c (11)
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (13)
geq#(z0,0) c2 (15)
geq#(0,s(z0)) c3 (17)
geq#(s(z0),s(z1)) c4(geq#(z0,z1)) (19)
div#(0,s(z0)) c5 (21)
div#(s(z0),s(z1)) c6(if#(geq(z0,z1),s(div(minus(z0,z1),s(z1))),0),geq#(z0,z1),div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (23)
if#(true,z0,z1) c7 (25)
if#(false,z0,z1) c8 (27)
minus(s(z0),s(z1)) minus(z0,z1) (12)
minus(0,z0) 0 (10)

1.1.1.1.1.1 Rule Shifting

The rules
if#(true,z0,z1) c7 (25)
if#(false,z0,z1) c8 (27)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1)] = 1 · x1 + 0
[c2] = 0
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[c5] = 0
[c6(x1,...,x4)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4
[c7] = 0
[c8] = 0
[minus(x1, x2)] = 0
[geq(x1, x2)] = 0
[div(x1, x2)] = 1 + 1 · x1
[if(x1, x2, x3)] = 1 + 1 · x1 + 1 · x2 + 1 · x3
[minus#(x1, x2)] = 0
[geq#(x1, x2)] = 0
[div#(x1, x2)] = 1 · x1 + 0
[if#(x1, x2, x3)] = 1 + 1 · x3
[0] = 0
[true] = 0
[s(x1)] = 1
[false] = 0
which has the intended complexity. Here, only the following usable rules have been considered:
minus#(0,z0) c (11)
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (13)
geq#(z0,0) c2 (15)
geq#(0,s(z0)) c3 (17)
geq#(s(z0),s(z1)) c4(geq#(z0,z1)) (19)
div#(0,s(z0)) c5 (21)
div#(s(z0),s(z1)) c6(if#(geq(z0,z1),s(div(minus(z0,z1),s(z1))),0),geq#(z0,z1),div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (23)
if#(true,z0,z1) c7 (25)
if#(false,z0,z1) c8 (27)
minus(s(z0),s(z1)) minus(z0,z1) (12)
minus(0,z0) 0 (10)

1.1.1.1.1.1.1 Rule Shifting

The rules
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (13)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c] = 0
[c1(x1)] = 1 · x1 + 0
[c2] = 0
[c3] = 0
[c4(x1)] = 1 · x1 + 0
[c5] = 0
[c6(x1,...,x4)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4
[c7] = 0
[c8] = 0
[minus(x1, x2)] = 1
[geq(x1, x2)] = 1 + 1 · x1 + 1 · x2
[div(x1, x2)] = 1 + 1 · x1 + 1 · x2
[if(x1, x2, x3)] = 1 + 1 · x1 + 1 · x2 + 1 · x3
[minus#(x1, x2)] = 1 · x1 + 0
[geq#(x1, x2)] = 0
[div#(x1, x2)] = 1 · x1 + 0
[if#(x1, x2, x3)] = 0
[0] = 1
[true] = 0
[s(x1)] = 1 + 1 · x1
[false] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
minus#(0,z0) c (11)
minus#(s(z0),s(z1)) c1(minus#(z0,z1)) (13)
geq#(z0,0) c2 (15)
geq#(0,s(z0)) c3 (17)
geq#(s(z0),s(z1)) c4(geq#(z0,z1)) (19)
div#(0,s(z0)) c5 (21)
div#(s(z0),s(z1)) c6(if#(geq(z0,z1),s(div(minus(z0,z1),s(z1))),0),geq#(z0,z1),div#(minus(z0,z1),s(z1)),minus#(z0,z1)) (23)
if#(true,z0,z1) c7 (25)
if#(false,z0,z1) c8 (27)
minus(s(z0),s(z1)) minus(z0,z1) (12)
minus(0,z0) 0 (10)

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