mark propositionless search states as solutions
Matt S Trout [Thu, 23 Jun 2016 21:03:14 +0000 (21:03 +0000)]
lib/DX/SearchState.pm

index ee6a1b5..1548f11 100644 (file)
@@ -28,11 +28,16 @@ sub new_for {
   $class->new(
     current_hypothesis => $hyp,
     alternatives => [],
-    next_step => DX::Step::InvokeNextPredicate->new(
-      proposition => $props->members->[0],
-    ),
     propositions => $props,
-    is_solution_state => 0,
+    (@{$props->members}
+      ? (
+          next_step => DX::Step::InvokeNextPredicate->new(
+            proposition => $props->members->[0],
+          ),
+          is_solution_state => 0,
+        )
+      : ( is_solution_state => 1 )
+    ),
   );
 }