Term Rewriting System R:
[Y, X, N, M, L, K]
eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))

Innermost Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

EQ(s(X), s(Y)) -> EQ(X, Y)
LE(s(X), s(Y)) -> LE(X, Y)
MIN(cons(N, cons(M, L))) -> IFMIN(le(N, M), cons(N, cons(M, L)))
MIN(cons(N, cons(M, L))) -> LE(N, M)
IFMIN(true, cons(N, cons(M, L))) -> MIN(cons(N, L))
IFMIN(false, cons(N, cons(M, L))) -> MIN(cons(M, L))
REPLACE(N, M, cons(K, L)) -> IFREPL(eq(N, K), N, M, cons(K, L))
REPLACE(N, M, cons(K, L)) -> EQ(N, K)
IFREPL(false, N, M, cons(K, L)) -> REPLACE(N, M, L)
SELSORT(cons(N, L)) -> IFSELSORT(eq(N, min(cons(N, L))), cons(N, L))
SELSORT(cons(N, L)) -> EQ(N, min(cons(N, L)))
SELSORT(cons(N, L)) -> MIN(cons(N, L))
IFSELSORT(true, cons(N, L)) -> SELSORT(L)
IFSELSORT(false, cons(N, L)) -> MIN(cons(N, L))
IFSELSORT(false, cons(N, L)) -> SELSORT(replace(min(cons(N, L)), N, L))
IFSELSORT(false, cons(N, L)) -> REPLACE(min(cons(N, L)), N, L)

Furthermore, R contains five SCCs.


   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


Dependency Pair:

EQ(s(X), s(Y)) -> EQ(X, Y)


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




The following dependency pair can be strictly oriented:

EQ(s(X), s(Y)) -> EQ(X, Y)


There are no usable rules for innermost that need to be oriented.
Used ordering: Homeomorphic Embedding Order with EMB
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
Nar
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pair:


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


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
Nar
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pair:

LE(s(X), s(Y)) -> LE(X, Y)


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




The following dependency pair can be strictly oriented:

LE(s(X), s(Y)) -> LE(X, Y)


There are no usable rules for innermost that need to be oriented.
Used ordering: Homeomorphic Embedding Order with EMB
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
Nar
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pair:


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


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
Narrowing Transformation
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pairs:

IFREPL(false, N, M, cons(K, L)) -> REPLACE(N, M, L)
REPLACE(N, M, cons(K, L)) -> IFREPL(eq(N, K), N, M, cons(K, L))


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

REPLACE(N, M, cons(K, L)) -> IFREPL(eq(N, K), N, M, cons(K, L))
four new Dependency Pairs are created:

REPLACE(0, M, cons(0, L)) -> IFREPL(true, 0, M, cons(0, L))
REPLACE(0, M, cons(s(Y'), L)) -> IFREPL(false, 0, M, cons(s(Y'), L))
REPLACE(s(X'), M, cons(0, L)) -> IFREPL(false, s(X'), M, cons(0, L))
REPLACE(s(X'), M, cons(s(Y'), L)) -> IFREPL(eq(X', Y'), s(X'), M, cons(s(Y'), L))

The transformation is resulting in one new DP problem:



   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


Dependency Pairs:

REPLACE(s(X'), M, cons(s(Y'), L)) -> IFREPL(eq(X', Y'), s(X'), M, cons(s(Y'), L))
REPLACE(s(X'), M, cons(0, L)) -> IFREPL(false, s(X'), M, cons(0, L))
REPLACE(0, M, cons(s(Y'), L)) -> IFREPL(false, 0, M, cons(s(Y'), L))
IFREPL(false, N, M, cons(K, L)) -> REPLACE(N, M, L)


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




On this DP problem, an Instantiation SCC transformation can be performed.
As a result of transforming the rule

IFREPL(false, N, M, cons(K, L)) -> REPLACE(N, M, L)
three new Dependency Pairs are created:

IFREPL(false, 0, M'', cons(s(Y'''), L'')) -> REPLACE(0, M'', L'')
IFREPL(false, s(X'''), M'', cons(0, L'')) -> REPLACE(s(X'''), M'', L'')
IFREPL(false, s(X'''), M'', cons(s(Y'''), L'')) -> REPLACE(s(X'''), M'', L'')

The transformation is resulting in two new DP problems:



   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
       →DP Problem 3
Nar
           →DP Problem 8
Inst
             ...
               →DP Problem 9
Forward Instantiation Transformation
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pairs:

IFREPL(false, s(X'''), M'', cons(0, L'')) -> REPLACE(s(X'''), M'', L'')
REPLACE(s(X'), M, cons(0, L)) -> IFREPL(false, s(X'), M, cons(0, L))
IFREPL(false, s(X'''), M'', cons(s(Y'''), L'')) -> REPLACE(s(X'''), M'', L'')
REPLACE(s(X'), M, cons(s(Y'), L)) -> IFREPL(eq(X', Y'), s(X'), M, cons(s(Y'), L))


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

IFREPL(false, s(X'''), M'', cons(0, L'')) -> REPLACE(s(X'''), M'', L'')
two new Dependency Pairs are created:

IFREPL(false, s(X''''), M''', cons(0, cons(0, L'''))) -> REPLACE(s(X''''), M''', cons(0, L'''))
IFREPL(false, s(X''''), M''', cons(0, cons(s(Y'''), L'''))) -> REPLACE(s(X''''), M''', cons(s(Y'''), L'''))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
       →DP Problem 3
Nar
           →DP Problem 8
Inst
             ...
               →DP Problem 11
Forward Instantiation Transformation
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pairs:

IFREPL(false, s(X'''), M'', cons(s(Y'''), L'')) -> REPLACE(s(X'''), M'', L'')
REPLACE(s(X'), M, cons(s(Y'), L)) -> IFREPL(eq(X', Y'), s(X'), M, cons(s(Y'), L))
IFREPL(false, s(X''''), M''', cons(0, cons(s(Y'''), L'''))) -> REPLACE(s(X''''), M''', cons(s(Y'''), L'''))
IFREPL(false, s(X''''), M''', cons(0, cons(0, L'''))) -> REPLACE(s(X''''), M''', cons(0, L'''))
REPLACE(s(X'), M, cons(0, L)) -> IFREPL(false, s(X'), M, cons(0, L))


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

REPLACE(s(X'), M, cons(0, L)) -> IFREPL(false, s(X'), M, cons(0, L))
two new Dependency Pairs are created:

REPLACE(s(X''), M', cons(0, cons(0, L'''''))) -> IFREPL(false, s(X''), M', cons(0, cons(0, L''''')))
REPLACE(s(X''), M', cons(0, cons(s(Y'''''), L'''''))) -> IFREPL(false, s(X''), M', cons(0, cons(s(Y'''''), L''''')))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
       →DP Problem 3
Nar
           →DP Problem 8
Inst
             ...
               →DP Problem 13
Forward Instantiation Transformation
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pairs:

IFREPL(false, s(X''''), M''', cons(0, cons(s(Y'''), L'''))) -> REPLACE(s(X''''), M''', cons(s(Y'''), L'''))
REPLACE(s(X''), M', cons(0, cons(s(Y'''''), L'''''))) -> IFREPL(false, s(X''), M', cons(0, cons(s(Y'''''), L''''')))
IFREPL(false, s(X''''), M''', cons(0, cons(0, L'''))) -> REPLACE(s(X''''), M''', cons(0, L'''))
REPLACE(s(X''), M', cons(0, cons(0, L'''''))) -> IFREPL(false, s(X''), M', cons(0, cons(0, L''''')))
REPLACE(s(X'), M, cons(s(Y'), L)) -> IFREPL(eq(X', Y'), s(X'), M, cons(s(Y'), L))
IFREPL(false, s(X'''), M'', cons(s(Y'''), L'')) -> REPLACE(s(X'''), M'', L'')


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

IFREPL(false, s(X'''), M'', cons(s(Y'''), L'')) -> REPLACE(s(X'''), M'', L'')
three new Dependency Pairs are created:

IFREPL(false, s(X''''), M''', cons(s(Y'''), cons(s(Y'''), L'''))) -> REPLACE(s(X''''), M''', cons(s(Y'''), L'''))
IFREPL(false, s(X'''''), M'''', cons(s(Y'''), cons(0, cons(0, L''''''')))) -> REPLACE(s(X'''''), M'''', cons(0, cons(0, L''''''')))
IFREPL(false, s(X'''''), M'''', cons(s(Y'''), cons(0, cons(s(Y'''''''), L''''''')))) -> REPLACE(s(X'''''), M'''', cons(0, cons(s(Y'''''''), L''''''')))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
       →DP Problem 3
Nar
           →DP Problem 8
Inst
             ...
               →DP Problem 15
Forward Instantiation Transformation
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pairs:

IFREPL(false, s(X'''''), M'''', cons(s(Y'''), cons(0, cons(s(Y'''''''), L''''''')))) -> REPLACE(s(X'''''), M'''', cons(0, cons(s(Y'''''''), L''''''')))
REPLACE(s(X''), M', cons(0, cons(s(Y'''''), L'''''))) -> IFREPL(false, s(X''), M', cons(0, cons(s(Y'''''), L''''')))
IFREPL(false, s(X''''), M''', cons(0, cons(0, L'''))) -> REPLACE(s(X''''), M''', cons(0, L'''))
REPLACE(s(X''), M', cons(0, cons(0, L'''''))) -> IFREPL(false, s(X''), M', cons(0, cons(0, L''''')))
IFREPL(false, s(X'''''), M'''', cons(s(Y'''), cons(0, cons(0, L''''''')))) -> REPLACE(s(X'''''), M'''', cons(0, cons(0, L''''''')))
IFREPL(false, s(X''''), M''', cons(s(Y'''), cons(s(Y'''), L'''))) -> REPLACE(s(X''''), M''', cons(s(Y'''), L'''))
REPLACE(s(X'), M, cons(s(Y'), L)) -> IFREPL(eq(X', Y'), s(X'), M, cons(s(Y'), L))
IFREPL(false, s(X''''), M''', cons(0, cons(s(Y'''), L'''))) -> REPLACE(s(X''''), M''', cons(s(Y'''), L'''))


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

REPLACE(s(X'), M, cons(s(Y'), L)) -> IFREPL(eq(X', Y'), s(X'), M, cons(s(Y'), L))
three new Dependency Pairs are created:

REPLACE(s(X''), M', cons(s(Y''), cons(s(Y''''''), L'''''))) -> IFREPL(eq(X'', Y''), s(X''), M', cons(s(Y''), cons(s(Y''''''), L''''')))
REPLACE(s(X''), M', cons(s(Y''), cons(0, cons(0, L''''''''')))) -> IFREPL(eq(X'', Y''), s(X''), M', cons(s(Y''), cons(0, cons(0, L'''''''''))))
REPLACE(s(X''), M', cons(s(Y''), cons(0, cons(s(Y'''''''''), L''''''''')))) -> IFREPL(eq(X'', Y''), s(X''), M', cons(s(Y''), cons(0, cons(s(Y'''''''''), L'''''''''))))

The transformation is resulting in one new DP problem:



   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)




The following remains to be proven:


   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
       →DP Problem 3
Nar
           →DP Problem 8
Inst
             ...
               →DP Problem 10
Forward Instantiation Transformation
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pairs:

IFREPL(false, 0, M'', cons(s(Y'''), L'')) -> REPLACE(0, M'', L'')
REPLACE(0, M, cons(s(Y'), L)) -> IFREPL(false, 0, M, cons(s(Y'), L))


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

IFREPL(false, 0, M'', cons(s(Y'''), L'')) -> REPLACE(0, M'', L'')
one new Dependency Pair is created:

IFREPL(false, 0, M''', cons(s(Y'''), cons(s(Y'''), L'''))) -> REPLACE(0, M''', cons(s(Y'''), L'''))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
       →DP Problem 3
Nar
           →DP Problem 8
Inst
             ...
               →DP Problem 12
Forward Instantiation Transformation
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pairs:

IFREPL(false, 0, M''', cons(s(Y'''), cons(s(Y'''), L'''))) -> REPLACE(0, M''', cons(s(Y'''), L'''))
REPLACE(0, M, cons(s(Y'), L)) -> IFREPL(false, 0, M, cons(s(Y'), L))


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

REPLACE(0, M, cons(s(Y'), L)) -> IFREPL(false, 0, M, cons(s(Y'), L))
one new Dependency Pair is created:

REPLACE(0, M', cons(s(Y''), cons(s(Y''''''), L'''''))) -> IFREPL(false, 0, M', cons(s(Y''), cons(s(Y''''''), L''''')))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
       →DP Problem 3
Nar
           →DP Problem 8
Inst
             ...
               →DP Problem 14
Argument Filtering and Ordering
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pairs:

REPLACE(0, M', cons(s(Y''), cons(s(Y''''''), L'''''))) -> IFREPL(false, 0, M', cons(s(Y''), cons(s(Y''''''), L''''')))
IFREPL(false, 0, M''', cons(s(Y'''), cons(s(Y'''), L'''))) -> REPLACE(0, M''', cons(s(Y'''), L'''))


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


Strategy:

innermost




The following dependency pair can be strictly oriented:

IFREPL(false, 0, M''', cons(s(Y'''), cons(s(Y'''), L'''))) -> REPLACE(0, M''', cons(s(Y'''), L'''))


There are no usable rules for innermost that need to be oriented.
Used ordering: Homeomorphic Embedding Order with EMB
resulting in one new DP problem.
Used Argument Filtering System:
REPLACE(x1, x2, x3) -> x3
cons(x1, x2) -> cons(x1, x2)
IFREPL(x1, x2, x3, x4) -> x4
s(x1) -> s(x1)


   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
       →DP Problem 3
Nar
           →DP Problem 8
Inst
             ...
               →DP Problem 17
Dependency Graph
       →DP Problem 4
Remaining
       →DP Problem 5
Remaining


Dependency Pair:

REPLACE(0, M', cons(s(Y''), cons(s(Y''''''), L'''''))) -> IFREPL(false, 0, M', cons(s(Y''), cons(s(Y''''''), L''''')))


Rules:


eq(0, 0) -> true
eq(0, s(Y)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
le(0, Y) -> true
le(s(X), 0) -> false
le(s(X), s(Y)) -> le(X, Y)
min(cons(0, nil)) -> 0
min(cons(s(N), nil)) -> s(N)
min(cons(N, cons(M, L))) -> ifmin(le(N, M), cons(N, cons(M, L)))
ifmin(true, cons(N, cons(M, L))) -> min(cons(N, L))
ifmin(false, cons(N, cons(M, L))) -> min(cons(M, L))
replace(N, M, nil) -> nil
replace(N, M, cons(K, L)) -> ifrepl(eq(N, K), N, M, cons(K, L))
ifrepl(true, N, M, cons(K, L)) -> cons(M, L)
ifrepl(false, N, M, cons(K, L)) -> cons(K, replace(N, M, L))
selsort(nil) -> nil
selsort(cons(N, L)) -> ifselsort(eq(N, min(cons(N, L))), cons(N, L))
ifselsort(true, cons(N, L)) -> cons(N, selsort(L))
ifselsort(false, cons(N, L)) -> cons(min(cons(N, L)), selsort(replace(min(cons(N, L)), N, L)))


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
Nar
       →DP Problem 4
Remaining Obligation(s)
       →DP Problem 5
Remaining Obligation(s)




The following remains to be proven:


   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)




The following remains to be proven:

Innermost Termination of R could not be shown.
Duration:
0:09 minutes