1 package DX::SearchProcess;
6 has current_search_state => (
7 is => 'ro', isa => SearchState, required => 1,
9 current_hypothesis next_step propositions alternatives
14 my ($class, $hyp, $props) = @_;
16 current_search_state => DX::SearchState->new_for($hyp, $props),
22 my $new_ss = $self->current_search_state->with_one_step;
23 return undef unless $new_ss;
24 return $self->but(current_search_state => $new_ss);
29 my $state = $self->current_search_state;
30 while ($state and $state->next_proposition) {
31 $state = $state->with_one_step;
33 return undef unless $state;
34 trace 'search.solution.hyp' => $state->current_hypothesis;
35 return $self->but(current_search_state => $state);
40 my $new_ss = $self->current_search_state->force_backtrack;
41 return undef unless $new_ss;
42 return $self->but(current_search_state => $new_ss);
45 sub find_next_solution {
47 return undef unless my $bt = $self->force_backtrack;
48 return $bt->find_solution;