1 package DX::Hypothesis;
3 use DX::ActionPolicy::LockScope;
4 use Types::Standard qw(ArrayRef);
5 use DX::Utils qw(deparse);
8 has scope => (is => 'ro', isa => Scope, required => 1);
10 has resolved_propositions => (
11 is => 'ro', isa => ResolvedPropositionSet, required => 1
15 is => 'ro', isa => ArrayRef[Action], required => 1
18 has action_applications => (
19 is => 'ro', isa => ArrayRef[Action], required => 1
22 has action_policy => (is => 'ro', isa => ActionPolicy, required => 1);
25 my ($self, @actions) = @_;
28 foreach my $act (@actions) {
29 return undef unless $self->action_policy->allows($act);
30 ($hyp, my @these_events) = $act->dry_run($hyp);
31 return undef unless $hyp;
32 push @events, @these_events;
34 my ($still_resolved, @recheck) = $hyp->resolved_propositions
35 ->but_expire_for(@events);
37 $hyp->but(resolved_propositions => $still_resolved),
43 my ($self, $prop, $depends, $actions) = @_;
44 (my $hyp, my @recheck) = $self->with_actions(@$actions);
45 return undef unless $hyp;
48 resolved_propositions => $self->resolved_propositions
49 ->with_resolution_for(