has current_search_state => (
is => 'ro', isa => SearchState, required => 1,
handles => [ qw(
- current_hypothesis next_step propositions adjustments_made
+ current_hypothesis next_step propositions
) ],
);
has propositions => (is => 'ro', isa => PropositionSequence, required => 1);
-has adjustments_made => (is => 'ro', isa => AdjustmentList, required => 1);
+has decisions_taken => (is => 'ro', isa => DecisionList, required => 1);
has is_solution_state => (is => 'ro', isa => Bool, required => 1);
my ($class, $hyp, $props) = @_;
$class->new(
current_hypothesis => $hyp,
- adjustments_made => [],
+ decisions_taken => [],
propositions => $props,
(@{$props->members}
? (
sub apply_to {
my ($self, $ss) = @_;
trace backtrack => [ statement => [ [ symbol => 'backtrack' ] ] ];
- foreach my $adj (@{$ss->adjustments_made}) {
- my ($step_was, $ss_was) = @$adj;
- if (my $alt = $step_was->alternative_step) {
- return $ss_was->but(next_step => $alt);
- }
+ foreach my $adj (@{$ss->decisions_taken}) {
+ my ($rspace_was, $ss_was) = @$adj;
+ return $ss_was->but(
+ next_step => $rspace_was->remaining_resolution_space->next_step
+ );
}
return $ss->but(next_step => $ss->on_exhaustion_step);
}
my $ss = DX::SearchState->new(
current_hypothesis => $hyp,
- adjustments_made => [],
+ decisions_taken => [],
propositions => $pseq,
next_step => DX::Step::ConsiderProposition->new(
proposition => $prop,
};
my $ss = $old_ss->but(
next_step => $ns,
- (@{$self->actions}
- ? (adjustments_made => [
- [ $self, $old_ss ],
- @{$old_ss->adjustments_made}
- ])
- : ()
- ),
+ decisions_taken => [
+ [ $self->resolution_space, $old_ss ],
+ @{$old_ss->decisions_taken}
+ ],
);
my $new_ss = $self->_apply_to_ss($ss);
return $ss->but(next_step => DX::Step::Backtrack->new) unless $new_ss;
declare PropositionList => as ArrayRef[Proposition];
-declare AdjustmentList => as ArrayRef[Tuple[Step, SearchState]];
+declare DecisionList => as ArrayRef[Tuple[ResolutionSpace, SearchState]];
declare DependencyType => where {
foreach my $cand (EXISTENCE_OF, TYPE_OF, INDICES_OF, CONTENTS_OF) {