From: Matt S Trout Date: Thu, 23 Jun 2016 21:03:14 +0000 (+0000) Subject: mark propositionless search states as solutions X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FDX.git;a=commitdiff_plain;h=75389058155127e77375e5bd77d3b12c301452ec mark propositionless search states as solutions --- diff --git a/lib/DX/SearchState.pm b/lib/DX/SearchState.pm index ee6a1b5..1548f11 100644 --- a/lib/DX/SearchState.pm +++ b/lib/DX/SearchState.pm @@ -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 ) + ), ); }