@@ -191,6 +191,61 @@ function test_range()
191191 return
192192end
193193
194+ function test_range_and_bound ()
195+ model = Model ()
196+ @variable (model, 10 <= x <= 11 )
197+ @variable (model, 1 <= y <= 11 )
198+ @variable (model, 1 <= z <= 0 )
199+ @constraint (model, c, x + y <= 1 )
200+ @objective (model, Max, x + y)
201+ solver = MOCS. Optimizer ()
202+ MOI. set (solver, MOCS. InfeasibleModel (), JuMP. backend (model))
203+ MOI. compute_conflict! (solver)
204+ data = solver. results
205+ @test length (data) == 1
206+ @test _isequal_unordered (
207+ data[]. constraints,
208+ [
209+ JuMP. index (LowerBoundRef (z)),
210+ JuMP. index (UpperBoundRef (z)),
211+ ],
212+ )
213+ @test MOI. get (solver, MOCS. StopIfInfeasibleBounds ()) == true
214+ MOI. set (solver, MOCS. StopIfInfeasibleBounds (), false )
215+ @test MOI. get (solver, MOCS. StopIfInfeasibleBounds ()) == false
216+ MOI. compute_conflict! (solver)
217+ data = solver. results
218+ @test length (data) == 2
219+ @test _isequal_unordered (
220+ data[1 ]. constraints,
221+ [
222+ JuMP. index (LowerBoundRef (z)),
223+ JuMP. index (UpperBoundRef (z)),
224+ ],
225+ )
226+ @test _isequal_unordered (
227+ data[2 ]. constraints,
228+ [
229+ JuMP. index (c),
230+ JuMP. index (UpperBoundRef (x)),
231+ JuMP. index (LowerBoundRef (x)),
232+ JuMP. index (UpperBoundRef (y)),
233+ JuMP. index (LowerBoundRef (y)),
234+ ],
235+ )
236+ @test data[2 ]. irreducible
237+ @test data[2 ]. metadata ==
238+ MOCS. RangeData (11.0 , 22.0 , MOI. LessThan {Float64} (1.0 ))
239+ @test MOI. get (solver, MOCS. StopIfInfeasibleRanges ()) == true
240+ MOI. set (solver, MOCS. StopIfInfeasibleRanges (), false )
241+ @test MOI. get (solver, MOCS. StopIfInfeasibleRanges ()) == false
242+ MOI. set (solver, MOCS. InnerOptimizer (), HiGHS. Optimizer)
243+ MOI. compute_conflict! (solver)
244+ data = solver. results
245+ @test length (data) == 2
246+ return
247+ end
248+
194249function test_range_neg ()
195250 model = Model ()
196251 @variable (model, 10 <= x <= 11 )
0 commit comments