my ($self) = @_;
my $hyp = $self->current_hypothesis;
return undef unless my $step = $self->next_step;
- my ($first_alt, @rest_alt) = my @alt = @{$self->alternatives};
my ($new_ss, $alt_step) = $step->apply_to($self);
- my $new_hyp = ($new_ss ? $new_ss->current_hypothesis : undef);
- if ($new_hyp) {
- return $self->but(
- current_hypothesis => $new_hyp,
+ if ($new_ss) {
+ return $new_ss->but(
alternatives => [
($alt_step
? [ $hyp, $alt_step ]
: ()),
- @alt
+ @{$new_ss->alternatives}
],
next_step => DX::Step::InvokeNextPredicate->new(
- proposition => $self->next_proposition($new_hyp),
+ proposition => $new_ss->next_proposition,
),
);
}
if ($alt_step) {
return $self->but(next_step => $alt_step);
}
+ my ($first_alt, @rest_alt) = @{$self->alternatives};
return undef unless $first_alt;
trace 'search.backtrack.rewind_to' => $first_alt->[1];
return $self->but(