Expression transformations (cpmpy.transformations)

Methods to transform CPMpy expressions into other CPMpy expressions

Input and output are always CPMpy expressions, so transformations can be chained and called multiple times, as needed.

A transformation can not modify expressions in place but in that case should create and return new expression objects. In this way, the expressions prior to the transformation remain intact, and could be used for other purposes too.

List of submodules

comparison

Transformations regarding Comparison constraints (originally).

decompose_global

Decompose any global constraint not supported by the solver.

flatten_model

Flattening a model (or individual constraints) into 'flat normal form'.

get_variables

Returns an list of all variables in the model or expressions

linearize

Transformations regarding linearization of constraints.

negation

Transformations dealing with negations.

normalize

Normalizing the constraints given to a CPMpy model.

reification

Transformations regarding reification constraints.

to_cnf

Converts the logical constraints into disjuctions using the tseitin transform,