@@ 338-344 (lines=7) @@ | ||
335 | public function hasSolution(array $contextual_options=[]) |
|
336 | { |
|
337 | $operands = $this->getOperands(); |
|
338 | if ( (count($operands) == 1 && ! reset($operands)->hasSolution()) // skip simplification case after call of addMinimalCase() (which seems to have unwanted side effect) |
|
339 | && ! $this->simplicationStepReached(self::simplified)) { |
|
340 | throw new \LogicException( |
|
341 | "hasSolution has no sens if the rule is not simplified instead of being at: " |
|
342 | .var_export($this->current_simplification_step, true) |
|
343 | ); |
|
344 | } |
|
345 | ||
346 | // atomic rules |
|
347 | foreach ($operands as $operand) { |
@@ 282-288 (lines=7) @@ | ||
279 | } |
|
280 | ||
281 | $operands = $this->getOperands(); |
|
282 | if ( (count($operands) == 1 && ! reset($operands)->hasSolution()) // skip simplification case after call of addMinimalCase() (which seems to have unwanted side effect) |
|
283 | && ! $this->simplicationStepReached(self::simplified)) { |
|
284 | throw new \LogicException( |
|
285 | "hasSolution has no sens if the rule is not simplified instead of being at: " |
|
286 | .var_export($this->current_simplification_step, true) |
|
287 | ); |
|
288 | } |
|
289 | ||
290 | // If there is no remaining operand in an OrRule, it means it has |
|
291 | // no solution. |