Term Rewriting System R:
[X, Y]
minus(X, s(Y)) -> pred(minus(X, Y))
minus(X, 0) -> X
pred(s(X)) -> X
le(s(X), s(Y)) -> le(X, Y)
le(s(X), 0) -> false
le(0, Y) -> true
gcd(0, Y) -> 0
gcd(s(X), 0) -> s(X)
gcd(s(X), s(Y)) -> if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) -> gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) -> gcd(minus(Y, X), s(X))

Termination of R to be shown.



   R
Overlay and local confluence Check



The TRS is overlay and locally confluent (all critical pairs are trivially joinable).Hence, we can switch to innermost.


   R
OC
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

MINUS(X, s(Y)) -> PRED(minus(X, Y))
MINUS(X, s(Y)) -> MINUS(X, Y)
LE(s(X), s(Y)) -> LE(X, Y)
GCD(s(X), s(Y)) -> IF(le(Y, X), s(X), s(Y))
GCD(s(X), s(Y)) -> LE(Y, X)
IF(true, s(X), s(Y)) -> GCD(minus(X, Y), s(Y))
IF(true, s(X), s(Y)) -> MINUS(X, Y)
IF(false, s(X), s(Y)) -> GCD(minus(Y, X), s(X))
IF(false, s(X), s(Y)) -> MINUS(Y, X)

Furthermore, R contains three SCCs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
Usable Rules (Innermost)
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules


Dependency Pair:

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


Rules:


minus(X, s(Y)) -> pred(minus(X, Y))
minus(X, 0) -> X
pred(s(X)) -> X
le(s(X), s(Y)) -> le(X, Y)
le(s(X), 0) -> false
le(0, Y) -> true
gcd(0, Y) -> 0
gcd(s(X), 0) -> s(X)
gcd(s(X), s(Y)) -> if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) -> gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) -> gcd(minus(Y, X), s(X))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
             ...
               →DP Problem 4
Size-Change Principle
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules


Dependency Pair:

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


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. MINUS(X, s(Y)) -> MINUS(X, Y)
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
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
Usable Rules (Innermost)
           →DP Problem 3
UsableRules


Dependency Pair:

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


Rules:


minus(X, s(Y)) -> pred(minus(X, Y))
minus(X, 0) -> X
pred(s(X)) -> X
le(s(X), s(Y)) -> le(X, Y)
le(s(X), 0) -> false
le(0, Y) -> true
gcd(0, Y) -> 0
gcd(s(X), 0) -> s(X)
gcd(s(X), s(Y)) -> if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) -> gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) -> gcd(minus(Y, X), s(X))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 5
Size-Change Principle
           →DP Problem 3
UsableRules


Dependency Pair:

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


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. LE(s(X), s(Y)) -> LE(X, Y)
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
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
Usable Rules (Innermost)


Dependency Pairs:

IF(false, s(X), s(Y)) -> GCD(minus(Y, X), s(X))
IF(true, s(X), s(Y)) -> GCD(minus(X, Y), s(Y))
GCD(s(X), s(Y)) -> IF(le(Y, X), s(X), s(Y))


Rules:


minus(X, s(Y)) -> pred(minus(X, Y))
minus(X, 0) -> X
pred(s(X)) -> X
le(s(X), s(Y)) -> le(X, Y)
le(s(X), 0) -> false
le(0, Y) -> true
gcd(0, Y) -> 0
gcd(s(X), 0) -> s(X)
gcd(s(X), s(Y)) -> if(le(Y, X), s(X), s(Y))
if(true, s(X), s(Y)) -> gcd(minus(X, Y), s(Y))
if(false, s(X), s(Y)) -> gcd(minus(Y, X), s(X))


Strategy:

innermost




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


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
             ...
               →DP Problem 6
Negative Polynomial Order


Dependency Pairs:

IF(false, s(X), s(Y)) -> GCD(minus(Y, X), s(X))
IF(true, s(X), s(Y)) -> GCD(minus(X, Y), s(Y))
GCD(s(X), s(Y)) -> IF(le(Y, X), s(X), s(Y))


Rules:


minus(X, 0) -> X
minus(X, s(Y)) -> pred(minus(X, Y))
pred(s(X)) -> X
le(s(X), 0) -> false
le(0, Y) -> true
le(s(X), s(Y)) -> le(X, Y)


Strategy:

innermost




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

IF(false, s(X), s(Y)) -> GCD(minus(Y, X), s(X))
IF(true, s(X), s(Y)) -> GCD(minus(X, Y), s(Y))


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

minus(X, 0) -> X
minus(X, s(Y)) -> pred(minus(X, Y))
pred(s(X)) -> X
le(s(X), 0) -> false
le(0, Y) -> true
le(s(X), s(Y)) -> le(X, Y)


Used ordering:
Polynomial Order with Interpretation:

POL( IF(x1, ..., x3) ) = x2 + x3

POL( s(x1) ) = x1 + 1

POL( GCD(x1, x2) ) = x1 + x2

POL( minus(x1, x2) ) = x1

POL( pred(x1) ) = x1

POL( le(x1, x2) ) = 0

POL( false ) = 0

POL( true ) = 0


This results in one new DP problem.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
             ...
               →DP Problem 7
Dependency Graph


Dependency Pair:

GCD(s(X), s(Y)) -> IF(le(Y, X), s(X), s(Y))


Rules:


minus(X, 0) -> X
minus(X, s(Y)) -> pred(minus(X, Y))
pred(s(X)) -> X
le(s(X), 0) -> false
le(0, Y) -> true
le(s(X), s(Y)) -> le(X, Y)


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.

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