Repository navigation
fix: Abstract interpretation proves false assertions about arithmetic - #1159
Draft
fabiomadge wants to merge 1 commit into
Draft
fabiomadge wants to merge 1 commit into
fabiomadge wants to merge 1 commit into
Conversation
This was referenced Aug 31, 2026
fabiomadge
force-pushed
the
fix/interval-arithmetic-rules
branch
from
August 31, 2026 16:30
8f4cb09 to
64c9b66
Compare
fabiomadge
force-pushed
the
fix/interval-arithmetic-rules
branch
from
September 20, 2026 15:50
64c9b66 to
33727e8
Compare
fabiomadge
force-pushed
the
fix/interval-arithmetic-rules
branch
from
October 9, 2026 12:10
06b7c5f to
33a8752
Compare
*, div, mod, / and **
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.
Five of the interval domain's arithmetic rules inferred bounds that need not hold.
*with two negative lowerbounds claimed the product is at most their product.
div,modand/accepted a divisor that may be zero,which leaves the result unspecified.
**claimed a lower bound of 1 for an exponent of at least 1 and took itsupper bound from the exponent, though 0.5 ** 1.0 is 0.5 and 3.0 ** 2.0 is 9.0.
-infer:j→ 1 verified, 0 errors, though x = y = 4 gives 16. The loop is there only because inferred factsreach the prover at loop heads. Dafny turns this inference on by default and maps
*on reals to Boogie's*,so there the same pattern over reals proves
falsewithout any flags.Fix.
*keeps only its nonnegative case, and the divisions require a divisor of at least 1. That makes thedivand/rules identical, so they now share a case, whose bounds/checkInferproves for int and realoperands alike.
**loses its rule.Testing.
ArithmeticBounds.bplasserts each false bound; master verifies every one.**is emitted asreal_pow, which a monomorphic program leaves undeclared until #1166, soPowerBounds.bplchecks the inferredinvariant under
-noVerifyinstead, where master infers1e0 <= p && p <= 2e0. It should land before #1166:with that alone, master proves such false
**assertions.Linear5.bpl.expecthad recorded the falsex < 2after
-1 <= xandx := x*x. Dafny's 130 test files that use reals and reach the verifier give the sameresults with this change.
One of six.