add alternatives to search state inside normal step
[scpubgit/DX.git] / 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
   );
 }