Closed Wout4 closed 1 year ago
this is actually related to the problem in flattening (#399 ), removing the rule for applying distributivity of disjunctions and conjunctions there leads to only 185 flat constraints (with more aux vars but still preferable obviously)
[IV147,IV148,IV149,IV137,IV138,IV139]= intvar(0,4,6) errey = cp.cpm_array([IV147,IV148, IV149, IV137, IV138]) const = [Xor([(errey[IV137] == 0), (errey[IV138] == 1), (errey[IV139] == 2)])] const = decompose_in_tree(const) const = flatten_constraint(const) print(len(const))
= 601147This simple constraint flattens into 600000 constraints! The problem is our recursive decomposition of Xor, it introduces a lot of disjunctions. Maybe it will be better with cse already but we can do better in the decomposition of xor as well