You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should rewrite the decompose_globals transformation to work with non-flattened constraints.
This way, less auxiliary variables are introduced.
Some special edge cases to take care of in this transformation:
Nesting of global numerical constraints:
For example: AllDiff(max(x,y,z), p,q) when AllDiff is supported but not max should become [AllDiff(aux,pq), max(x,y,z).decompose_comparison('==',aux)]
Global constraints in negative context: make sure to use decompose_negation
In essence, this function should walk trough the expression tree and decompose any unsupported global constraint/function BEFORE flattening. This allows downstream transformations to completely ignore global constraints and allows solvers such as z3 which directly work on the expression tree level to not worry about special global constraint cases.
The text was updated successfully, but these errors were encountered:
The advantage of flattening first however, is that there is no need for the whole decompose_negation thing
Do you have an example or insight of why this leads to more auxiliary variables?
We have to implement the logic for any object-oriented solver (such as Z3) anyway. So I think it would be best to just make it a transformation and let all solvers benefit from the effort.
We should rewrite the decompose_globals transformation to work with non-flattened constraints.
This way, less auxiliary variables are introduced.
Some special edge cases to take care of in this transformation:
For example:
AllDiff(max(x,y,z), p,q)
whenAllDiff
is supported but notmax
should become[AllDiff(aux,pq), max(x,y,z).decompose_comparison('==',aux)]
decompose_negation
In essence, this function should walk trough the expression tree and decompose any unsupported global constraint/function BEFORE flattening. This allows downstream transformations to completely ignore global constraints and allows solvers such as
z3
which directly work on the expression tree level to not worry about special global constraint cases.The text was updated successfully, but these errors were encountered: