Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend inclusion check for interval and interval box #519

Closed
mforets opened this issue May 14, 2022 · 2 comments · Fixed by #520
Closed

Extend inclusion check for interval and interval box #519

mforets opened this issue May 14, 2022 · 2 comments · Fixed by #520

Comments

@mforets
Copy link
Contributor

mforets commented May 14, 2022

julia> (0 .. 1)  IntervalBox(0 .. 1, 1)
ERROR: ArgumentError: [0, 1]  [0, 1]¹ is not defined
Stacktrace:
 [1] in(X::IntervalArithmetic.Interval{Float64}, Y::IntervalBox{1, Float64})
   @ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/997vH/src/multidim/intervalbox.jl:82
 [2] issubset(l::IntervalArithmetic.Interval{Float64}, r::IntervalBox{1, Float64})
   @ Base ./abstractset.jl:293
 [3] top-level scope
   @ REPL[39]:1
@lucaferranti
Copy link
Member

lucaferranti commented May 14, 2022

what should (0 .. 1) ⊆ IntervalBox(0 .. 1, 2) then return? I guess an error? Since IntervalBox uses N (the dimension) as parameter type, we could define

(a::Interval, b::IntervalBox{1}) = a  first(b)

do you need this somewhere in JuliaReach?

@mforets
Copy link
Contributor Author

mforets commented May 14, 2022

The solution you propose sounds good to me 👍
(No need to implement it with IntervalBox{N} for N higher than one as the default MethodError is usually fine).

do you need this somewhere in JuliaReach?

Yes, this is to avoid special casing inputs which can be 1-dim or mult-dim intervals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants