fix #4641
This commit is contained in:
@@ -3869,6 +3869,7 @@ cc_library(
|
||||
":drat_writer",
|
||||
":sat_base",
|
||||
"//ortools/base",
|
||||
"//ortools/base:file",
|
||||
"//ortools/base:strong_vector",
|
||||
"//ortools/util:strong_integers",
|
||||
"@abseil-cpp//absl/log:check",
|
||||
|
||||
@@ -2156,9 +2156,9 @@ class CpModel:
|
||||
self.assert_is_boolean_variable(arg.negated())
|
||||
return arg.index
|
||||
if isinstance(arg, IntegralTypes):
|
||||
if arg == ~False: # -1
|
||||
if arg == ~int(False):
|
||||
return self.get_or_make_index_from_constant(1)
|
||||
if arg == ~True: # -2
|
||||
if arg == ~int(True):
|
||||
return self.get_or_make_index_from_constant(0)
|
||||
arg = cmn.assert_is_zero_or_one(arg)
|
||||
return self.get_or_make_index_from_constant(arg)
|
||||
|
||||
Reference in New Issue
Block a user