1 package DX::Step::EnterRecheck;
3 use DX::Step::CompleteRecheck;
4 use DX::Step::FailRecheck;
10 has proposition_list => (is => 'ro', required => 1);
12 has on_completion_step => (is => 'ro', required => 1);
14 has on_failure_step => (is => 'ro', required => 1);
17 my ($self, $old_ss) = @_;
19 my ($prop, @rest) = @{$self->proposition_list};
21 my $old_hyp = $old_ss->current_hypothesis;
23 # we should probably be doing something about pruning the scope
24 # but that's completely pointless until we have rules (and also,
25 # the lock_to_depth arg needs to come from the proposition somehow)
27 my $ap = DX::ActionPolicy::LockScope->new(
28 lock_to_depth => $old_hyp->scope->depth,
29 next_policy => $old_hyp->action_policy,
32 my $hyp = ref($old_hyp)->new(
33 scope => $old_hyp->scope,
34 resolved_propositions => DX::ResolvedPropositionSet->new_empty,
36 action_applications => [],
40 my $pseq = DX::PropositionSequence->new(
46 my $next_step = (@rest
47 ? $self->but(proposition_list => \@rest)
48 : $self->on_completion_step);
50 my $ss = DX::SearchState->new(
51 current_hypothesis => $hyp,
53 propositions => $pseq,
54 next_step => DX::Step::ConsiderProposition->new(
57 is_solution_state => 0,
58 on_solution_step => DX::Step::CompleteRecheck->new(
59 resume_search_state => $old_ss->but(next_step => $next_step),
60 was_recheck_for => $prop,
62 on_exhaustion_step => DX::Step::FailRecheck->new(
63 resume_search_state => $old_ss->but(next_step => $self->on_failure_step),