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);
14 my ($self, @actions) = @_;
16 foreach my $act (@actions) {
17 ($hyp, my @events) = $act->dry_run_against($hyp);
18 return undef unless $hyp;
19 $hyp = $hyp->but_recheck_for(@events);
20 return undef unless $hyp;
26 my ($self, @events) = @_;
27 my ($still_resolved, @recheck) = $self->resolved_propositions
28 ->but_expire_for(@events);
29 my $hyp = $self->but(resolved_propositions => $still_resolved);
30 $hyp = $_->but_recheck_against($hyp) or return undef for @recheck;
34 sub resolve_head_dependent_on {
35 my ($self, $depends) = @_;
36 my ($first, @rest) = @{$self->outstanding_propositions};
38 resolved_propositions => $self->resolved_propositions
39 ->but_with_resolution(
40 proposition => $first,
41 depends_on => $depends,
42 at_depth => $self->scope->depth,
44 outstanding_propositons => \@rest,