Term Rewriting System R:
[m, n, x, k]
eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Innermost Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

EQ(s(n), s(m)) -> EQ(n, m)
LE(s(n), s(m)) -> LE(n, m)
MIN(cons(n, cons(m, x))) -> IFMIN(le(n, m), cons(n, cons(m, x)))
MIN(cons(n, cons(m, x))) -> LE(n, m)
IFMIN(true, cons(n, cons(m, x))) -> MIN(cons(n, x))
IFMIN(false, cons(n, cons(m, x))) -> MIN(cons(m, x))
REPLACE(n, m, cons(k, x)) -> IFREPLACE(eq(n, k), n, m, cons(k, x))
REPLACE(n, m, cons(k, x)) -> EQ(n, k)
IFREPLACE(false, n, m, cons(k, x)) -> REPLACE(n, m, x)
SORT(cons(n, x)) -> MIN(cons(n, x))
SORT(cons(n, x)) -> SORT(replace(min(cons(n, x)), n, x))
SORT(cons(n, x)) -> REPLACE(min(cons(n, x)), n, x)

Furthermore, R contains five SCCs.

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

Dependency Pair:

EQ(s(n), s(m)) -> EQ(n, m)

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

The following dependency pair can be strictly oriented:

EQ(s(n), s(m)) -> EQ(n, m)

There are no usable rules for innermost that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(EQ(x1, x2)) =  x1 + x2 POL(s(x1)) =  1 + x1

resulting in one new DP problem.
Used Argument Filtering System:
EQ(x1, x2) -> EQ(x1, x2)
s(x1) -> s(x1)

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

Dependency Pair:

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

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`
`       →DP Problem 4`
`         ↳AFS`
`       →DP Problem 5`
`         ↳AFS`

Dependency Pair:

LE(s(n), s(m)) -> LE(n, m)

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

The following dependency pair can be strictly oriented:

LE(s(n), s(m)) -> LE(n, m)

There are no usable rules for innermost that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(LE(x1, x2)) =  x1 + x2 POL(s(x1)) =  1 + x1

resulting in one new DP problem.
Used Argument Filtering System:
LE(x1, x2) -> LE(x1, x2)
s(x1) -> s(x1)

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

Dependency Pair:

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

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`
`       →DP Problem 4`
`         ↳AFS`
`       →DP Problem 5`
`         ↳AFS`

Dependency Pairs:

IFREPLACE(false, n, m, cons(k, x)) -> REPLACE(n, m, x)
REPLACE(n, m, cons(k, x)) -> IFREPLACE(eq(n, k), n, m, cons(k, x))

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

The following dependency pair can be strictly oriented:

IFREPLACE(false, n, m, cons(k, x)) -> REPLACE(n, m, x)

The following usable rules for innermost can be oriented:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(REPLACE(x1, x2, x3)) =  x1 + x2 + x3 POL(eq) =  0 POL(false) =  0 POL(cons(x1, x2)) =  1 + x1 + x2 POL(IF_REPLACE(x1, x2, x3, x4)) =  x1 + x2 + x3 + x4 POL(true) =  0

resulting in one new DP problem.
Used Argument Filtering System:
IFREPLACE(x1, x2, x3, x4) -> IFREPLACE(x1, x2, x3, x4)
REPLACE(x1, x2, x3) -> REPLACE(x1, x2, x3)
cons(x1, x2) -> cons(x1, x2)
eq(x1, x2) -> eq

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

Dependency Pair:

REPLACE(n, m, cons(k, x)) -> IFREPLACE(eq(n, k), n, m, cons(k, x))

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

Using the Dependency Graph resulted in no new DP problems.

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

Dependency Pairs:

IFMIN(false, cons(n, cons(m, x))) -> MIN(cons(m, x))
IFMIN(true, cons(n, cons(m, x))) -> MIN(cons(n, x))
MIN(cons(n, cons(m, x))) -> IFMIN(le(n, m), cons(n, cons(m, x)))

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

The following dependency pair can be strictly oriented:

MIN(cons(n, cons(m, x))) -> IFMIN(le(n, m), cons(n, cons(m, x)))

The following usable rules for innermost can be oriented:

le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(cons(x1, x2)) =  1 + x1 + x2 POL(false) =  0 POL(MIN(x1)) =  1 + x1 POL(true) =  0 POL(IF_MIN(x1, x2)) =  x1 + x2 POL(le) =  0

resulting in one new DP problem.
Used Argument Filtering System:
MIN(x1) -> MIN(x1)
IFMIN(x1, x2) -> IFMIN(x1, x2)
cons(x1, x2) -> cons(x1, x2)
le(x1, x2) -> le

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

Dependency Pairs:

IFMIN(false, cons(n, cons(m, x))) -> MIN(cons(m, x))
IFMIN(true, cons(n, cons(m, x))) -> MIN(cons(n, x))

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

Using the Dependency Graph resulted in no new DP problems.

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

Dependency Pair:

SORT(cons(n, x)) -> SORT(replace(min(cons(n, x)), n, x))

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

The following dependency pair can be strictly oriented:

SORT(cons(n, x)) -> SORT(replace(min(cons(n, x)), n, x))

The following usable rules for innermost can be oriented:

replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(eq) =  0 POL(0) =  0 POL(cons(x1, x2)) =  1 + x1 + x2 POL(false) =  0 POL(min) =  0 POL(nil) =  0 POL(true) =  0 POL(s) =  0 POL(replace(x1, x2, x3)) =  x1 + x2 + x3 POL(le) =  0 POL(if_replace(x1, x2, x3, x4)) =  x1 + x2 + x3 + x4 POL(SORT(x1)) =  1 + x1

resulting in one new DP problem.
Used Argument Filtering System:
SORT(x1) -> SORT(x1)
cons(x1, x2) -> cons(x1, x2)
replace(x1, x2, x3) -> replace(x1, x2, x3)
min(x1) -> min
ifreplace(x1, x2, x3, x4) -> ifreplace(x1, x2, x3, x4)
eq(x1, x2) -> eq
s(x1) -> s
ifmin(x1, x2) -> x1
le(x1, x2) -> le

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

Dependency Pair:

Rules:

eq(0, 0) -> true
eq(0, s(m)) -> false
eq(s(n), 0) -> false
eq(s(n), s(m)) -> eq(n, m)
le(0, m) -> true
le(s(n), 0) -> false
le(s(n), s(m)) -> le(n, m)
min(cons(0, nil)) -> 0
min(cons(s(n), nil)) -> s(n)
min(cons(n, cons(m, x))) -> ifmin(le(n, m), cons(n, cons(m, x)))
ifmin(true, cons(n, cons(m, x))) -> min(cons(n, x))
ifmin(false, cons(n, cons(m, x))) -> min(cons(m, x))
replace(n, m, nil) -> nil
replace(n, m, cons(k, x)) -> ifreplace(eq(n, k), n, m, cons(k, x))
ifreplace(true, n, m, cons(k, x)) -> cons(m, x)
ifreplace(false, n, m, cons(k, x)) -> cons(k, replace(n, m, x))
sort(nil) -> nil
sort(cons(n, x)) -> cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))

Strategy:

innermost

Using the Dependency Graph resulted in no new DP problems.

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