Repository navigation
Conversation
…r foreign code (bendlang#1463) A PROOF.bend's claims are its own defs and its LAWS.bend's. Any other def that relies on unsafe or foreign code, such as a foreign effect in the module that holds main, is listed in a note on the pass instead of failing every law. Under --verdict the kernel lets those noted defs be out of its scope. Other roots keep bendlang#1001's rule: every def outside Base is a claim.
viridale
force-pushed
the
fix-1463-proof-claims
branch
from
October 10, 2026 03:04
56d2e9c to
25e4dbf
Compare
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.
Fixes #1463.
Until now,
bend PROOF.bendfailed every law if any def in the import graph relied on unsafe or foreign code, for example an effect in the module that holdsmain. With this change, a PROOF.bend's claims are its own defs and itsLAWS.bend's. A def outside them that relies on a promise is listed in a note, and the run passes:A law still fails when its statement or proof relies on a promise, directly or through anything it names. The walk is the same
book_promisesflood as before; only the split into a failure and a note is new. An unsafe fill of a law counts too, because it setsuon the law's own def. Roots other than PROOF.bend keep #1001's rule: every def outside Base is a claim. Theunsafe_*import tests are unchanged.bend2/main.ts:cli_verdicttakes the root file and splitsbook_promisesinto the failure and the note. A new helper,relies, formats both lists. The failure text is byte-for-byte the same as before.bend2/safe.ts:safe_checktakes the noted defs and lets them be out of the kernel's scope. Without this,--verdictwould answer an unused@unsafedef with the MISMATCH message. Everything else it checks is unchanged.guide/GUIDE.md: the--verdictparagraph now says "every law and proof" instead of "every def outside Base".Tests (a test runs its file as the root, so each PROOF.bend has its own directory):
tests/proof/PROOF.bend: a law about a puregreet, beside an importedmainthat loops by an@unsafedef. It passes with the note. Before this change it failed and listedapp/main.serveandapp/main.main.tests/import/PROOF.bend: a false law, proved by an@unsafedef of the PROOF.bend's own. It still fails, listing the law and that def, but no longer the unrelatedunsafe-law/safe.spinit also imports.LAWS.bendrun alone is an open claim, which the test pins.How I checked it, all locally:
gates/repo.ts: 54 / 54.--verdictwith the Lean kernel on both the issue's files andtests/proof/PROOF.bend: ALL PROOFS CHECK plus the note.app_slash_boss_3d,io_http_server,io_tcp_echos,pure_hvm5_mini) now pass with a note. In each, the noted defs belong to the module that holdsmain, and no law names them. The others are unchanged.