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
Polynomial Ordering
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Polo
       →DP Problem 5
Polo


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 w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(EQ(x1, x2))=  x1  
  POL(s(x1))=  1 + x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 6
Dependency Graph
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Polo
       →DP Problem 5
Polo


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
Polo
       →DP Problem 2
Polynomial Ordering
       →DP Problem 3
Polo
       →DP Problem 4
Polo
       →DP Problem 5
Polo


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 w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(LE(x1, x2))=  x1  
  POL(s(x1))=  1 + x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
           →DP Problem 7
Dependency Graph
       →DP Problem 3
Polo
       →DP Problem 4
Polo
       →DP Problem 5
Polo


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
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polynomial Ordering
       →DP Problem 4
Polo
       →DP Problem 5
Polo


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)


There are no usable rules for innermost w.r.t. to the implicit AFS that need to be oriented.

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

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
           →DP Problem 8
Dependency Graph
       →DP Problem 4
Polo
       →DP Problem 5
Polo


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
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Polynomial Ordering
       →DP Problem 5
Polo


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 pairs can be strictly oriented:

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


There are no usable rules for innermost w.r.t. to the implicit AFS that need to be oriented.

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

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Polo
           →DP Problem 9
Dependency Graph
       →DP Problem 5
Polo


Dependency Pair:

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




Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Polo
       →DP Problem 5
Polynomial 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))


Additionally, the following usable rules for innermost w.r.t. to the implicit AFS can be oriented:

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))


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

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Polo
       →DP Problem 5
Polo
           →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