switch adjustments to keep search state to preserve on_X_step values
Matt S Trout [Mon, 13 Feb 2017 21:08:57 +0000 (21:08 +0000)]
lib/DX/Step/Backtrack.pm
lib/DX/Step/ResolveProposition.pm
lib/DX/Types.pm

index ca565bc..f145351 100644 (file)
@@ -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;
index 17df581..d738ac1 100644 (file)
@@ -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}
         ])
       : ()
index c9a79e7..2d3237d 100644 (file)
@@ -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) {