Commit | Line | Data |
251177ea |
1 | package DX::Step::CompleteRecheck; |
2 | |
3 | use DX::Class; |
4 | |
5 | with 'DX::Role::Step'; |
6 | |
7 | has was_recheck_for => (is => 'ro', required => 1); |
8 | |
9 | has original_search_state => (is => 'ro', required => 1); |
10 | |
11 | sub apply_to { |
12 | my ($self, $ss) = @_; |
13 | |
14 | my $prop = $self->was_recheck_for; |
15 | my $re_ss = $self->original_search_state; |
16 | my $re_hyp = $re_ss->current_hypothesis; |
17 | my $re_rsp = $re_hyp->resolved_propositions; |
18 | |
19 | my $rsp = $re_rsp->with_updated_dependencies_for( |
20 | $prop, |
21 | $ss->current_hypothesis |
22 | ->resolved_propositions |
23 | ->dependencies_for($prop) |
24 | ); |
25 | |
26 | return $re_ss->but( |
27 | current_hypothesis => $re_hyp->but( |
28 | resolved_propositions => $rsp |
29 | ), |
30 | is_solution_state => 1 |
31 | ); |
32 | } |
33 | |
34 | 1; |