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

Automatic simplification fails with singletons in special cases #38

Closed
TimBergner opened this issue Sep 16, 2020 · 4 comments
Closed

Automatic simplification fails with singletons in special cases #38

TimBergner opened this issue Sep 16, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@TimBergner
Copy link

The automatic simplification seems to fail with singletons if it closes exactly one gap. In this case the singleton is only added to the left open interval on the right of the sigleton.
Examples:

P.open(1, 2) | P.open(2, 3) | P.singleton(2)
>>> (1,2) | [2,3)
P.open(1, 3) & ~P.singleton(2) | P.singleton(2)
>>> (1,2) | [2,3)

If the result is stored in a Variable x, further calculations might be faulty:

P.open(1, 3) in x
>>> False
@TimBergner
Copy link
Author

Of course one of the most important information was only implicit in the examples: the problem concerns the merge function.

@AlexandreDecan
Copy link
Owner

Hello,

Thank you for having reported this issue! I'll have a look asap and try to release a hotfix asap as well :-)

@AlexandreDecan AlexandreDecan added the bug Something isn't working label Sep 16, 2020
AlexandreDecan added a commit that referenced this issue Sep 16, 2020
@AlexandreDecan
Copy link
Owner

I found the issue. When intervals are simplified, the underlying atomic intervals are sorted by their lower bound. and an attempt to merge them is made. Since (2, 3) and [2] have the same lower bound, the order in which they are provided defines the order in which they will be considered (and that's why (1, 2) | [2] | (2, 3) works): it tries first to merge (1, 2) and (2, 3) (they can't), then (2, 3) and [2] (which results in [2, 3)).

I'll confirm this asap, fix it, and release a hotfix.

AlexandreDecan added a commit that referenced this issue Sep 16, 2020
@AlexandreDecan
Copy link
Owner

Fixed in 39e2564

Fix will be released in a few minutes as part of version 2.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants