Repository navigation
Trap i64.MIN remainder overflow in the Lean operator - #170
Open
dcharlot65-openie wants to merge 2 commits into
Open
dcharlot65-openie wants to merge 2 commits into
dcharlot65-openie wants to merge 2 commits into
Conversation
N2 requires i64.MIN % -1 to trap with overflow, the same as division. The expression operator returned 0, and the printed MiniRust remainder checked only the remainder in i128. Both now check the quotient against the static range first. Vectors cover the Lean operator, the core evaluator, the emit differential, and the reference interpreter. Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
Bring in the production acceptance gate and the longer fast-job limit. Co-authored-by: David Charlot <dcharlot65-openie@users.noreply.github.com>
This branch has not been deployed
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.
N2 requires
i64.MIN % -1to trap with overflow, the same asi64.MIN / -1. The interpreter andemit/rt.rsalready trap. The Lean expression operator returnedok 0for that case, and the printed MiniRust remainder checked onlychecked_remini128, which holds the quotient2^63.binop .remchecks the quotient against the static range before the remainder.checked_div, thenchecked_rem.binop_tystill says a successful operator result has the result type. The proof cases on the quotient check.binopand coreevalexamples, the emit differential (i64_min_div,i64_min_rem), and the interpreter testn2_min.Checks
lake buildcompleted.lake env lean audit/Audit.lean: 5539 RCE theorems, standard axioms only.Trap::Overflow.cargo test --test n2_minandb001_imin_rem_minus_one_trapspassed on Rust 1.98.1.No
sorry, no new axioms, and no weakened statement.