add some basic tracing using the new deparser
[scpubgit/DX.git] / lib / DX / Step / CompleteRecheck.pm
CommitLineData
251177ea 1package DX::Step::CompleteRecheck;
2
3use DX::Class;
4
5with 'DX::Role::Step';
6
739912d9 7has was_recheck_for => (is => 'ro', isa => Proposition, required => 1);
251177ea 8
739912d9 9has resume_search_state => (is => 'ro', isa => SearchState, required => 1);
251177ea 10
11sub apply_to {
12 my ($self, $ss) = @_;
13
5b6cab1b 14 trace recheck => [ statement => [ [ symbol => 'complete_recheck' ] ] ];
15
251177ea 16 my $prop = $self->was_recheck_for;
2ccd4b58 17 my $re_ss = $self->resume_search_state;
251177ea 18 my $re_hyp = $re_ss->current_hypothesis;
2ccd4b58 19 my $re_rps = $re_hyp->resolved_propositions;
251177ea 20
2ccd4b58 21 my $rps = $re_rps->with_updated_dependencies_for(
251177ea 22 $prop,
23 $ss->current_hypothesis
24 ->resolved_propositions
25 ->dependencies_for($prop)
26 );
27
28 return $re_ss->but(
29 current_hypothesis => $re_hyp->but(
2ccd4b58 30 resolved_propositions => $rps
251177ea 31 ),
251177ea 32 );
33}
34
351;