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
Nar


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)


There are no usable rules 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 3
Dependency Graph
       →DP Problem 2
Nar


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
Narrowing Transformation


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





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

MINUS(x, s(y)) -> MINUS(x, p(s(y)))
one new Dependency Pair is created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Nar
           →DP Problem 4
Polynomial Ordering


Dependency Pair:

MINUS(x, s(y')) -> MINUS(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:

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


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

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

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Nar
           →DP Problem 4
Polo
             ...
               →DP Problem 5
Dependency Graph


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.

Termination of R successfully shown.
Duration:
0:00 minutes