format aperture in backtrack trace
[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   trace recheck => [ 'leave_block' ];
16
17   my $prop = $self->was_recheck_for;
18   my $re_ss = $self->resume_search_state;
19   my $re_hyp = $re_ss->current_hypothesis;
20   my $re_rps = $re_hyp->resolved_propositions;
21
22   my $rps = $re_rps->with_updated_dependencies_for(
23     $prop,
24     $ss->current_hypothesis
25        ->resolved_propositions
26        ->dependencies_for($prop)
27   );
28
29   return $re_ss->but(
30     current_hypothesis => $re_hyp->but(
31       resolved_propositions => $rps
32     ),
33   );
34 }
35
36 1;