add some basic tracing using the new deparser
[scpubgit/DX.git] / lib / DX / Step / CompleteRecheck.pm
1 package DX::Step::CompleteRecheck;
2
3 use DX::Class;
4
5 with 'DX::Role::Step';
6
7 has was_recheck_for => (is => 'ro', isa => Proposition, required => 1);
8
9 has resume_search_state => (is => 'ro', isa => SearchState, required => 1);
10
11 sub apply_to {
12   my ($self, $ss) = @_;
13
14   trace recheck => [ statement => [ [ symbol => 'complete_recheck' ] ] ];
15
16   my $prop = $self->was_recheck_for;
17   my $re_ss = $self->resume_search_state;
18   my $re_hyp = $re_ss->current_hypothesis;
19   my $re_rps = $re_hyp->resolved_propositions;
20
21   my $rps = $re_rps->with_updated_dependencies_for(
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(
30       resolved_propositions => $rps
31     ),
32   );
33 }
34
35 1;