1 package DX::Hypothesis;
5 has scope => (is => 'ro', required => 1);
7 has resolved_propositions => (is => 'ro', required => 1);
9 has outstanding_propositions => (is => 'ro', required => 1);
11 has actions => (is => 'ro', required => 1);
13 sub head_proposition { shift->outstanding_propositions->[0] }
16 my ($self, @actions) = @_;
18 foreach my $act (@actions) {
19 ($hyp, my @events) = $act->dry_run($hyp);
20 return undef unless $hyp;
21 $hyp = $hyp->but_recheck_for(@events);
22 return undef unless $hyp;
28 my ($self, @events) = @_;
29 my ($still_resolved, @recheck) = $self->resolved_propositions
30 ->but_expire_for(@events);
31 my $hyp = $self->but(resolved_propositions => $still_resolved);
32 $hyp = $_->but_recheck_against($hyp) or return undef for @recheck;
36 sub resolve_head_dependent_on {
37 my ($self, $depends) = @_;
38 my ($first, @rest) = @{$self->outstanding_propositions};
40 resolved_propositions => $self->resolved_propositions
41 ->with_resolution_for(
45 outstanding_propositions => \@rest,