-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
I think the new implementation with Symbolics is broken because constraint can only be called once. This breaks interactive usage.
Here is the example from the README:
julia> using IntervalConstraintProgramming, Symbolics
julia> vars = @variables x, y;
julia> constraint(x^2 + 2y^2 ≥ 1, vars) # first call works
Separator(in(-1 + x^2 + 2(y^2), [0.0, ∞)_dac), vars=x, y)Then calling constraint another time (note that you need to stop the previous run, e.g., separate commands in the REPL):
julia> constraint(x^2 + 2y^2 ≥ 1, vars)
ERROR: ArgumentError: `==` is purposely not supported when the intervals are overlapping. See instead `isequal_interval`I do not fully understand why it works the first time. It seems that some other code path is taken. I guess the reason must be that some methods are only defined later and an old definition is taken during the first run.
Simplified version
Here is an even more simplified version:
using IntervalConstraintProgramming, Symbolics, IntervalArithmetic
julia> vars = @variables x, y;
julia> ex = -1 + x^2 + 2y^2;
julia> c = interval(0, Inf);
julia> ex in c # first call works
in(-1 + x^2 + 2(y^2), [0.0, ∞)_dac)julia> ex in c
ERROR: ArgumentError: `==` is purposely not supported when the intervals are overlapping. See instead `isequal_interval`Environment
(IntervalConstraintProgramming) pkg> st
Project IntervalConstraintProgramming v0.14.0
Status `~/.julia/dev/IntervalConstraintProgramming/Project.toml`
⌅ [d1acc4aa] IntervalArithmetic v0.22.36
[43d83c95] IntervalBoxes v0.2.3 `~/.julia/dev/IntervalBoxes`
[15111844] IntervalContractors v0.5.0
[527681c1] ReversePropagation v0.3.0
[90137ffa] StaticArrays v1.9.15
⌅ [0c5d862f] Symbolics v6.58.0Metadata
Metadata
Assignees
Labels
No labels