-
Notifications
You must be signed in to change notification settings - Fork 71
Draft of multi-intervals (unions of disjoint intervals) #452
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
Conversation
|
This is a great idea; in fact I had an implementation somewhere. I actually think this belongs in a different package, though. Personally I would call this |
|
Sure, maybe it's better standalone! Mincing and boxes would have to be figured out, as well as subset-hood and stuff. But I don't think it's difficult. |
|
I think it is definitely very cool. Please let us know here if you decide to turn that into its own package, especially if you would like some feedbacks. Here are few of them already:
|
|
Here's another relevant paper, where they try to deal with the point raised by @Kolaru by introducing criteria for joining together boxes in the union: https://link.springer.com/chapter/10.1007/978-3-030-31041-7_14 |
|
Thanks for the references and feedback. I'll have a read through them. I'm thinking I like Interval Unions more, since they're called this in the lit.
Again agnostic about it being it's own package. Pros: Users of IntervalArithmetic don't need it in general. And it would be easier to manage if it was stand alone. Cons: I can think of two situations where you get multi-intervals from standard intervals:
For example consider the following function: function interval_ifs(A)
if A < 3
A = A + 2
else
A = A - 2
end
return A
end
A = interval(0,5)
interval_ifs(A)I believe that the answer should be In cases with uncertain conditional statements, I think the interval should be bisected at 3, with each part going down different branches and then unioned afterwards. Similar for while and for loops. Although we can't do this yet, I think with Julia's metaprogamming we should be able to do some nice stuff. Maybe even with Intermediate representation: https://github.com/FluxML/IRTools.jl IntervalUnions would play a role I think, but you could also envelop the union and get |
|
We definitely do not want to mix up interval unions with normal intervals. You should have to explicitly start with an interval union to explicitly allow interval unions in the result. So it makes sense for it to be a separate package. |
|
I agree. Thanks! |
|
IntervalUnionArithmetic.jl has been created |
Are you guys interested in an implementation of Multi-Intervals?
Multi-Intervals are sets of reals defined by unions of disjoint intervals. This PR includes:
Usage:
Note that the arithmetic doesn't broadcast on the elements of the multi-interval, but does every combination. The result is then condensed if any intervals overlap.
I'm agnostic to the name "Multi-Interval", it's what we call them but maybe there's a better name.
This is a draft and just includes a stand alone file which uses IntervalArithmetic.jl, and does not yet integrate it into the module.
Extension to interval boxes should also be possible.