(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

Q is empty.

(1) Overlay + Local Confluence (EQUIVALENT transformation)

The TRS is overlay and locally confluent. By [NOC] we can switch to innermost.

(2) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

The set Q consists of the following terms:

gt(s(x0), 0)
gt(0, x0)
gt(s(x0), s(x1))
divides(x0, x1)
div(0, 0, x0)
div(0, s(x0), x1)
div(s(x0), 0, s(x1))
div(s(x0), s(x1), x2)
prime(x0)
test(x0, x1)
if1(true, x0, x1)
if1(false, x0, x1)
if2(true, x0, x1)
if2(false, x0, x1)

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(4) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GT(s(x), s(y)) → GT(x, y)
DIVIDES(x, y) → DIV(x, y, y)
DIV(s(x), 0, s(z)) → DIV(s(x), s(z), s(z))
DIV(s(x), s(y), z) → DIV(x, y, z)
PRIME(x) → TEST(x, s(s(0)))
TEST(x, y) → IF1(gt(x, y), x, y)
TEST(x, y) → GT(x, y)
IF1(true, x, y) → IF2(divides(x, y), x, y)
IF1(true, x, y) → DIVIDES(x, y)
IF2(false, x, y) → TEST(x, s(y))

The TRS R consists of the following rules:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

The set Q consists of the following terms:

gt(s(x0), 0)
gt(0, x0)
gt(s(x0), s(x1))
divides(x0, x1)
div(0, 0, x0)
div(0, s(x0), x1)
div(s(x0), 0, s(x1))
div(s(x0), s(x1), x2)
prime(x0)
test(x0, x1)
if1(true, x0, x1)
if1(false, x0, x1)
if2(true, x0, x1)
if2(false, x0, x1)

We have to consider all minimal (P,Q,R)-chains.

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 3 SCCs with 4 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Q DP problem:
The TRS P consists of the following rules:

DIV(s(x), s(y), z) → DIV(x, y, z)
DIV(s(x), 0, s(z)) → DIV(s(x), s(z), s(z))

The TRS R consists of the following rules:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

The set Q consists of the following terms:

gt(s(x0), 0)
gt(0, x0)
gt(s(x0), s(x1))
divides(x0, x1)
div(0, 0, x0)
div(0, s(x0), x1)
div(s(x0), 0, s(x1))
div(s(x0), s(x1), x2)
prime(x0)
test(x0, x1)
if1(true, x0, x1)
if1(false, x0, x1)
if2(true, x0, x1)
if2(false, x0, x1)

We have to consider all minimal (P,Q,R)-chains.

(8) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


DIV(s(x), s(y), z) → DIV(x, y, z)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
DIV(x1, x2, x3)  =  DIV(x1, x3)
s(x1)  =  s(x1)
0  =  0
gt(x1, x2)  =  gt(x1, x2)
true  =  true
false  =  false
divides(x1, x2)  =  divides(x2)
div(x1, x2, x3)  =  div
prime(x1)  =  prime(x1)
test(x1, x2)  =  x1
if1(x1, x2, x3)  =  x2
if2(x1, x2, x3)  =  x2

Lexicographic path order with status [LPO].
Quasi-Precedence:
prime1 > [DIV2, s1, 0] > [gt2, true, false, divides1, div]

Status:
DIV2: [2,1]
s1: [1]
0: []
gt2: [2,1]
true: []
false: []
divides1: [1]
div: []
prime1: [1]


The following usable rules [FROCOS05] were oriented:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

(9) Obligation:

Q DP problem:
The TRS P consists of the following rules:

DIV(s(x), 0, s(z)) → DIV(s(x), s(z), s(z))

The TRS R consists of the following rules:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

The set Q consists of the following terms:

gt(s(x0), 0)
gt(0, x0)
gt(s(x0), s(x1))
divides(x0, x1)
div(0, 0, x0)
div(0, s(x0), x1)
div(s(x0), 0, s(x1))
div(s(x0), s(x1), x2)
prime(x0)
test(x0, x1)
if1(true, x0, x1)
if1(false, x0, x1)
if2(true, x0, x1)
if2(false, x0, x1)

We have to consider all minimal (P,Q,R)-chains.

(10) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(11) TRUE

(12) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GT(s(x), s(y)) → GT(x, y)

The TRS R consists of the following rules:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

The set Q consists of the following terms:

gt(s(x0), 0)
gt(0, x0)
gt(s(x0), s(x1))
divides(x0, x1)
div(0, 0, x0)
div(0, s(x0), x1)
div(s(x0), 0, s(x1))
div(s(x0), s(x1), x2)
prime(x0)
test(x0, x1)
if1(true, x0, x1)
if1(false, x0, x1)
if2(true, x0, x1)
if2(false, x0, x1)

We have to consider all minimal (P,Q,R)-chains.

(13) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


GT(s(x), s(y)) → GT(x, y)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
GT(x1, x2)  =  x2
s(x1)  =  s(x1)
gt(x1, x2)  =  gt(x1, x2)
0  =  0
true  =  true
false  =  false
divides(x1, x2)  =  divides(x2)
div(x1, x2, x3)  =  div
prime(x1)  =  prime(x1)
test(x1, x2)  =  x1
if1(x1, x2, x3)  =  x2
if2(x1, x2, x3)  =  x2

Lexicographic path order with status [LPO].
Quasi-Precedence:
prime1 > [s1, 0] > [gt2, true, false, divides1, div]

Status:
s1: [1]
gt2: [2,1]
0: []
true: []
false: []
divides1: [1]
div: []
prime1: [1]


The following usable rules [FROCOS05] were oriented:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

(14) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

The set Q consists of the following terms:

gt(s(x0), 0)
gt(0, x0)
gt(s(x0), s(x1))
divides(x0, x1)
div(0, 0, x0)
div(0, s(x0), x1)
div(s(x0), 0, s(x1))
div(s(x0), s(x1), x2)
prime(x0)
test(x0, x1)
if1(true, x0, x1)
if1(false, x0, x1)
if2(true, x0, x1)
if2(false, x0, x1)

We have to consider all minimal (P,Q,R)-chains.

(15) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(16) TRUE

(17) Obligation:

Q DP problem:
The TRS P consists of the following rules:

TEST(x, y) → IF1(gt(x, y), x, y)
IF1(true, x, y) → IF2(divides(x, y), x, y)
IF2(false, x, y) → TEST(x, s(y))

The TRS R consists of the following rules:

gt(s(x), 0) → true
gt(0, y) → false
gt(s(x), s(y)) → gt(x, y)
divides(x, y) → div(x, y, y)
div(0, 0, z) → true
div(0, s(x), z) → false
div(s(x), 0, s(z)) → div(s(x), s(z), s(z))
div(s(x), s(y), z) → div(x, y, z)
prime(x) → test(x, s(s(0)))
test(x, y) → if1(gt(x, y), x, y)
if1(true, x, y) → if2(divides(x, y), x, y)
if1(false, x, y) → true
if2(true, x, y) → false
if2(false, x, y) → test(x, s(y))

The set Q consists of the following terms:

gt(s(x0), 0)
gt(0, x0)
gt(s(x0), s(x1))
divides(x0, x1)
div(0, 0, x0)
div(0, s(x0), x1)
div(s(x0), 0, s(x1))
div(s(x0), s(x1), x2)
prime(x0)
test(x0, x1)
if1(true, x0, x1)
if1(false, x0, x1)
if2(true, x0, x1)
if2(false, x0, x1)

We have to consider all minimal (P,Q,R)-chains.