(0) Obligation:

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

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

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:

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

The set Q consists of the following terms:

eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
or(true, x0)
or(false, x0)
union(empty, x0)
union(edge(x0, x1, x2), x3)
isEmpty(empty)
isEmpty(edge(x0, x1, x2))
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
reach(x0, x1, x2, x3)
if1(true, x0, x1, x2, x3, x4, x5, x6)
if1(false, x0, x1, x2, x3, x4, x5, x6)
if2(true, x0, x1, x2, x3, x4, x5)
if2(false, x0, x1, x2, x3, x4, x5)
if3(false, x0, x1, x2, x3, x4)
if3(true, x0, x1, x2, x3, x4)
if4(true, x0, x1, x2, x3)
if4(false, x0, x1, x2, x3)

(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:

EQ(s(x), s(y)) → EQ(x, y)
UNION(edge(x, y, i), h) → UNION(i, h)
REACH(x, y, i, h) → IF1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
REACH(x, y, i, h) → EQ(x, y)
REACH(x, y, i, h) → ISEMPTY(i)
REACH(x, y, i, h) → EQ(x, from(i))
REACH(x, y, i, h) → FROM(i)
REACH(x, y, i, h) → EQ(y, to(i))
REACH(x, y, i, h) → TO(i)
IF1(false, b1, b2, b3, x, y, i, h) → IF2(b1, b2, b3, x, y, i, h)
IF2(false, b2, b3, x, y, i, h) → IF3(b2, b3, x, y, i, h)
IF3(false, b3, x, y, i, h) → REACH(x, y, rest(i), edge(from(i), to(i), h))
IF3(false, b3, x, y, i, h) → REST(i)
IF3(false, b3, x, y, i, h) → FROM(i)
IF3(false, b3, x, y, i, h) → TO(i)
IF3(true, b3, x, y, i, h) → IF4(b3, x, y, i, h)
IF4(false, x, y, i, h) → OR(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))
IF4(false, x, y, i, h) → REACH(x, y, rest(i), h)
IF4(false, x, y, i, h) → REST(i)
IF4(false, x, y, i, h) → REACH(to(i), y, union(rest(i), h), empty)
IF4(false, x, y, i, h) → TO(i)
IF4(false, x, y, i, h) → UNION(rest(i), h)

The TRS R consists of the following rules:

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

The set Q consists of the following terms:

eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
or(true, x0)
or(false, x0)
union(empty, x0)
union(edge(x0, x1, x2), x3)
isEmpty(empty)
isEmpty(edge(x0, x1, x2))
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
reach(x0, x1, x2, x3)
if1(true, x0, x1, x2, x3, x4, x5, x6)
if1(false, x0, x1, x2, x3, x4, x5, x6)
if2(true, x0, x1, x2, x3, x4, x5)
if2(false, x0, x1, x2, x3, x4, x5)
if3(false, x0, x1, x2, x3, x4)
if3(true, x0, x1, x2, x3, x4)
if4(true, x0, x1, x2, x3)
if4(false, x0, x1, x2, x3)

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 13 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

UNION(edge(x, y, i), h) → UNION(i, h)

The TRS R consists of the following rules:

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

The set Q consists of the following terms:

eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
or(true, x0)
or(false, x0)
union(empty, x0)
union(edge(x0, x1, x2), x3)
isEmpty(empty)
isEmpty(edge(x0, x1, x2))
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
reach(x0, x1, x2, x3)
if1(true, x0, x1, x2, x3, x4, x5, x6)
if1(false, x0, x1, x2, x3, x4, x5, x6)
if2(true, x0, x1, x2, x3, x4, x5)
if2(false, x0, x1, x2, x3, x4, x5)
if3(false, x0, x1, x2, x3, x4)
if3(true, x0, x1, x2, x3, x4)
if4(true, x0, x1, x2, x3)
if4(false, x0, x1, x2, x3)

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.


UNION(edge(x, y, i), h) → UNION(i, h)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
UNION(x1, x2)  =  UNION(x1, x2)
edge(x1, x2, x3)  =  edge(x1, x2, x3)
eq(x1, x2)  =  x1
0  =  0
true  =  true
s(x1)  =  x1
false  =  false
or(x1, x2)  =  x2
union(x1, x2)  =  union(x1, x2)
empty  =  empty
isEmpty(x1)  =  isEmpty
from(x1)  =  from(x1)
to(x1)  =  to(x1)
rest(x1)  =  x1
reach(x1, x2, x3, x4)  =  reach
if1(x1, x2, x3, x4, x5, x6, x7, x8)  =  x2
if2(x1, x2, x3, x4, x5, x6, x7)  =  x1
if3(x1, x2, x3, x4, x5, x6)  =  if3
if4(x1, x2, x3, x4, x5)  =  if4

Lexicographic path order with status [LPO].
Quasi-Precedence:
union2 > edge3 > UNION2 > [0, true, false, isEmpty, reach, if3, if4]
empty > [0, true, false, isEmpty, reach, if3, if4]
from1 > [0, true, false, isEmpty, reach, if3, if4]
to1 > [0, true, false, isEmpty, reach, if3, if4]

Status:
UNION2: [2,1]
edge3: [1,3,2]
0: []
true: []
false: []
union2: [2,1]
empty: []
isEmpty: []
from1: [1]
to1: [1]
reach: []
if3: []
if4: []


The following usable rules [FROCOS05] were oriented:

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

(9) Obligation:

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

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

The set Q consists of the following terms:

eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
or(true, x0)
or(false, x0)
union(empty, x0)
union(edge(x0, x1, x2), x3)
isEmpty(empty)
isEmpty(edge(x0, x1, x2))
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
reach(x0, x1, x2, x3)
if1(true, x0, x1, x2, x3, x4, x5, x6)
if1(false, x0, x1, x2, x3, x4, x5, x6)
if2(true, x0, x1, x2, x3, x4, x5)
if2(false, x0, x1, x2, x3, x4, x5)
if3(false, x0, x1, x2, x3, x4)
if3(true, x0, x1, x2, x3, x4)
if4(true, x0, x1, x2, x3)
if4(false, x0, x1, x2, x3)

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

(10) PisEmptyProof (EQUIVALENT transformation)

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

(11) TRUE

(12) Obligation:

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

EQ(s(x), s(y)) → EQ(x, y)

The TRS R consists of the following rules:

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

The set Q consists of the following terms:

eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
or(true, x0)
or(false, x0)
union(empty, x0)
union(edge(x0, x1, x2), x3)
isEmpty(empty)
isEmpty(edge(x0, x1, x2))
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
reach(x0, x1, x2, x3)
if1(true, x0, x1, x2, x3, x4, x5, x6)
if1(false, x0, x1, x2, x3, x4, x5, x6)
if2(true, x0, x1, x2, x3, x4, x5)
if2(false, x0, x1, x2, x3, x4, x5)
if3(false, x0, x1, x2, x3, x4)
if3(true, x0, x1, x2, x3, x4)
if4(true, x0, x1, x2, x3)
if4(false, x0, x1, x2, x3)

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.


EQ(s(x), s(y)) → EQ(x, y)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
EQ(x1, x2)  =  x2
s(x1)  =  s(x1)
eq(x1, x2)  =  x1
0  =  0
true  =  true
false  =  false
or(x1, x2)  =  x2
union(x1, x2)  =  union(x1, x2)
empty  =  empty
edge(x1, x2, x3)  =  edge(x1, x2, x3)
isEmpty(x1)  =  x1
from(x1)  =  from(x1)
to(x1)  =  to(x1)
rest(x1)  =  x1
reach(x1, x2, x3, x4)  =  reach(x2)
if1(x1, x2, x3, x4, x5, x6, x7, x8)  =  if1(x6)
if2(x1, x2, x3, x4, x5, x6, x7)  =  if2(x5)
if3(x1, x2, x3, x4, x5, x6)  =  if3(x4)
if4(x1, x2, x3, x4, x5)  =  if4(x3)

Lexicographic path order with status [LPO].
Quasi-Precedence:
s1 > [0, false] > from1 > true
s1 > [0, false] > to1 > true
[union2, reach1, if11, if21, if31, if41] > empty > true
[union2, reach1, if11, if21, if31, if41] > edge3 > [0, false] > from1 > true
[union2, reach1, if11, if21, if31, if41] > edge3 > [0, false] > to1 > true

Status:
s1: [1]
0: []
true: []
false: []
union2: [1,2]
empty: []
edge3: [2,1,3]
from1: [1]
to1: [1]
reach1: [1]
if11: [1]
if21: [1]
if31: [1]
if41: [1]


The following usable rules [FROCOS05] were oriented:

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

(14) Obligation:

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

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

The set Q consists of the following terms:

eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
or(true, x0)
or(false, x0)
union(empty, x0)
union(edge(x0, x1, x2), x3)
isEmpty(empty)
isEmpty(edge(x0, x1, x2))
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
reach(x0, x1, x2, x3)
if1(true, x0, x1, x2, x3, x4, x5, x6)
if1(false, x0, x1, x2, x3, x4, x5, x6)
if2(true, x0, x1, x2, x3, x4, x5)
if2(false, x0, x1, x2, x3, x4, x5)
if3(false, x0, x1, x2, x3, x4)
if3(true, x0, x1, x2, x3, x4)
if4(true, x0, x1, x2, x3)
if4(false, x0, x1, x2, x3)

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:

REACH(x, y, i, h) → IF1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
IF1(false, b1, b2, b3, x, y, i, h) → IF2(b1, b2, b3, x, y, i, h)
IF2(false, b2, b3, x, y, i, h) → IF3(b2, b3, x, y, i, h)
IF3(false, b3, x, y, i, h) → REACH(x, y, rest(i), edge(from(i), to(i), h))
IF3(true, b3, x, y, i, h) → IF4(b3, x, y, i, h)
IF4(false, x, y, i, h) → REACH(x, y, rest(i), h)
IF4(false, x, y, i, h) → REACH(to(i), y, union(rest(i), h), empty)

The TRS R consists of the following rules:

eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
or(true, y) → true
or(false, y) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
reach(x, y, i, h) → if1(eq(x, y), isEmpty(i), eq(x, from(i)), eq(y, to(i)), x, y, i, h)
if1(true, b1, b2, b3, x, y, i, h) → true
if1(false, b1, b2, b3, x, y, i, h) → if2(b1, b2, b3, x, y, i, h)
if2(true, b2, b3, x, y, i, h) → false
if2(false, b2, b3, x, y, i, h) → if3(b2, b3, x, y, i, h)
if3(false, b3, x, y, i, h) → reach(x, y, rest(i), edge(from(i), to(i), h))
if3(true, b3, x, y, i, h) → if4(b3, x, y, i, h)
if4(true, x, y, i, h) → true
if4(false, x, y, i, h) → or(reach(x, y, rest(i), h), reach(to(i), y, union(rest(i), h), empty))

The set Q consists of the following terms:

eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
or(true, x0)
or(false, x0)
union(empty, x0)
union(edge(x0, x1, x2), x3)
isEmpty(empty)
isEmpty(edge(x0, x1, x2))
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
reach(x0, x1, x2, x3)
if1(true, x0, x1, x2, x3, x4, x5, x6)
if1(false, x0, x1, x2, x3, x4, x5, x6)
if2(true, x0, x1, x2, x3, x4, x5)
if2(false, x0, x1, x2, x3, x4, x5)
if3(false, x0, x1, x2, x3, x4)
if3(true, x0, x1, x2, x3, x4)
if4(true, x0, x1, x2, x3)
if4(false, x0, x1, x2, x3)

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