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

Innermost Termination of R to be shown.



   R
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
DPs
       →DP Problem 1
Argument Filtering and Ordering
       →DP Problem 2
AFS
       →DP Problem 3
Remaining


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




The following dependency pair can be strictly oriented:

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


There are no usable rules for innermost w.r.t. to the AFS that need to be oriented.
Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
trivial

resulting in one new DP problem.
Used Argument Filtering System:
MINUS(x1, x2) -> MINUS(x1, x2)
s(x1) -> s(x1)


   R
DPs
       →DP Problem 1
AFS
           →DP Problem 4
Dependency Graph
       →DP Problem 2
AFS
       →DP Problem 3
Remaining


Dependency Pair:


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




Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
Argument Filtering and Ordering
       →DP Problem 3
Remaining


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




The following dependency pair can be strictly oriented:

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


There are no usable rules for innermost w.r.t. to the AFS that need to be oriented.
Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
trivial

resulting in one new DP problem.
Used Argument Filtering System:
LE(x1, x2) -> LE(x1, x2)
s(x1) -> s(x1)


   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
           →DP Problem 5
Dependency Graph
       →DP Problem 3
Remaining


Dependency Pair:


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




Using the Dependency Graph resulted in no new DP problems.


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




The following remains to be proven:
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



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