use is_solution_state flag in find_solution
[scpubgit/DX.git] / lib / DX / SearchProcess.pm
index 437f71d..cb50a2f 100644 (file)
@@ -27,7 +27,7 @@ sub with_one_step {
 sub find_solution {
   my ($self) = @_;
   my $state = $self->current_search_state;
-  while ($state and $state->next_proposition) {
+  while ($state and (not $state->is_solution_state)) {
     $state = $state->with_one_step;
   }
   return undef unless $state;