Negation (cpmpy.transformations.negation)

Transformations dealing with negations (used by other transformations).

cpmpy.transformations.negation.negated_normal(expr)[source]

Deprecated since version 0.9.16: Please use recurse_negation() instead.

cpmpy.transformations.negation.push_down_negation(lst_of_expr, toplevel=True)[source]

Transformation that checks all elements from the list, and pushes down any negation it finds with the recurse_negation() function.

Assumes the input is a list (typically from toplevel_list()) and ensures the output is a toplevel_list if the input was.

cpmpy.transformations.negation.recurse_negation(expr)[source]

Negate expr by pushing the negation down into it and its args.