Term Rewriting System R:
[Y, X, X1, X2]
minus(n0, Y) -> 0
minus(ns(X), ns(Y)) -> minus(activate(X), activate(Y))
minus(X1, X2) -> nminus(X1, X2)
geq(X, n0) -> true
geq(n0, ns(Y)) -> false
geq(ns(X), ns(Y)) -> geq(activate(X), activate(Y))
div(0, ns(Y)) -> 0
div(s(X), ns(Y)) -> if(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
div(X1, X2) -> ndiv(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(activate(X))
activate(ndiv(X1, X2)) -> div(activate(X1), X2)
activate(nminus(X1, X2)) -> minus(X1, X2)
activate(X) -> X

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

MINUS(n0, Y) -> 0'
MINUS(ns(X), ns(Y)) -> MINUS(activate(X), activate(Y))
MINUS(ns(X), ns(Y)) -> ACTIVATE(X)
MINUS(ns(X), ns(Y)) -> ACTIVATE(Y)
GEQ(ns(X), ns(Y)) -> GEQ(activate(X), activate(Y))
GEQ(ns(X), ns(Y)) -> ACTIVATE(X)
GEQ(ns(X), ns(Y)) -> ACTIVATE(Y)
DIV(s(X), ns(Y)) -> IF(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
DIV(s(X), ns(Y)) -> GEQ(X, activate(Y))
DIV(s(X), ns(Y)) -> ACTIVATE(Y)
IF(true, X, Y) -> ACTIVATE(X)
IF(false, X, Y) -> ACTIVATE(Y)
ACTIVATE(n0) -> 0'
ACTIVATE(ns(X)) -> S(activate(X))
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(ndiv(X1, X2)) -> DIV(activate(X1), X2)
ACTIVATE(ndiv(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nminus(X1, X2)) -> MINUS(X1, X2)

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Narrowing Transformation


Dependency Pairs:

DIV(s(X), ns(Y)) -> ACTIVATE(Y)
GEQ(ns(X), ns(Y)) -> ACTIVATE(Y)
GEQ(ns(X), ns(Y)) -> ACTIVATE(X)
GEQ(ns(X), ns(Y)) -> GEQ(activate(X), activate(Y))
DIV(s(X), ns(Y)) -> GEQ(X, activate(Y))
IF(false, X, Y) -> ACTIVATE(Y)
MINUS(ns(X), ns(Y)) -> ACTIVATE(Y)
ACTIVATE(nminus(X1, X2)) -> MINUS(X1, X2)
ACTIVATE(ndiv(X1, X2)) -> ACTIVATE(X1)
IF(true, X, Y) -> ACTIVATE(X)
DIV(s(X), ns(Y)) -> IF(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
ACTIVATE(ndiv(X1, X2)) -> DIV(activate(X1), X2)
ACTIVATE(ns(X)) -> ACTIVATE(X)
MINUS(ns(X), ns(Y)) -> ACTIVATE(X)
MINUS(ns(X), ns(Y)) -> MINUS(activate(X), activate(Y))


Rules:


minus(n0, Y) -> 0
minus(ns(X), ns(Y)) -> minus(activate(X), activate(Y))
minus(X1, X2) -> nminus(X1, X2)
geq(X, n0) -> true
geq(n0, ns(Y)) -> false
geq(ns(X), ns(Y)) -> geq(activate(X), activate(Y))
div(0, ns(Y)) -> 0
div(s(X), ns(Y)) -> if(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
div(X1, X2) -> ndiv(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(activate(X))
activate(ndiv(X1, X2)) -> div(activate(X1), X2)
activate(nminus(X1, X2)) -> minus(X1, X2)
activate(X) -> X





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

MINUS(ns(X), ns(Y)) -> MINUS(activate(X), activate(Y))
10 new Dependency Pairs are created:

MINUS(ns(n0), ns(Y)) -> MINUS(0, activate(Y))
MINUS(ns(ns(X'')), ns(Y)) -> MINUS(s(activate(X'')), activate(Y))
MINUS(ns(ndiv(X1', X2')), ns(Y)) -> MINUS(div(activate(X1'), X2'), activate(Y))
MINUS(ns(nminus(X1', X2')), ns(Y)) -> MINUS(minus(X1', X2'), activate(Y))
MINUS(ns(X''), ns(Y)) -> MINUS(X'', activate(Y))
MINUS(ns(X), ns(n0)) -> MINUS(activate(X), 0)
MINUS(ns(X), ns(ns(X''))) -> MINUS(activate(X), s(activate(X'')))
MINUS(ns(X), ns(ndiv(X1', X2'))) -> MINUS(activate(X), div(activate(X1'), X2'))
MINUS(ns(X), ns(nminus(X1', X2'))) -> MINUS(activate(X), minus(X1', X2'))
MINUS(ns(X), ns(Y')) -> MINUS(activate(X), Y')

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Narrowing Transformation


Dependency Pairs:

GEQ(ns(X), ns(Y)) -> ACTIVATE(Y)
GEQ(ns(X), ns(Y)) -> ACTIVATE(X)
GEQ(ns(X), ns(Y)) -> GEQ(activate(X), activate(Y))
DIV(s(X), ns(Y)) -> GEQ(X, activate(Y))
IF(false, X, Y) -> ACTIVATE(Y)
MINUS(ns(X), ns(Y')) -> MINUS(activate(X), Y')
MINUS(ns(X), ns(nminus(X1', X2'))) -> MINUS(activate(X), minus(X1', X2'))
MINUS(ns(X), ns(ndiv(X1', X2'))) -> MINUS(activate(X), div(activate(X1'), X2'))
MINUS(ns(X), ns(ns(X''))) -> MINUS(activate(X), s(activate(X'')))
MINUS(ns(X), ns(n0)) -> MINUS(activate(X), 0)
MINUS(ns(X''), ns(Y)) -> MINUS(X'', activate(Y))
MINUS(ns(nminus(X1', X2')), ns(Y)) -> MINUS(minus(X1', X2'), activate(Y))
MINUS(ns(ndiv(X1', X2')), ns(Y)) -> MINUS(div(activate(X1'), X2'), activate(Y))
MINUS(ns(ns(X'')), ns(Y)) -> MINUS(s(activate(X'')), activate(Y))
MINUS(ns(n0), ns(Y)) -> MINUS(0, activate(Y))
MINUS(ns(X), ns(Y)) -> ACTIVATE(Y)
MINUS(ns(X), ns(Y)) -> ACTIVATE(X)
ACTIVATE(nminus(X1, X2)) -> MINUS(X1, X2)
ACTIVATE(ndiv(X1, X2)) -> ACTIVATE(X1)
IF(true, X, Y) -> ACTIVATE(X)
DIV(s(X), ns(Y)) -> IF(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
ACTIVATE(ndiv(X1, X2)) -> DIV(activate(X1), X2)
ACTIVATE(ns(X)) -> ACTIVATE(X)
DIV(s(X), ns(Y)) -> ACTIVATE(Y)


Rules:


minus(n0, Y) -> 0
minus(ns(X), ns(Y)) -> minus(activate(X), activate(Y))
minus(X1, X2) -> nminus(X1, X2)
geq(X, n0) -> true
geq(n0, ns(Y)) -> false
geq(ns(X), ns(Y)) -> geq(activate(X), activate(Y))
div(0, ns(Y)) -> 0
div(s(X), ns(Y)) -> if(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
div(X1, X2) -> ndiv(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(activate(X))
activate(ndiv(X1, X2)) -> div(activate(X1), X2)
activate(nminus(X1, X2)) -> minus(X1, X2)
activate(X) -> X





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

GEQ(ns(X), ns(Y)) -> GEQ(activate(X), activate(Y))
10 new Dependency Pairs are created:

GEQ(ns(n0), ns(Y)) -> GEQ(0, activate(Y))
GEQ(ns(ns(X'')), ns(Y)) -> GEQ(s(activate(X'')), activate(Y))
GEQ(ns(ndiv(X1', X2')), ns(Y)) -> GEQ(div(activate(X1'), X2'), activate(Y))
GEQ(ns(nminus(X1', X2')), ns(Y)) -> GEQ(minus(X1', X2'), activate(Y))
GEQ(ns(X''), ns(Y)) -> GEQ(X'', activate(Y))
GEQ(ns(X), ns(n0)) -> GEQ(activate(X), 0)
GEQ(ns(X), ns(ns(X''))) -> GEQ(activate(X), s(activate(X'')))
GEQ(ns(X), ns(ndiv(X1', X2'))) -> GEQ(activate(X), div(activate(X1'), X2'))
GEQ(ns(X), ns(nminus(X1', X2'))) -> GEQ(activate(X), minus(X1', X2'))
GEQ(ns(X), ns(Y')) -> GEQ(activate(X), Y')

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

DIV(s(X), ns(Y)) -> ACTIVATE(Y)
GEQ(ns(X), ns(Y')) -> GEQ(activate(X), Y')
GEQ(ns(X), ns(nminus(X1', X2'))) -> GEQ(activate(X), minus(X1', X2'))
GEQ(ns(X), ns(ndiv(X1', X2'))) -> GEQ(activate(X), div(activate(X1'), X2'))
GEQ(ns(X), ns(ns(X''))) -> GEQ(activate(X), s(activate(X'')))
GEQ(ns(X), ns(n0)) -> GEQ(activate(X), 0)
GEQ(ns(X''), ns(Y)) -> GEQ(X'', activate(Y))
GEQ(ns(nminus(X1', X2')), ns(Y)) -> GEQ(minus(X1', X2'), activate(Y))
GEQ(ns(ndiv(X1', X2')), ns(Y)) -> GEQ(div(activate(X1'), X2'), activate(Y))
GEQ(ns(ns(X'')), ns(Y)) -> GEQ(s(activate(X'')), activate(Y))
GEQ(ns(n0), ns(Y)) -> GEQ(0, activate(Y))
GEQ(ns(X), ns(Y)) -> ACTIVATE(X)
DIV(s(X), ns(Y)) -> GEQ(X, activate(Y))
IF(false, X, Y) -> ACTIVATE(Y)
MINUS(ns(X), ns(Y')) -> MINUS(activate(X), Y')
MINUS(ns(X), ns(nminus(X1', X2'))) -> MINUS(activate(X), minus(X1', X2'))
MINUS(ns(X), ns(ndiv(X1', X2'))) -> MINUS(activate(X), div(activate(X1'), X2'))
MINUS(ns(X), ns(ns(X''))) -> MINUS(activate(X), s(activate(X'')))
MINUS(ns(X), ns(n0)) -> MINUS(activate(X), 0)
MINUS(ns(X''), ns(Y)) -> MINUS(X'', activate(Y))
MINUS(ns(nminus(X1', X2')), ns(Y)) -> MINUS(minus(X1', X2'), activate(Y))
MINUS(ns(ndiv(X1', X2')), ns(Y)) -> MINUS(div(activate(X1'), X2'), activate(Y))
MINUS(ns(ns(X'')), ns(Y)) -> MINUS(s(activate(X'')), activate(Y))
MINUS(ns(n0), ns(Y)) -> MINUS(0, activate(Y))
MINUS(ns(X), ns(Y)) -> ACTIVATE(Y)
MINUS(ns(X), ns(Y)) -> ACTIVATE(X)
ACTIVATE(nminus(X1, X2)) -> MINUS(X1, X2)
ACTIVATE(ndiv(X1, X2)) -> ACTIVATE(X1)
IF(true, X, Y) -> ACTIVATE(X)
DIV(s(X), ns(Y)) -> IF(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
ACTIVATE(ndiv(X1, X2)) -> DIV(activate(X1), X2)
ACTIVATE(ns(X)) -> ACTIVATE(X)
GEQ(ns(X), ns(Y)) -> ACTIVATE(Y)


Rules:


minus(n0, Y) -> 0
minus(ns(X), ns(Y)) -> minus(activate(X), activate(Y))
minus(X1, X2) -> nminus(X1, X2)
geq(X, n0) -> true
geq(n0, ns(Y)) -> false
geq(ns(X), ns(Y)) -> geq(activate(X), activate(Y))
div(0, ns(Y)) -> 0
div(s(X), ns(Y)) -> if(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
div(X1, X2) -> ndiv(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(activate(X))
activate(ndiv(X1, X2)) -> div(activate(X1), X2)
activate(nminus(X1, X2)) -> minus(X1, X2)
activate(X) -> X





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

DIV(s(X), ns(Y)) -> GEQ(X, activate(Y))
five new Dependency Pairs are created:

DIV(s(X), ns(n0)) -> GEQ(X, 0)
DIV(s(X), ns(ns(X''))) -> GEQ(X, s(activate(X'')))
DIV(s(X), ns(ndiv(X1', X2'))) -> GEQ(X, div(activate(X1'), X2'))
DIV(s(X), ns(nminus(X1', X2'))) -> GEQ(X, minus(X1', X2'))
DIV(s(X), ns(Y')) -> GEQ(X, Y')

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 4
Narrowing Transformation


Dependency Pairs:

DIV(s(X), ns(Y')) -> GEQ(X, Y')
DIV(s(X), ns(nminus(X1', X2'))) -> GEQ(X, minus(X1', X2'))
DIV(s(X), ns(ndiv(X1', X2'))) -> GEQ(X, div(activate(X1'), X2'))
DIV(s(X), ns(ns(X''))) -> GEQ(X, s(activate(X'')))
GEQ(ns(X), ns(Y')) -> GEQ(activate(X), Y')
GEQ(ns(X), ns(nminus(X1', X2'))) -> GEQ(activate(X), minus(X1', X2'))
GEQ(ns(X), ns(ndiv(X1', X2'))) -> GEQ(activate(X), div(activate(X1'), X2'))
GEQ(ns(X), ns(ns(X''))) -> GEQ(activate(X), s(activate(X'')))
GEQ(ns(X), ns(n0)) -> GEQ(activate(X), 0)
GEQ(ns(X''), ns(Y)) -> GEQ(X'', activate(Y))
GEQ(ns(nminus(X1', X2')), ns(Y)) -> GEQ(minus(X1', X2'), activate(Y))
GEQ(ns(ndiv(X1', X2')), ns(Y)) -> GEQ(div(activate(X1'), X2'), activate(Y))
GEQ(ns(ns(X'')), ns(Y)) -> GEQ(s(activate(X'')), activate(Y))
GEQ(ns(n0), ns(Y)) -> GEQ(0, activate(Y))
GEQ(ns(X), ns(Y)) -> ACTIVATE(Y)
GEQ(ns(X), ns(Y)) -> ACTIVATE(X)
DIV(s(X), ns(n0)) -> GEQ(X, 0)
IF(false, X, Y) -> ACTIVATE(Y)
MINUS(ns(X), ns(Y')) -> MINUS(activate(X), Y')
MINUS(ns(X), ns(nminus(X1', X2'))) -> MINUS(activate(X), minus(X1', X2'))
MINUS(ns(X), ns(ndiv(X1', X2'))) -> MINUS(activate(X), div(activate(X1'), X2'))
MINUS(ns(X), ns(ns(X''))) -> MINUS(activate(X), s(activate(X'')))
MINUS(ns(X), ns(n0)) -> MINUS(activate(X), 0)
MINUS(ns(X''), ns(Y)) -> MINUS(X'', activate(Y))
MINUS(ns(nminus(X1', X2')), ns(Y)) -> MINUS(minus(X1', X2'), activate(Y))
MINUS(ns(ndiv(X1', X2')), ns(Y)) -> MINUS(div(activate(X1'), X2'), activate(Y))
MINUS(ns(ns(X'')), ns(Y)) -> MINUS(s(activate(X'')), activate(Y))
MINUS(ns(n0), ns(Y)) -> MINUS(0, activate(Y))
MINUS(ns(X), ns(Y)) -> ACTIVATE(Y)
MINUS(ns(X), ns(Y)) -> ACTIVATE(X)
ACTIVATE(nminus(X1, X2)) -> MINUS(X1, X2)
ACTIVATE(ndiv(X1, X2)) -> ACTIVATE(X1)
IF(true, X, Y) -> ACTIVATE(X)
DIV(s(X), ns(Y)) -> IF(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
ACTIVATE(ndiv(X1, X2)) -> DIV(activate(X1), X2)
ACTIVATE(ns(X)) -> ACTIVATE(X)
DIV(s(X), ns(Y)) -> ACTIVATE(Y)


Rules:


minus(n0, Y) -> 0
minus(ns(X), ns(Y)) -> minus(activate(X), activate(Y))
minus(X1, X2) -> nminus(X1, X2)
geq(X, n0) -> true
geq(n0, ns(Y)) -> false
geq(ns(X), ns(Y)) -> geq(activate(X), activate(Y))
div(0, ns(Y)) -> 0
div(s(X), ns(Y)) -> if(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
div(X1, X2) -> ndiv(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(activate(X))
activate(ndiv(X1, X2)) -> div(activate(X1), X2)
activate(nminus(X1, X2)) -> minus(X1, X2)
activate(X) -> X





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

ACTIVATE(ndiv(X1, X2)) -> DIV(activate(X1), X2)
five new Dependency Pairs are created:

ACTIVATE(ndiv(n0, X2)) -> DIV(0, X2)
ACTIVATE(ndiv(ns(X'), X2)) -> DIV(s(activate(X')), X2)
ACTIVATE(ndiv(ndiv(X1'', X2''), X2)) -> DIV(div(activate(X1''), X2''), X2)
ACTIVATE(ndiv(nminus(X1'', X2''), X2)) -> DIV(minus(X1'', X2''), X2)
ACTIVATE(ndiv(X1', X2)) -> DIV(X1', X2)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 5
Instantiation Transformation


Dependency Pairs:

MINUS(ns(X), ns(Y')) -> MINUS(activate(X), Y')
MINUS(ns(X), ns(nminus(X1', X2'))) -> MINUS(activate(X), minus(X1', X2'))
MINUS(ns(X), ns(ndiv(X1', X2'))) -> MINUS(activate(X), div(activate(X1'), X2'))
MINUS(ns(X), ns(ns(X''))) -> MINUS(activate(X), s(activate(X'')))
MINUS(ns(X), ns(n0)) -> MINUS(activate(X), 0)
MINUS(ns(X''), ns(Y)) -> MINUS(X'', activate(Y))
MINUS(ns(nminus(X1', X2')), ns(Y)) -> MINUS(minus(X1', X2'), activate(Y))
MINUS(ns(ndiv(X1', X2')), ns(Y)) -> MINUS(div(activate(X1'), X2'), activate(Y))
MINUS(ns(ns(X'')), ns(Y)) -> MINUS(s(activate(X'')), activate(Y))
MINUS(ns(n0), ns(Y)) -> MINUS(0, activate(Y))
MINUS(ns(X), ns(Y)) -> ACTIVATE(Y)
IF(false, X, Y) -> ACTIVATE(Y)
ACTIVATE(ndiv(X1', X2)) -> DIV(X1', X2)
DIV(s(X), ns(nminus(X1', X2'))) -> GEQ(X, minus(X1', X2'))
DIV(s(X), ns(ndiv(X1', X2'))) -> GEQ(X, div(activate(X1'), X2'))
GEQ(ns(X), ns(Y')) -> GEQ(activate(X), Y')
GEQ(ns(X), ns(nminus(X1', X2'))) -> GEQ(activate(X), minus(X1', X2'))
GEQ(ns(X), ns(ndiv(X1', X2'))) -> GEQ(activate(X), div(activate(X1'), X2'))
GEQ(ns(X), ns(ns(X''))) -> GEQ(activate(X), s(activate(X'')))
GEQ(ns(X), ns(n0)) -> GEQ(activate(X), 0)
GEQ(ns(X''), ns(Y)) -> GEQ(X'', activate(Y))
GEQ(ns(nminus(X1', X2')), ns(Y)) -> GEQ(minus(X1', X2'), activate(Y))
GEQ(ns(ndiv(X1', X2')), ns(Y)) -> GEQ(div(activate(X1'), X2'), activate(Y))
GEQ(ns(ns(X'')), ns(Y)) -> GEQ(s(activate(X'')), activate(Y))
GEQ(ns(n0), ns(Y)) -> GEQ(0, activate(Y))
DIV(s(X), ns(ns(X''))) -> GEQ(X, s(activate(X'')))
ACTIVATE(ndiv(nminus(X1'', X2''), X2)) -> DIV(minus(X1'', X2''), X2)
GEQ(ns(X), ns(Y)) -> ACTIVATE(Y)
DIV(s(X), ns(n0)) -> GEQ(X, 0)
ACTIVATE(ndiv(ndiv(X1'', X2''), X2)) -> DIV(div(activate(X1''), X2''), X2)
DIV(s(X), ns(Y)) -> ACTIVATE(Y)
ACTIVATE(ndiv(ns(X'), X2)) -> DIV(s(activate(X')), X2)
IF(true, X, Y) -> ACTIVATE(X)
DIV(s(X), ns(Y)) -> IF(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
ACTIVATE(ndiv(n0, X2)) -> DIV(0, X2)
MINUS(ns(X), ns(Y)) -> ACTIVATE(X)
ACTIVATE(nminus(X1, X2)) -> MINUS(X1, X2)
ACTIVATE(ndiv(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(X)) -> ACTIVATE(X)
GEQ(ns(X), ns(Y)) -> ACTIVATE(X)
DIV(s(X), ns(Y')) -> GEQ(X, Y')


Rules:


minus(n0, Y) -> 0
minus(ns(X), ns(Y)) -> minus(activate(X), activate(Y))
minus(X1, X2) -> nminus(X1, X2)
geq(X, n0) -> true
geq(n0, ns(Y)) -> false
geq(ns(X), ns(Y)) -> geq(activate(X), activate(Y))
div(0, ns(Y)) -> 0
div(s(X), ns(Y)) -> if(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
div(X1, X2) -> ndiv(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(activate(X))
activate(ndiv(X1, X2)) -> div(activate(X1), X2)
activate(nminus(X1, X2)) -> minus(X1, X2)
activate(X) -> X





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

IF(true, X, Y) -> ACTIVATE(X)
one new Dependency Pair is created:

IF(true, ns(ndiv(nminus(X'', x'''0), ns(x'''''))), n0) -> ACTIVATE(ns(ndiv(nminus(X'', x'''0), ns(x'''''))))

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

MINUS(ns(X), ns(nminus(X1', X2'))) -> MINUS(activate(X), minus(X1', X2'))
MINUS(ns(X), ns(ndiv(X1', X2'))) -> MINUS(activate(X), div(activate(X1'), X2'))
MINUS(ns(X), ns(ns(X''))) -> MINUS(activate(X), s(activate(X'')))
MINUS(ns(X), ns(n0)) -> MINUS(activate(X), 0)
MINUS(ns(X''), ns(Y)) -> MINUS(X'', activate(Y))
MINUS(ns(nminus(X1', X2')), ns(Y)) -> MINUS(minus(X1', X2'), activate(Y))
MINUS(ns(ndiv(X1', X2')), ns(Y)) -> MINUS(div(activate(X1'), X2'), activate(Y))
MINUS(ns(ns(X'')), ns(Y)) -> MINUS(s(activate(X'')), activate(Y))
MINUS(ns(n0), ns(Y)) -> MINUS(0, activate(Y))
IF(true, ns(ndiv(nminus(X'', x'''0), ns(x'''''))), n0) -> ACTIVATE(ns(ndiv(nminus(X'', x'''0), ns(x'''''))))
DIV(s(X), ns(Y')) -> GEQ(X, Y')
DIV(s(X), ns(nminus(X1', X2'))) -> GEQ(X, minus(X1', X2'))
GEQ(ns(X), ns(Y')) -> GEQ(activate(X), Y')
GEQ(ns(X), ns(nminus(X1', X2'))) -> GEQ(activate(X), minus(X1', X2'))
GEQ(ns(X), ns(ndiv(X1', X2'))) -> GEQ(activate(X), div(activate(X1'), X2'))
GEQ(ns(X), ns(ns(X''))) -> GEQ(activate(X), s(activate(X'')))
GEQ(ns(X), ns(n0)) -> GEQ(activate(X), 0)
GEQ(ns(X''), ns(Y)) -> GEQ(X'', activate(Y))
GEQ(ns(nminus(X1', X2')), ns(Y)) -> GEQ(minus(X1', X2'), activate(Y))
GEQ(ns(ndiv(X1', X2')), ns(Y)) -> GEQ(div(activate(X1'), X2'), activate(Y))
GEQ(ns(ns(X'')), ns(Y)) -> GEQ(s(activate(X'')), activate(Y))
GEQ(ns(n0), ns(Y)) -> GEQ(0, activate(Y))
DIV(s(X), ns(ndiv(X1', X2'))) -> GEQ(X, div(activate(X1'), X2'))
ACTIVATE(ndiv(X1', X2)) -> DIV(X1', X2)
GEQ(ns(X), ns(Y)) -> ACTIVATE(Y)
DIV(s(X), ns(ns(X''))) -> GEQ(X, s(activate(X'')))
ACTIVATE(ndiv(nminus(X1'', X2''), X2)) -> DIV(minus(X1'', X2''), X2)
GEQ(ns(X), ns(Y)) -> ACTIVATE(X)
DIV(s(X), ns(n0)) -> GEQ(X, 0)
ACTIVATE(ndiv(ndiv(X1'', X2''), X2)) -> DIV(div(activate(X1''), X2''), X2)
DIV(s(X), ns(Y)) -> ACTIVATE(Y)
ACTIVATE(ndiv(ns(X'), X2)) -> DIV(s(activate(X')), X2)
IF(false, X, Y) -> ACTIVATE(Y)
DIV(s(X), ns(Y)) -> IF(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
ACTIVATE(ndiv(n0, X2)) -> DIV(0, X2)
MINUS(ns(X), ns(Y)) -> ACTIVATE(Y)
ACTIVATE(nminus(X1, X2)) -> MINUS(X1, X2)
ACTIVATE(ndiv(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(X)) -> ACTIVATE(X)
MINUS(ns(X), ns(Y)) -> ACTIVATE(X)
MINUS(ns(X), ns(Y')) -> MINUS(activate(X), Y')


Rules:


minus(n0, Y) -> 0
minus(ns(X), ns(Y)) -> minus(activate(X), activate(Y))
minus(X1, X2) -> nminus(X1, X2)
geq(X, n0) -> true
geq(n0, ns(Y)) -> false
geq(ns(X), ns(Y)) -> geq(activate(X), activate(Y))
div(0, ns(Y)) -> 0
div(s(X), ns(Y)) -> if(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
div(X1, X2) -> ndiv(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(activate(X))
activate(ndiv(X1, X2)) -> div(activate(X1), X2)
activate(nminus(X1, X2)) -> minus(X1, X2)
activate(X) -> X





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

IF(false, X, Y) -> ACTIVATE(Y)
one new Dependency Pair is created:

IF(false, ns(ndiv(nminus(X'', x'''0), ns(x'''''))), n0) -> ACTIVATE(n0)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 7
Remaining Obligation(s)




The following remains to be proven:
Dependency Pairs:

MINUS(ns(X), ns(Y')) -> MINUS(activate(X), Y')
MINUS(ns(X), ns(ndiv(X1', X2'))) -> MINUS(activate(X), div(activate(X1'), X2'))
MINUS(ns(X), ns(ns(X''))) -> MINUS(activate(X), s(activate(X'')))
MINUS(ns(X), ns(n0)) -> MINUS(activate(X), 0)
MINUS(ns(X''), ns(Y)) -> MINUS(X'', activate(Y))
MINUS(ns(nminus(X1', X2')), ns(Y)) -> MINUS(minus(X1', X2'), activate(Y))
MINUS(ns(ndiv(X1', X2')), ns(Y)) -> MINUS(div(activate(X1'), X2'), activate(Y))
MINUS(ns(ns(X'')), ns(Y)) -> MINUS(s(activate(X'')), activate(Y))
MINUS(ns(n0), ns(Y)) -> MINUS(0, activate(Y))
ACTIVATE(ndiv(X1', X2)) -> DIV(X1', X2)
DIV(s(X), ns(Y')) -> GEQ(X, Y')
DIV(s(X), ns(nminus(X1', X2'))) -> GEQ(X, minus(X1', X2'))
GEQ(ns(X), ns(Y')) -> GEQ(activate(X), Y')
GEQ(ns(X), ns(nminus(X1', X2'))) -> GEQ(activate(X), minus(X1', X2'))
GEQ(ns(X), ns(ndiv(X1', X2'))) -> GEQ(activate(X), div(activate(X1'), X2'))
GEQ(ns(X), ns(ns(X''))) -> GEQ(activate(X), s(activate(X'')))
GEQ(ns(X), ns(n0)) -> GEQ(activate(X), 0)
GEQ(ns(X''), ns(Y)) -> GEQ(X'', activate(Y))
GEQ(ns(nminus(X1', X2')), ns(Y)) -> GEQ(minus(X1', X2'), activate(Y))
GEQ(ns(ndiv(X1', X2')), ns(Y)) -> GEQ(div(activate(X1'), X2'), activate(Y))
GEQ(ns(ns(X'')), ns(Y)) -> GEQ(s(activate(X'')), activate(Y))
GEQ(ns(n0), ns(Y)) -> GEQ(0, activate(Y))
DIV(s(X), ns(ndiv(X1', X2'))) -> GEQ(X, div(activate(X1'), X2'))
ACTIVATE(ndiv(nminus(X1'', X2''), X2)) -> DIV(minus(X1'', X2''), X2)
GEQ(ns(X), ns(Y)) -> ACTIVATE(Y)
DIV(s(X), ns(ns(X''))) -> GEQ(X, s(activate(X'')))
ACTIVATE(ndiv(ndiv(X1'', X2''), X2)) -> DIV(div(activate(X1''), X2''), X2)
GEQ(ns(X), ns(Y)) -> ACTIVATE(X)
DIV(s(X), ns(n0)) -> GEQ(X, 0)
ACTIVATE(ndiv(ns(X'), X2)) -> DIV(s(activate(X')), X2)
DIV(s(X), ns(Y)) -> ACTIVATE(Y)
IF(true, ns(ndiv(nminus(X'', x'''0), ns(x'''''))), n0) -> ACTIVATE(ns(ndiv(nminus(X'', x'''0), ns(x'''''))))
DIV(s(X), ns(Y)) -> IF(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
ACTIVATE(ndiv(n0, X2)) -> DIV(0, X2)
MINUS(ns(X), ns(Y)) -> ACTIVATE(Y)
ACTIVATE(nminus(X1, X2)) -> MINUS(X1, X2)
ACTIVATE(ndiv(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(X)) -> ACTIVATE(X)
MINUS(ns(X), ns(Y)) -> ACTIVATE(X)
MINUS(ns(X), ns(nminus(X1', X2'))) -> MINUS(activate(X), minus(X1', X2'))


Rules:


minus(n0, Y) -> 0
minus(ns(X), ns(Y)) -> minus(activate(X), activate(Y))
minus(X1, X2) -> nminus(X1, X2)
geq(X, n0) -> true
geq(n0, ns(Y)) -> false
geq(ns(X), ns(Y)) -> geq(activate(X), activate(Y))
div(0, ns(Y)) -> 0
div(s(X), ns(Y)) -> if(geq(X, activate(Y)), ns(ndiv(nminus(X, activate(Y)), ns(activate(Y)))), n0)
div(X1, X2) -> ndiv(X1, X2)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
0 -> n0
s(X) -> ns(X)
activate(n0) -> 0
activate(ns(X)) -> s(activate(X))
activate(ndiv(X1, X2)) -> div(activate(X1), X2)
activate(nminus(X1, X2)) -> minus(X1, X2)
activate(X) -> X




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