Term Rewriting System R:
[x, y]
p(0) -> 0
p(s(x)) -> x
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
minus(x, 0) -> x
minus(x, s(y)) -> if(le(x, s(y)), 0, p(minus(x, p(s(y)))))
if(true, x, y) -> x
if(false, x, y) -> y

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

LE(s(x), s(y)) -> LE(x, y)
MINUS(x, s(y)) -> IF(le(x, s(y)), 0, p(minus(x, p(s(y)))))
MINUS(x, s(y)) -> LE(x, s(y))
MINUS(x, s(y)) -> P(minus(x, p(s(y))))
MINUS(x, s(y)) -> MINUS(x, p(s(y)))
MINUS(x, s(y)) -> P(s(y))

Furthermore, R contains two SCCs.


   R
DPs
       →DP Problem 1
Polynomial Ordering
       →DP Problem 2
Remaining


Dependency Pair:

LE(s(x), s(y)) -> LE(x, y)


Rules:


p(0) -> 0
p(s(x)) -> x
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
minus(x, 0) -> x
minus(x, s(y)) -> if(le(x, s(y)), 0, p(minus(x, p(s(y)))))
if(true, x, y) -> x
if(false, x, y) -> y





The following dependency pair can be strictly oriented:

LE(s(x), s(y)) -> LE(x, y)


Additionally, the following rules can be oriented:

p(0) -> 0
p(s(x)) -> x
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
minus(x, 0) -> x
minus(x, s(y)) -> if(le(x, s(y)), 0, p(minus(x, p(s(y)))))
if(true, x, y) -> x
if(false, x, y) -> y


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(if(x1, x2, x3))=  x2 + x3  
  POL(LE(x1, x2))=  1 + x1  
  POL(0)=  0  
  POL(false)=  0  
  POL(minus(x1, x2))=  x1  
  POL(true)=  0  
  POL(s(x1))=  1 + x1  
  POL(le(x1, x2))=  0  
  POL(p(x1))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 3
Dependency Graph
       →DP Problem 2
Remaining


Dependency Pair:


Rules:


p(0) -> 0
p(s(x)) -> x
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
minus(x, 0) -> x
minus(x, s(y)) -> if(le(x, s(y)), 0, p(minus(x, p(s(y)))))
if(true, x, y) -> x
if(false, x, y) -> y





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Remaining Obligation(s)




The following remains to be proven:
Dependency Pair:

MINUS(x, s(y)) -> MINUS(x, p(s(y)))


Rules:


p(0) -> 0
p(s(x)) -> x
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
minus(x, 0) -> x
minus(x, s(y)) -> if(le(x, s(y)), 0, p(minus(x, p(s(y)))))
if(true, x, y) -> x
if(false, x, y) -> y




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