From: Matt S Trout Date: Mon, 13 Feb 2017 21:08:57 +0000 (+0000) Subject: switch adjustments to keep search state to preserve on_X_step values X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a3ff9ce39be445b043924592eae745c2ee84febf;p=scpubgit%2FDX.git switch adjustments to keep search state to preserve on_X_step values --- diff --git a/lib/DX/Step/Backtrack.pm b/lib/DX/Step/Backtrack.pm index ca565bc..f145351 100644 --- a/lib/DX/Step/Backtrack.pm +++ b/lib/DX/Step/Backtrack.pm @@ -8,12 +8,7 @@ sub apply_to { my ($self, $ss) = @_; my ($first_alt, @rest_alt) = @{$ss->adjustments_made}; return $ss->but(next_step => $ss->on_exhaustion_step) unless $first_alt; - return $ss->but( - current_hypothesis => $first_alt->[1], - adjustments_made => \@rest_alt, - next_step => $first_alt->[0]->alternative_step, - is_solution_state => 0, - ); + return $first_alt->[1]->but(next_step => $first_alt->[0]->alternative_step); } 1; diff --git a/lib/DX/Step/ResolveProposition.pm b/lib/DX/Step/ResolveProposition.pm index 17df581..d738ac1 100644 --- a/lib/DX/Step/ResolveProposition.pm +++ b/lib/DX/Step/ResolveProposition.pm @@ -57,7 +57,7 @@ sub apply_to { next_step => $ns, ($alt_step ? (adjustments_made => [ - [ $self, $old_ss->current_hypothesis ], + [ $self, $old_ss ], @{$old_ss->adjustments_made} ]) : () diff --git a/lib/DX/Types.pm b/lib/DX/Types.pm index c9a79e7..2d3237d 100644 --- a/lib/DX/Types.pm +++ b/lib/DX/Types.pm @@ -33,7 +33,7 @@ foreach my $role (our @ROLES) { class_type DictValue => { class => 'DX::Value::Dict' }; -declare AdjustmentList => as ArrayRef[Tuple[Step, Hypothesis]]; +declare AdjustmentList => as ArrayRef[Tuple[Step, SearchState]]; declare DependencyType => where { foreach my $cand (EXISTENCE_OF, TYPE_OF, INDICES_OF, CONTENTS_OF) {