Simplify exclusion bit range module and type #1816
Merged
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.
Previously the exclusion bit ranges used this module:
There's a lot of unnecessary complication here:
ikind-aware interval domain implementation for the bit ranges, which aren't really C things. And to do it we're arbitrarily considering them as Cint.ikind-awareness lifts each interval domain element into a record which also keeps track of theikind, which is always the same for bit ranges.overflow_infowhich isn't relevant for the small bit ranges anyway.IntervalFunctoralso hasbot, but bit ranges should never have that: if the bit range is bottom, the whole def_exc/enums abstraction should become bottom.int64 * int64, butint * intwould be enough for bit ranges (they're very small numbers anyway). But also it avoids extra indirection needed byint64in OCaml.After this PR, the module is much simpler:
IntervalArithisn't a full-blownLattice, but just a small set of mathematical interval operations (without a bottom). This already existed before to share some code, but is slightly extended here.NIntOpsusesintfor the bounds.TODO
suppress_ovwarnarguments #1815.