Certification Problem

Input (TPDB Runtime_Complexity_Innermost_Rewriting/AG01/#3.12)

The rewrite relation of the following TRS is considered.

app(nil,y) y (1)
app(add(n,x),y) add(n,app(x,y)) (2)
reverse(nil) nil (3)
reverse(add(n,x)) app(reverse(x),add(n,nil)) (4)
shuffle(nil) nil (5)
shuffle(add(n,x)) add(n,shuffle(reverse(x))) (6)
The evaluation strategy is innermost.

Property / Task

Determine bounds on the runtime complexity.

Answer / Result

An upperbound for the complexity is O(n3).

Proof (by AProVE @ termCOMP 2023)

1 Dependency Tuples

We get the following set of dependency tuples:
app#(nil,z0) c (8)
originates from
app(nil,z0) z0 (7)
app#(add(z0,z1),z2) c1(app#(z1,z2)) (10)
originates from
app(add(z0,z1),z2) add(z0,app(z1,z2)) (9)
reverse#(nil) c2 (11)
originates from
reverse(nil) nil (3)
reverse#(add(z0,z1)) c3(app#(reverse(z1),add(z0,nil)),reverse#(z1)) (13)
originates from
reverse(add(z0,z1)) app(reverse(z1),add(z0,nil)) (12)
shuffle#(nil) c4 (14)
originates from
shuffle(nil) nil (5)
shuffle#(add(z0,z1)) c5(shuffle#(reverse(z1)),reverse#(z1)) (16)
originates from
shuffle(add(z0,z1)) add(z0,shuffle(reverse(z1))) (15)
Moreover, we add the following terms to the innermost strategy.
app#(nil,z0)
app#(add(z0,z1),z2)
reverse#(nil)
reverse#(add(z0,z1))
shuffle#(nil)
shuffle#(add(z0,z1))

1.1 Usable Rules

We remove the following rules since they are not usable.
shuffle(nil) nil (5)
shuffle(add(z0,z1)) add(z0,shuffle(reverse(z1))) (15)

1.1.1 Rule Shifting

The rules
shuffle#(nil) c4 (14)
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
[c4] = 0
[c5(x1, x2)] = 1 · x1 + 0 + 1 · x2
[reverse(x1)] = 1
[app(x1, x2)] = 1 + 1 · x1 + 1 · x2
[app#(x1, x2)] = 0
[reverse#(x1)] = 0
[shuffle#(x1)] = 1
[nil] = 1
[add(x1, x2)] = 1 + 1 · x1
which has the intended complexity. Here, only the following usable rules have been considered:
app#(nil,z0) c (8)
app#(add(z0,z1),z2) c1(app#(z1,z2)) (10)
reverse#(nil) c2 (11)
reverse#(add(z0,z1)) c3(app#(reverse(z1),add(z0,nil)),reverse#(z1)) (13)
shuffle#(nil) c4 (14)
shuffle#(add(z0,z1)) c5(shuffle#(reverse(z1)),reverse#(z1)) (16)

1.1.1.1 Rule Shifting

The rules
reverse#(nil) c2 (11)
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
[c4] = 0
[c5(x1, x2)] = 1 · x1 + 0 + 1 · x2
[reverse(x1)] = 1 · x1 + 0
[app(x1, x2)] = 1 · x1 + 0 + 1 · x2
[app#(x1, x2)] = 0
[reverse#(x1)] = 1
[shuffle#(x1)] = 1 · x1 + 0
[nil] = 0
[add(x1, x2)] = 1 + 1 · x1 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
app#(nil,z0) c (8)
app#(add(z0,z1),z2) c1(app#(z1,z2)) (10)
reverse#(nil) c2 (11)
reverse#(add(z0,z1)) c3(app#(reverse(z1),add(z0,nil)),reverse#(z1)) (13)
shuffle#(nil) c4 (14)
shuffle#(add(z0,z1)) c5(shuffle#(reverse(z1)),reverse#(z1)) (16)
reverse(nil) nil (3)
app(add(z0,z1),z2) add(z0,app(z1,z2)) (9)
app(nil,z0) z0 (7)
reverse(add(z0,z1)) app(reverse(z1),add(z0,nil)) (12)

1.1.1.1.1 Rule Shifting

The rules
shuffle#(add(z0,z1)) c5(shuffle#(reverse(z1)),reverse#(z1)) (16)
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
[c4] = 0
[c5(x1, x2)] = 1 · x1 + 0 + 1 · x2
[reverse(x1)] = 1 · x1 + 0
[app(x1, x2)] = 1 · x1 + 0 + 1 · x2
[app#(x1, x2)] = 0
[reverse#(x1)] = 0
[shuffle#(x1)] = 1 · x1 + 0
[nil] = 0
[add(x1, x2)] = 1 + 1 · x1 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
app#(nil,z0) c (8)
app#(add(z0,z1),z2) c1(app#(z1,z2)) (10)
reverse#(nil) c2 (11)
reverse#(add(z0,z1)) c3(app#(reverse(z1),add(z0,nil)),reverse#(z1)) (13)
shuffle#(nil) c4 (14)
shuffle#(add(z0,z1)) c5(shuffle#(reverse(z1)),reverse#(z1)) (16)
reverse(nil) nil (3)
app(add(z0,z1),z2) add(z0,app(z1,z2)) (9)
app(nil,z0) z0 (7)
reverse(add(z0,z1)) app(reverse(z1),add(z0,nil)) (12)

1.1.1.1.1.1 Rule Shifting

The rules
reverse#(add(z0,z1)) c3(app#(reverse(z1),add(z0,nil)),reverse#(z1)) (13)
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
[c4] = 0
[c5(x1, x2)] = 1 · x1 + 0 + 1 · x2
[reverse(x1)] = 1 · x1 + 0
[app(x1, x2)] = 1 · x1 + 0 + 1 · x2
[app#(x1, x2)] = 0
[reverse#(x1)] = 1 · x1 + 0
[shuffle#(x1)] = 2 · x1 · x1 + 0
[nil] = 0
[add(x1, x2)] = 1 + 1 · x1 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
app#(nil,z0) c (8)
app#(add(z0,z1),z2) c1(app#(z1,z2)) (10)
reverse#(nil) c2 (11)
reverse#(add(z0,z1)) c3(app#(reverse(z1),add(z0,nil)),reverse#(z1)) (13)
shuffle#(nil) c4 (14)
shuffle#(add(z0,z1)) c5(shuffle#(reverse(z1)),reverse#(z1)) (16)
reverse(nil) nil (3)
app(add(z0,z1),z2) add(z0,app(z1,z2)) (9)
app(nil,z0) z0 (7)
reverse(add(z0,z1)) app(reverse(z1),add(z0,nil)) (12)

1.1.1.1.1.1.1 Rule Shifting

The rules
app#(nil,z0) c (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
[c4] = 0
[c5(x1, x2)] = 1 · x1 + 0 + 1 · x2
[reverse(x1)] = 1 · x1 + 0
[app(x1, x2)] = 1 · x1 + 0 + 1 · x2
[app#(x1, x2)] = 2
[reverse#(x1)] = 2 + 1 · x1
[shuffle#(x1)] = 2 · x1 · x1 + 0
[nil] = 0
[add(x1, x2)] = 2 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
app#(nil,z0) c (8)
app#(add(z0,z1),z2) c1(app#(z1,z2)) (10)
reverse#(nil) c2 (11)
reverse#(add(z0,z1)) c3(app#(reverse(z1),add(z0,nil)),reverse#(z1)) (13)
shuffle#(nil) c4 (14)
shuffle#(add(z0,z1)) c5(shuffle#(reverse(z1)),reverse#(z1)) (16)
reverse(nil) nil (3)
app(add(z0,z1),z2) add(z0,app(z1,z2)) (9)
app(nil,z0) z0 (7)
reverse(add(z0,z1)) app(reverse(z1),add(z0,nil)) (12)

1.1.1.1.1.1.1.1 Rule Shifting

The rules
app#(add(z0,z1),z2) c1(app#(z1,z2)) (10)
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
[c4] = 0
[c5(x1, x2)] = 1 · x1 + 0 + 1 · x2
[reverse(x1)] = 1 · x1 + 0
[app(x1, x2)] = 1 · x1 + 0 + 1 · x2
[app#(x1, x2)] = 1 · x1 + 0 + 1 · x2 · x2 · x1
[reverse#(x1)] = 1 · x1 · x1 + 0
[shuffle#(x1)] = 1 · x1 · x1 · x1 + 0
[nil] = 0
[add(x1, x2)] = 1 + 1 · x2
which has the intended complexity. Here, only the following usable rules have been considered:
app#(nil,z0) c (8)
app#(add(z0,z1),z2) c1(app#(z1,z2)) (10)
reverse#(nil) c2 (11)
reverse#(add(z0,z1)) c3(app#(reverse(z1),add(z0,nil)),reverse#(z1)) (13)
shuffle#(nil) c4 (14)
shuffle#(add(z0,z1)) c5(shuffle#(reverse(z1)),reverse#(z1)) (16)
reverse(nil) nil (3)
app(add(z0,z1),z2) add(z0,app(z1,z2)) (9)
app(nil,z0) z0 (7)
reverse(add(z0,z1)) app(reverse(z1),add(z0,nil)) (12)

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