Allow access to input program rules and query by asserting them and exporting the resulting dynamic predicates.
o_
) is appended
to predicates and compound terms that either begin with an
underscore (legal in ASP but not Prolog) or with a reserved prefix.
It will be removed last before printing, and at most one copy will
be removed, ensuring that user-defined predicates starting with a
reserved prefix won't be processed the same as internally created
ones.
defined_predicates(List)
with a list of predicate identifiers,
atoms encoded as <name>_<arity>, e.g., parent_2
for parent/2.defined_rule(Name, Head, Body, Origin)
where Name is the functor name
of Head and Body represents the conjunction of the body as a
list, and Origin denotes the source of the rule's definition.defined_query(List, Count)
List is like Body above, expressing the query and Count is the
number of answer sets to generate by default (based on the
`Count { Query }.` syntax.defined_nmr_check(List)
When defined, a list of one atom containing the rule name for the
NMR check._false_0
should be included
explictly, in case a hard-coded query overrode the default one. We
add _false_0
as head of the query for that purpose. This both
gets the query in the shape of a rule and ensures _false_0
is
included.
:- -x, x.
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
The following predicates are exported, but not or incorrectly documented.