Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/Frederiksen_Glenstrup/member)

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

member(x',Cons(x,xs)) → member[Ite][True][Ite](!EQ(x',x),x',Cons(x,xs)) (1)
member(x,Nil) → False (2)
notEmpty(Cons(x,xs)) → True (3)
notEmpty(Nil) → False (4)
goal(x,xs) → member(x,xs) (5)

and S is the following TRS.

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

1.1 Usable Rules

We remove the following rules since they are not usable.
member[Ite][True][Ite](False,z0,Cons(z1,z2)) → member(z0,z2) (28)
member[Ite][True][Ite](True,z0,z1) → True (30)
member(z0,Cons(z1,z2)) → member[Ite][True][Ite](!EQ(z0,z1),z0,Cons(z1,z2)) (12)
member(z0,Nil) → False (14)
notEmpty(Cons(z0,z1)) → True (16)
notEmpty(Nil) → False (4)
goal(z0,z1) → member(z0,z1) (19)

1.1.1 Rule Shifting

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

1.1.1.1 Rule Shifting

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

1.1.1.1.1 Rule Shifting

The rules
member#(z0,Cons(z1,z2)) → c6(member[Ite][True][Ite]#(!EQ(z0,z1),z0,Cons(z1,z2)),!EQ#(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] = 0
[c4(x1)] = 1 · x1 + 0
[c5] = 0
[c6(x1, x2)] = 1 · x1 + 0 + 1 · x2
[c7] = 0
[c8] = 0
[c9] = 0
[c10(x1)] = 1 · x1 + 0
[!EQ(x1, x2)] = 3
[!EQ#(x1, x2)] = 0
[member[Ite][True][Ite]#(x1, x2, x3)] = 3 · x2 + 0 + 2 · x3
[member#(x1, x2)] = 1 + 3 · x1 + 2 · x2
[notEmpty#(x1)] = 0
[goal#(x1, x2)] = 1 + 3 · x1 + 2 · x2
[S(x1)] = 3 + 1 · x1
[0] = 3
[False] = 3
[True] = 3
[Cons(x1, x2)] = 1 + 1 · x2
[Nil] = 0
which has the intended complexity. Here, only the following usable rules have been considered:
!EQ#(S(z0),S(z1)) → c(!EQ#(z0,z1)) (22)
!EQ#(0,S(z0)) → c1 (24)
!EQ#(S(z0),0) → c2 (26)
!EQ#(0,0) → c3 (27)
member[Ite][True][Ite]#(False,z0,Cons(z1,z2)) → c4(member#(z0,z2)) (29)
member[Ite][True][Ite]#(True,z0,z1) → c5 (31)
member#(z0,Cons(z1,z2)) → c6(member[Ite][True][Ite]#(!EQ(z0,z1),z0,Cons(z1,z2)),!EQ#(z0,z1)) (13)
member#(z0,Nil) → c7 (15)
notEmpty#(Cons(z0,z1)) → c8 (17)
notEmpty#(Nil) → c9 (18)
goal#(z0,z1) → c10(member#(z0,z1)) (20)

1.1.1.1.1.1 R is empty

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