Skip to content

Commit b712b8d

Browse files
authored
Refactoring boolsets (#263)
* some refactoring for boolsets * made init_constraint, solved and violated general for boolsets
1 parent 3b72462 commit b712b8d

File tree

11 files changed

+201
-268
lines changed

11 files changed

+201
-268
lines changed

src/MOI_wrapper/Bridges/bool.jl

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ end
55
function MOI.supports_constraint(
66
bridge::Type{<:BoolBridge{T, B1, B2}},
77
fct::Type{<:MOI.AbstractFunction},
8-
set::Type{<:CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}}
9-
) where {T, B1, B2, F1, F2, F1dim, F2dim, S1<:BoolSet, S2<:BoolSet}
8+
set::Type{<:CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}}
9+
) where {T, B1, B2, F1, F2, F1dim, F2dim, S1<:AbstractBoolSet, S2<:AbstractBoolSet}
1010
return MOI.supports_constraint(bridge, F1, S1) && MOI.supports_constraint(bridge, F2, S2)
1111
end
1212

1313
function MOI.supports_constraint(
1414
bridge::Type{<:BoolBridge{T, B1, B2}},
1515
fct::Type{<:MOI.AbstractFunction},
16-
set::Type{<:CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}}
17-
) where {T, B1, B2, F1, F2, F1dim, F2dim, S1<:BoolSet, S2}
16+
set::Type{<:CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}}
17+
) where {T, B1, B2, F1, F2, F1dim, F2dim, S1<:AbstractBoolSet, S2}
1818
direct_support, inner_bridge = how_supported(B1, B2, F2, S2)
1919
if direct_support || inner_bridge !== nothing
2020
return MOI.supports_constraint(bridge, F1, S1)
@@ -24,8 +24,8 @@ end
2424
function MOI.supports_constraint(
2525
bridge::Type{<:BoolBridge{T, B1, B2}},
2626
fct::Type{<:MOI.AbstractFunction},
27-
set::Type{<:CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}}
28-
) where {T, B1, B2, F1, F2, F1dim, F2dim, S1, S2<:BoolSet}
27+
set::Type{<:CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}}
28+
) where {T, B1, B2, F1, F2, F1dim, F2dim, S1, S2<:AbstractBoolSet}
2929
direct_support, inner_bridge = how_supported(B1, B2, F1, S1)
3030
if direct_support || inner_bridge !== nothing
3131
return MOI.supports_constraint(bridge, F2, S2)
@@ -35,7 +35,7 @@ end
3535
function MOI.supports_constraint(
3636
bridge::Type{<:BoolBridge{T, B1, B2}},
3737
fct::Type{<:MOI.AbstractFunction},
38-
set::Type{<:CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}}
38+
set::Type{<:CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}}
3939
) where {T, B1, B2, F1, F2, F1dim, F2dim, S1, S2}
4040
direct_support, inner_bridge = how_supported(B1, B2, F1, S1)
4141
if !direct_support && inner_bridge === nothing
@@ -50,20 +50,20 @@ end
5050

5151
function added_constraint_types(
5252
bridge::Type{<:BoolBridge{T, B1, B2}},
53-
::Type{<:CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}}
53+
::Type{<:CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}}
5454
) where {T,B1,B2,F1, F2, F1dim, F2dim, S1, S2}
5555
set = get_bridged_and_set(bridge,F1,F2,F1dim,F2dim,S1,S2)
5656
end
5757

5858
function MOIBC.concrete_bridge_type(
5959
::Type{<:BoolBridge{T,B1,B2}},
6060
G::Type{<:MOI.AbstractFunction},
61-
::Type{<:CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}}
61+
::Type{<:CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}}
6262
) where {T,B1,B2,F1, F2, F1dim, F2dim, S1, S2}
6363
return BoolBridge{T,B1,B2,F1,F2,S1,S2}
6464
end
6565

66-
function MOIBC.bridge_constraint(B::Type{<:BoolBridge{T, B1, B2, F1, F2, S1, S2}}, model, fct, set::CS.BoolSet) where {T, B1, B2, F1, F2, S1, S2}
66+
function MOIBC.bridge_constraint(B::Type{<:BoolBridge{T, B1, B2, F1, F2, S1, S2}}, model, fct, set::CS.AbstractBoolSet) where {T, B1, B2, F1, F2, S1, S2}
6767
new_fct = map_function(B, fct, set)
6868
new_set = map_set(B, set)
6969
return BoolBridge{T,B1,B2,F1,F2,S1,S2}(MOI.add_constraint(model, new_fct, new_set))
@@ -142,13 +142,13 @@ function get_bridged_and_set(
142142
F2::Type{<:MOI.AbstractFunction},
143143
F1dim,
144144
F2dim,
145-
S1::Type{<:BoolSet{F11,F12,F11dim,F12dim,S11,S12}},
146-
S2::Type{<:BoolSet{F21,F22,F21dim,F22dim,S21,S22}}
145+
S1::Type{<:AbstractBoolSet{F11,F12,F11dim,F12dim,S11,S12}},
146+
S2::Type{<:AbstractBoolSet{F21,F22,F21dim,F22dim,S21,S22}}
147147
) where {T, B1, B2, F11, F12,F11dim,F12dim, S11, S12, F21, F22, F21dim,F22dim, S21, S22}
148148
lhs_constraint_types = get_bridged_and_set(bridge, F11, F12, F11dim, F12dim, S11, S12)
149149
rhs_constraint_types = get_bridged_and_set(bridge, F21, F22, F21dim, F22dim, S21, S22)
150150
new_F1, new_F2, new_S1, new_S2 = unpack_constraint_types(lhs_constraint_types, rhs_constraint_types)
151-
return [(MOI.VectorAffineFunction{T},BoolSet{new_F1,new_F2,F1dim,F2dim,new_S1,new_S2})]
151+
return [(MOI.VectorAffineFunction{T},AbstractBoolSet{new_F1,new_F2,F1dim,F2dim,new_S1,new_S2})]
152152
end
153153

154154
function get_bridged_and_set(
@@ -157,13 +157,13 @@ function get_bridged_and_set(
157157
F2::Type{<:MOI.AbstractFunction},
158158
F1dim,
159159
F2dim,
160-
S1::Type{<:BoolSet{F11,F12,F11dim,F12dim,S11,S12}},
160+
S1::Type{<:AbstractBoolSet{F11,F12,F11dim,F12dim,S11,S12}},
161161
S2
162162
) where {T, B1, B2, F11, F12, F11dim, F12dim, S11, S12}
163163
lhs_constraint_types = get_bridged_and_set(bridge, F11, F12, F11dim, F12dim, S11, S12)
164164
rhs_constraint_types = get_constraint_types(B1, B2, F2, S2)
165165
new_F1, new_F2, new_S1, new_S2 = unpack_constraint_types(lhs_constraint_types, rhs_constraint_types)
166-
return [(MOI.VectorAffineFunction{T},BoolSet{new_F1,new_F2,F1dim,F2dim,new_S1,new_S2})]
166+
return [(MOI.VectorAffineFunction{T},AbstractBoolSet{new_F1,new_F2,F1dim,F2dim,new_S1,new_S2})]
167167
end
168168

169169
function get_bridged_and_set(
@@ -173,12 +173,12 @@ function get_bridged_and_set(
173173
F1dim,
174174
F2dim,
175175
S1,
176-
S2::Type{<:BoolSet{F21,F22,F21dim,F22dim,S21,S22}}
176+
S2::Type{<:AbstractBoolSet{F21,F22,F21dim,F22dim,S21,S22}}
177177
) where {T, B1, B2, F21, F22, F21dim, F22dim, S21, S22}
178178
lhs_constraint_types = get_constraint_types(B1, B2, F1, S1)
179179
rhs_constraint_types = get_bridged_and_set(bridge, F21, F22, F21dim, F22dim, S21, S22)
180180
new_F1, new_F2, new_S1, new_S2 = unpack_constraint_types(lhs_constraint_types, rhs_constraint_types)
181-
return [(MOI.VectorAffineFunction{T},BoolSet{new_F1,new_F2,F1dim,F2dim,new_S1,new_S2})]
181+
return [(MOI.VectorAffineFunction{T},AbstractBoolSet{new_F1,new_F2,F1dim,F2dim,new_S1,new_S2})]
182182
end
183183

184184
function get_bridged_and_set(
@@ -193,14 +193,14 @@ function get_bridged_and_set(
193193
lhs_constraint_types = get_constraint_types(B1, B2, F1, S1)
194194
rhs_constraint_types = get_constraint_types(B1, B2, F2, S2)
195195
new_F1, new_F2, new_S1, new_S2 = unpack_constraint_types(lhs_constraint_types, rhs_constraint_types)
196-
return [(MOI.VectorAffineFunction{T}, BoolSet{new_F1,new_F2,F1dim,F2dim,new_S1,new_S2})]
196+
return [(MOI.VectorAffineFunction{T}, AbstractBoolSet{new_F1,new_F2,F1dim,F2dim,new_S1,new_S2})]
197197
end
198198

199199
function map_function(
200200
bridge::Type{<:BoolBridge{T, B1, B2}},
201201
fct,
202-
set::CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}
203-
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1<:BoolSet,S2<:BoolSet}
202+
set::CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}
203+
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1<:AbstractBoolSet,S2<:AbstractBoolSet}
204204
f = MOIU.eachscalar(fct)
205205
lhs_fct = map_function(bridge, f[1:get_value(F1dim)], set.lhs_set)
206206
rhs_fct = map_function(bridge, f[end-get_value(F2dim)+1:end], set.rhs_set)
@@ -210,8 +210,8 @@ end
210210
function map_function(
211211
bridge::Type{<:BoolBridge{T, B1, B2}},
212212
fct,
213-
set::CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}
214-
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1<:BoolSet,S2}
213+
set::CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}
214+
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1<:AbstractBoolSet,S2}
215215
f = MOIU.eachscalar(fct)
216216
lhs_fct = map_function(bridge, f[1:get_value(F1dim)], set.lhs_set)
217217
rhs_fct = get_mapped_fct(B1, B2, F2, S2, f[end-get_value(F2dim)+1:end])
@@ -221,8 +221,8 @@ end
221221
function map_function(
222222
bridge::Type{<:BoolBridge{T, B1, B2}},
223223
fct,
224-
set::CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}
225-
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1,S2<:BoolSet}
224+
set::CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}
225+
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1,S2<:AbstractBoolSet}
226226
f = MOIU.eachscalar(fct)
227227
lhs_fct = get_mapped_fct(B1, B2, F1, S1, f[1:get_value(F1dim)])
228228
rhs_fct = map_function(bridge, f[end-get_value(F2dim)+1:end], set.rhs_set)
@@ -232,7 +232,7 @@ end
232232
function map_function(
233233
bridge::Type{<:BoolBridge{T, B1, B2}},
234234
fct,
235-
set::CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}
235+
set::CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}
236236
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1,S2}
237237
f = MOIU.eachscalar(fct)
238238
lhs_fct = get_mapped_fct(B1, B2, F1, S1, f[1:get_value(F1dim)])
@@ -244,37 +244,37 @@ end
244244

245245
function map_set(
246246
bridge::Type{<:BoolBridge{T, B1, B2}},
247-
set::CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}
248-
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1<:BoolSet,S2<:BoolSet}
247+
set::CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}
248+
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1<:AbstractBoolSet,S2<:AbstractBoolSet}
249249
lhs_set = map_set(bridge, set.lhs_set)
250250
rhs_set = map_set(bridge, set.rhs_set)
251-
return typeof_without_parmas(set){F1,F2}(lhs_set, rhs_set)
251+
return typeof_without_params(set){F1,F2}(lhs_set, rhs_set)
252252
end
253253

254254
function map_set(
255255
bridge::Type{<:BoolBridge{T, B1, B2}},
256-
set::CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}
257-
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1<:BoolSet,S2}
256+
set::CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}
257+
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1<:AbstractBoolSet,S2}
258258
lhs_set = map_set(bridge, set.lhs_set)
259259
rhs_set = get_mapped_set(B1, B2, F2, S2, set.rhs_set)
260-
return typeof_without_parmas(set){F1,F2}(lhs_set, rhs_set)
260+
return typeof_without_params(set){F1,F2}(lhs_set, rhs_set)
261261
end
262262

263263
function map_set(
264264
bridge::Type{<:BoolBridge{T, B1, B2}},
265-
set::CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}
266-
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1,S2<:BoolSet}
265+
set::CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}
266+
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1,S2<:AbstractBoolSet}
267267
lhs_set = get_mapped_set(B1, B2, F1, S1, set.lhs_set)
268268
rhs_set = map_set(bridge, set.rhs_set)
269-
return typeof_without_parmas(set){F1,F2}(lhs_set, rhs_set)
269+
return typeof_without_params(set){F1,F2}(lhs_set, rhs_set)
270270
end
271271

272272
function map_set(
273273
bridge::Type{<:BoolBridge{T, B1, B2}},
274-
set::CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}
274+
set::CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}
275275
) where {T,B1,B2,F1,F2,F1dim,F2dim,S1,S2}
276276
lhs_set = get_mapped_set(B1, B2, F1, S1, set.lhs_set)
277277
rhs_set = get_mapped_set(B1, B2, F2, S2, set.rhs_set)
278278

279-
return typeof_without_parmas(set){F1,F2}(lhs_set, rhs_set)
279+
return typeof_without_params(set){F1,F2}(lhs_set, rhs_set)
280280
end

src/MOI_wrapper/Bridges/indicator.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function MOI.supports_constraint(
99
) where {T, B, F<:MOI.VectorAffineFunction, A, S}
1010
is_supported = MOI.supports_constraint(B, MOIU.scalar_type(F), S)
1111
!is_supported && return false
12-
S <: BoolSet && return true
12+
S <: AbstractBoolSet && return true
1313

1414
concrete_B = MOIBC.concrete_bridge_type(B, MOI.ScalarAffineFunction{T}, S)
1515
return supports_concreteB(concrete_B)
@@ -20,7 +20,7 @@ function MOIBC.concrete_bridge_type(
2020
G::Type{<:MOI.VectorAffineFunction},
2121
::Type{IS},
2222
) where {T,B,A,S,IS<:Union{MOI.IndicatorSet{A,S}, CS.IndicatorSet{A,S}}}
23-
if S <: BoolSet
23+
if S <: AbstractBoolSet
2424
concrete_B = B
2525
else
2626
concrete_B = MOIBC.concrete_bridge_type(B, MOI.ScalarAffineFunction{T}, S)
@@ -32,7 +32,7 @@ end
3232
function MOIB.added_constraint_types(
3333
::Type{<:IndicatorBridge{T,B,A,IS_MOI_OR_CS,S}}
3434
) where {T,B,A,IS_MOI_OR_CS,S}
35-
if S <: BoolSet
35+
if S <: AbstractBoolSet
3636
added_constraints = added_constraint_types(B, S)
3737
else
3838
added_constraints = MOIB.added_constraint_types(B)
@@ -46,7 +46,7 @@ end
4646

4747
function MOIBC.bridge_constraint(::Type{<:IndicatorBridge{T, B, A, IS_MOI_OR_CS, S}}, model, func, set) where {T, B, A, IS_MOI_OR_CS, S}
4848
f = MOIU.eachscalar(func)
49-
if S <: BoolSet
49+
if S <: AbstractBoolSet
5050
new_func = MOIU.operate(vcat, T, f[1], map_function(B, f[2:end], set.set))
5151
new_inner_set = map_set(B, set.set)
5252
else

src/MOI_wrapper/Bridges/reified.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function MOI.supports_constraint(
99
) where {T, B, F<:MOI.VectorAffineFunction, A, S}
1010
is_supported = MOI.supports_constraint(B, MOIU.scalar_type(F), S)
1111
!is_supported && return false
12-
S <: BoolSet && return true
12+
S <: AbstractBoolSet && return true
1313

1414
concrete_B = MOIBC.concrete_bridge_type(B, MOI.ScalarAffineFunction{T}, S)
1515
return supports_concreteB(concrete_B)
@@ -20,7 +20,7 @@ function MOIBC.concrete_bridge_type(
2020
G::Type{<:MOI.VectorAffineFunction},
2121
::Type{IS},
2222
) where {T,B,A,S,IS<:CS.ReifiedSet{A,S}}
23-
if S <: BoolSet
23+
if S <: AbstractBoolSet
2424
concrete_B = B
2525
else
2626
concrete_B = MOIBC.concrete_bridge_type(B, MOI.ScalarAffineFunction{T}, S)
@@ -31,7 +31,7 @@ end
3131
function MOIB.added_constraint_types(
3232
::Type{<:ReifiedBridge{T,B,A,S}}
3333
) where {T,B,A,S}
34-
if S <: BoolSet
34+
if S <: AbstractBoolSet
3535
added_constraints = added_constraint_types(B, S)
3636
else
3737
added_constraints = MOIB.added_constraint_types(B)
@@ -45,7 +45,7 @@ end
4545

4646
function MOIBC.bridge_constraint(::Type{<:ReifiedBridge{T, B, A, S}}, model, func, set) where {T, B, A, S}
4747
f = MOIU.eachscalar(func)
48-
if S <: BoolSet
48+
if S <: AbstractBoolSet
4949
new_func = MOIU.operate(vcat, T, f[1], map_function(B, f[2:end], set.set))
5050
new_inner_set = map_set(B, set.set)
5151
else

src/MOI_wrapper/and.jl renamed to src/MOI_wrapper/bool.jl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
function _build_and_constraint(
1+
const BOOL_VALS = Union{Val{:(&&)}, Val{:(||)}}
2+
3+
bool_val_to_set(::Val{:(&&)}) = AndSet
4+
bool_val_to_set(::Val{:(||)}) = OrSet
5+
6+
function _build_bool_constraint(
27
_error::Function,
38
lhs,
49
rhs,
10+
set_type
511
)
612
lhs_set = JuMP.moi_set(lhs)
713
rhs_set = JuMP.moi_set(rhs)
@@ -14,12 +20,12 @@ function _build_and_constraint(
1420

1521
func = [lhs_jump_func..., rhs_jump_func...]
1622
return JuMP.VectorConstraint(
17-
func, AndSet{typeof(lhs_func), typeof(rhs_func)}(lhs_set, rhs_set)
23+
func, set_type{typeof(lhs_func), typeof(rhs_func)}(lhs_set, rhs_set)
1824
)
1925
end
2026

2127

22-
function JuMP.parse_constraint_head(_error::Function, ::Val{:(&&)}, lhs, rhs)
28+
function JuMP.parse_constraint_head(_error::Function, bool_val::BOOL_VALS, lhs, rhs)
2329
_error1 = deepcopy(_error)
2430
lhs_vectorized, lhs_parsecode, lhs_buildcall =
2531
JuMP.parse_constraint_expr(_error, lhs)
@@ -42,10 +48,13 @@ function JuMP.parse_constraint_head(_error::Function, ::Val{:(&&)}, lhs, rhs)
4248
$rhs_parsecode
4349
end
4450

45-
buildcall = :($(esc(:(CS._build_and_constraint)))(
51+
bool_set = bool_val_to_set(bool_val)
52+
53+
buildcall = :($(esc(:(CS._build_bool_constraint)))(
4654
$_error,
4755
$lhs_buildcall,
48-
$rhs_buildcall
56+
$rhs_buildcall,
57+
$bool_set
4958
))
5059
return vectorized, complete_parsecode, buildcall
5160
end

src/MOI_wrapper/constraints.jl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ MOIU.shift_constant(set::NotEqualTo, value) = NotEqualTo(set.value + value)
99

1010
include("indicator.jl")
1111
include("reified.jl")
12-
include("and.jl")
13-
include("or.jl")
12+
include("bool.jl")
1413

1514
"""
1615
MOI constraints
@@ -77,7 +76,7 @@ function MOI.supports_constraint(
7776
func::Type{VAF{T}},
7877
set::Type{OS},
7978
) where {A,T<:Real,IS,OS<:CS.IndicatorSet{A,IS}}
80-
if IS <: BoolSet
79+
if IS <: AbstractBoolSet
8180
return is_boolset_supported(optimizer, IS)
8281
end
8382
return A == MOI.ACTIVATE_ON_ONE || A == MOI.ACTIVATE_ON_ZERO
@@ -109,7 +108,7 @@ function MOI.supports_constraint(
109108
if IS <: MOI.GreaterThan || IS <: Strictly{T, MOI.GreaterThan{T}}
110109
return false
111110
end
112-
if IS <: BoolSet
111+
if IS <: AbstractBoolSet
113112
return is_boolset_supported(optimizer, IS)
114113
end
115114
return A == MOI.ACTIVATE_ON_ONE || A == MOI.ACTIVATE_ON_ZERO
@@ -119,7 +118,7 @@ function MOI.supports_constraint(
119118
optimizer::Optimizer,
120119
func::Type{VAF{T}},
121120
set::Type{BS},
122-
) where {T,F1,F2,F1dim,F2dim,S1,S2,BS<:CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}}
121+
) where {T,F1,F2,F1dim,F2dim,S1,S2,BS<:CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}}
123122
return is_boolset_supported(optimizer, set)
124123
end
125124

@@ -131,9 +130,9 @@ MOI.supports_constraint(
131130
) = true
132131

133132
"""
134-
Return whether the two constraint inside the `BoolSet` are supported directly by the solver
133+
Return whether the two constraint inside the `AbstractBoolSet` are supported directly by the solver
135134
"""
136-
function is_boolset_supported(optimizer::Optimizer, ::Type{<:CS.BoolSet{F1,F2,F1dim,F2dim,S1,S2}}) where {F1, F2, F1dim, F2dim, S1, S2}
135+
function is_boolset_supported(optimizer::Optimizer, ::Type{<:CS.AbstractBoolSet{F1,F2,F1dim,F2dim,S1,S2}}) where {F1, F2, F1dim, F2dim, S1, S2}
137136
is_supported = MOI.supports_constraint(optimizer, F1, S1) && MOI.supports_constraint(optimizer, F2, S2)
138137
return is_supported
139138
end
@@ -605,7 +604,7 @@ function MOI.add_constraint(
605604
model::Optimizer,
606605
func::VAF{T},
607606
set::BS,
608-
) where {T,BS<:BoolSet}
607+
) where {T,BS<:AbstractBoolSet}
609608
com = model.inner
610609
internals = create_interals(com, func, set)
611610
constraint = init_constraint_struct(set, internals)

0 commit comments

Comments
 (0)