YES
0 QTRS
↳1 Overlay + Local Confluence (⇔, 0 ms)
↳2 QTRS
↳3 DependencyPairsProof (⇔, 0 ms)
↳4 QDP
↳5 DependencyGraphProof (⇔, 0 ms)
↳6 AND
↳7 QDP
↳8 UsableRulesProof (⇔, 0 ms)
↳9 QDP
↳10 QReductionProof (⇔, 0 ms)
↳11 QDP
↳12 QDPSizeChangeProof (⇔, 0 ms)
↳13 YES
↳14 QDP
↳15 UsableRulesProof (⇔, 0 ms)
↳16 QDP
↳17 QReductionProof (⇔, 0 ms)
↳18 QDP
↳19 QDPSizeChangeProof (⇔, 0 ms)
↳20 YES
↳21 QDP
↳22 UsableRulesProof (⇔, 0 ms)
↳23 QDP
↳24 QReductionProof (⇔, 0 ms)
↳25 QDP
↳26 QDPQMonotonicMRRProof (⇔, 35 ms)
↳27 QDP
↳28 TransformationProof (⇔, 0 ms)
↳29 QDP
↳30 DependencyGraphProof (⇔, 0 ms)
↳31 QDP
↳32 TransformationProof (⇔, 0 ms)
↳33 QDP
↳34 TransformationProof (⇔, 0 ms)
↳35 QDP
↳36 TransformationProof (⇔, 0 ms)
↳37 QDP
↳38 TransformationProof (⇔, 0 ms)
↳39 QDP
↳40 TransformationProof (⇔, 0 ms)
↳41 QDP
↳42 TransformationProof (⇔, 1 ms)
↳43 QDP
↳44 TransformationProof (⇔, 0 ms)
↳45 QDP
↳46 TransformationProof (⇔, 0 ms)
↳47 QDP
↳48 DependencyGraphProof (⇔, 0 ms)
↳49 AND
↳50 QDP
↳51 TransformationProof (⇔, 0 ms)
↳52 QDP
↳53 TransformationProof (⇔, 0 ms)
↳54 QDP
↳55 UsableRulesProof (⇔, 0 ms)
↳56 QDP
↳57 QReductionProof (⇔, 0 ms)
↳58 QDP
↳59 TransformationProof (⇔, 0 ms)
↳60 QDP
↳61 TransformationProof (⇔, 0 ms)
↳62 QDP
↳63 TransformationProof (⇔, 0 ms)
↳64 QDP
↳65 DependencyGraphProof (⇔, 0 ms)
↳66 QDP
↳67 TransformationProof (⇔, 0 ms)
↳68 QDP
↳69 UsableRulesProof (⇔, 0 ms)
↳70 QDP
↳71 QReductionProof (⇔, 0 ms)
↳72 QDP
↳73 TransformationProof (⇔, 0 ms)
↳74 QDP
↳75 UsableRulesProof (⇔, 0 ms)
↳76 QDP
↳77 QReductionProof (⇔, 0 ms)
↳78 QDP
↳79 TransformationProof (⇔, 0 ms)
↳80 QDP
↳81 DependencyGraphProof (⇔, 0 ms)
↳82 QDP
↳83 UsableRulesProof (⇔, 0 ms)
↳84 QDP
↳85 QReductionProof (⇔, 0 ms)
↳86 QDP
↳87 TransformationProof (⇔, 0 ms)
↳88 QDP
↳89 TransformationProof (⇔, 0 ms)
↳90 QDP
↳91 TransformationProof (⇔, 0 ms)
↳92 QDP
↳93 TransformationProof (⇔, 0 ms)
↳94 QDP
↳95 TransformationProof (⇔, 0 ms)
↳96 QDP
↳97 TransformationProof (⇔, 0 ms)
↳98 QDP
↳99 TransformationProof (⇔, 0 ms)
↳100 QDP
↳101 TransformationProof (⇔, 0 ms)
↳102 QDP
↳103 TransformationProof (⇔, 0 ms)
↳104 QDP
↳105 QDPQMonotonicMRRProof (⇔, 0 ms)
↳106 QDP
↳107 DependencyGraphProof (⇔, 0 ms)
↳108 QDP
↳109 QDPQMonotonicMRRProof (⇔, 19 ms)
↳110 QDP
↳111 DependencyGraphProof (⇔, 0 ms)
↳112 TRUE
↳113 QDP
↳114 TransformationProof (⇔, 0 ms)
↳115 QDP
↳116 TransformationProof (⇔, 0 ms)
↳117 QDP
↳118 TransformationProof (⇔, 0 ms)
↳119 QDP
↳120 TransformationProof (⇔, 0 ms)
↳121 QDP
↳122 TransformationProof (⇔, 0 ms)
↳123 QDP
↳124 DependencyGraphProof (⇔, 0 ms)
↳125 QDP
↳126 TransformationProof (⇔, 0 ms)
↳127 QDP
↳128 TransformationProof (⇔, 0 ms)
↳129 QDP
↳130 TransformationProof (⇔, 0 ms)
↳131 QDP
↳132 DependencyGraphProof (⇔, 0 ms)
↳133 QDP
↳134 TransformationProof (⇔, 0 ms)
↳135 QDP
↳136 TransformationProof (⇔, 0 ms)
↳137 QDP
↳138 TransformationProof (⇔, 0 ms)
↳139 QDP
↳140 TransformationProof (⇔, 0 ms)
↳141 QDP
↳142 TransformationProof (⇔, 0 ms)
↳143 QDP
↳144 UsableRulesProof (⇔, 0 ms)
↳145 QDP
↳146 QReductionProof (⇔, 0 ms)
↳147 QDP
↳148 TransformationProof (⇔, 0 ms)
↳149 QDP
↳150 TransformationProof (⇔, 0 ms)
↳151 QDP
↳152 TransformationProof (⇔, 0 ms)
↳153 QDP
↳154 TransformationProof (⇔, 0 ms)
↳155 QDP
↳156 DependencyGraphProof (⇔, 0 ms)
↳157 QDP
↳158 TransformationProof (⇔, 0 ms)
↳159 QDP
↳160 UsableRulesProof (⇔, 0 ms)
↳161 QDP
↳162 QReductionProof (⇔, 0 ms)
↳163 QDP
↳164 TransformationProof (⇔, 0 ms)
↳165 QDP
↳166 UsableRulesProof (⇔, 0 ms)
↳167 QDP
↳168 QReductionProof (⇔, 0 ms)
↳169 QDP
↳170 TransformationProof (⇔, 0 ms)
↳171 QDP
↳172 DependencyGraphProof (⇔, 0 ms)
↳173 QDP
↳174 UsableRulesProof (⇔, 0 ms)
↳175 QDP
↳176 QReductionProof (⇔, 0 ms)
↳177 QDP
↳178 TransformationProof (⇔, 0 ms)
↳179 QDP
↳180 TransformationProof (⇔, 0 ms)
↳181 QDP
↳182 TransformationProof (⇔, 0 ms)
↳183 QDP
↳184 TransformationProof (⇔, 0 ms)
↳185 QDP
↳186 TransformationProof (⇔, 0 ms)
↳187 QDP
↳188 TransformationProof (⇔, 0 ms)
↳189 QDP
↳190 TransformationProof (⇔, 0 ms)
↳191 QDP
↳192 TransformationProof (⇔, 0 ms)
↳193 QDP
↳194 TransformationProof (⇔, 0 ms)
↳195 QDP
↳196 TransformationProof (⇔, 0 ms)
↳197 QDP
↳198 TransformationProof (⇔, 0 ms)
↳199 QDP
↳200 TransformationProof (⇔, 0 ms)
↳201 QDP
↳202 TransformationProof (⇔, 0 ms)
↳203 QDP
↳204 TransformationProof (⇔, 0 ms)
↳205 QDP
↳206 TransformationProof (⇔, 0 ms)
↳207 QDP
↳208 TransformationProof (⇔, 0 ms)
↳209 QDP
↳210 TransformationProof (⇔, 0 ms)
↳211 QDP
↳212 TransformationProof (⇔, 0 ms)
↳213 QDP
↳214 TransformationProof (⇔, 0 ms)
↳215 QDP
↳216 TransformationProof (⇔, 0 ms)
↳217 QDP
↳218 TransformationProof (⇔, 0 ms)
↳219 QDP
↳220 TransformationProof (⇔, 0 ms)
↳221 QDP
↳222 QDPQMonotonicMRRProof (⇔, 96 ms)
↳223 QDP
↳224 DependencyGraphProof (⇔, 0 ms)
↳225 AND
↳226 QDP
↳227 UsableRulesProof (⇔, 0 ms)
↳228 QDP
↳229 QReductionProof (⇔, 0 ms)
↳230 QDP
↳231 QDPSizeChangeProof (⇔, 0 ms)
↳232 YES
↳233 QDP
↳234 UsableRulesProof (⇔, 0 ms)
↳235 QDP
↳236 QReductionProof (⇔, 0 ms)
↳237 QDP
↳238 QDPSizeChangeProof (⇔, 0 ms)
↳239 YES
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))
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))
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)
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)
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))
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)
UNION(edge(x, y, i), h) → UNION(i, h)
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))
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)
UNION(edge(x, y, i), h) → UNION(i, h)
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)
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)
UNION(edge(x, y, i), h) → UNION(i, h)
From the DPs we obtained the following set of size-change graphs:
EQ(s(x), s(y)) → EQ(x, y)
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))
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)
EQ(s(x), s(y)) → EQ(x, y)
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)
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)
EQ(s(x), s(y)) → EQ(x, y)
From the DPs we obtained the following set of size-change graphs:
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)
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))
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)
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)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
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)
or(true, x0)
or(false, x0)
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)
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)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(empty) → true
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
isEmpty(empty) → true
POL(0) = 0
POL(IF1(x1, x2, x3, x4, x5, x6, x7, x8)) = x2
POL(IF2(x1, x2, x3, x4, x5, x6, x7)) = x1
POL(IF3(x1, x2, x3, x4, x5, x6)) = 1
POL(IF4(x1, x2, x3, x4, x5)) = 1
POL(REACH(x1, x2, x3, x4)) = 1
POL(edge(x1, x2, x3)) = 2·x1 + x2 + x3
POL(empty) = 0
POL(eq(x1, x2)) = 2
POL(false) = 1
POL(from(x1)) = 2 + x1
POL(isEmpty(x1)) = 1
POL(rest(x1)) = 2 + x1
POL(s(x1)) = x1
POL(to(x1)) = 1 + x1
POL(true) = 0
POL(union(x1, x2)) = 2·x1 + x2
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)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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(0, 0, y2, y3) → IF1(true, isEmpty(y2), eq(0, from(y2)), eq(0, to(y2)), 0, 0, y2, y3) → REACH(0, 0, y2, y3) → IF1(true, isEmpty(y2), eq(0, from(y2)), eq(0, to(y2)), 0, 0, y2, y3)
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3) → REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3) → REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3) → REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
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)
REACH(0, 0, y2, y3) → IF1(true, isEmpty(y2), eq(0, from(y2)), eq(0, to(y2)), 0, 0, y2, y3)
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
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))
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
IF1(false, b1, b2, b3, x, y, i, h) → IF2(b1, b2, b3, x, y, i, h)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
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)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF4(false, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(rest(edge(x0, x1, x2)), y3), empty) → IF4(false, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(rest(edge(x0, x1, x2)), y3), empty)
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))
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
IF1(false, b1, b2, b3, x, y, i, h) → IF2(b1, b2, b3, x, y, i, h)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
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, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(rest(edge(x0, x1, x2)), y3), empty)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF4(false, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(x2, y3), empty) → IF4(false, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(x2, y3), empty)
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))
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
IF1(false, b1, b2, b3, x, y, i, h) → IF2(b1, b2, b3, x, y, i, h)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
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, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(x2, y3), empty)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF1(false, y_0, y_2, y_4, 0, s(z0), z1, z2) → IF2(y_0, y_2, y_4, 0, s(z0), z1, z2) → IF1(false, y_0, y_2, y_4, 0, s(z0), z1, z2) → IF2(y_0, y_2, y_4, 0, s(z0), z1, z2)
IF1(false, y_0, y_2, y_4, s(z0), 0, z1, z2) → IF2(y_0, y_2, y_4, s(z0), 0, z1, z2) → IF1(false, y_0, y_2, y_4, s(z0), 0, z1, z2) → IF2(y_0, y_2, y_4, s(z0), 0, z1, z2)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
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))
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
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, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(x2, y3), empty)
IF1(false, y_0, y_2, y_4, 0, s(z0), z1, z2) → IF2(y_0, y_2, y_4, 0, s(z0), z1, z2)
IF1(false, y_0, y_2, y_4, s(z0), 0, z1, z2) → IF2(y_0, y_2, y_4, s(z0), 0, z1, z2)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5) → IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5) → IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6) → IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, b3, x, y, i, h) → REACH(x, y, rest(i), edge(from(i), to(i), h))
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
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, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(x2, y3), empty)
IF1(false, y_0, y_2, y_4, 0, s(z0), z1, z2) → IF2(y_0, y_2, y_4, 0, s(z0), z1, z2)
IF1(false, y_0, y_2, y_4, s(z0), 0, z1, z2) → IF2(y_0, y_2, y_4, s(z0), 0, z1, z2)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4)) → IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4)) → IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5)) → IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
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, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(x2, y3), empty)
IF1(false, y_0, y_2, y_4, 0, s(z0), z1, z2) → IF2(y_0, y_2, y_4, 0, s(z0), z1, z2)
IF1(false, y_0, y_2, y_4, s(z0), 0, z1, z2) → IF2(y_0, y_2, y_4, s(z0), 0, z1, z2)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4) → IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4) → IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5) → IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF4(false, x, y, i, h) → REACH(x, y, rest(i), h)
IF4(false, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(x2, y3), empty)
IF1(false, y_0, y_2, y_4, 0, s(z0), z1, z2) → IF2(y_0, y_2, y_4, 0, s(z0), z1, z2)
IF1(false, y_0, y_2, y_4, s(z0), 0, z1, z2) → IF2(y_0, y_2, y_4, s(z0), 0, z1, z2)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3) → IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3) → IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4) → IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF4(false, y0, y1, edge(x0, x1, x2), y3) → REACH(x1, y1, union(x2, y3), empty)
IF1(false, y_0, y_2, y_4, 0, s(z0), z1, z2) → IF2(y_0, y_2, y_4, 0, s(z0), z1, z2)
IF1(false, y_0, y_2, y_4, s(z0), 0, z1, z2) → IF2(y_0, y_2, y_4, s(z0), 0, z1, z2)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty) → IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty) → IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty) → IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_0, y_2, y_4, 0, s(z0), z1, z2) → IF2(y_0, y_2, y_4, 0, s(z0), z1, z2)
IF1(false, y_0, y_2, y_4, s(z0), 0, z1, z2) → IF2(y_0, y_2, y_4, s(z0), 0, z1, z2)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF1(false, y_0, y_2, y_4, s(z0), 0, z1, z2) → IF2(y_0, y_2, y_4, s(z0), 0, z1, z2)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5) → IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
REACH(s(x0), 0, y2, y3) → IF1(false, isEmpty(y2), eq(s(x0), from(y2)), eq(0, to(y2)), s(x0), 0, y2, y3)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), from(edge(x0, x1, x2))), eq(0, to(edge(x0, x1, x2))), s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), from(edge(x0, x1, x2))), eq(0, to(edge(x0, x1, x2))), s(y0), 0, edge(x0, x1, x2), y2)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), from(edge(x0, x1, x2))), eq(0, to(edge(x0, x1, x2))), s(y0), 0, edge(x0, x1, x2), y2)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), from(edge(x0, x1, x2))), eq(0, to(edge(x0, x1, x2))), s(y0), 0, edge(x0, x1, x2), y2)
from(edge(x, y, i)) → x
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
to(edge(x, y, i)) → y
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
isEmpty(empty)
isEmpty(edge(x0, x1, x2))
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), from(edge(x0, x1, x2))), eq(0, to(edge(x0, x1, x2))), s(y0), 0, edge(x0, x1, x2), y2)
from(edge(x, y, i)) → x
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
to(edge(x, y, i)) → y
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, to(edge(x0, x1, x2))), s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, to(edge(x0, x1, x2))), s(y0), 0, edge(x0, x1, x2), y2)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, to(edge(x0, x1, x2))), s(y0), 0, edge(x0, x1, x2), y2)
from(edge(x, y, i)) → x
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
to(edge(x, y, i)) → y
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(false, z1, s(z2), 0, z3, z4) → REACH(s(z2), 0, rest(z3), edge(from(z3), to(z3), z4))
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
from(edge(x, y, i)) → x
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
to(edge(x, y, i)) → y
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y3)) → IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y3))
IF3(false, y0, s(y1), 0, empty, y3) → REACH(s(y1), 0, empty, edge(from(empty), to(empty), y3)) → IF3(false, y0, s(y1), 0, empty, y3) → REACH(s(y1), 0, empty, edge(from(empty), to(empty), y3))
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y3))
IF3(false, y0, s(y1), 0, empty, y3) → REACH(s(y1), 0, empty, edge(from(empty), to(empty), y3))
from(edge(x, y, i)) → x
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
to(edge(x, y, i)) → y
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y3))
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
from(edge(x, y, i)) → x
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
to(edge(x, y, i)) → y
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, to(edge(x0, x1, x2)), y3)) → IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, to(edge(x0, x1, x2)), y3))
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, to(edge(x0, x1, x2)), y3))
from(edge(x, y, i)) → x
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
to(edge(x, y, i)) → y
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, to(edge(x0, x1, x2)), y3))
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
from(edge(x0, x1, x2))
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, to(edge(x0, x1, x2)), y3))
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3)) → IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
to(edge(x0, x1, x2))
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(z1), 0, z2, z3) → REACH(s(z1), 0, rest(z2), z3)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
rest(edge(x0, x1, x2))
rest(empty)
IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2) → IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2)
IF4(false, s(y0), 0, empty, y2) → REACH(s(y0), 0, empty, y2) → IF4(false, s(y0), 0, empty, y2) → REACH(s(y0), 0, empty, y2)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2)
IF4(false, s(y0), 0, empty, y2) → REACH(s(y0), 0, empty, y2)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
rest(edge(x0, x1, x2))
rest(empty)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
rest(edge(x0, x1, x2))
rest(empty)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
rest(edge(x0, x1, x2))
rest(empty)
rest(edge(x0, x1, x2))
rest(empty)
IF4(false, s(z1), 0, edge(x2, x3, x4), z3) → REACH(x3, 0, union(x4, z3), empty)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, s(y0), 0, edge(y1, y2, empty), x0) → REACH(y2, 0, x0, empty) → IF4(false, s(y0), 0, edge(y1, y2, empty), x0) → REACH(y2, 0, x0, empty)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty) → IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, s(x3), 0, x4, x5) → IF2(false, x1, x2, s(x3), 0, x4, x5)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
IF4(false, s(y0), 0, edge(y1, y2, empty), x0) → REACH(y2, 0, x0, empty)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF2(false, z1, z2, s(z3), 0, z4, z5) → IF3(z1, z2, s(z3), 0, z4, z5)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
IF4(false, s(y0), 0, edge(y1, y2, empty), x0) → REACH(y2, 0, x0, empty)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF2(false, z0, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF3(z0, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF2(false, z0, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF3(z0, z1, s(z2), 0, edge(z3, z4, z5), z6)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF3(true, z1, s(z2), 0, z3, z4) → IF4(z1, s(z2), 0, z3, z4)
IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
IF4(false, s(y0), 0, edge(y1, y2, empty), x0) → REACH(y2, 0, x0, empty)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF2(false, z0, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF3(z0, z1, s(z2), 0, edge(z3, z4, z5), z6)
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(true, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF4(z1, s(z2), 0, edge(z3, z4, z5), z6) → IF3(true, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF4(z1, s(z2), 0, edge(z3, z4, z5), z6)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF4(false, s(y0), 0, edge(x0, x1, x2), y2) → REACH(s(y0), 0, x2, y2)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
IF4(false, s(y0), 0, edge(y1, y2, empty), x0) → REACH(y2, 0, x0, empty)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF2(false, z0, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF3(z0, z1, s(z2), 0, edge(z3, z4, z5), z6)
IF3(true, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF4(z1, s(z2), 0, edge(z3, z4, z5), z6)
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, s(x0), 0, edge(x1, x2, edge(y_1, y_2, y_3)), x4) → REACH(s(x0), 0, edge(y_1, y_2, y_3), x4) → IF4(false, s(x0), 0, edge(x1, x2, edge(y_1, y_2, y_3)), x4) → REACH(s(x0), 0, edge(y_1, y_2, y_3), x4)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF3(false, y0, s(y1), 0, edge(x0, x1, x2), y3) → REACH(s(y1), 0, x2, edge(x0, x1, y3))
IF4(false, s(y0), 0, edge(y1, y2, empty), x0) → REACH(y2, 0, x0, empty)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF2(false, z0, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF3(z0, z1, s(z2), 0, edge(z3, z4, z5), z6)
IF3(true, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF4(z1, s(z2), 0, edge(z3, z4, z5), z6)
IF4(false, s(x0), 0, edge(x1, x2, edge(y_1, y_2, y_3)), x4) → REACH(s(x0), 0, edge(y_1, y_2, y_3), x4)
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(false, x0, s(x1), 0, edge(x2, x3, edge(y_1, y_2, y_3)), x5) → REACH(s(x1), 0, edge(y_1, y_2, y_3), edge(x2, x3, x5)) → IF3(false, x0, s(x1), 0, edge(x2, x3, edge(y_1, y_2, y_3)), x5) → REACH(s(x1), 0, edge(y_1, y_2, y_3), edge(x2, x3, x5))
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF4(false, s(y0), 0, edge(y1, y2, empty), x0) → REACH(y2, 0, x0, empty)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF2(false, z0, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF3(z0, z1, s(z2), 0, edge(z3, z4, z5), z6)
IF3(true, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF4(z1, s(z2), 0, edge(z3, z4, z5), z6)
IF4(false, s(x0), 0, edge(x1, x2, edge(y_1, y_2, y_3)), x4) → REACH(s(x0), 0, edge(y_1, y_2, y_3), x4)
IF3(false, x0, s(x1), 0, edge(x2, x3, edge(y_1, y_2, y_3)), x5) → REACH(s(x1), 0, edge(y_1, y_2, y_3), edge(x2, x3, x5))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, s(x0), 0, edge(x1, s(y_0), empty), edge(y_1, y_2, y_3)) → REACH(s(y_0), 0, edge(y_1, y_2, y_3), empty) → IF4(false, s(x0), 0, edge(x1, s(y_0), empty), edge(y_1, y_2, y_3)) → REACH(s(y_0), 0, edge(y_1, y_2, y_3), empty)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF2(false, z0, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF3(z0, z1, s(z2), 0, edge(z3, z4, z5), z6)
IF3(true, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF4(z1, s(z2), 0, edge(z3, z4, z5), z6)
IF4(false, s(x0), 0, edge(x1, x2, edge(y_1, y_2, y_3)), x4) → REACH(s(x0), 0, edge(y_1, y_2, y_3), x4)
IF3(false, x0, s(x1), 0, edge(x2, x3, edge(y_1, y_2, y_3)), x5) → REACH(s(x1), 0, edge(y_1, y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), 0, edge(x1, s(y_0), empty), edge(y_1, y_2, y_3)) → REACH(s(y_0), 0, edge(y_1, y_2, y_3), empty)
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF2(false, true, x1, s(x2), 0, edge(x3, x4, x5), x6) → IF3(true, x1, s(x2), 0, edge(x3, x4, x5), x6) → IF2(false, true, x1, s(x2), 0, edge(x3, x4, x5), x6) → IF3(true, x1, s(x2), 0, edge(x3, x4, x5), x6)
IF2(false, false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF3(false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF2(false, false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF3(false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF3(true, z1, s(z2), 0, edge(z3, z4, z5), z6) → IF4(z1, s(z2), 0, edge(z3, z4, z5), z6)
IF4(false, s(x0), 0, edge(x1, x2, edge(y_1, y_2, y_3)), x4) → REACH(s(x0), 0, edge(y_1, y_2, y_3), x4)
IF3(false, x0, s(x1), 0, edge(x2, x3, edge(y_1, y_2, y_3)), x5) → REACH(s(x1), 0, edge(y_1, y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), 0, edge(x1, s(y_0), empty), edge(y_1, y_2, y_3)) → REACH(s(y_0), 0, edge(y_1, y_2, y_3), empty)
IF2(false, true, x1, s(x2), 0, edge(x3, x4, x5), x6) → IF3(true, x1, s(x2), 0, edge(x3, x4, x5), x6)
IF2(false, false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF3(false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6)
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(true, false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5) → IF4(false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5) → IF3(true, false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5) → IF4(false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5)
IF3(true, false, s(x1), 0, edge(x2, s(y_2), empty), edge(y_3, y_4, y_5)) → IF4(false, s(x1), 0, edge(x2, s(y_2), empty), edge(y_3, y_4, y_5)) → IF3(true, false, s(x1), 0, edge(x2, s(y_2), empty), edge(y_3, y_4, y_5)) → IF4(false, s(x1), 0, edge(x2, s(y_2), empty), edge(y_3, y_4, y_5))
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF4(false, s(x0), 0, edge(x1, x2, edge(y_1, y_2, y_3)), x4) → REACH(s(x0), 0, edge(y_1, y_2, y_3), x4)
IF3(false, x0, s(x1), 0, edge(x2, x3, edge(y_1, y_2, y_3)), x5) → REACH(s(x1), 0, edge(y_1, y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), 0, edge(x1, s(y_0), empty), edge(y_1, y_2, y_3)) → REACH(s(y_0), 0, edge(y_1, y_2, y_3), empty)
IF2(false, true, x1, s(x2), 0, edge(x3, x4, x5), x6) → IF3(true, x1, s(x2), 0, edge(x3, x4, x5), x6)
IF2(false, false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF3(false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6)
IF3(true, false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5) → IF4(false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5)
IF3(true, false, s(x1), 0, edge(x2, s(y_2), empty), edge(y_3, y_4, y_5)) → IF4(false, s(x1), 0, edge(x2, s(y_2), empty), edge(y_3, y_4, y_5))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, s(x0), 0, edge(x1, x2, edge(y_1, y_2, y_3)), x4) → REACH(s(x0), 0, edge(y_1, y_2, y_3), x4)
IF4(false, s(x0), 0, edge(x1, s(y_0), empty), edge(y_1, y_2, y_3)) → REACH(s(y_0), 0, edge(y_1, y_2, y_3), empty)
union(empty, h) → h
POL(0) = 2
POL(IF1(x1, x2, x3, x4, x5, x6, x7, x8)) = 2·x1 + 2·x2 + 2·x5 + x7 + x8
POL(IF2(x1, x2, x3, x4, x5, x6, x7)) = 2 + 2·x1 + 2·x4 + x6 + x7
POL(IF3(x1, x2, x3, x4, x5, x6)) = 2 + 2·x3 + x4 + x5 + x6
POL(IF4(x1, x2, x3, x4, x5)) = 2·x1 + 2·x2 + x3 + x4 + x5
POL(REACH(x1, x2, x3, x4)) = 2·x1 + 2·x2 + x3 + x4
POL(edge(x1, x2, x3)) = 1 + 2·x2 + x3
POL(empty) = 1
POL(eq(x1, x2)) = 2·x1 + x2
POL(false) = 1
POL(s(x1)) = x1
POL(true) = 2
POL(union(x1, x2)) = x1 + x2
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF3(false, x0, s(x1), 0, edge(x2, x3, edge(y_1, y_2, y_3)), x5) → REACH(s(x1), 0, edge(y_1, y_2, y_3), edge(x2, x3, x5))
IF2(false, true, x1, s(x2), 0, edge(x3, x4, x5), x6) → IF3(true, x1, s(x2), 0, edge(x3, x4, x5), x6)
IF2(false, false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF3(false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6)
IF3(true, false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5) → IF4(false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5)
IF3(true, false, s(x1), 0, edge(x2, s(y_2), empty), edge(y_3, y_4, y_5)) → IF4(false, s(x1), 0, edge(x2, s(y_2), empty), edge(y_3, y_4, y_5))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF2(false, true, x1, s(x2), 0, edge(x3, x4, x5), x6) → IF3(true, x1, s(x2), 0, edge(x3, x4, x5), x6)
IF3(true, false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5) → IF4(false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF2(false, false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF3(false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6)
IF3(false, x0, s(x1), 0, edge(x2, x3, edge(y_1, y_2, y_3)), x5) → REACH(s(x1), 0, edge(y_1, y_2, y_3), edge(x2, x3, x5))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF2(false, true, x1, s(x2), 0, edge(x3, x4, x5), x6) → IF3(true, x1, s(x2), 0, edge(x3, x4, x5), x6)
IF3(true, false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5) → IF4(false, s(x1), 0, edge(x2, x3, edge(y_3, y_4, y_5)), x5)
IF2(false, false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF3(false, x1, s(x2), 0, edge(x3, x4, edge(y_4, y_5, y_6)), x6)
POL(0) = 1
POL(IF1(x1, x2, x3, x4, x5, x6, x7, x8)) = 1 + x1 + 2·x2 + x6 + 2·x7
POL(IF2(x1, x2, x3, x4, x5, x6, x7)) = 1 + x1 + x4 + 2·x5 + 2·x6
POL(IF3(x1, x2, x3, x4, x5, x6)) = 1 + 2·x4 + x5
POL(IF4(x1, x2, x3, x4, x5)) = 1 + x4
POL(REACH(x1, x2, x3, x4)) = 1 + 2·x1 + 2·x2 + 2·x3
POL(edge(x1, x2, x3)) = 2 + 2·x2 + 2·x3
POL(empty) = 0
POL(eq(x1, x2)) = 2
POL(false) = 1
POL(s(x1)) = 1
POL(true) = 2
POL(union(x1, x2)) = x1
IF1(false, false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, s(z0), 0, edge(z1, z2, z3), z4)
IF4(false, s(y0), 0, edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, 0, edge(x0, x1, union(x2, x3)), empty)
REACH(s(y0), 0, edge(x0, x1, x2), y2) → IF1(false, false, eq(s(y0), x0), eq(0, x1), s(y0), 0, edge(x0, x1, x2), y2)
IF3(false, x0, s(x1), 0, edge(x2, x3, edge(y_1, y_2, y_3)), x5) → REACH(s(x1), 0, edge(y_1, y_2, y_3), edge(x2, x3, x5))
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF1(false, y_0, y_2, y_4, 0, s(z0), z1, z2) → IF2(y_0, y_2, y_4, 0, s(z0), z1, z2)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5) → IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
REACH(0, s(x0), y2, y3) → IF1(false, isEmpty(y2), eq(0, from(y2)), eq(s(x0), to(y2)), 0, s(x0), y2, y3)
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, from(edge(x0, x1, x2))), eq(s(y0), to(edge(x0, x1, x2))), 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, from(edge(x0, x1, x2))), eq(s(y0), to(edge(x0, x1, x2))), 0, s(y0), edge(x0, x1, x2), y2)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, from(edge(x0, x1, x2))), eq(s(y0), to(edge(x0, x1, x2))), 0, s(y0), edge(x0, x1, x2), y2)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), to(edge(x0, x1, x2))), 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), to(edge(x0, x1, x2))), 0, s(y0), edge(x0, x1, x2), y2)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), to(edge(x0, x1, x2))), 0, s(y0), edge(x0, x1, x2), y2)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF3(false, z1, 0, s(z2), z3, z4) → REACH(0, s(z2), rest(z3), edge(from(z3), to(z3), z4))
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y3)) → IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y3))
IF3(false, y0, 0, s(y1), empty, y3) → REACH(0, s(y1), empty, edge(from(empty), to(empty), y3)) → IF3(false, y0, 0, s(y1), empty, y3) → REACH(0, s(y1), empty, edge(from(empty), to(empty), y3))
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y3))
IF3(false, y0, 0, s(y1), empty, y3) → REACH(0, s(y1), empty, edge(from(empty), to(empty), y3))
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y3))
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, to(edge(x0, x1, x2)), y3)) → IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, to(edge(x0, x1, x2)), y3))
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, to(edge(x0, x1, x2)), y3))
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3)) → IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(z1), z2, z3) → REACH(0, s(z1), rest(z2), z3)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2) → IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), empty, y2) → REACH(0, s(y0), empty, y2) → IF4(false, 0, s(y0), empty, y2) → REACH(0, s(y0), empty, y2)
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), empty, y2) → REACH(0, s(y0), empty, y2)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, x1, x2, 0, s(x3), x4, x5) → IF2(false, x1, x2, 0, s(x3), x4, x5)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF2(false, z1, z2, 0, s(z3), z4, z5) → IF3(z1, z2, 0, s(z3), z4, z5)
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF3(true, z1, 0, s(z2), z3, z4) → IF4(z1, 0, s(z2), z3, z4)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF1(false, y_1, y_3, y_5, s(z0), s(z1), z2, z3) → IF2(y_1, y_3, y_5, s(z0), s(z1), z2, z3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6) → IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
REACH(s(x0), s(x1), y2, y3) → IF1(eq(x0, x1), isEmpty(y2), eq(s(x0), from(y2)), eq(s(x1), to(y2)), s(x0), s(x1), y2, y3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), from(edge(x0, x1, x2))), eq(s(y1), to(edge(x0, x1, x2))), s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), from(edge(x0, x1, x2))), eq(s(y1), to(edge(x0, x1, x2))), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), from(edge(x0, x1, x2))), eq(s(y1), to(edge(x0, x1, x2))), s(y0), s(y1), edge(x0, x1, x2), y3)
to(edge(x, y, i)) → y
rest(edge(x, y, i)) → i
rest(empty) → empty
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
from(edge(x, y, i)) → x
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
isEmpty(edge(x, y, i)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), from(edge(x0, x1, x2))), eq(s(y1), to(edge(x0, x1, x2))), s(y0), s(y1), edge(x0, x1, x2), y3)
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
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)
isEmpty(empty)
isEmpty(edge(x0, x1, x2))
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), from(edge(x0, x1, x2))), eq(s(y1), to(edge(x0, x1, x2))), s(y0), s(y1), edge(x0, x1, x2), y3)
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), to(edge(x0, x1, x2))), s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), to(edge(x0, x1, x2))), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), to(edge(x0, x1, x2))), s(y0), s(y1), edge(x0, x1, x2), y3)
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, 0, s(z1), edge(x2, x3, x4), z3) → REACH(x3, s(z1), union(x4, z3), empty)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty) → IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty) → IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, z1, s(z2), s(z3), z4, z5) → REACH(s(z2), s(z3), rest(z4), edge(from(z4), to(z4), z5))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y4)) → IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y4))
IF3(false, y0, s(y1), s(y2), empty, y4) → REACH(s(y1), s(y2), empty, edge(from(empty), to(empty), y4)) → IF3(false, y0, s(y1), s(y2), empty, y4) → REACH(s(y1), s(y2), empty, edge(from(empty), to(empty), y4))
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y4))
IF3(false, y0, s(y1), s(y2), empty, y4) → REACH(s(y1), s(y2), empty, edge(from(empty), to(empty), y4))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(from(edge(x0, x1, x2)), to(edge(x0, x1, x2)), y4))
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, to(edge(x0, x1, x2)), y4)) → IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, to(edge(x0, x1, x2)), y4))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, to(edge(x0, x1, x2)), y4))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
from(edge(x, y, i)) → x
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, to(edge(x0, x1, x2)), y4))
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
from(edge(x0, x1, x2))
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
from(edge(x0, x1, x2))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, to(edge(x0, x1, x2)), y4))
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4)) → IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
to(edge(x, y, i)) → y
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
to(edge(x0, x1, x2))
rest(edge(x0, x1, x2))
rest(empty)
to(edge(x0, x1, x2))
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(z1), s(z2), z3, z4) → REACH(s(z1), s(z2), rest(z3), z4)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
rest(edge(x0, x1, x2))
rest(empty)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3) → IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF4(false, s(y0), s(y1), empty, y3) → REACH(s(y0), s(y1), empty, y3) → IF4(false, s(y0), s(y1), empty, y3) → REACH(s(y0), s(y1), empty, y3)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF4(false, s(y0), s(y1), empty, y3) → REACH(s(y0), s(y1), empty, y3)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
rest(edge(x0, x1, x2))
rest(empty)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
rest(edge(x, y, i)) → i
rest(empty) → empty
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
rest(edge(x0, x1, x2))
rest(empty)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
rest(edge(x0, x1, x2))
rest(empty)
rest(edge(x0, x1, x2))
rest(empty)
IF4(false, s(z1), s(z2), edge(x2, x3, x4), z4) → REACH(x3, s(z2), union(x4, z4), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty) → IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty) → IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, x1, x2, s(x3), s(x4), x5, x6) → IF2(false, x1, x2, s(x3), s(x4), x5, x6)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF2(false, z1, z2, s(z3), s(z4), z5, z6) → IF3(z1, z2, s(z3), s(z4), z5, z6)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF3(true, z1, s(z2), s(z3), z4, z5) → IF4(z1, s(z2), s(z3), z4, z5)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF2(false, z0, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF3(z0, z1, 0, s(z2), edge(z3, z4, z5), z6)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(true, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF1(false, false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4) → IF2(false, y_0, y_1, 0, s(z0), edge(z1, z2, z3), z4)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(true, x1, 0, s(x2), edge(x3, x4, x5), x6)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF1(false, false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(x0, x1, x2), y2) → IF1(false, false, eq(0, x0), eq(s(y0), x1), 0, s(y0), edge(x0, x1, x2), y2)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(true, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4) → REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4) → REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(true, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF2(false, true, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(true, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF3(true, z1, 0, s(z2), edge(z3, z4, z5), z6) → IF4(z1, 0, s(z2), edge(z3, z4, z5), z6)
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF4(false, 0, s(y0), edge(x0, x1, x2), y2) → REACH(0, s(y0), x2, y2)
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4) → IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
IF4(false, 0, s(y0), edge(y1, y2, empty), x0) → REACH(y2, s(y0), x0, empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty) → IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, 0, s(y0), edge(y1, y2, edge(x0, x1, x2)), x3) → REACH(y2, s(y0), edge(x0, x1, union(x2, x3)), empty)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty) → IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, y0, 0, s(y1), edge(x0, x1, x2), y3) → REACH(0, s(y1), x2, edge(x0, x1, y3))
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5)) → IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5)) → IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(x0, x1, x2), y3) → REACH(s(y0), s(y1), x2, y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5) → IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF3(false, y0, s(y1), s(y2), edge(x0, x1, x2), y4) → REACH(s(y1), s(y2), x2, edge(x0, x1, y4))
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6)) → IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(y2, y3, empty), x0) → REACH(y3, s(y1), x0, empty)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, s(x0), s(x1), edge(x2, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x1), edge(y_2, y_3, y_4), empty) → IF4(false, s(x0), s(x1), edge(x2, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x1), edge(y_2, y_3, y_4), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x1), edge(0, y_1, y_2), empty) → IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x1), edge(0, y_1, y_2), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), empty) → IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF3(z0, z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
IF4(false, s(x0), s(x1), edge(x2, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x1), edge(y_2, y_3, y_4), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x1), edge(0, y_1, y_2), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), empty)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF2(false, true, x1, s(x2), s(x3), edge(x4, x5, x6), x7) → IF3(true, x1, s(x2), s(x3), edge(x4, x5, x6), x7) → IF2(false, true, x1, s(x2), s(x3), edge(x4, x5, x6), x7) → IF3(true, x1, s(x2), s(x3), edge(x4, x5, x6), x7)
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF3(true, z1, s(z2), s(z3), edge(z4, z5, z6), z7) → IF4(z1, s(z2), s(z3), edge(z4, z5, z6), z7)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
IF4(false, s(x0), s(x1), edge(x2, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x1), edge(y_2, y_3, y_4), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x1), edge(0, y_1, y_2), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), empty)
IF2(false, true, x1, s(x2), s(x3), edge(x4, x5, x6), x7) → IF3(true, x1, s(x2), s(x3), edge(x4, x5, x6), x7)
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(true, false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF4(false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF3(true, false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF4(false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6)
IF3(true, false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6)) → IF4(false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6)) → IF3(true, false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6)) → IF4(false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4)) → IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5)) → IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5))
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF4(z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
IF4(false, s(x0), s(x1), edge(x2, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x1), edge(y_2, y_3, y_4), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x1), edge(0, y_1, y_2), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), empty)
IF2(false, true, x1, s(x2), s(x3), edge(x4, x5, x6), x7) → IF3(true, x1, s(x2), s(x3), edge(x4, x5, x6), x7)
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
IF3(true, false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF4(false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6)
IF3(true, false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6)) → IF4(false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5))
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(true, false, 0, s(x1), edge(0, x2, x3), x4) → IF4(false, 0, s(x1), edge(0, x2, x3), x4) → IF3(true, false, 0, s(x1), edge(0, x2, x3), x4) → IF4(false, 0, s(x1), edge(0, x2, x3), x4)
IF3(true, false, 0, s(x1), edge(0, x2, empty), x4) → IF4(false, 0, s(x1), edge(0, x2, empty), x4) → IF3(true, false, 0, s(x1), edge(0, x2, empty), x4) → IF4(false, 0, s(x1), edge(0, x2, empty), x4)
IF3(true, false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4) → IF4(false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4) → IF3(true, false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4) → IF4(false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, z3), z4) → REACH(0, s(z1), z3, z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
IF4(false, s(x0), s(x1), edge(x2, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x1), edge(y_2, y_3, y_4), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x1), edge(0, y_1, y_2), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), empty)
IF2(false, true, x1, s(x2), s(x3), edge(x4, x5, x6), x7) → IF3(true, x1, s(x2), s(x3), edge(x4, x5, x6), x7)
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
IF3(true, false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF4(false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6)
IF3(true, false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6)) → IF4(false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5))
IF3(true, false, 0, s(x1), edge(0, x2, x3), x4) → IF4(false, 0, s(x1), edge(0, x2, x3), x4)
IF3(true, false, 0, s(x1), edge(0, x2, empty), x4) → IF4(false, 0, s(x1), edge(0, x2, empty), x4)
IF3(true, false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4) → IF4(false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, 0, s(x0), edge(0, x1, edge(0, y_1, y_2)), x3) → REACH(0, s(x0), edge(0, y_1, y_2), x3) → IF4(false, 0, s(x0), edge(0, x1, edge(0, y_1, y_2)), x3) → REACH(0, s(x0), edge(0, y_1, y_2), x3)
IF4(false, 0, s(x0), edge(0, x1, edge(s(y_1), y_2, y_3)), x3) → REACH(0, s(x0), edge(s(y_1), y_2, y_3), x3) → IF4(false, 0, s(x0), edge(0, x1, edge(s(y_1), y_2, y_3)), x3) → REACH(0, s(x0), edge(s(y_1), y_2, y_3), x3)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, empty), z4) → REACH(z2, s(z1), z4, empty)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
IF4(false, s(x0), s(x1), edge(x2, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x1), edge(y_2, y_3, y_4), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x1), edge(0, y_1, y_2), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), empty)
IF2(false, true, x1, s(x2), s(x3), edge(x4, x5, x6), x7) → IF3(true, x1, s(x2), s(x3), edge(x4, x5, x6), x7)
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
IF3(true, false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF4(false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6)
IF3(true, false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6)) → IF4(false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5))
IF3(true, false, 0, s(x1), edge(0, x2, x3), x4) → IF4(false, 0, s(x1), edge(0, x2, x3), x4)
IF3(true, false, 0, s(x1), edge(0, x2, empty), x4) → IF4(false, 0, s(x1), edge(0, x2, empty), x4)
IF3(true, false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4) → IF4(false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4)
IF4(false, 0, s(x0), edge(0, x1, edge(0, y_1, y_2)), x3) → REACH(0, s(x0), edge(0, y_1, y_2), x3)
IF4(false, 0, s(x0), edge(0, x1, edge(s(y_1), y_2, y_3)), x3) → REACH(0, s(x0), edge(s(y_1), y_2, y_3), x3)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, 0, s(x0), edge(0, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x0), edge(y_2, y_3, y_4), empty) → IF4(false, 0, s(x0), edge(0, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x0), edge(y_2, y_3, y_4), empty)
IF4(false, 0, s(x0), edge(0, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x0), edge(0, y_1, y_2), empty) → IF4(false, 0, s(x0), edge(0, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x0), edge(0, y_1, y_2), empty)
IF4(false, 0, s(x0), edge(0, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x0), edge(s(y_1), y_2, y_3), empty) → IF4(false, 0, s(x0), edge(0, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x0), edge(s(y_1), y_2, y_3), empty)
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
IF4(false, s(x0), s(x1), edge(x2, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x1), edge(y_2, y_3, y_4), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x1), edge(0, y_1, y_2), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), empty)
IF2(false, true, x1, s(x2), s(x3), edge(x4, x5, x6), x7) → IF3(true, x1, s(x2), s(x3), edge(x4, x5, x6), x7)
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
IF3(true, false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF4(false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6)
IF3(true, false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6)) → IF4(false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5))
IF3(true, false, 0, s(x1), edge(0, x2, x3), x4) → IF4(false, 0, s(x1), edge(0, x2, x3), x4)
IF3(true, false, 0, s(x1), edge(0, x2, empty), x4) → IF4(false, 0, s(x1), edge(0, x2, empty), x4)
IF3(true, false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4) → IF4(false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4)
IF4(false, 0, s(x0), edge(0, x1, edge(0, y_1, y_2)), x3) → REACH(0, s(x0), edge(0, y_1, y_2), x3)
IF4(false, 0, s(x0), edge(0, x1, edge(s(y_1), y_2, y_3)), x3) → REACH(0, s(x0), edge(s(y_1), y_2, y_3), x3)
IF4(false, 0, s(x0), edge(0, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x0), edge(y_2, y_3, y_4), empty)
IF4(false, 0, s(x0), edge(0, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x0), edge(0, y_1, y_2), empty)
IF4(false, 0, s(x0), edge(0, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x0), edge(s(y_1), y_2, y_3), empty)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF4(false, s(y0), s(y1), edge(y2, y3, edge(x0, x1, x2)), x3) → REACH(y3, s(y1), edge(x0, x1, union(x2, x3)), empty)
IF2(false, true, z0, 0, s(z1), edge(0, z2, z3), z4) → IF3(true, z0, 0, s(z1), edge(0, z2, z3), z4)
IF4(false, 0, s(z1), edge(0, z2, edge(x3, x4, x5)), z4) → REACH(z2, s(z1), edge(x3, x4, union(x5, z4)), empty)
IF4(false, s(x0), s(x1), edge(x2, x3, edge(y_2, y_3, y_4)), x5) → REACH(s(x0), s(x1), edge(y_2, y_3, y_4), x5)
IF4(false, s(x0), s(x1), edge(x2, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x1), edge(y_2, y_3, y_4), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x1), edge(0, y_1, y_2), empty)
IF4(false, s(x0), s(x1), edge(x2, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), empty)
IF2(false, true, x1, s(x2), s(x3), edge(x4, x5, x6), x7) → IF3(true, x1, s(x2), s(x3), edge(x4, x5, x6), x7)
IF3(true, false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6) → IF4(false, s(x1), s(x2), edge(x3, x4, edge(y_4, y_5, y_6)), x6)
IF3(true, false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6)) → IF4(false, s(x1), s(x2), edge(x3, s(y_3), empty), edge(y_4, y_5, y_6))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(0, y_3, y_4))
IF3(true, false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5)) → IF4(false, s(x1), s(x2), edge(x3, 0, empty), edge(s(y_3), y_4, y_5))
IF4(false, 0, s(x0), edge(0, x1, edge(0, y_1, y_2)), x3) → REACH(0, s(x0), edge(0, y_1, y_2), x3)
IF4(false, 0, s(x0), edge(0, x1, edge(s(y_1), y_2, y_3)), x3) → REACH(0, s(x0), edge(s(y_1), y_2, y_3), x3)
IF4(false, 0, s(x0), edge(0, s(y_0), empty), edge(y_2, y_3, y_4)) → REACH(s(y_0), s(x0), edge(y_2, y_3, y_4), empty)
IF4(false, 0, s(x0), edge(0, 0, empty), edge(0, y_1, y_2)) → REACH(0, s(x0), edge(0, y_1, y_2), empty)
IF4(false, 0, s(x0), edge(0, 0, empty), edge(s(y_1), y_2, y_3)) → REACH(0, s(x0), edge(s(y_1), y_2, y_3), empty)
POL(0) = 2
POL(IF1(x1, x2, x3, x4, x5, x6, x7, x8)) = 2 + x2 + x5 + 2·x7 + 2·x8
POL(IF2(x1, x2, x3, x4, x5, x6, x7)) = 2·x1 + x4 + x5 + 2·x6 + 2·x7
POL(IF3(x1, x2, x3, x4, x5, x6)) = 2 + x1 + x3 + 2·x5 + 2·x6
POL(IF4(x1, x2, x3, x4, x5)) = 2·x2 + 2·x4 + 2·x5
POL(REACH(x1, x2, x3, x4)) = 2 + x1 + x2 + 2·x3 + 2·x4
POL(edge(x1, x2, x3)) = 2 + x2 + x3
POL(empty) = 0
POL(eq(x1, x2)) = 2
POL(false) = 1
POL(s(x1)) = 1
POL(true) = 0
POL(union(x1, x2)) = x1 + x2
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
REACH(0, s(y0), edge(0, y2, y3), y4) → IF1(false, false, true, eq(s(y0), y2), 0, s(y0), edge(0, y2, y3), y4)
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, true, y_0, 0, s(z0), edge(0, z1, z2), z3) → IF2(false, true, y_0, 0, s(z0), edge(0, z1, z2), z3)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(0, y_1, y_2)), x5) → REACH(0, s(x1), edge(0, y_1, y_2), edge(x2, x3, x5))
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
IF3(true, false, 0, s(x1), edge(0, x2, x3), x4) → IF4(false, 0, s(x1), edge(0, x2, x3), x4)
IF3(true, false, 0, s(x1), edge(0, x2, empty), x4) → IF4(false, 0, s(x1), edge(0, x2, empty), x4)
IF3(true, false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4) → IF4(false, 0, s(x1), edge(0, x2, edge(y_2, y_3, y_4)), x4)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF3(false, x0, 0, s(x1), edge(x2, x3, edge(s(y_1), y_2, y_3)), x5) → REACH(0, s(x1), edge(s(y_1), y_2, y_3), edge(x2, x3, x5))
REACH(0, s(y0), edge(s(x0), y2, y3), y4) → IF1(false, false, false, eq(s(y0), y2), 0, s(y0), edge(s(x0), y2, y3), y4)
IF1(false, false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6)
IF2(false, false, x1, 0, s(x2), edge(x3, x4, x5), x6) → IF3(false, x1, 0, s(x2), edge(x3, x4, x5), x6)
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0) → true
eq(0, s(x)) → false
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
From the DPs we obtained the following set of size-change graphs:
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
union(empty, h) → h
union(edge(x, y, i), h) → edge(x, y, union(i, h))
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
union(empty, x0)
union(edge(x0, x1, x2), x3)
union(empty, x0)
union(edge(x0, x1, x2), x3)
IF1(false, false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5) → IF2(false, y_1, y_2, s(z0), s(z1), edge(z2, z3, z4), z5)
IF2(false, false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7) → IF3(false, x1, s(x2), s(x3), edge(x4, x5, edge(y_5, y_6, y_7)), x7)
IF3(false, x0, s(x1), s(x2), edge(x3, x4, edge(y_2, y_3, y_4)), x6) → REACH(s(x1), s(x2), edge(y_2, y_3, y_4), edge(x3, x4, x6))
REACH(s(y0), s(y1), edge(x0, x1, x2), y3) → IF1(eq(y0, y1), false, eq(s(y0), x0), eq(s(y1), x1), s(y0), s(y1), edge(x0, x1, x2), y3)
eq(0, 0) → true
eq(0, s(x)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
eq(0, 0)
eq(0, s(x0))
eq(s(x0), 0)
eq(s(x0), s(x1))
From the DPs we obtained the following set of size-change graphs: