R
↳Dependency Pair Analysis
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)
R
↳DPs
→DP Problem 1
↳Argument Filtering and Ordering
→DP Problem 2
↳AFS
→DP Problem 3
↳Nar
→DP Problem 4
↳Remaining
→DP Problem 5
↳Remaining
EQ(s(n), s(m)) -> EQ(n, m)
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
EQ(s(n), s(m)) -> EQ(n, m)
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
↳Nar
→DP Problem 4
↳Remaining
→DP Problem 5
↳Remaining
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
R
↳DPs
→DP Problem 1
↳AFS
→DP Problem 2
↳Argument Filtering and Ordering
→DP Problem 3
↳Nar
→DP Problem 4
↳Remaining
→DP Problem 5
↳Remaining
LE(s(n), s(m)) -> LE(n, m)
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
LE(s(n), s(m)) -> LE(n, m)
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
↳Nar
→DP Problem 4
↳Remaining
→DP Problem 5
↳Remaining
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
R
↳DPs
→DP Problem 1
↳AFS
→DP Problem 2
↳AFS
→DP Problem 3
↳Narrowing Transformation
→DP Problem 4
↳Remaining
→DP Problem 5
↳Remaining
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))
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
four new Dependency Pairs are created:
REPLACE(n, m, cons(k, x)) -> IFREPLACE(eq(n, k), n, m, cons(k, x))
REPLACE(0, m, cons(0, x)) -> IFREPLACE(true, 0, m, cons(0, x))
REPLACE(0, m, cons(s(m''), x)) -> IFREPLACE(false, 0, m, cons(s(m''), x))
REPLACE(s(n''), m, cons(0, x)) -> IFREPLACE(false, s(n''), m, cons(0, x))
REPLACE(s(n''), m, cons(s(m''), x)) -> IFREPLACE(eq(n'', m''), s(n''), m, cons(s(m''), x))
R
↳DPs
→DP Problem 1
↳AFS
→DP Problem 2
↳AFS
→DP Problem 3
↳Nar
→DP Problem 8
↳Instantiation Transformation
→DP Problem 4
↳Remaining
→DP Problem 5
↳Remaining
REPLACE(s(n''), m, cons(s(m''), x)) -> IFREPLACE(eq(n'', m''), s(n''), m, cons(s(m''), x))
REPLACE(s(n''), m, cons(0, x)) -> IFREPLACE(false, s(n''), m, cons(0, x))
REPLACE(0, m, cons(s(m''), x)) -> IFREPLACE(false, 0, m, cons(s(m''), x))
IFREPLACE(false, n, m, cons(k, x)) -> REPLACE(n, 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)
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
three new Dependency Pairs are created:
IFREPLACE(false, n, m, cons(k, x)) -> REPLACE(n, m, x)
IFREPLACE(false, 0, m'', cons(s(m''''), x'')) -> REPLACE(0, m'', x'')
IFREPLACE(false, s(n''''), m'', cons(0, x'')) -> REPLACE(s(n''''), m'', x'')
IFREPLACE(false, s(n''''), m'', cons(s(m''''), x')) -> REPLACE(s(n''''), m'', x')
R
↳DPs
→DP Problem 1
↳AFS
→DP Problem 2
↳AFS
→DP Problem 3
↳Nar
→DP Problem 4
↳Remaining Obligation(s)
→DP Problem 5
↳Remaining Obligation(s)
IFREPLACE(false, s(n''''), m'', cons(0, x'')) -> REPLACE(s(n''''), m'', x'')
REPLACE(s(n''), m, cons(0, x)) -> IFREPLACE(false, s(n''), m, cons(0, x))
IFREPLACE(false, s(n''''), m'', cons(s(m''''), x')) -> REPLACE(s(n''''), m'', x')
REPLACE(s(n''), m, cons(s(m''), x)) -> IFREPLACE(eq(n'', m''), s(n''), m, cons(s(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)
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
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)))
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
SORT(cons(n, x)) -> SORT(replace(min(cons(n, x)), n, 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)
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
R
↳DPs
→DP Problem 1
↳AFS
→DP Problem 2
↳AFS
→DP Problem 3
↳Nar
→DP Problem 8
↳Inst
...
→DP Problem 10
↳Argument Filtering and Ordering
→DP Problem 4
↳Remaining
→DP Problem 5
↳Remaining
IFREPLACE(false, 0, m'', cons(s(m''''), x'')) -> REPLACE(0, m'', x'')
REPLACE(0, m, cons(s(m''), x)) -> IFREPLACE(false, 0, m, cons(s(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)
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
IFREPLACE(false, 0, m'', cons(s(m''''), x'')) -> REPLACE(0, m'', x'')
IFREPLACE(x1, x2, x3, x4) -> x4
cons(x1, x2) -> cons(x1, x2)
REPLACE(x1, x2, x3) -> x3
s(x1) -> s(x1)
R
↳DPs
→DP Problem 1
↳AFS
→DP Problem 2
↳AFS
→DP Problem 3
↳Nar
→DP Problem 8
↳Inst
...
→DP Problem 11
↳Dependency Graph
→DP Problem 4
↳Remaining
→DP Problem 5
↳Remaining
REPLACE(0, m, cons(s(m''), x)) -> IFREPLACE(false, 0, m, cons(s(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)
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
R
↳DPs
→DP Problem 1
↳AFS
→DP Problem 2
↳AFS
→DP Problem 3
↳Nar
→DP Problem 4
↳Remaining Obligation(s)
→DP Problem 5
↳Remaining Obligation(s)
IFREPLACE(false, s(n''''), m'', cons(0, x'')) -> REPLACE(s(n''''), m'', x'')
REPLACE(s(n''), m, cons(0, x)) -> IFREPLACE(false, s(n''), m, cons(0, x))
IFREPLACE(false, s(n''''), m'', cons(s(m''''), x')) -> REPLACE(s(n''''), m'', x')
REPLACE(s(n''), m, cons(s(m''), x)) -> IFREPLACE(eq(n'', m''), s(n''), m, cons(s(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)
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
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)))
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
SORT(cons(n, x)) -> SORT(replace(min(cons(n, x)), n, 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)
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
R
↳DPs
→DP Problem 1
↳AFS
→DP Problem 2
↳AFS
→DP Problem 3
↳Nar
→DP Problem 4
↳Remaining Obligation(s)
→DP Problem 5
↳Remaining Obligation(s)
IFREPLACE(false, s(n''''), m'', cons(0, x'')) -> REPLACE(s(n''''), m'', x'')
REPLACE(s(n''), m, cons(0, x)) -> IFREPLACE(false, s(n''), m, cons(0, x))
IFREPLACE(false, s(n''''), m'', cons(s(m''''), x')) -> REPLACE(s(n''''), m'', x')
REPLACE(s(n''), m, cons(s(m''), x)) -> IFREPLACE(eq(n'', m''), s(n''), m, cons(s(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)
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
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)))
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
SORT(cons(n, x)) -> SORT(replace(min(cons(n, x)), n, 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)
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