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

Innermost Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

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

Furthermore, R contains five SCCs.


   R
DPs
       →DP Problem 1
Usable Rules (Innermost)
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules


Dependency Pair:

APP(app(eq, app(s, n)), app(s, m)) -> APP(app(eq, n), m)


Rules:


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


Strategy:

innermost




As we are in the innermost case, we can delete all 18 non-usable-rules.


   R
DPs
       →DP Problem 1
UsableRules
           →DP Problem 6
A-Transformation
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules


Dependency Pair:

APP(app(eq, app(s, n)), app(s, m)) -> APP(app(eq, n), m)


Rule:

none


Strategy:

innermost




We have an applicative DP problem with proper arity. Thus we can use the A-Transformation to obtain one new DP problem which consists of the A-transformed TRSs.


   R
DPs
       →DP Problem 1
UsableRules
           →DP Problem 6
ATrans
             ...
               →DP Problem 7
Size-Change Principle
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules


Dependency Pair:

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


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. EQ(s(n), s(m)) -> EQ(n, m)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2>2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1
2>2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
Usable Rules (Innermost)
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules


Dependency Pair:

APP(app(le, app(s, n)), app(s, m)) -> APP(app(le, n), m)


Rules:


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


Strategy:

innermost




As we are in the innermost case, we can delete all 18 non-usable-rules.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
           →DP Problem 8
A-Transformation
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules


Dependency Pair:

APP(app(le, app(s, n)), app(s, m)) -> APP(app(le, n), m)


Rule:

none


Strategy:

innermost




We have an applicative DP problem with proper arity. Thus we can use the A-Transformation to obtain one new DP problem which consists of the A-transformed TRSs.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
           →DP Problem 8
ATrans
             ...
               →DP Problem 9
Size-Change Principle
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules


Dependency Pair:

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


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. LE(s(n), s(m)) -> LE(n, m)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2>2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1
2>2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
Usable Rules (Innermost)
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules


Dependency Pairs:

APP(app(app(app(ifreplace, false), n), m), app(app(cons, k), x)) -> APP(app(app(replace, n), m), x)
APP(app(app(replace, n), m), app(app(cons, k), x)) -> APP(app(app(app(ifreplace, app(app(eq, n), k)), n), m), app(app(cons, k), x))


Rules:


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


Strategy:

innermost




As we are in the innermost case, we can delete all 14 non-usable-rules.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
           →DP Problem 10
A-Transformation
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules


Dependency Pairs:

APP(app(app(app(ifreplace, false), n), m), app(app(cons, k), x)) -> APP(app(app(replace, n), m), x)
APP(app(app(replace, n), m), app(app(cons, k), x)) -> APP(app(app(app(ifreplace, app(app(eq, n), k)), n), m), app(app(cons, k), x))


Rules:


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


Strategy:

innermost




We have an applicative DP problem with proper arity. Thus we can use the A-Transformation to obtain one new DP problem which consists of the A-transformed TRSs.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
           →DP Problem 10
ATrans
             ...
               →DP Problem 11
Size-Change Principle
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules


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(s(n), 0) -> false
eq(0, s(m)) -> false
eq(0, 0) -> true
eq(s(n), s(m)) -> eq(n, m)


Strategy:

innermost




We number the DPs as follows:
  1. IFREPLACE(false, n, m, cons(k, x)) -> REPLACE(n, m, x)
  2. REPLACE(n, m, cons(k, x)) -> IFREPLACE(eq(n, k), n, m, cons(k, x))
and get the following Size-Change Graph(s):
{1} , {1}
2=1
3=2
4>3
{2} , {2}
1=2
2=3
3=4

which lead(s) to this/these maximal multigraph(s):
{1} , {2}
2=2
3=3
4>4
{2} , {1}
1=1
2=2
3>3

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
cons(x1, x2) -> cons(x1, x2)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
Usable Rules (Innermost)
       →DP Problem 5
UsableRules


Dependency Pairs:

APP(app(ifmin, false), app(app(cons, n), app(app(cons, m), x))) -> APP(min, app(app(cons, m), x))
APP(app(ifmin, true), app(app(cons, n), app(app(cons, m), x))) -> APP(min, app(app(cons, n), x))
APP(min, app(app(cons, n), app(app(cons, m), x))) -> APP(app(ifmin, app(app(le, n), m)), app(app(cons, n), app(app(cons, m), x)))


Rules:


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


Strategy:

innermost




As we are in the innermost case, we can delete all 15 non-usable-rules.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
           →DP Problem 12
A-Transformation
       →DP Problem 5
UsableRules


Dependency Pairs:

APP(app(ifmin, false), app(app(cons, n), app(app(cons, m), x))) -> APP(min, app(app(cons, m), x))
APP(app(ifmin, true), app(app(cons, n), app(app(cons, m), x))) -> APP(min, app(app(cons, n), x))
APP(min, app(app(cons, n), app(app(cons, m), x))) -> APP(app(ifmin, app(app(le, n), m)), app(app(cons, n), app(app(cons, m), x)))


Rules:


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


Strategy:

innermost




We have an applicative DP problem with proper arity. Thus we can use the A-Transformation to obtain one new DP problem which consists of the A-transformed TRSs.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
           →DP Problem 12
ATrans
             ...
               →DP Problem 13
Size-Change Principle
       →DP Problem 5
UsableRules


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:


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


Strategy:

innermost




We number the DPs as follows:
  1. IFMIN(false, cons(n, cons(m, x))) -> MIN(cons(m, x))
  2. IFMIN(true, cons(n, cons(m, x))) -> MIN(cons(n, x))
  3. MIN(cons(n, cons(m, x))) -> IFMIN(le(n, m), cons(n, cons(m, x)))
and get the following Size-Change Graph(s):
{1, 2} , {1, 2}
2>1
{3} , {3}
1=2

which lead(s) to this/these maximal multigraph(s):
{1, 2} , {3}
2>2
{3} , {1, 2}
1>1

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
cons(x1, x2) -> cons(x1, x2)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
Usable Rules (Innermost)


Dependency Pair:

APP(sort, app(app(cons, n), x)) -> APP(sort, app(app(app(replace, app(min, app(app(cons, n), x))), n), x))


Rules:


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


Strategy:

innermost




As we are in the innermost case, we can delete all 2 non-usable-rules.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules
           →DP Problem 14
A-Transformation


Dependency Pair:

APP(sort, app(app(cons, n), x)) -> APP(sort, app(app(app(replace, app(min, app(app(cons, n), x))), n), x))


Rules:


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


Strategy:

innermost




We have an applicative DP problem with proper arity. Thus we can use the A-Transformation to obtain one new DP problem which consists of the A-transformed TRSs.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules
           →DP Problem 14
ATrans
             ...
               →DP Problem 15
Negative Polynomial Order


Dependency Pair:

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


Rules:


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


Strategy:

innermost




The following Dependency Pair can be strictly oriented using the given order.

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


Moreover, the following usable rules (regarding the implicit AFS) are oriented.

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


Used ordering:
Polynomial Order with Interpretation:

POL( SORT(x1) ) = x1

POL( cons(x1, x2) ) = x2 + 1

POL( replace(x1, ..., x3) ) = x3

POL( ifmin(x1, x2) ) = 0

POL( min(x1) ) = 0

POL( eq(x1, x2) ) = 0

POL( le(x1, x2) ) = 0

POL( ifreplace(x1, ..., x4) ) = x4

POL( true ) = 0

POL( false ) = 0

POL( 0 ) = 0

POL( s(x1) ) = 0

POL( nil ) = 0


This results in one new DP problem.


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
       →DP Problem 3
UsableRules
       →DP Problem 4
UsableRules
       →DP Problem 5
UsableRules
           →DP Problem 14
ATrans
             ...
               →DP Problem 16
Dependency Graph


Dependency Pair:


Rules:


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


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.

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