1 package DX::Hypothesis;
3 use DX::ActionPolicy::LockScope;
4 use DX::Utils qw(deparse);
7 has scope => (is => 'ro', isa => Scope, required => 1);
9 has resolved_propositions => (
10 is => 'ro', isa => ResolvedPropositionSet, required => 1
14 is => 'ro', isa => ArrayRef[Action], required => 1
17 has action_applications => (
18 is => 'ro', isa => ArrayRef[Action], required => 1
21 has action_policy => (is => 'ro', isa => ActionPolicy, required => 1);
24 my ($self, @actions) = @_;
27 foreach my $act (@actions) {
28 return undef unless $self->action_policy->allows($act);
29 ($hyp, my @these_events) = $act->dry_run($hyp);
30 return undef unless $hyp;
31 push @events, @these_events;
33 my ($still_resolved, @recheck) = $hyp->resolved_propositions
34 ->but_expire_for(@events);
36 $hyp->but(resolved_propositions => $still_resolved),
42 my ($self, $prop, $depends, $actions) = @_;
43 (my $hyp, my @recheck) = $self->with_actions(@$actions);
44 return undef unless $hyp;
47 resolved_propositions => $self->resolved_propositions
48 ->with_resolution_for(