Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/HirokawaMiddeldorp_04/t014)

The rewrite relation of the following TRS is considered.

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

1.1 Usable Rules

We remove the following rules since they are not usable.
div(z0,0) 0 (28)

1.1.1 Rule Shifting

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

1.1.1.1 Rule Shifting

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

1.1.1.1.1 Rule Shifting

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

1.1.1.1.1.1 Rule Shifting

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

1.1.1.1.1.1.1 Rule Shifting

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

1.1.1.1.1.1.1.1 Rule Shifting

The rules
lt#(s(z0),s(z1)) c5(lt#(z0,z1)) (23)
are strictly oriented by the following non-linear polynomial interpretation over the naturals
[c] = 0
[c1] = 0
[c2(x1)] = 1 · x1 + 0
[c3] = 0
[c4] = 0
[c5(x1)] = 1 · x1 + 0
[c6] = 0
[c7] = 0
[c8] = 0
[c9] = 0
[c10(x1,...,x4)] = 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4
[lt(x1, x2)] = 0
[div(x1, x2)] = 1 · x1 + 0
[-(x1, x2)] = 1 · x1 + 0
[if(x1, x2, x3)] = 2 · x2 + 0 + 1 · x3 + 1 · x2 · x2
[-#(x1, x2)] = 0
[lt#(x1, x2)] = 1 · x1 + 0
[if#(x1, x2, x3)] = 1 · x2 + 0 + 1 · x3 + 1 · x2 · x2
[div#(x1, x2)] = 1 · x1 · x1 + 0
[0] = 0
[false] = 1
[s(x1)] = 1 + 1 · x1
[true] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
-#(z0,0) c (13)
-#(0,s(z0)) c1 (15)
-#(s(z0),s(z1)) c2(-#(z0,z1)) (17)
lt#(z0,0) c3 (19)
lt#(0,s(z0)) c4 (21)
lt#(s(z0),s(z1)) c5(lt#(z0,z1)) (23)
if#(true,z0,z1) c6 (25)
if#(false,z0,z1) c7 (27)
div#(z0,0) c8 (29)
div#(0,z0) c9 (31)
div#(s(z0),s(z1)) c10(if#(lt(z0,z1),0,s(div(-(z0,z1),s(z1)))),lt#(z0,z1),div#(-(z0,z1),s(z1)),-#(z0,z1)) (33)
-(0,s(z0)) 0 (14)
-(s(z0),s(z1)) -(z0,z1) (16)
div(s(z0),s(z1)) if(lt(z0,z1),0,s(div(-(z0,z1),s(z1)))) (32)
if(true,z0,z1) z0 (24)
-(z0,0) z0 (12)
div(0,z0) 0 (30)
if(false,z0,z1) z1 (26)

1.1.1.1.1.1.1.1.1 Rule Shifting

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

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