Skip to content

rejections

These transformers hard-reject ASP constructs that break the equivalence algorithm.

Module to check if a program contains disjunctive rules.

RejectDisjunctions

Bases: Transformer

Reject any disjunctive rules.

visit_Rule(node: AST) -> AST

Raise an exception if the rule is disjunctive.

Module to reject classical negation.

RejectClassicalNegation

Bases: Transformer

Reject classically negated atoms (e.g. -p), which are not supported.

visit_SymbolicAtom(node: AST) -> AST

Raise an error if the atom uses classical negation.

Classical negation is represented as a symbolic atom whose symbol is a unary operation (e.g. -p); ordinary atoms have a function or pool symbol. The check is on the atom's symbol only, so arithmetic negation in an argument (e.g. p(-X)) is not affected.