Term Rewriting System R:
[y, x, n, m]
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

LE(s(x), s(y)) -> LE(x, y)
APP(add(n, x), y) -> APP(x, y)
LOW(n, add(m, x)) -> LE(m, n)
IFLOW(true, n, add(m, x)) -> LOW(n, x)
IFLOW(false, n, add(m, x)) -> LOW(n, x)
HIGH(n, add(m, x)) -> LE(m, n)
IFHIGH(true, n, add(m, x)) -> HIGH(n, x)
IFHIGH(false, n, add(m, x)) -> HIGH(n, x)

Furthermore, R contains five SCCs.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Polynomial Ordering`
`       →DP Problem 2`
`         ↳Remaining`
`       →DP Problem 3`
`         ↳Remaining`
`       →DP Problem 4`
`         ↳Remaining`
`       →DP Problem 5`
`         ↳Remaining`

Dependency Pair:

LE(s(x), s(y)) -> LE(x, y)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

The following dependency pair can be strictly oriented:

LE(s(x), s(y)) -> LE(x, y)

Additionally, the following rules can be oriented:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(LE(x1, x2)) =  x1 POL(if_low(x1, x2, x3)) =  0 POL(false) =  0 POL(high(x1, x2)) =  0 POL(low(x1, x2)) =  0 POL(true) =  0 POL(add(x1, x2)) =  0 POL(0) =  0 POL(quicksort(x1)) =  0 POL(if_high(x1, x2, x3)) =  0 POL(nil) =  0 POL(s(x1)) =  1 + x1 POL(le(x1, x2)) =  0 POL(app(x1, x2)) =  x2

resulting in one new DP problem.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Polo`
`           →DP Problem 6`
`             ↳Dependency Graph`
`       →DP Problem 2`
`         ↳Remaining`
`       →DP Problem 3`
`         ↳Remaining`
`       →DP Problem 4`
`         ↳Remaining`
`       →DP Problem 5`
`         ↳Remaining`

Dependency Pair:

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

Using the Dependency Graph resulted in no new DP problems.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Polo`
`       →DP Problem 2`
`         ↳Remaining Obligation(s)`
`       →DP Problem 3`
`         ↳Remaining Obligation(s)`
`       →DP Problem 4`
`         ↳Remaining Obligation(s)`
`       →DP Problem 5`
`         ↳Remaining Obligation(s)`

The following remains to be proven:
• Dependency Pair:

APP(add(n, x), y) -> APP(x, y)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

IFLOW(false, n, add(m, x)) -> LOW(n, x)
IFLOW(true, n, add(m, x)) -> LOW(n, x)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

IFHIGH(false, n, add(m, x)) -> HIGH(n, x)
IFHIGH(true, n, add(m, x)) -> HIGH(n, x)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Polo`
`       →DP Problem 2`
`         ↳Remaining Obligation(s)`
`       →DP Problem 3`
`         ↳Remaining Obligation(s)`
`       →DP Problem 4`
`         ↳Remaining Obligation(s)`
`       →DP Problem 5`
`         ↳Remaining Obligation(s)`

The following remains to be proven:
• Dependency Pair:

APP(add(n, x), y) -> APP(x, y)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

IFLOW(false, n, add(m, x)) -> LOW(n, x)
IFLOW(true, n, add(m, x)) -> LOW(n, x)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

IFHIGH(false, n, add(m, x)) -> HIGH(n, x)
IFHIGH(true, n, add(m, x)) -> HIGH(n, x)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Polo`
`       →DP Problem 2`
`         ↳Remaining Obligation(s)`
`       →DP Problem 3`
`         ↳Remaining Obligation(s)`
`       →DP Problem 4`
`         ↳Remaining Obligation(s)`
`       →DP Problem 5`
`         ↳Remaining Obligation(s)`

The following remains to be proven:
• Dependency Pair:

APP(add(n, x), y) -> APP(x, y)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

IFLOW(false, n, add(m, x)) -> LOW(n, x)
IFLOW(true, n, add(m, x)) -> LOW(n, x)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

IFHIGH(false, n, add(m, x)) -> HIGH(n, x)
IFHIGH(true, n, add(m, x)) -> HIGH(n, x)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Polo`
`       →DP Problem 2`
`         ↳Remaining Obligation(s)`
`       →DP Problem 3`
`         ↳Remaining Obligation(s)`
`       →DP Problem 4`
`         ↳Remaining Obligation(s)`
`       →DP Problem 5`
`         ↳Remaining Obligation(s)`

The following remains to be proven:
• Dependency Pair:

APP(add(n, x), y) -> APP(x, y)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

IFLOW(false, n, add(m, x)) -> LOW(n, x)
IFLOW(true, n, add(m, x)) -> LOW(n, x)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

IFHIGH(false, n, add(m, x)) -> HIGH(n, x)
IFHIGH(true, n, add(m, x)) -> HIGH(n, x)

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil
ifhigh(true, n, add(m, x)) -> high(n, x)
quicksort(nil) -> nil

• Dependency Pairs:

Rules:

le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
app(nil, y) -> y
low(n, nil) -> nil
iflow(false, n, add(m, x)) -> low(n, x)
high(n, nil) -> nil