Term Rewriting System R:
[x, y, z]
qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))

Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

QSORT(.(x, y)) -> QSORT(lowers(x, y))
QSORT(.(x, y)) -> LOWERS(x, y)
QSORT(.(x, y)) -> QSORT(greaters(x, y))
QSORT(.(x, y)) -> GREATERS(x, y)
LOWERS(x, .(y, z)) -> LOWERS(x, z)
GREATERS(x, .(y, z)) -> GREATERS(x, z)

Furthermore, R contains three SCCs.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Argument Filtering and Ordering`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`

Dependency Pair:

LOWERS(x, .(y, z)) -> LOWERS(x, z)

Rules:

qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))

The following dependency pair can be strictly oriented:

LOWERS(x, .(y, z)) -> LOWERS(x, z)

The following rules can be oriented:

qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))

Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
qsort > . > lowers > <=
qsort > . > greaters > <=
qsort > ++

resulting in one new DP problem.
Used Argument Filtering System:
LOWERS(x1, x2) -> LOWERS(x1, x2)
.(x1, x2) -> .(x1, x2)
qsort(x1) -> qsort(x1)
++(x1, x2) -> ++(x1, x2)
lowers(x1, x2) -> lowers(x1, x2)
greaters(x1, x2) -> greaters(x1, x2)
if(x1, x2, x3) -> x1
<=(x1, x2) -> <=(x1, x2)

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`           →DP Problem 4`
`             ↳Dependency Graph`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`

Dependency Pair:

Rules:

qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))

Using the Dependency Graph resulted in no new DP problems.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳Argument Filtering and Ordering`
`       →DP Problem 3`
`         ↳AFS`

Dependency Pair:

GREATERS(x, .(y, z)) -> GREATERS(x, z)

Rules:

qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))

The following dependency pair can be strictly oriented:

GREATERS(x, .(y, z)) -> GREATERS(x, z)

The following rules can be oriented:

qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))

Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
qsort > . > lowers > <=
qsort > . > greaters > <=
qsort > ++

resulting in one new DP problem.
Used Argument Filtering System:
GREATERS(x1, x2) -> GREATERS(x1, x2)
.(x1, x2) -> .(x1, x2)
qsort(x1) -> qsort(x1)
++(x1, x2) -> ++(x1, x2)
lowers(x1, x2) -> lowers(x1, x2)
greaters(x1, x2) -> greaters(x1, x2)
if(x1, x2, x3) -> x1
<=(x1, x2) -> <=(x1, x2)

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`           →DP Problem 5`
`             ↳Dependency Graph`
`       →DP Problem 3`
`         ↳AFS`

Dependency Pair:

Rules:

qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))

Using the Dependency Graph resulted in no new DP problems.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳Argument Filtering and Ordering`

Dependency Pairs:

QSORT(.(x, y)) -> QSORT(greaters(x, y))
QSORT(.(x, y)) -> QSORT(lowers(x, y))

Rules:

qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))

The following dependency pairs can be strictly oriented:

QSORT(.(x, y)) -> QSORT(greaters(x, y))
QSORT(.(x, y)) -> QSORT(lowers(x, y))

The following rules can be oriented:

greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))

Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
{., qsort} > lowers > <=
{., qsort} > ++
{., qsort} > greaters > <=

resulting in one new DP problem.
Used Argument Filtering System:
QSORT(x1) -> QSORT(x1)
.(x1, x2) -> .(x1, x2)
greaters(x1, x2) -> greaters(x1, x2)
lowers(x1, x2) -> lowers(x1, x2)
if(x1, x2, x3) -> x1
<=(x1, x2) -> <=(x1, x2)
qsort(x1) -> qsort(x1)
++(x1, x2) -> ++(x1, x2)

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`           →DP Problem 6`
`             ↳Dependency Graph`

Dependency Pair:

Rules:

qsort(nil) -> nil
qsort(.(x, y)) -> ++(qsort(lowers(x, y)), .(x, qsort(greaters(x, y))))
lowers(x, nil) -> nil
lowers(x, .(y, z)) -> if(<=(y, x), .(y, lowers(x, z)), lowers(x, z))
greaters(x, nil) -> nil
greaters(x, .(y, z)) -> if(<=(y, x), greaters(x, z), .(y, greaters(x, z)))

Using the Dependency Graph resulted in no new DP problems.

Termination of R successfully shown.
Duration:
0:00 minutes