sub apply_to {
my ($self, $ss) = @_;
- my $old_hyp = $ss->current_hypothesis;
- trace 'step.apply.old_hyp '.$self => $old_hyp;
+ trace 'step.apply.old_hyp '.$self => $ss->current_hypothesis;
trace 'step.apply.actions '.$self => $self->actions;
my $new_ss = $self->_apply_to_ss($ss);
return $ss->but(next_step => DX::Step::Backtrack->new) unless $new_ss;
- my $new_hyp = $new_ss->current_hypothesis;
- trace 'step.apply.new_hyp '.$self => $new_hyp;
+ trace 'step.apply.new_hyp '.$self => $new_ss->current_hypothesis;
my $ns = do {
- if (my $prop = $ss->next_proposition($new_hyp)) {
+ if (my $prop = $new_ss->next_proposition) {
DX::Step::ConsiderProposition->new(
proposition => $prop
)
} else {
- $ss->on_solution_step
+ $new_ss->on_solution_step
}
};
my $alt_step = $self->alternative_step;
return (
- $ss->but(
- current_hypothesis => $new_hyp,
+ $new_ss->but(
next_step => $ns,
($alt_step
- ? (alternatives => [ [ $old_hyp, $alt_step ], @{$ss->alternatives} ])
+ ? (alternatives => [
+ [ $ss->current_hypothesis, $alt_step ],
+ @{$ss->alternatives}
+ ])
: ()
),
),