my ($self, $vars, @terms) = @_;
my $rule_set = $self->rule_set;
push @terms, map +[ materialize => $_ ], @$vars;
- my $head = reduce { $b->but(next => $a) }
- reverse map $rule_set->expand(@$_), @terms;
+ my $head = $rule_set->expand_and_link(undef, @terms);
my $state = DX::State->new(
next_op => $head,
return_stack => [],
);
}
+sub run_action {
+ my ($self, $action) = @_;
+ my @invalidate = $action->run;
+ while (my ($type, $value) = splice @invalidate, 0, 2) {
+ $self->facts->{$type}->remove_value($value);
+ }
+}
+
1;