Merged
Conversation
sim642
commented
Aug 14, 2025
Comment on lines
-297
to
-302
| let is_zero v = Ints_t.compare v Ints_t.zero = 0 in | ||
| match y1, y2 with | ||
| | l, u when is_zero l && is_zero u -> (top_of ik,{underflow=false; overflow=false}) | ||
| | l, _ when is_zero l -> div ik (Some (x1,x2)) (Some (Ints_t.one,y2)) | ||
| | _, u when is_zero u -> div ik (Some (x1,x2)) (Some (y1, Ints_t.(neg one))) | ||
| | _ when leq (of_int ik (Ints_t.zero) |> fst) (Some (y1,y2)) -> (top_of ik,{underflow=false; overflow=false}) |
Member
Author
There was a problem hiding this comment.
By the way, I'm not sure why, but the old handling of division by 0 is quite inconsistent (i.e. not monotone in the second argument):
x / [0, 0]returns top (for division by 0).x / [0, 42]delegates tox / [1, 42], which doesn't return top.x / [-42, 0]delegates tox / [-42, -1], which doesn't return top.x / [-42, 42]again returns top (for division by 0).
The new handling consistently returns top in all of the above cases.
Maybe the goal was to imitate the kind of split at 0 which is now part of the general logic in IArith.div?
sim642
added a commit
that referenced
this pull request
Sep 23, 2025
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1803.
TODO
leqcheck.