head¶
Module to normalize rule heads.
NormalizeHead
¶
Bases: Transformer
Normalize (non-choice) rule heads, i.e. remove negated heads and comparisons.
-
single negation: not l :- body. is turned into :- body, l.
-
double negation: not not l :- body. is turned into :- body, not l.
-
comparisons: X < Y :- body. is turned into :- body, not X < Y. (note that negated comparisons are already handled in 1/2)
visit_Rule(node: AST) -> AST
¶
Transform rules heads.