sub new_for {
my ($class, $hyp, $props) = @_;
$class->new(
- current_search_state => DX::SearchState->new(
- current_hypothesis => $hyp,
- alternatives => [],
- next_step => DX::Step::InvokeNextPredicate->new(
- proposition => $props->members->[0],
- ),
- propositions => $props,
- ),
+ current_search_state => DX::SearchState->new_for($hyp, $props),
);
}
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;