has action_policy => (is => 'ro', isa => ActionPolicy, required => 1);
-sub head_proposition { shift->outstanding_propositions->[0] }
-
sub with_actions {
my ($self, @actions) = @_;
my $hyp = $self;
has alternatives => (is => 'ro', isa => AlternativeList, required => 1);
-sub next_proposition { $_[0]->current_hypothesis->head_proposition }
+sub next_proposition {
+ my ($self) = @_;
+ $self->propositions->members->[
+ $self->current_hypothesis->resolved_propositions->resolved_count
+ ];
+}
sub new_for {
my ($class, $hyp, $props) = @_;
current_hypothesis => $hyp,
alternatives => [],
next_step => DX::Step::InvokeNextPredicate->new(
- proposition => $hyp->head_proposition,
+ proposition => $props->members->[0],
),
propositions => $props,
);
sub find_solution {
my $state = $_[0];
- while ($state and @{$state->current_hypothesis->outstanding_propositions}) {
+ while ($state and $state->next_proposition) {
$state = $state->with_one_step;
}
trace 'search.solution.hyp' => $state->current_hypothesis if $state;