Term Rewriting System R:
[x, y, z]
plus(x, 0) -> x
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(0), y) -> y
times(s(x), y) -> plus(y, times(x, y))
div(0, y) -> 0
div(x, y) -> quot(x, y, y)
div(div(x, y), z) -> div(x, times(y, z))
quot(0, s(y), z) -> 0
quot(s(x), s(y), z) -> quot(x, y, z)
quot(x, 0, s(z)) -> s(div(x, s(z)))
eq(0, 0) -> true
eq(s(x), 0) -> false
eq(0, s(y)) -> false
eq(s(x), s(y)) -> eq(x, y)
divides(y, x) -> eq(x, times(div(x, y), y))
prime(s(s(x))) -> pr(s(s(x)), s(x))
pr(x, s(0)) -> true
pr(x, s(s(y))) -> if(divides(s(s(y)), x), x, s(y))
if(true, x, y) -> false
if(false, x, y) -> pr(x, y)

Innermost Termination of R to be shown.



   R
Removing Redundant Rules for Innermost Termination



Removing the following rules from R which left hand sides contain non normal subterms

div(div(x, y), z) -> div(x, times(y, z))


   R
RRRI
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

PLUS(s(x), y) -> PLUS(x, y)
TIMES(s(x), y) -> PLUS(y, times(x, y))
TIMES(s(x), y) -> TIMES(x, y)
DIV(x, y) -> QUOT(x, y, y)
QUOT(s(x), s(y), z) -> QUOT(x, y, z)
QUOT(x, 0, s(z)) -> DIV(x, s(z))
EQ(s(x), s(y)) -> EQ(x, y)
DIVIDES(y, x) -> EQ(x, times(div(x, y), y))
DIVIDES(y, x) -> TIMES(div(x, y), y)
DIVIDES(y, x) -> DIV(x, y)
PRIME(s(s(x))) -> PR(s(s(x)), s(x))
PR(x, s(s(y))) -> IF(divides(s(s(y)), x), x, s(y))
PR(x, s(s(y))) -> DIVIDES(s(s(y)), x)
IF(false, x, y) -> PR(x, y)

Furthermore, R contains five SCCs.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
Size-Change Principle
           →DP Problem 2
Neg POLO
           →DP Problem 3
SCP
           →DP Problem 4
SCP
           →DP Problem 5
SCP


Dependency Pair:

PLUS(s(x), y) -> PLUS(x, y)


Rules:


plus(x, 0) -> x
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(0), y) -> y
times(s(x), y) -> plus(y, times(x, y))
div(0, y) -> 0
div(x, y) -> quot(x, y, y)
quot(0, s(y), z) -> 0
quot(s(x), s(y), z) -> quot(x, y, z)
quot(x, 0, s(z)) -> s(div(x, s(z)))
eq(0, 0) -> true
eq(s(x), 0) -> false
eq(0, s(y)) -> false
eq(s(x), s(y)) -> eq(x, y)
divides(y, x) -> eq(x, times(div(x, y), y))
prime(s(s(x))) -> pr(s(s(x)), s(x))
pr(x, s(0)) -> true
pr(x, s(s(y))) -> if(divides(s(s(y)), x), x, s(y))
if(true, x, y) -> false
if(false, x, y) -> pr(x, y)





We number the DPs as follows:
  1. PLUS(s(x), y) -> PLUS(x, y)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2=2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1
2=2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
Negative Polynomial Order
           →DP Problem 3
SCP
           →DP Problem 4
SCP
           →DP Problem 5
SCP


Dependency Pairs:

QUOT(x, 0, s(z)) -> DIV(x, s(z))
QUOT(s(x), s(y), z) -> QUOT(x, y, z)
DIV(x, y) -> QUOT(x, y, y)


Rules:


plus(x, 0) -> x
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(0), y) -> y
times(s(x), y) -> plus(y, times(x, y))
div(0, y) -> 0
div(x, y) -> quot(x, y, y)
quot(0, s(y), z) -> 0
quot(s(x), s(y), z) -> quot(x, y, z)
quot(x, 0, s(z)) -> s(div(x, s(z)))
eq(0, 0) -> true
eq(s(x), 0) -> false
eq(0, s(y)) -> false
eq(s(x), s(y)) -> eq(x, y)
divides(y, x) -> eq(x, times(div(x, y), y))
prime(s(s(x))) -> pr(s(s(x)), s(x))
pr(x, s(0)) -> true
pr(x, s(s(y))) -> if(divides(s(s(y)), x), x, s(y))
if(true, x, y) -> false
if(false, x, y) -> pr(x, y)





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

QUOT(s(x), s(y), z) -> QUOT(x, y, z)


There are no usable rules (regarding the implicit AFS).
Used ordering:
Polynomial Order with Interpretation:

POL( QUOT(x1, ..., x3) ) = x1

POL( s(x1) ) = x1 + 1

POL( DIV(x1, x2) ) = x1


This results in one new DP problem.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
Neg POLO
             ...
               →DP Problem 6
Instantiation Transformation
           →DP Problem 3
SCP
           →DP Problem 4
SCP
           →DP Problem 5
SCP


Dependency Pairs:

QUOT(x, 0, s(z)) -> DIV(x, s(z))
DIV(x, y) -> QUOT(x, y, y)


Rules:


plus(x, 0) -> x
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(0), y) -> y
times(s(x), y) -> plus(y, times(x, y))
div(0, y) -> 0
div(x, y) -> quot(x, y, y)
quot(0, s(y), z) -> 0
quot(s(x), s(y), z) -> quot(x, y, z)
quot(x, 0, s(z)) -> s(div(x, s(z)))
eq(0, 0) -> true
eq(s(x), 0) -> false
eq(0, s(y)) -> false
eq(s(x), s(y)) -> eq(x, y)
divides(y, x) -> eq(x, times(div(x, y), y))
prime(s(s(x))) -> pr(s(s(x)), s(x))
pr(x, s(0)) -> true
pr(x, s(s(y))) -> if(divides(s(s(y)), x), x, s(y))
if(true, x, y) -> false
if(false, x, y) -> pr(x, y)





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

DIV(x, y) -> QUOT(x, y, y)
one new Dependency Pair is created:

DIV(x'', s(z'')) -> QUOT(x'', s(z''), s(z''))

The transformation is resulting in no new DP problems.



   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
Neg POLO
           →DP Problem 3
Size-Change Principle
           →DP Problem 4
SCP
           →DP Problem 5
SCP


Dependency Pair:

EQ(s(x), s(y)) -> EQ(x, y)


Rules:


plus(x, 0) -> x
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(0), y) -> y
times(s(x), y) -> plus(y, times(x, y))
div(0, y) -> 0
div(x, y) -> quot(x, y, y)
quot(0, s(y), z) -> 0
quot(s(x), s(y), z) -> quot(x, y, z)
quot(x, 0, s(z)) -> s(div(x, s(z)))
eq(0, 0) -> true
eq(s(x), 0) -> false
eq(0, s(y)) -> false
eq(s(x), s(y)) -> eq(x, y)
divides(y, x) -> eq(x, times(div(x, y), y))
prime(s(s(x))) -> pr(s(s(x)), s(x))
pr(x, s(0)) -> true
pr(x, s(s(y))) -> if(divides(s(s(y)), x), x, s(y))
if(true, x, y) -> false
if(false, x, y) -> pr(x, y)





We number the DPs as follows:
  1. EQ(s(x), s(y)) -> EQ(x, y)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2>2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1
2>2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
Neg POLO
           →DP Problem 3
SCP
           →DP Problem 4
Size-Change Principle
           →DP Problem 5
SCP


Dependency Pair:

TIMES(s(x), y) -> TIMES(x, y)


Rules:


plus(x, 0) -> x
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(0), y) -> y
times(s(x), y) -> plus(y, times(x, y))
div(0, y) -> 0
div(x, y) -> quot(x, y, y)
quot(0, s(y), z) -> 0
quot(s(x), s(y), z) -> quot(x, y, z)
quot(x, 0, s(z)) -> s(div(x, s(z)))
eq(0, 0) -> true
eq(s(x), 0) -> false
eq(0, s(y)) -> false
eq(s(x), s(y)) -> eq(x, y)
divides(y, x) -> eq(x, times(div(x, y), y))
prime(s(s(x))) -> pr(s(s(x)), s(x))
pr(x, s(0)) -> true
pr(x, s(s(y))) -> if(divides(s(s(y)), x), x, s(y))
if(true, x, y) -> false
if(false, x, y) -> pr(x, y)





We number the DPs as follows:
  1. TIMES(s(x), y) -> TIMES(x, y)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2=2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1
2=2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
RRRI
       →TRS2
DPs
           →DP Problem 1
SCP
           →DP Problem 2
Neg POLO
           →DP Problem 3
SCP
           →DP Problem 4
SCP
           →DP Problem 5
Size-Change Principle


Dependency Pairs:

IF(false, x, y) -> PR(x, y)
PR(x, s(s(y))) -> IF(divides(s(s(y)), x), x, s(y))


Rules:


plus(x, 0) -> x
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
times(0, y) -> 0
times(s(0), y) -> y
times(s(x), y) -> plus(y, times(x, y))
div(0, y) -> 0
div(x, y) -> quot(x, y, y)
quot(0, s(y), z) -> 0
quot(s(x), s(y), z) -> quot(x, y, z)
quot(x, 0, s(z)) -> s(div(x, s(z)))
eq(0, 0) -> true
eq(s(x), 0) -> false
eq(0, s(y)) -> false
eq(s(x), s(y)) -> eq(x, y)
divides(y, x) -> eq(x, times(div(x, y), y))
prime(s(s(x))) -> pr(s(s(x)), s(x))
pr(x, s(0)) -> true
pr(x, s(s(y))) -> if(divides(s(s(y)), x), x, s(y))
if(true, x, y) -> false
if(false, x, y) -> pr(x, y)





We number the DPs as follows:
  1. IF(false, x, y) -> PR(x, y)
  2. PR(x, s(s(y))) -> IF(divides(s(s(y)), x), x, s(y))
and get the following Size-Change Graph(s):
{1} , {1}
2=1
3=2
{2} , {2}
1=2
2>3

which lead(s) to this/these maximal multigraph(s):
{1} , {2}
2=2
3>3
{2} , {1}
1=1
2>2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.

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