Lower Bounds for Runtime Complexity of Term Rewriting
J¨urgen Giesl
LuFG Informatik 2, RWTH Aachen University, Germany
joint work withFlorian Frohn,Jera Hensel,Cornelius Aschermann, andThomas Str¨oder
Lower Bounds?
input size
runtime
worst-case upper bounds
best-case lower bounds worst-case lower boundsWhy?
tight
bounds detect bugs
detect potential attacks (DoS)
Lower Bounds?
input size
runtime
worst-case upper bounds
best-case lower bounds worst-case lower bounds
Why?
tight
bounds detect bugs
detect potential attacks (DoS)
Lower Bounds?
input size
runtime
worst-case upper bounds
best-case lower boundsworst-case lower bounds
Why?
tight
bounds detect bugs
detect potential attacks (DoS)
Lower Bounds?
input size
runtime
worst-case upper bounds
best-case lower bounds worst-case lower boundsWhy?
tight
bounds detect bugs
detect potential attacks (DoS)
Lower Bounds?
input size
runtime
worst-case upper bounds
best-case lower bounds worst-case lower boundsWhy?
tight
bounds
detect bugs
detect potential attacks (DoS)
Lower Bounds?
input size
runtime
worst-case upper bounds
best-case lower bounds worst-case lower boundsWhy?
tight
bounds detect bugs
detect potential attacks (DoS)
Lower Bounds?
input size
runtime
worst-case upper bounds
best-case lower bounds worst-case lower boundsWhy?
tight
bounds detect bugs
detect potential attacks (DoS)
Worst-Case Lower Bounds
Integer Transition Systems
under-approximatingprogram acceleration(IJCAR 16)
⇒WST-talk by M. Naaf, Tue 15:00
Term Rewrite Systems
inferrewrite lemmasthat represent families of rewrite sequences (RTA 15) detectdecreasing loops(JAR 17)
⇒much more efficient and applicable to most examples
Worst-Case Lower Bounds
Integer Transition Systems
under-approximatingprogram acceleration(IJCAR 16)
⇒WST-talk by M. Naaf, Tue 15:00
Term Rewrite Systems
inferrewrite lemmasthat represent families of rewrite sequences (RTA 15) detectdecreasing loops(JAR 17)
⇒much more efficient and applicable to most examples
Worst-Case Lower Bounds
Integer Transition Systems
under-approximatingprogram acceleration(IJCAR 16)
⇒WST-talk by M. Naaf, Tue 15:00
Term Rewrite Systems
inferrewrite lemmasthat represent families of rewrite sequences (RTA 15) detectdecreasing loops(JAR 17)
⇒much more efficient and applicable to most examples
Worst-Case Lower Bounds
Integer Transition Systems
under-approximatingprogram acceleration(IJCAR 16)
⇒WST-talk by M. Naaf, Tue 15:00
Term Rewrite Systems
inferrewrite lemmasthat represent families of rewrite sequences (RTA 15) detectdecreasing loops(JAR 17)
⇒much more efficient and applicable to most examples
Worst-Case Lower Bounds
Integer Transition Systems
under-approximatingprogram acceleration(IJCAR 16)
⇒WST-talk by M. Naaf, Tue 15:00
Term Rewrite Systems
inferrewrite lemmasthat represent families of rewrite sequences (RTA 15) detectdecreasing loops(JAR 17)
⇒much more efficient and applicable to most examples
Worst-Case Lower Bounds
Integer Transition Systems
under-approximatingprogram acceleration(IJCAR 16)
⇒WST-talk by M. Naaf, Tue 15:00
Term Rewrite Systems
inferrewrite lemmasthat represent families of rewrite sequences (RTA 15)
detectdecreasing loops(JAR 17)
⇒much more efficient and applicable to most examples
Worst-Case Lower Bounds
Integer Transition Systems
under-approximatingprogram acceleration(IJCAR 16)
⇒WST-talk by M. Naaf, Tue 15:00
Term Rewrite Systems
inferrewrite lemmasthat represent families of rewrite sequences (RTA 15) detectdecreasing loops(JAR 17)
⇒much more efficient and applicable to most examples
Worst-Case Lower Bounds
Integer Transition Systems
under-approximatingprogram acceleration(IJCAR 16)
⇒WST-talk by M. Naaf, Tue 15:00
Term Rewrite Systems
inferrewrite lemmasthat represent families of rewrite sequences (RTA 15) detectdecreasing loops(JAR 17)
⇒much more efficient and applicable to most examples
Decreasing Loops
Generalizing
loopsto prove
linear and exponential
lower bounds for rc(n).
Example: il
(5,[ ])→∗
6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with a basic term of size ≤
n
Basic Terms
: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential
lower bounds for rc(n).
Example: il
(5,[ ])→∗
6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with a basic term of size ≤
n
Basic Terms
: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il
(5,[ ])→∗
6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with a basic term of size ≤
n
Basic Terms
: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il
(5,[ ])→∗
6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with a basic term of size ≤
n
Basic Terms
: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il
(5,[ ])→∗
6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with a basic term of size ≤
n
Basic Terms
: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il(5,
[ ])→∗6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with a basic term of size ≤
n
Basic Terms
: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il(5,
[ ])→∗6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with a basic term of size ≤
n
Basic Terms
: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il(5,
[ ])→∗6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with abasic
term of size
≤n
Basic Terms
: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il(5,
[ ])→∗6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with abasic
term of size
≤n
Basic Terms: defined symbol only at root
il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il(5,
[ ])→∗6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with abasic
term of size
≤n
Basic Terms: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il(5,
[ ])→∗6
[0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with abasic
term of size
≤n
Basic Terms: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il(5,
[ ])→∗
6 [0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with abasic
term of size
≤n
Basic Terms: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il(5,
[ ])→∗
6 [0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with abasic
term of size
≤n
Basic Terms: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n)
and rc(n)
∈ O(n)Decreasing Loops
Generalizing
loopsto prove linear and
exponential lower bounds for rc(n).
Example: il(5,
[ ])→∗
6 [0,1,2,3,4]
il(s(x),
ys) →il(x, cons(x,
ys))il(0,
ys) → ysrc(n): Length of longest derivation starting with abasic
term of size
≤n
Basic Terms: defined symbol only at root il(s(0), cons(x,
ys))Xil(x, il(0,
ys))8Here:
rc(n)
∈Ω(n) and rc(n)
∈ O(n)Loops
il(s(x),
ys) →il(x, cons(x,
ys))il(x,
ys) →il(s(x), cons(x,
ys))il(x,
ys)→il(s(x),
cons(x,ys))→il(s(s(x)),
cons(s(x),cons(x,ys)))→. . .
t tσ
+
Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys) →il(s(x), cons(x,
ys))il(x,
ys)→il(s(x),
cons(x,ys))→il(s(s(x)),
cons(s(x),cons(x,ys)))→. . .
t tσ
+
Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys) →il(s(x), cons(x,
ys))il(x,
ys)→il(s(x),
cons(x,ys))→
il(s(s(x)),
cons(s(x),cons(x,ys)))→. . .
t tσ
+
Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys) →il(s(x), cons(x,
ys))il(x,
ys)→il(s(x),
cons(x,ys))→il(s(s(x)),
cons(s(x),cons(x,ys)))→. . .
t tσ
+
Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys) →il(s(x), cons(x,
ys))il(x,
ys)→il(s(x),
cons(x,ys))→il(s(s(x)),
cons(s(x),cons(x,ys)))→. . .
t tσ
+
Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys) →il(s(x), cons(x,
ys))il(x,
ys)→il(s(x),
cons(x,ys))→il(s(s(x)),
cons(s(x),cons(x,ys)))→. . .
t tσ
+
Generalizing Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys){x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),
ys) →il(x,
cons(x,ys))θ: Pumping Substitution σ: Result Substitution
`: Base Term
=
⇒Generalizing Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys){x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),
ys) →il(x,
cons(x,ys))θ: Pumping Substitution σ: Result Substitution
`: Base Term
=
⇒Generalizing Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys){x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),
ys) →il(x,
cons(x,ys))θ: Pumping Substitution σ: Result Substitution
`: Base Term
=
⇒Generalizing Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys){x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),
ys) →il(x,
cons(x,ys))θ: Pumping Substitution σ: Result Substitution
`: Base Term
=
⇒Generalizing Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys){x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),
ys) →il(x,
cons(x,ys))θ: Pumping Substitution σ: Result Substitution
`: Base Term
=
⇒Generalizing Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys){x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),
ys) →il(x,
cons(x,ys))θ: Pumping Substitution σ: Result Substitution
`: Base Term
=
⇒Generalizing Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys){x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),
ys) →il(x,
cons(x,ys))θ: Pumping Substitution
σ: Result Substitution
`: Base Term
=
⇒Generalizing Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys){x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),
ys) →il(x,
cons(x,ys))θ: Pumping Substitution σ: Result Substitution
`: Base Term
=
⇒Generalizing Loops
il(s(x),ys) → il(x,cons(x,ys))
il(x,
ys){x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),
ys) →il(x,
cons(x,ys))θ: Pumping Substitution σ: Result Substitution
`: Base Term
=
⇒Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
rθn = il(sn(x),cons(sn(x),ys)) →
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn = `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
rθn = il(sn(x),cons(sn(x),ys)) →
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn
rθn = `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys)
→ rθn = il(sn(x),cons(sn(x),ys)) →
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn
rθn = `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
rθn
= il(sn(x),cons(sn(x),ys)) →
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn
= `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
rθn = il(sn(x),cons(sn(x),ys))
→
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn
= `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
rθn = il(sn(x),cons(sn(x),ys))
→
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn = `σθn
= `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
rθn = il(sn(x),cons(sn(x),ys))
→
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn = `σθn = `θnδ
= `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
rθn = il(sn(x),cons(sn(x),ys))
→
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn = `σθn = `θnδ
= `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
rθn = il(sn(x),cons(sn(x),ys))
→
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn = `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
`θn−1δ = il(sn(x),cons(sn(x),ys))
→
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn = `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
`θn−1δ = il(sn(x),cons(sn(x),ys))
→
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn = `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
`θn−1δ = il(sn(x),cons(sn(x),ys)) →
`θn−2δ0 =
il(sn−1(x),cons(sn−1(x), ...))
→ . . .
`θn rθn = `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
`θn−1δ = il(sn(x),cons(sn(x),ys)) →
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...))
→ . . .
`θn rθn = `σθn = `θnδ = `θn−1δ
Generalizing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
`θn = il(sn+1(x),ys) →
`θn−1δ = il(sn(x),cons(sn(x),ys)) →
`θn−2δ0 = il(sn−1(x),cons(sn−1(x), ...)) → . . .
`θn rθn = `σθn = `θnδ = `θn−1δ
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x
1, . . . , xm
∈ V,π
1, . . . , πm
∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic
and linear,r /∈ V
`|π
i
=x
i
r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic
and linear,r /∈ V
`|πi =xi r|ξ
i
=x
i
for some ξ
i
< π
i
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic
and linear,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x
1
]ξ
1. . .[xm]ξm
matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic
and linear,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x1]ξ1. . .[xm]ξm matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic
and linear,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x1]ξ1. . .[xm]ξm matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8
f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic
and linear,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x1]ξ1. . .[xm]ξm matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic and linear
,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x1]ξ1. . .[xm]ξm matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic and linear
,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x1]ξ1. . .[xm]ξm matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8f(x)
→x
8
Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic and linear
,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x1]ξ1. . .[xm]ξm matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8f(x)
→x
8Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[
r
]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic and linear,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x1]ξ1. . .[xm]ξm matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8f(x)
→x
8Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+
C[r]
x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic and linear,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x1]ξ1. . .[xm]ξm matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8f(x)
→x
8Decreasing Loops
il(x,ys)
{x/s(x)} 99K
L99 {ys/cons(x,ys)}
il(s(x),ys) → il(x,cons(x,ys))
↑ ↑
π ξ
Decreasing Loop
`→+C[r]x1, . . . , xm∈ V,π1, . . . , πm∈ Poswith
`basic and linear,r /∈ V
`|πi =xi
r|ξi =xi for some ξi< πi
`=`[x1]ξ1. . .[xm]ξm matchesr
Theorem: Linear Bounds
If a TRS has a decreasing loop, then rc(n)
∈Ω(n).Decreasing Loops?
f(s(x), x)
→f(x, x)
8f(x)
→x
8Exponential Bounds
decreasing loop: linear bound Ω(n)
context around variable xis removed in each step, same rewrite rule again applicable to rhs
dparallel decreasing loops: exponential boundΩ(dn)
Fibonacci
f( s(s(x)) )
→plus(
f(s(x))
, f(x) )
Here:
rc(n)
∈Ω(2
n)
f(sn−2(0)) . . .
%
f(sn−1(0)) → f(sn−3(0)) . . .
% f(sn(0))
&
f(sn−2(0)) → f(sn−3(0)) . . .
&
f(sn−4(0)) . . .
tr(nodem−2(x, x)) . . .
%
tr(nodem−1(x, x)) → tr(nodem−2(x, x)) . . .
% tr(nodem(x, x))
&
tr(nodem−1(x, x)) → tr(nodem−2(x, x)) . . .
&
tr(nodem−2(x, x)) . . .