Repository navigation
Conversation
Collaborator
|
Closing as superseded by #2213, which is merged: |
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.
Part of #2059. This does not close it.
This lands the proved part of adeerkhan's draft from #2059 as
tests/proof/u32_bits.bend, with amaininstance (shl_p2at 8 bits). The lemmas are the ones that do not needNat.subor theWord.sub/Word.cmplaws:shr_shlctop_eqtop_shlshl_p2top_p2plus the helper defs and def-theorems they rest on (
ctop,top,init,zeros,p2,ctop_p_eq,top_zeros, ...).Why
tests/proof, notBase: Base carries the operations andU32.add_commonly; these proofs need local helper defs, nothing in Base consumes them yet, and adding them to the prelude would slow every check.tests/proofis the established home for proven laws that are not yet in Base (bool_algebra.bendsays the same). They can move into Base when the four Array facts are complete and a consumer uses them.Verification on
upstream/main9162bfe9:bun bend2/main.ts tests/proof/u32_bits.bend --verdict->ALL PROOFS CHECK(Lean 4.34.0 kernel)bun bend2/main.ts tests/proof/u32_bits.bend->{==}bun bend2/main.ts tests/proof/u32_bits.bend -o u32_bits.js -o u32_bits-> the C and JS lanes both print{==}bun gates/repo.ts->PASS: 56 / 56The proofs are adeerkhan's draft; this PR adds the test wrapper and re-verifies them on current main.
Still missing for #2059:
Nat.add(d, Nat.sub(32, d)) == 32ford <= 32, then the borrow chain throughWord.adc/Word.sub/Word.cmp, the mask fact, the branch bit, and the subtraction bound. I'd be glad to continue on those once this lands.If maintainers would rather have these lemmas in
Basenow, say so and I'll move them.