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
Forward Instantiation Transformation
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar


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




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

MINUS(X, s(Y)) -> MINUS(X, Y)
one new Dependency Pair is created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
           →DP Problem 4
Forward Instantiation Transformation
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar


Dependency Pair:

MINUS(X'', s(s(Y''))) -> MINUS(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




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

MINUS(X'', s(s(Y''))) -> MINUS(X'', s(Y''))
one new Dependency Pair is created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
           →DP Problem 4
FwdInst
             ...
               →DP Problem 5
Argument Filtering and Ordering
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar


Dependency Pair:

MINUS(X'''', s(s(s(Y'''')))) -> MINUS(X'''', s(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




The following dependency pair can be strictly oriented:

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


There are no usable rules for innermost w.r.t. to the AFS that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(MINUS(x1, x2))=  1 + x1 + x2  
  POL(s(x1))=  1 + x1  

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
FwdInst
           →DP Problem 4
FwdInst
             ...
               →DP Problem 6
Dependency Graph
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar


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
FwdInst
       →DP Problem 2
Forward Instantiation Transformation
       →DP Problem 3
Nar


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




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

LE(s(X), s(Y)) -> LE(X, Y)
one new Dependency Pair is created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
           →DP Problem 7
Forward Instantiation Transformation
       →DP Problem 3
Nar


Dependency Pair:

LE(s(s(X'')), s(s(Y''))) -> LE(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




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

LE(s(s(X'')), s(s(Y''))) -> LE(s(X''), s(Y''))
one new Dependency Pair is created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
           →DP Problem 7
FwdInst
             ...
               →DP Problem 8
Argument Filtering and Ordering
       →DP Problem 3
Nar


Dependency Pair:

LE(s(s(s(X''''))), s(s(s(Y'''')))) -> LE(s(s(X'''')), s(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




The following dependency pair can be strictly oriented:

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


There are no usable rules for innermost w.r.t. to the AFS that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(LE(x1, x2))=  1 + x1 + x2  
  POL(s(x1))=  1 + x1  

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
FwdInst
       →DP Problem 2
FwdInst
           →DP Problem 7
FwdInst
             ...
               →DP Problem 9
Dependency Graph
       →DP Problem 3
Nar


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
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Narrowing Transformation


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




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

GCD(s(X), s(Y)) -> IF(le(Y, X), s(X), s(Y))
three new Dependency Pairs are created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Narrowing Transformation


Dependency Pairs:

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


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




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

IF(true, s(X), s(Y)) -> GCD(minus(X, Y), s(Y))
two new Dependency Pairs are created:

IF(true, s(X''), s(s(Y''))) -> GCD(pred(minus(X'', Y'')), s(s(Y'')))
IF(true, s(X''), s(0)) -> GCD(X'', s(0))

The transformation is resulting in two new DP problems:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 11
Forward Instantiation Transformation


Dependency Pairs:

IF(true, s(X''), s(0)) -> GCD(X'', s(0))
GCD(s(X'), s(0)) -> IF(true, s(X'), s(0))


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




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

IF(true, s(X''), s(0)) -> GCD(X'', s(0))
one new Dependency Pair is created:

IF(true, s(s(X'''')), s(0)) -> GCD(s(X''''), s(0))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 13
Forward Instantiation Transformation


Dependency Pairs:

IF(true, s(s(X'''')), s(0)) -> GCD(s(X''''), s(0))
GCD(s(X'), s(0)) -> IF(true, s(X'), s(0))


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




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

GCD(s(X'), s(0)) -> IF(true, s(X'), s(0))
one new Dependency Pair is created:

GCD(s(s(X'''''')), s(0)) -> IF(true, s(s(X'''''')), s(0))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 15
Argument Filtering and Ordering


Dependency Pairs:

GCD(s(s(X'''''')), s(0)) -> IF(true, s(s(X'''''')), s(0))
IF(true, s(s(X'''')), s(0)) -> GCD(s(X''''), s(0))


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:

IF(true, s(s(X'''')), s(0)) -> GCD(s(X''''), s(0))


There are no usable rules for innermost w.r.t. to the AFS that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(0)=  0  
  POL(GCD(x1, x2))=  x1 + x2  
  POL(true)=  0  
  POL(s(x1))=  1 + x1  
  POL(IF(x1, x2, x3))=  x1 + x2 + x3  

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


   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 20
Dependency Graph


Dependency Pair:

GCD(s(s(X'''''')), s(0)) -> IF(true, s(s(X'''''')), s(0))


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
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 12
Narrowing Transformation


Dependency Pairs:

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


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




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

IF(false, s(X), s(Y)) -> GCD(minus(Y, X), s(X))
two new Dependency Pairs are created:

IF(false, s(s(Y'')), s(Y0)) -> GCD(pred(minus(Y0, Y'')), s(s(Y'')))
IF(false, s(0), s(Y')) -> GCD(Y', s(0))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 14
Narrowing Transformation


Dependency Pairs:

IF(false, s(s(Y'')), s(Y0)) -> GCD(pred(minus(Y0, Y'')), s(s(Y'')))
GCD(s(s(Y'')), s(s(X''))) -> IF(le(X'', Y''), s(s(Y'')), s(s(X'')))
IF(true, s(X''), s(s(Y''))) -> GCD(pred(minus(X'', Y'')), s(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




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

GCD(s(s(Y'')), s(s(X''))) -> IF(le(X'', Y''), s(s(Y'')), s(s(X'')))
three new Dependency Pairs are created:

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

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 16
Narrowing Transformation


Dependency Pairs:

GCD(s(s(Y''')), s(s(0))) -> IF(true, s(s(Y''')), s(s(0)))
GCD(s(s(0)), s(s(s(X')))) -> IF(false, s(s(0)), s(s(s(X'))))
IF(true, s(X''), s(s(Y''))) -> GCD(pred(minus(X'', Y'')), s(s(Y'')))
GCD(s(s(s(Y'))), s(s(s(X')))) -> IF(le(X', Y'), s(s(s(Y'))), s(s(s(X'))))
IF(false, s(s(Y'')), s(Y0)) -> GCD(pred(minus(Y0, Y'')), s(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




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

IF(true, s(X''), s(s(Y''))) -> GCD(pred(minus(X'', Y'')), s(s(Y'')))
two new Dependency Pairs are created:

IF(true, s(X'''), s(s(s(Y')))) -> GCD(pred(pred(minus(X''', Y'))), s(s(s(Y'))))
IF(true, s(X'''), s(s(0))) -> GCD(pred(X'''), s(s(0)))

The transformation is resulting in two new DP problems:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 17
Argument Filtering and Ordering


Dependency Pairs:

IF(true, s(X'''), s(s(0))) -> GCD(pred(X'''), s(s(0)))
GCD(s(s(Y''')), s(s(0))) -> IF(true, s(s(Y''')), s(s(0)))


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:

GCD(s(s(Y''')), s(s(0))) -> IF(true, s(s(Y''')), s(s(0)))


The following usable rule for innermost w.r.t. to the AFS can be oriented:

pred(s(X)) -> X


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(0)=  0  
  POL(GCD(x1, x2))=  1 + x1 + x2  
  POL(pred(x1))=  x1  
  POL(true)=  0  
  POL(s(x1))=  1 + x1  
  POL(IF(x1, x2, x3))=  x1 + x2 + x3  

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


   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 21
Dependency Graph


Dependency Pair:

IF(true, s(X'''), s(s(0))) -> GCD(pred(X'''), s(s(0)))


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
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 18
Narrowing Transformation


Dependency Pairs:

IF(true, s(X'''), s(s(s(Y')))) -> GCD(pred(pred(minus(X''', Y'))), s(s(s(Y'))))
GCD(s(s(s(Y'))), s(s(s(X')))) -> IF(le(X', Y'), s(s(s(Y'))), s(s(s(X'))))
IF(false, s(s(Y'')), s(Y0)) -> GCD(pred(minus(Y0, Y'')), s(s(Y'')))
GCD(s(s(0)), s(s(s(X')))) -> IF(false, s(s(0)), s(s(s(X'))))


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




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

IF(false, s(s(Y'')), s(Y0)) -> GCD(pred(minus(Y0, Y'')), s(s(Y'')))
two new Dependency Pairs are created:

IF(false, s(s(s(Y'))), s(Y0')) -> GCD(pred(pred(minus(Y0', Y'))), s(s(s(Y'))))
IF(false, s(s(0)), s(Y0')) -> GCD(pred(Y0'), s(s(0)))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 19
Argument Filtering and Ordering


Dependency Pairs:

IF(false, s(s(s(Y'))), s(Y0')) -> GCD(pred(pred(minus(Y0', Y'))), s(s(s(Y'))))
GCD(s(s(s(Y'))), s(s(s(X')))) -> IF(le(X', Y'), s(s(s(Y'))), s(s(s(X'))))
IF(true, s(X'''), s(s(s(Y')))) -> GCD(pred(pred(minus(X''', Y'))), s(s(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




The following dependency pairs can be strictly oriented:

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


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

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


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(GCD(x1, x2))=  x1 + x2  
  POL(false)=  0  
  POL(pred(x1))=  x1  
  POL(true)=  0  
  POL(s(x1))=  1 + x1  
  POL(le)=  0  
  POL(IF(x1, x2, x3))=  x1 + x2 + x3  

resulting in one new DP problem.
Used Argument Filtering System:
IF(x1, x2, x3) -> IF(x1, x2, x3)
GCD(x1, x2) -> GCD(x1, x2)
s(x1) -> s(x1)
pred(x1) -> pred(x1)
minus(x1, x2) -> x1
le(x1, x2) -> le


   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Nar
           →DP Problem 10
Nar
             ...
               →DP Problem 22
Dependency Graph


Dependency Pair:

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


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.

Innermost Termination of R successfully shown.
Duration:
0:01 minutes