add alternatives to search state inside normal step
Matt S Trout [Tue, 21 Jun 2016 19:47:46 +0000 (19:47 +0000)]
lib/DX/Step/Normal.pm

index 10c4eb9..2ec93aa 100644 (file)
@@ -35,12 +35,16 @@ sub apply_to {
   my $ns = DX::Step::InvokeNextPredicate->new(
     proposition => $ss->next_proposition($new_hyp)
   );
+  my $alt_step = $self->alternative_step;
   return (
     $ss->but(
       current_hypothesis => $new_hyp,
       next_step => $ns,
+      ($alt_step
+        ? (alternatives => [ [ $old_hyp, $alt_step ], @{$ss->alternatives} ])
+        : ()
+      ),
     ),
-    $self->alternative_step
   );
 }