Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Frederiksen_Glenstrup/ordered)

The relative rewrite relation R/S is considered where R is the following TRS

ordered(Cons(x',Cons(x,xs))) ordered[Ite](<(x',x),Cons(x',Cons(x,xs))) (1)
ordered(Cons(x,Nil)) True (2)
ordered(Nil) True (3)
notEmpty(Cons(x,xs)) True (4)
notEmpty(Nil) False (5)
goal(xs) ordered(xs) (6)

and S is the following TRS.

<(S(x),S(y)) <(x,y) (7)
<(0,S(y)) True (8)
<(x,0) False (9)
ordered[Ite](True,Cons(x',Cons(x,xs))) ordered(xs) (10)
ordered[Ite](False,xs) False (11)
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:
ordered#(Cons(z0,Cons(z1,z2))) c5(ordered[Ite]#(<(z0,z1),Cons(z0,Cons(z1,z2))),<#(z0,z1)) (13)
originates from
ordered(Cons(z0,Cons(z1,z2))) ordered[Ite](<(z0,z1),Cons(z0,Cons(z1,z2))) (12)
ordered#(Cons(z0,Nil)) c6 (15)
originates from
ordered(Cons(z0,Nil)) True (14)
ordered#(Nil) c7 (16)
originates from
ordered(Nil) True (3)
notEmpty#(Cons(z0,z1)) c8 (18)
originates from
notEmpty(Cons(z0,z1)) True (17)
notEmpty#(Nil) c9 (19)
originates from
notEmpty(Nil) False (5)
goal#(z0) c10(ordered#(z0)) (21)
originates from
goal(z0) ordered(z0) (20)
<#(S(z0),S(z1)) c(<#(z0,z1)) (23)
originates from
<(S(z0),S(z1)) <(z0,z1) (22)
<#(0,S(z0)) c1 (25)
originates from
<(0,S(z0)) True (24)
<#(z0,0) c2 (27)
originates from
<(z0,0) False (26)
ordered[Ite]#(True,Cons(z0,Cons(z1,z2))) c3(ordered#(z2)) (29)
originates from
ordered[Ite](True,Cons(z0,Cons(z1,z2))) ordered(z2) (28)
ordered[Ite]#(False,z0) c4 (31)
originates from
ordered[Ite](False,z0) False (30)
Moreover, we add the following terms to the innermost strategy.
<#(S(z0),S(z1))
<#(0,S(z0))
<#(z0,0)
ordered[Ite]#(True,Cons(z0,Cons(z1,z2)))
ordered[Ite]#(False,z0)
ordered#(Cons(z0,Cons(z1,z2)))
ordered#(Cons(z0,Nil))
ordered#(Nil)
notEmpty#(Cons(z0,z1))
notEmpty#(Nil)
goal#(z0)

1.1 Usable Rules

We remove the following rules since they are not usable.
ordered[Ite](True,Cons(z0,Cons(z1,z2))) ordered(z2) (28)
ordered[Ite](False,z0) False (30)
ordered(Cons(z0,Cons(z1,z2))) ordered[Ite](<(z0,z1),Cons(z0,Cons(z1,z2))) (12)
ordered(Cons(z0,Nil)) True (14)
ordered(Nil) True (3)
notEmpty(Cons(z0,z1)) True (17)
notEmpty(Nil) False (5)
goal(z0) ordered(z0) (20)

1.1.1 Rule Shifting

The rules
ordered#(Cons(z0,Nil)) c6 (15)
ordered#(Nil) c7 (16)
notEmpty#(Cons(z0,z1)) c8 (18)
notEmpty#(Nil) c9 (19)
goal#(z0) c10(ordered#(z0)) (21)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1)] = 1 · x1 + 0
[c1] = 0
[c2] = 0
[c3(x1)] = 1 · x1 + 0
[c4] = 0
[c5(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c6] = 0
[c7] = 0
[c8] = 0
[c9] = 0
[c10(x1)] = 1 · x1 + 0
[<(x1, x2)] = 0
[<#(x1, x2)] = 0
[ordered[Ite]#(x1, x2)] = 1 · x1 + 0 + 1 · x2
[ordered#(x1)] = 1 · x1 + 0
[notEmpty#(x1)] = 1 + 1 · x1
[goal#(x1)] = 1 + 1 · x1
[S(x1)] = 1 + 1 · x1
[0] = 1
[True] = 0
[False] = 0
[Cons(x1, x2)] = 1 · x1 + 0 + 1 · x2
[Nil] = 1
which has the intended complexity. Here, only the following usable rules have been considered:
<#(S(z0),S(z1)) c(<#(z0,z1)) (23)
<#(0,S(z0)) c1 (25)
<#(z0,0) c2 (27)
ordered[Ite]#(True,Cons(z0,Cons(z1,z2))) c3(ordered#(z2)) (29)
ordered[Ite]#(False,z0) c4 (31)
ordered#(Cons(z0,Cons(z1,z2))) c5(ordered[Ite]#(<(z0,z1),Cons(z0,Cons(z1,z2))),<#(z0,z1)) (13)
ordered#(Cons(z0,Nil)) c6 (15)
ordered#(Nil) c7 (16)
notEmpty#(Cons(z0,z1)) c8 (18)
notEmpty#(Nil) c9 (19)
goal#(z0) c10(ordered#(z0)) (21)
<(z0,0) False (26)
<(0,S(z0)) True (24)
<(S(z0),S(z1)) <(z0,z1) (22)

1.1.1.1 Rule Shifting

The rules
ordered#(Cons(z0,Cons(z1,z2))) c5(ordered[Ite]#(<(z0,z1),Cons(z0,Cons(z1,z2))),<#(z0,z1)) (13)
are strictly oriented by the following linear polynomial interpretation over the naturals
[c(x1)] = 1 · x1 + 0
[c1] = 0
[c2] = 0
[c3(x1)] = 1 · x1 + 0
[c4] = 0
[c5(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c6] = 0
[c7] = 0
[c8] = 0
[c9] = 0
[c10(x1)] = 1 · x1 + 0
[<(x1, x2)] = 0
[<#(x1, x2)] = 0
[ordered[Ite]#(x1, x2)] = 1 · x1 + 0 + 1 · x2
[ordered#(x1)] = 1 + 1 · x1
[notEmpty#(x1)] = 0
[goal#(x1)] = 1 + 1 · x1
[S(x1)] = 1 + 1 · x1
[0] = 1
[True] = 0
[False] = 0
[Cons(x1, x2)] = 1 + 1 · x1 + 1 · x2
[Nil] = 0
which has the intended complexity. Here, only the following usable rules have been considered:
<#(S(z0),S(z1)) c(<#(z0,z1)) (23)
<#(0,S(z0)) c1 (25)
<#(z0,0) c2 (27)
ordered[Ite]#(True,Cons(z0,Cons(z1,z2))) c3(ordered#(z2)) (29)
ordered[Ite]#(False,z0) c4 (31)
ordered#(Cons(z0,Cons(z1,z2))) c5(ordered[Ite]#(<(z0,z1),Cons(z0,Cons(z1,z2))),<#(z0,z1)) (13)
ordered#(Cons(z0,Nil)) c6 (15)
ordered#(Nil) c7 (16)
notEmpty#(Cons(z0,z1)) c8 (18)
notEmpty#(Nil) c9 (19)
goal#(z0) c10(ordered#(z0)) (21)
<(z0,0) False (26)
<(0,S(z0)) True (24)
<(S(z0),S(z1)) <(z0,z1) (22)

1.1.1.1.1 R is empty

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