incomplete rollback, I think (creates regressions)
@@ -174,19 +174,6 @@ def flatten_constraint(expr):
newexpr = Operator(expr.name, (lhs,rhs))
return [newexpr]+[c for c in flatcons]
- # TODO: CASES need to be handled by weighted sum constraint!
- elif isinstance(expr, Comparison) and expr.args[0].name == "sum" and all(
- # weight
- is_int(arg) or \
- # variable
- isinstance(arg,_NumVarImpl) or \
- # +/- weighted variable
- (isinstance(arg, Operator) and arg.name == "mul" and is_int(arg.args[0]) and isinstance(arg.args[1], _NumVarImpl)) or \
- # - variable
- (isinstance(arg, Operator) and arg.name == "-" and isinstance(arg.args[0], _IntVarImpl)) or \
- (isinstance(arg, Operator) and arg.name == "-" and isinstance(arg.args[0], Operator) and arg.args[0].name == "mul" and is_int(arg.args[0].args[0]) and isinstance(arg.args[0].args[1], _NumVarImpl))
- for arg in expr.args[0].args):
- return [expr]
elif isinstance(expr, Comparison):
"""
