1 package DX::PropositionSequence;
5 has members => (is => 'ro', isa => PropositionList, required => 1);
7 has external_names => (is => 'ro', isa => HashRef[One], required => 1);
9 has internal_names => (is => 'ro', isa => HashRef[One], required => 1);
19 sub with_additional_proposition {
20 my ($self, $prop) = @_;
22 %{$self->external_names}, %{$self->internal_names}
26 my @missing = grep !$already_names{$_}, sort keys %{$prop->required_names}
29 " variables ".join(' ', @missing)." required but not in scope";
32 my @shadow = grep $already_names{$_}, keys %{$prop->introduced_names}
35 " new variables ".join(' ', @shadow)." are already in scope";
38 die join("\n", "Can't add call to ${\$prop->predicate}:", @fail, '');
41 members => [ @{$self->members}, $prop ],
42 internal_names => { %{$self->internal_names}, %{$prop->introduced_names} },