From: Matt S Trout Date: Thu, 23 Jun 2016 19:59:22 +0000 (+0000) Subject: add is_solution_state flag on SearchState X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FDX.git;a=commitdiff_plain;h=8cc971ec0c75cd572292d928b92d46e9b6b63609 add is_solution_state flag on SearchState --- diff --git a/lib/DX/SearchProcess.pm b/lib/DX/SearchProcess.pm index 10248ab..437f71d 100644 --- a/lib/DX/SearchProcess.pm +++ b/lib/DX/SearchProcess.pm @@ -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), ); } diff --git a/lib/DX/SearchState.pm b/lib/DX/SearchState.pm index dcfb606..ee6a1b5 100644 --- a/lib/DX/SearchState.pm +++ b/lib/DX/SearchState.pm @@ -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, ); }