Term Rewriting System R:
[Y, X, X1, X2, X3]
aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

AMINUS(s(X), s(Y)) -> AMINUS(X, Y)
AGEQ(s(X), s(Y)) -> AGEQ(X, Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
ADIV(s(X), s(Y)) -> AGEQ(X, Y)
AIF(true, X, Y) -> MARK(X)
AIF(false, X, Y) -> MARK(Y)
MARK(minus(X1, X2)) -> AMINUS(X1, X2)
MARK(geq(X1, X2)) -> AGEQ(X1, X2)
MARK(div(X1, X2)) -> ADIV(mark(X1), X2)
MARK(div(X1, X2)) -> MARK(X1)
MARK(if(X1, X2, X3)) -> AIF(mark(X1), X2, X3)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(s(X)) -> MARK(X)

Furthermore, R contains three SCCs.


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


Dependency Pair:

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


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





The following dependency pair can be strictly oriented:

AMINUS(s(X), s(Y)) -> AMINUS(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(A__MINUS(x1, x2))=  x1  
  POL(s(x1))=  1 + x1  

resulting in one new DP problem.



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


Dependency Pair:


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





Using the Dependency Graph resulted in no new DP problems.


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


Dependency Pair:

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


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





The following dependency pair can be strictly oriented:

AGEQ(s(X), s(Y)) -> AGEQ(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(A__GEQ(x1, x2))=  x1  
  POL(s(x1))=  1 + x1  

resulting in one new DP problem.



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


Dependency Pair:


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Narrowing Transformation


Dependency Pairs:

MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
AIF(false, X, Y) -> MARK(Y)
MARK(if(X1, X2, X3)) -> AIF(mark(X1), X2, X3)
MARK(div(X1, X2)) -> MARK(X1)
MARK(div(X1, X2)) -> ADIV(mark(X1), X2)
AIF(true, X, Y) -> MARK(X)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(div(X1, X2)) -> ADIV(mark(X1), X2)
eight new Dependency Pairs are created:

MARK(div(minus(X1'', X2''), X2)) -> ADIV(aminus(X1'', X2''), X2)
MARK(div(geq(X1'', X2''), X2)) -> ADIV(ageq(X1'', X2''), X2)
MARK(div(div(X1'', X2''), X2)) -> ADIV(adiv(mark(X1''), X2''), X2)
MARK(div(if(X1'', X2'', X3'), X2)) -> ADIV(aif(mark(X1''), X2'', X3'), X2)
MARK(div(0, X2)) -> ADIV(0, X2)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(div(true, X2)) -> ADIV(true, X2)
MARK(div(false, X2)) -> ADIV(false, X2)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Narrowing Transformation


Dependency Pairs:

MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(div(if(X1'', X2'', X3'), X2)) -> ADIV(aif(mark(X1''), X2'', X3'), X2)
MARK(div(div(X1'', X2''), X2)) -> ADIV(adiv(mark(X1''), X2''), X2)
MARK(div(geq(X1'', X2''), X2)) -> ADIV(ageq(X1'', X2''), X2)
AIF(false, X, Y) -> MARK(Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(minus(X1'', X2''), X2)) -> ADIV(aminus(X1'', X2''), X2)
MARK(if(X1, X2, X3)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
MARK(if(X1, X2, X3)) -> AIF(mark(X1), X2, X3)
MARK(div(X1, X2)) -> MARK(X1)
MARK(s(X)) -> MARK(X)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(if(X1, X2, X3)) -> AIF(mark(X1), X2, X3)
eight new Dependency Pairs are created:

MARK(if(minus(X1'', X2''), X2, X3)) -> AIF(aminus(X1'', X2''), X2, X3)
MARK(if(geq(X1'', X2''), X2, X3)) -> AIF(ageq(X1'', X2''), X2, X3)
MARK(if(div(X1'', X2''), X2, X3)) -> AIF(adiv(mark(X1''), X2''), X2, X3)
MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
MARK(if(0, X2, X3)) -> AIF(0, X2, X3)
MARK(if(s(X'), X2, X3)) -> AIF(s(mark(X')), X2, X3)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 7
Narrowing Transformation


Dependency Pairs:

MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
MARK(if(div(X1'', X2''), X2, X3)) -> AIF(adiv(mark(X1''), X2''), X2, X3)
MARK(if(geq(X1'', X2''), X2, X3)) -> AIF(ageq(X1'', X2''), X2, X3)
AIF(false, X, Y) -> MARK(Y)
MARK(if(minus(X1'', X2''), X2, X3)) -> AIF(aminus(X1'', X2''), X2, X3)
MARK(div(if(X1'', X2'', X3'), X2)) -> ADIV(aif(mark(X1''), X2'', X3'), X2)
MARK(div(div(X1'', X2''), X2)) -> ADIV(adiv(mark(X1''), X2''), X2)
MARK(div(geq(X1'', X2''), X2)) -> ADIV(ageq(X1'', X2''), X2)
MARK(div(minus(X1'', X2''), X2)) -> ADIV(aminus(X1'', X2''), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(div(minus(X1'', X2''), X2)) -> ADIV(aminus(X1'', X2''), X2)
three new Dependency Pairs are created:

MARK(div(minus(0, X2'''), X2)) -> ADIV(0, X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(div(minus(X1''', X2'''), X2)) -> ADIV(minus(X1''', X2'''), X2)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 8
Narrowing Transformation


Dependency Pairs:

MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
MARK(if(div(X1'', X2''), X2, X3)) -> AIF(adiv(mark(X1''), X2''), X2, X3)
MARK(if(geq(X1'', X2''), X2, X3)) -> AIF(ageq(X1'', X2''), X2, X3)
MARK(if(minus(X1'', X2''), X2, X3)) -> AIF(aminus(X1'', X2''), X2, X3)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(div(if(X1'', X2'', X3'), X2)) -> ADIV(aif(mark(X1''), X2'', X3'), X2)
MARK(div(div(X1'', X2''), X2)) -> ADIV(adiv(mark(X1''), X2''), X2)
AIF(true, X, Y) -> MARK(X)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(geq(X1'', X2''), X2)) -> ADIV(ageq(X1'', X2''), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(false, X, Y) -> MARK(Y)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(div(geq(X1'', X2''), X2)) -> ADIV(ageq(X1'', X2''), X2)
four new Dependency Pairs are created:

MARK(div(geq(X1''', 0), X2)) -> ADIV(true, X2)
MARK(div(geq(0, s(Y')), X2)) -> ADIV(false, X2)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)
MARK(div(geq(X1''', X2'''), X2)) -> ADIV(geq(X1''', X2'''), X2)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 9
Narrowing Transformation


Dependency Pairs:

MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
MARK(if(div(X1'', X2''), X2, X3)) -> AIF(adiv(mark(X1''), X2''), X2, X3)
MARK(if(geq(X1'', X2''), X2, X3)) -> AIF(ageq(X1'', X2''), X2, X3)
AIF(false, X, Y) -> MARK(Y)
MARK(if(minus(X1'', X2''), X2, X3)) -> AIF(aminus(X1'', X2''), X2, X3)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(div(if(X1'', X2'', X3'), X2)) -> ADIV(aif(mark(X1''), X2'', X3'), X2)
MARK(div(div(X1'', X2''), X2)) -> ADIV(adiv(mark(X1''), X2''), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(div(div(X1'', X2''), X2)) -> ADIV(adiv(mark(X1''), X2''), X2)
nine new Dependency Pairs are created:

MARK(div(div(X1''', X2'''), X2)) -> ADIV(div(mark(X1'''), X2'''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(true, X2''), X2)) -> ADIV(adiv(true, X2''), X2)
MARK(div(div(false, X2''), X2)) -> ADIV(adiv(false, X2''), X2)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 10
Narrowing Transformation


Dependency Pairs:

MARK(div(div(false, X2''), X2)) -> ADIV(adiv(false, X2''), X2)
MARK(div(div(true, X2''), X2)) -> ADIV(adiv(true, X2''), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
MARK(if(div(X1'', X2''), X2, X3)) -> AIF(adiv(mark(X1''), X2''), X2, X3)
MARK(if(geq(X1'', X2''), X2, X3)) -> AIF(ageq(X1'', X2''), X2, X3)
AIF(false, X, Y) -> MARK(Y)
MARK(if(minus(X1'', X2''), X2, X3)) -> AIF(aminus(X1'', X2''), X2, X3)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(div(if(X1'', X2'', X3'), X2)) -> ADIV(aif(mark(X1''), X2'', X3'), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(div(if(X1'', X2'', X3'), X2)) -> ADIV(aif(mark(X1''), X2'', X3'), X2)
nine new Dependency Pairs are created:

MARK(div(if(X1''', X2''', X3''), X2)) -> ADIV(if(mark(X1'''), X2''', X3''), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(if(geq(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(ageq(X1', X2'''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(true, X2'', X3'), X2)) -> ADIV(aif(true, X2'', X3'), X2)
MARK(div(if(false, X2'', X3'), X2)) -> ADIV(aif(false, X2'', X3'), X2)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 11
Narrowing Transformation


Dependency Pairs:

MARK(div(if(false, X2'', X3'), X2)) -> ADIV(aif(false, X2'', X3'), X2)
MARK(div(if(true, X2'', X3'), X2)) -> ADIV(aif(true, X2'', X3'), X2)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(geq(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(ageq(X1', X2'''), X2'', X3'), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(div(true, X2''), X2)) -> ADIV(adiv(true, X2''), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
MARK(if(div(X1'', X2''), X2, X3)) -> AIF(adiv(mark(X1''), X2''), X2, X3)
MARK(if(geq(X1'', X2''), X2, X3)) -> AIF(ageq(X1'', X2''), X2, X3)
AIF(false, X, Y) -> MARK(Y)
MARK(if(minus(X1'', X2''), X2, X3)) -> AIF(aminus(X1'', X2''), X2, X3)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(div(false, X2''), X2)) -> ADIV(adiv(false, X2''), X2)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(if(minus(X1'', X2''), X2, X3)) -> AIF(aminus(X1'', X2''), X2, X3)
three new Dependency Pairs are created:

MARK(if(minus(0, X2'''), X2, X3)) -> AIF(0, X2, X3)
MARK(if(minus(s(X'), s(Y')), X2, X3)) -> AIF(aminus(X', Y'), X2, X3)
MARK(if(minus(X1''', X2'''), X2, X3)) -> AIF(minus(X1''', X2'''), X2, X3)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 12
Narrowing Transformation


Dependency Pairs:

MARK(if(minus(s(X'), s(Y')), X2, X3)) -> AIF(aminus(X', Y'), X2, X3)
MARK(div(if(true, X2'', X3'), X2)) -> ADIV(aif(true, X2'', X3'), X2)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(geq(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(ageq(X1', X2'''), X2'', X3'), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(div(false, X2''), X2)) -> ADIV(adiv(false, X2''), X2)
MARK(div(div(true, X2''), X2)) -> ADIV(adiv(true, X2''), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
MARK(if(div(X1'', X2''), X2, X3)) -> AIF(adiv(mark(X1''), X2''), X2, X3)
AIF(false, X, Y) -> MARK(Y)
MARK(if(geq(X1'', X2''), X2, X3)) -> AIF(ageq(X1'', X2''), X2, X3)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(if(false, X2'', X3'), X2)) -> ADIV(aif(false, X2'', X3'), X2)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(if(geq(X1'', X2''), X2, X3)) -> AIF(ageq(X1'', X2''), X2, X3)
four new Dependency Pairs are created:

MARK(if(geq(X1''', 0), X2, X3)) -> AIF(true, X2, X3)
MARK(if(geq(0, s(Y')), X2, X3)) -> AIF(false, X2, X3)
MARK(if(geq(s(X'), s(Y')), X2, X3)) -> AIF(ageq(X', Y'), X2, X3)
MARK(if(geq(X1''', X2'''), X2, X3)) -> AIF(geq(X1''', X2'''), X2, X3)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 13
Narrowing Transformation


Dependency Pairs:

MARK(if(geq(s(X'), s(Y')), X2, X3)) -> AIF(ageq(X', Y'), X2, X3)
MARK(if(geq(0, s(Y')), X2, X3)) -> AIF(false, X2, X3)
MARK(if(geq(X1''', 0), X2, X3)) -> AIF(true, X2, X3)
MARK(div(if(false, X2'', X3'), X2)) -> ADIV(aif(false, X2'', X3'), X2)
MARK(div(if(true, X2'', X3'), X2)) -> ADIV(aif(true, X2'', X3'), X2)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(geq(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(ageq(X1', X2'''), X2'', X3'), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(div(false, X2''), X2)) -> ADIV(adiv(false, X2''), X2)
MARK(div(div(true, X2''), X2)) -> ADIV(adiv(true, X2''), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
MARK(if(div(X1'', X2''), X2, X3)) -> AIF(adiv(mark(X1''), X2''), X2, X3)
AIF(false, X, Y) -> MARK(Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
MARK(if(minus(s(X'), s(Y')), X2, X3)) -> AIF(aminus(X', Y'), X2, X3)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(if(div(X1'', X2''), X2, X3)) -> AIF(adiv(mark(X1''), X2''), X2, X3)
nine new Dependency Pairs are created:

MARK(if(div(X1''', X2'''), X2, X3)) -> AIF(div(mark(X1'''), X2'''), X2, X3)
MARK(if(div(minus(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(aminus(X1', X2'''), X2''), X2, X3)
MARK(if(div(geq(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(ageq(X1', X2'''), X2''), X2, X3)
MARK(if(div(div(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(adiv(mark(X1'), X2'''), X2''), X2, X3)
MARK(if(div(if(X1', X2''', X3''), X2''), X2, X3)) -> AIF(adiv(aif(mark(X1'), X2''', X3''), X2''), X2, X3)
MARK(if(div(0, X2''), X2, X3)) -> AIF(adiv(0, X2''), X2, X3)
MARK(if(div(s(X'), X2''), X2, X3)) -> AIF(adiv(s(mark(X')), X2''), X2, X3)
MARK(if(div(true, X2''), X2, X3)) -> AIF(adiv(true, X2''), X2, X3)
MARK(if(div(false, X2''), X2, X3)) -> AIF(adiv(false, X2''), X2, X3)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 14
Narrowing Transformation


Dependency Pairs:

MARK(if(div(false, X2''), X2, X3)) -> AIF(adiv(false, X2''), X2, X3)
MARK(if(div(true, X2''), X2, X3)) -> AIF(adiv(true, X2''), X2, X3)
MARK(if(div(s(X'), X2''), X2, X3)) -> AIF(adiv(s(mark(X')), X2''), X2, X3)
MARK(if(div(0, X2''), X2, X3)) -> AIF(adiv(0, X2''), X2, X3)
MARK(if(div(if(X1', X2''', X3''), X2''), X2, X3)) -> AIF(adiv(aif(mark(X1'), X2''', X3''), X2''), X2, X3)
MARK(if(div(div(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(adiv(mark(X1'), X2'''), X2''), X2, X3)
MARK(if(div(geq(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(ageq(X1', X2'''), X2''), X2, X3)
MARK(if(div(minus(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(aminus(X1', X2'''), X2''), X2, X3)
MARK(if(geq(0, s(Y')), X2, X3)) -> AIF(false, X2, X3)
MARK(if(geq(X1''', 0), X2, X3)) -> AIF(true, X2, X3)
MARK(if(minus(s(X'), s(Y')), X2, X3)) -> AIF(aminus(X', Y'), X2, X3)
MARK(div(if(false, X2'', X3'), X2)) -> ADIV(aif(false, X2'', X3'), X2)
MARK(div(if(true, X2'', X3'), X2)) -> ADIV(aif(true, X2'', X3'), X2)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(geq(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(ageq(X1', X2'''), X2'', X3'), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(div(false, X2''), X2)) -> ADIV(adiv(false, X2''), X2)
MARK(div(div(true, X2''), X2)) -> ADIV(adiv(true, X2''), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
AIF(false, X, Y) -> MARK(Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
MARK(if(geq(s(X'), s(Y')), X2, X3)) -> AIF(ageq(X', Y'), X2, X3)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

MARK(if(if(X1'', X2'', X3''), X2, X3)) -> AIF(aif(mark(X1''), X2'', X3''), X2, X3)
nine new Dependency Pairs are created:

MARK(if(if(X1''', X2''', X3'''), X2, X3)) -> AIF(if(mark(X1'''), X2''', X3'''), X2, X3)
MARK(if(if(minus(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(aminus(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(if(geq(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(ageq(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(if(div(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(adiv(mark(X1'), X2'''), X2'', X3''), X2, X3)
MARK(if(if(if(X1', X2''', X3'''), X2'', X3''), X2, X3)) -> AIF(aif(aif(mark(X1'), X2''', X3'''), X2'', X3''), X2, X3)
MARK(if(if(0, X2'', X3''), X2, X3)) -> AIF(aif(0, X2'', X3''), X2, X3)
MARK(if(if(s(X'), X2'', X3''), X2, X3)) -> AIF(aif(s(mark(X')), X2'', X3''), X2, X3)
MARK(if(if(true, X2'', X3''), X2, X3)) -> AIF(aif(true, X2'', X3''), X2, X3)
MARK(if(if(false, X2'', X3''), X2, X3)) -> AIF(aif(false, X2'', X3''), X2, X3)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 15
Polynomial Ordering


Dependency Pairs:

MARK(if(if(false, X2'', X3''), X2, X3)) -> AIF(aif(false, X2'', X3''), X2, X3)
MARK(if(if(true, X2'', X3''), X2, X3)) -> AIF(aif(true, X2'', X3''), X2, X3)
MARK(if(if(s(X'), X2'', X3''), X2, X3)) -> AIF(aif(s(mark(X')), X2'', X3''), X2, X3)
MARK(if(if(0, X2'', X3''), X2, X3)) -> AIF(aif(0, X2'', X3''), X2, X3)
MARK(if(if(if(X1', X2''', X3'''), X2'', X3''), X2, X3)) -> AIF(aif(aif(mark(X1'), X2''', X3'''), X2'', X3''), X2, X3)
MARK(if(if(div(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(adiv(mark(X1'), X2'''), X2'', X3''), X2, X3)
MARK(if(if(geq(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(ageq(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(if(minus(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(aminus(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(div(true, X2''), X2, X3)) -> AIF(adiv(true, X2''), X2, X3)
MARK(if(div(s(X'), X2''), X2, X3)) -> AIF(adiv(s(mark(X')), X2''), X2, X3)
MARK(if(div(0, X2''), X2, X3)) -> AIF(adiv(0, X2''), X2, X3)
MARK(if(div(if(X1', X2''', X3''), X2''), X2, X3)) -> AIF(adiv(aif(mark(X1'), X2''', X3''), X2''), X2, X3)
MARK(if(div(div(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(adiv(mark(X1'), X2'''), X2''), X2, X3)
MARK(if(div(geq(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(ageq(X1', X2'''), X2''), X2, X3)
MARK(if(div(minus(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(aminus(X1', X2'''), X2''), X2, X3)
MARK(if(geq(s(X'), s(Y')), X2, X3)) -> AIF(ageq(X', Y'), X2, X3)
MARK(if(geq(0, s(Y')), X2, X3)) -> AIF(false, X2, X3)
MARK(if(geq(X1''', 0), X2, X3)) -> AIF(true, X2, X3)
MARK(if(minus(s(X'), s(Y')), X2, X3)) -> AIF(aminus(X', Y'), X2, X3)
MARK(div(if(false, X2'', X3'), X2)) -> ADIV(aif(false, X2'', X3'), X2)
MARK(div(if(true, X2'', X3'), X2)) -> ADIV(aif(true, X2'', X3'), X2)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(geq(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(ageq(X1', X2'''), X2'', X3'), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(div(false, X2''), X2)) -> ADIV(adiv(false, X2''), X2)
MARK(div(div(true, X2''), X2)) -> ADIV(adiv(true, X2''), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)
AIF(false, X, Y) -> MARK(Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
MARK(if(div(false, X2''), X2, X3)) -> AIF(adiv(false, X2''), X2, X3)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





The following dependency pairs can be strictly oriented:

MARK(if(if(true, X2'', X3''), X2, X3)) -> AIF(aif(true, X2'', X3''), X2, X3)
MARK(if(div(true, X2''), X2, X3)) -> AIF(adiv(true, X2''), X2, X3)
MARK(div(if(true, X2'', X3'), X2)) -> ADIV(aif(true, X2'', X3'), X2)
MARK(div(div(true, X2''), X2)) -> ADIV(adiv(true, X2''), X2)
MARK(if(true, X2, X3)) -> AIF(true, X2, X3)


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(MARK(x1))=  x1  
  POL(geq(x1, x2))=  0  
  POL(false)=  0  
  POL(minus(x1, x2))=  0  
  POL(true)=  1  
  POL(mark(x1))=  0  
  POL(a__div(x1, x2))=  0  
  POL(if(x1, x2, x3))=  x1 + x2 + x3  
  POL(0)=  0  
  POL(a__if(x1, x2, x3))=  0  
  POL(a__minus(x1, x2))=  0  
  POL(s(x1))=  x1  
  POL(a__geq(x1, x2))=  0  
  POL(div(x1, x2))=  x1  
  POL(A__DIV(x1, x2))=  0  
  POL(A__IF(x1, x2, x3))=  x2 + x3  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 16
Polynomial Ordering


Dependency Pairs:

MARK(if(if(false, X2'', X3''), X2, X3)) -> AIF(aif(false, X2'', X3''), X2, X3)
MARK(if(if(s(X'), X2'', X3''), X2, X3)) -> AIF(aif(s(mark(X')), X2'', X3''), X2, X3)
MARK(if(if(0, X2'', X3''), X2, X3)) -> AIF(aif(0, X2'', X3''), X2, X3)
MARK(if(if(if(X1', X2''', X3'''), X2'', X3''), X2, X3)) -> AIF(aif(aif(mark(X1'), X2''', X3'''), X2'', X3''), X2, X3)
MARK(if(if(div(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(adiv(mark(X1'), X2'''), X2'', X3''), X2, X3)
MARK(if(if(geq(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(ageq(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(if(minus(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(aminus(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(div(s(X'), X2''), X2, X3)) -> AIF(adiv(s(mark(X')), X2''), X2, X3)
MARK(if(div(0, X2''), X2, X3)) -> AIF(adiv(0, X2''), X2, X3)
MARK(if(div(if(X1', X2''', X3''), X2''), X2, X3)) -> AIF(adiv(aif(mark(X1'), X2''', X3''), X2''), X2, X3)
MARK(if(div(div(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(adiv(mark(X1'), X2'''), X2''), X2, X3)
MARK(if(div(geq(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(ageq(X1', X2'''), X2''), X2, X3)
MARK(if(div(minus(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(aminus(X1', X2'''), X2''), X2, X3)
MARK(if(geq(s(X'), s(Y')), X2, X3)) -> AIF(ageq(X', Y'), X2, X3)
MARK(if(geq(0, s(Y')), X2, X3)) -> AIF(false, X2, X3)
MARK(if(geq(X1''', 0), X2, X3)) -> AIF(true, X2, X3)
MARK(if(minus(s(X'), s(Y')), X2, X3)) -> AIF(aminus(X', Y'), X2, X3)
MARK(div(if(false, X2'', X3'), X2)) -> ADIV(aif(false, X2'', X3'), X2)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(geq(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(ageq(X1', X2'''), X2'', X3'), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(div(false, X2''), X2)) -> ADIV(adiv(false, X2''), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
AIF(false, X, Y) -> MARK(Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
MARK(if(div(false, X2''), X2, X3)) -> AIF(adiv(false, X2''), X2, X3)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





The following dependency pairs can be strictly oriented:

MARK(if(if(false, X2'', X3''), X2, X3)) -> AIF(aif(false, X2'', X3''), X2, X3)
MARK(div(if(false, X2'', X3'), X2)) -> ADIV(aif(false, X2'', X3'), X2)
MARK(div(div(false, X2''), X2)) -> ADIV(adiv(false, X2''), X2)
MARK(if(false, X2, X3)) -> AIF(false, X2, X3)
MARK(if(div(false, X2''), X2, X3)) -> AIF(adiv(false, X2''), X2, X3)


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(MARK(x1))=  x1  
  POL(geq(x1, x2))=  0  
  POL(false)=  1  
  POL(minus(x1, x2))=  0  
  POL(true)=  0  
  POL(mark(x1))=  0  
  POL(a__div(x1, x2))=  0  
  POL(if(x1, x2, x3))=  x1 + x2 + x3  
  POL(0)=  0  
  POL(a__if(x1, x2, x3))=  0  
  POL(a__minus(x1, x2))=  0  
  POL(s(x1))=  x1  
  POL(a__geq(x1, x2))=  0  
  POL(div(x1, x2))=  x1  
  POL(A__DIV(x1, x2))=  0  
  POL(A__IF(x1, x2, x3))=  x2 + x3  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 17
Polynomial Ordering


Dependency Pairs:

MARK(if(if(s(X'), X2'', X3''), X2, X3)) -> AIF(aif(s(mark(X')), X2'', X3''), X2, X3)
MARK(if(if(0, X2'', X3''), X2, X3)) -> AIF(aif(0, X2'', X3''), X2, X3)
MARK(if(if(if(X1', X2''', X3'''), X2'', X3''), X2, X3)) -> AIF(aif(aif(mark(X1'), X2''', X3'''), X2'', X3''), X2, X3)
MARK(if(if(div(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(adiv(mark(X1'), X2'''), X2'', X3''), X2, X3)
MARK(if(if(geq(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(ageq(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(if(minus(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(aminus(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(div(s(X'), X2''), X2, X3)) -> AIF(adiv(s(mark(X')), X2''), X2, X3)
MARK(if(div(0, X2''), X2, X3)) -> AIF(adiv(0, X2''), X2, X3)
MARK(if(div(if(X1', X2''', X3''), X2''), X2, X3)) -> AIF(adiv(aif(mark(X1'), X2''', X3''), X2''), X2, X3)
MARK(if(div(div(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(adiv(mark(X1'), X2'''), X2''), X2, X3)
MARK(if(div(geq(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(ageq(X1', X2'''), X2''), X2, X3)
MARK(if(div(minus(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(aminus(X1', X2'''), X2''), X2, X3)
MARK(if(geq(s(X'), s(Y')), X2, X3)) -> AIF(ageq(X', Y'), X2, X3)
MARK(if(geq(0, s(Y')), X2, X3)) -> AIF(false, X2, X3)
MARK(if(geq(X1''', 0), X2, X3)) -> AIF(true, X2, X3)
MARK(if(minus(s(X'), s(Y')), X2, X3)) -> AIF(aminus(X', Y'), X2, X3)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(geq(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(ageq(X1', X2'''), X2'', X3'), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
AIF(false, X, Y) -> MARK(Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





The following dependency pairs can be strictly oriented:

MARK(if(if(geq(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(ageq(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(div(geq(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(ageq(X1', X2'''), X2''), X2, X3)
MARK(if(geq(s(X'), s(Y')), X2, X3)) -> AIF(ageq(X', Y'), X2, X3)
MARK(if(geq(0, s(Y')), X2, X3)) -> AIF(false, X2, X3)
MARK(if(geq(X1''', 0), X2, X3)) -> AIF(true, X2, X3)
MARK(div(if(geq(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(ageq(X1', X2'''), X2'', X3'), X2)
MARK(div(div(geq(X1', X2'''), X2''), X2)) -> ADIV(adiv(ageq(X1', X2'''), X2''), X2)
MARK(div(geq(s(X'), s(Y')), X2)) -> ADIV(ageq(X', Y'), X2)


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(MARK(x1))=  x1  
  POL(geq(x1, x2))=  1  
  POL(false)=  0  
  POL(minus(x1, x2))=  0  
  POL(true)=  0  
  POL(mark(x1))=  0  
  POL(a__div(x1, x2))=  0  
  POL(if(x1, x2, x3))=  x1 + x2 + x3  
  POL(0)=  0  
  POL(a__if(x1, x2, x3))=  0  
  POL(a__minus(x1, x2))=  0  
  POL(s(x1))=  x1  
  POL(a__geq(x1, x2))=  0  
  POL(div(x1, x2))=  x1  
  POL(A__DIV(x1, x2))=  0  
  POL(A__IF(x1, x2, x3))=  x2 + x3  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 18
Polynomial Ordering


Dependency Pairs:

MARK(if(if(s(X'), X2'', X3''), X2, X3)) -> AIF(aif(s(mark(X')), X2'', X3''), X2, X3)
MARK(if(if(0, X2'', X3''), X2, X3)) -> AIF(aif(0, X2'', X3''), X2, X3)
MARK(if(if(if(X1', X2''', X3'''), X2'', X3''), X2, X3)) -> AIF(aif(aif(mark(X1'), X2''', X3'''), X2'', X3''), X2, X3)
MARK(if(if(div(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(adiv(mark(X1'), X2'''), X2'', X3''), X2, X3)
MARK(if(if(minus(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(aminus(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(div(s(X'), X2''), X2, X3)) -> AIF(adiv(s(mark(X')), X2''), X2, X3)
MARK(if(div(0, X2''), X2, X3)) -> AIF(adiv(0, X2''), X2, X3)
MARK(if(div(if(X1', X2''', X3''), X2''), X2, X3)) -> AIF(adiv(aif(mark(X1'), X2''', X3''), X2''), X2, X3)
MARK(if(div(div(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(adiv(mark(X1'), X2'''), X2''), X2, X3)
MARK(if(div(minus(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(aminus(X1', X2'''), X2''), X2, X3)
MARK(if(minus(s(X'), s(Y')), X2, X3)) -> AIF(aminus(X', Y'), X2, X3)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
AIF(false, X, Y) -> MARK(Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





The following dependency pairs can be strictly oriented:

MARK(if(if(s(X'), X2'', X3''), X2, X3)) -> AIF(aif(s(mark(X')), X2'', X3''), X2, X3)
MARK(if(if(0, X2'', X3''), X2, X3)) -> AIF(aif(0, X2'', X3''), X2, X3)
MARK(if(if(if(X1', X2''', X3'''), X2'', X3''), X2, X3)) -> AIF(aif(aif(mark(X1'), X2''', X3'''), X2'', X3''), X2, X3)
MARK(if(if(div(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(adiv(mark(X1'), X2'''), X2'', X3''), X2, X3)
MARK(if(if(minus(X1', X2'''), X2'', X3''), X2, X3)) -> AIF(aif(aminus(X1', X2'''), X2'', X3''), X2, X3)
MARK(if(div(s(X'), X2''), X2, X3)) -> AIF(adiv(s(mark(X')), X2''), X2, X3)
MARK(if(div(0, X2''), X2, X3)) -> AIF(adiv(0, X2''), X2, X3)
MARK(if(div(if(X1', X2''', X3''), X2''), X2, X3)) -> AIF(adiv(aif(mark(X1'), X2''', X3''), X2''), X2, X3)
MARK(if(div(div(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(adiv(mark(X1'), X2'''), X2''), X2, X3)
MARK(if(div(minus(X1', X2'''), X2''), X2, X3)) -> AIF(adiv(aminus(X1', X2'''), X2''), X2, X3)
MARK(if(minus(s(X'), s(Y')), X2, X3)) -> AIF(aminus(X', Y'), X2, X3)
MARK(div(if(s(X'), X2'', X3'), X2)) -> ADIV(aif(s(mark(X')), X2'', X3'), X2)
MARK(div(if(0, X2'', X3'), X2)) -> ADIV(aif(0, X2'', X3'), X2)
MARK(div(if(if(X1', X2''', X3''), X2'', X3'), X2)) -> ADIV(aif(aif(mark(X1'), X2''', X3''), X2'', X3'), X2)
MARK(div(if(div(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(adiv(mark(X1'), X2'''), X2'', X3'), X2)
MARK(div(if(minus(X1', X2'''), X2'', X3'), X2)) -> ADIV(aif(aminus(X1', X2'''), X2'', X3'), X2)
MARK(div(div(if(X1', X2''', X3'), X2''), X2)) -> ADIV(adiv(aif(mark(X1'), X2''', X3'), X2''), X2)
MARK(if(X1, X2, X3)) -> MARK(X1)


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(MARK(x1))=  x1  
  POL(geq(x1, x2))=  0  
  POL(false)=  0  
  POL(minus(x1, x2))=  0  
  POL(true)=  0  
  POL(mark(x1))=  0  
  POL(a__div(x1, x2))=  0  
  POL(if(x1, x2, x3))=  1 + x1 + x2 + x3  
  POL(0)=  0  
  POL(a__if(x1, x2, x3))=  0  
  POL(a__minus(x1, x2))=  0  
  POL(s(x1))=  x1  
  POL(a__geq(x1, x2))=  0  
  POL(div(x1, x2))=  x1  
  POL(A__DIV(x1, x2))=  0  
  POL(A__IF(x1, x2, x3))=  x2 + x3  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 19
Instantiation Transformation


Dependency Pairs:

MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
AIF(false, X, Y) -> MARK(Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(div(X1, X2)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

AIF(true, X, Y) -> MARK(X)
one new Dependency Pair is created:

AIF(true, s(div(minus(X'', Y'0), s(Y'''))), 0) -> MARK(s(div(minus(X'', Y'0), s(Y'''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 20
Instantiation Transformation


Dependency Pairs:

AIF(true, s(div(minus(X'', Y'0), s(Y'''))), 0) -> MARK(s(div(minus(X'', Y'0), s(Y'''))))
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
MARK(div(X1, X2)) -> MARK(X1)
AIF(false, X, Y) -> MARK(Y)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





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

AIF(false, X, Y) -> MARK(Y)
one new Dependency Pair is created:

AIF(false, s(div(minus(X'', Y'0), s(Y'''))), 0) -> MARK(0)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 21
Polynomial Ordering


Dependency Pairs:

MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(div(X1, X2)) -> MARK(X1)
MARK(s(X)) -> MARK(X)
AIF(true, s(div(minus(X'', Y'0), s(Y'''))), 0) -> MARK(s(div(minus(X'', Y'0), s(Y'''))))


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





The following dependency pair can be strictly oriented:

MARK(div(div(0, X2''), X2)) -> ADIV(adiv(0, X2''), X2)


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(MARK(x1))=  x1  
  POL(geq(x1, x2))=  0  
  POL(false)=  0  
  POL(minus(x1, x2))=  0  
  POL(true)=  0  
  POL(mark(x1))=  0  
  POL(a__div(x1, x2))=  0  
  POL(if(x1, x2, x3))=  0  
  POL(0)=  1  
  POL(a__if(x1, x2, x3))=  0  
  POL(a__minus(x1, x2))=  0  
  POL(s(x1))=  x1  
  POL(a__geq(x1, x2))=  0  
  POL(div(x1, x2))=  x1  
  POL(A__DIV(x1, x2))=  0  
  POL(A__IF(x1, x2, x3))=  0  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 22
Polynomial Ordering


Dependency Pairs:

MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(div(X1, X2)) -> MARK(X1)
MARK(s(X)) -> MARK(X)
AIF(true, s(div(minus(X'', Y'0), s(Y'''))), 0) -> MARK(s(div(minus(X'', Y'0), s(Y'''))))


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





The following dependency pairs can be strictly oriented:

MARK(div(div(s(X'), X2''), X2)) -> ADIV(adiv(s(mark(X')), X2''), X2)
MARK(div(div(div(X1', X2'''), X2''), X2)) -> ADIV(adiv(adiv(mark(X1'), X2'''), X2''), X2)
MARK(div(div(minus(X1', X2'''), X2''), X2)) -> ADIV(adiv(aminus(X1', X2'''), X2''), X2)
MARK(div(X1, X2)) -> MARK(X1)


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(MARK(x1))=  x1  
  POL(geq(x1, x2))=  0  
  POL(false)=  0  
  POL(minus(x1, x2))=  0  
  POL(true)=  0  
  POL(mark(x1))=  0  
  POL(a__div(x1, x2))=  0  
  POL(if(x1, x2, x3))=  0  
  POL(0)=  1  
  POL(a__if(x1, x2, x3))=  0  
  POL(a__minus(x1, x2))=  0  
  POL(s(x1))=  x1  
  POL(a__geq(x1, x2))=  0  
  POL(div(x1, x2))=  1 + x1  
  POL(A__DIV(x1, x2))=  1  
  POL(A__IF(x1, x2, x3))=  x3  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 23
Polynomial Ordering


Dependency Pairs:

MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
MARK(s(X)) -> MARK(X)
AIF(true, s(div(minus(X'', Y'0), s(Y'''))), 0) -> MARK(s(div(minus(X'', Y'0), s(Y'''))))


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





The following dependency pair can be strictly oriented:

MARK(s(X)) -> MARK(X)


Additionally, the following usable rules w.r.t. to the implicit AFS can be oriented:

aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(MARK(x1))=  x1  
  POL(geq(x1, x2))=  0  
  POL(false)=  0  
  POL(minus(x1, x2))=  0  
  POL(true)=  0  
  POL(mark(x1))=  x1  
  POL(a__div(x1, x2))=  x1  
  POL(if(x1, x2, x3))=  x2 + x3  
  POL(0)=  0  
  POL(a__if(x1, x2, x3))=  x2 + x3  
  POL(a__minus(x1, x2))=  0  
  POL(s(x1))=  1 + x1  
  POL(a__geq(x1, x2))=  0  
  POL(div(x1, x2))=  x1  
  POL(A__DIV(x1, x2))=  x1  
  POL(A__IF(x1, x2, x3))=  x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Nar
           →DP Problem 6
Nar
             ...
               →DP Problem 24
Dependency Graph


Dependency Pairs:

MARK(div(minus(s(X'), s(Y')), X2)) -> ADIV(aminus(X', Y'), X2)
ADIV(s(X), s(Y)) -> AIF(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
MARK(div(s(X'), X2)) -> ADIV(s(mark(X')), X2)
AIF(true, s(div(minus(X'', Y'0), s(Y'''))), 0) -> MARK(s(div(minus(X'', Y'0), s(Y'''))))


Rules:


aminus(0, Y) -> 0
aminus(s(X), s(Y)) -> aminus(X, Y)
aminus(X1, X2) -> minus(X1, X2)
ageq(X, 0) -> true
ageq(0, s(Y)) -> false
ageq(s(X), s(Y)) -> ageq(X, Y)
ageq(X1, X2) -> geq(X1, X2)
adiv(0, s(Y)) -> 0
adiv(s(X), s(Y)) -> aif(ageq(X, Y), s(div(minus(X, Y), s(Y))), 0)
adiv(X1, X2) -> div(X1, X2)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
mark(minus(X1, X2)) -> aminus(X1, X2)
mark(geq(X1, X2)) -> ageq(X1, X2)
mark(div(X1, X2)) -> adiv(mark(X1), X2)
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(0) -> 0
mark(s(X)) -> s(mark(X))
mark(true) -> true
mark(false) -> false





Using the Dependency Graph resulted in no new DP problems.

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