add is_solution_state flag on SearchState
Matt S Trout [Thu, 23 Jun 2016 19:59:22 +0000 (19:59 +0000)]
lib/DX/SearchProcess.pm
lib/DX/SearchState.pm

index 10248ab..437f71d 100644 (file)
@@ -13,14 +13,7 @@ has current_search_state => (
 sub new_for {
   my ($class, $hyp, $props) = @_;
   $class->new(
-    current_search_state => DX::SearchState->new(
-      current_hypothesis => $hyp,
-      alternatives => [],
-      next_step => DX::Step::InvokeNextPredicate->new(
-        proposition => $props->members->[0],
-      ),
-      propositions => $props,
-    ),
+    current_search_state => DX::SearchState->new_for($hyp, $props),
   );
 }
 
index dcfb606..ee6a1b5 100644 (file)
@@ -13,6 +13,8 @@ has propositions => (is => 'ro', isa => PropositionSequence, required => 1);
 
 has alternatives => (is => 'ro', isa => AlternativeList, required => 1);
 
+has is_solution_state => (is => 'ro', required => 1);
+
 sub next_proposition {
   my ($self, $hyp) = @_;
   $hyp ||= $self->current_hypothesis;
@@ -30,6 +32,7 @@ sub new_for {
       proposition => $props->members->[0],
     ),
     propositions => $props,
+    is_solution_state => 0,
   );
 }