You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
One @unsafe law fill in a file PROOF.bend imports silently proves every law: bend PROOF.bend prints a clean "All terms check." (regression from #848) #1001
The verdict is unsound: LAWS.false_law : {1n == 0n : Nat} holds only because an @unsafe self-call skips the termination check, yet bend reports every term as checked and prints no unsafe note. LAWS.bend is imported (through Helper), so the "PROOF.bend must import ./LAWS.bend" check passes, and no law is open, so there is no TODO error.
The false law is then an ordinary hypothesis for every other law. With a second law in LAWS.bend
lawsucc_is_id:
for+n: Nat
{1n+n==n : Nat}
and its proof added to Helper.bend, derived from false_law with no further @unsafe:
bend PROOF.bend still prints a clean All terms check. (exit 0). One @unsafe line in a file PROOF.bend imports closes every law of LAWS.bend without a note.
The report itself works when it starts from the right place. The unsafe fill written in PROOF.bend instead gives
All terms check, but 1 def relies on unsafe or foreign code:
- LAWS.false_law
and the derivation written in PROOF.bend (the unsafe fill still in Helper) gives
All terms check, but 2 defs rely on unsafe or foreign code:
- boom
- LAWS.succ_is_id
This is a regression. Running the first repro (false_law only) across commits:
Since f1d23d3c, cli_report walks the references of the root file's own entries (book.order.slice(n0)), so "an imported @unsafe def the file never calls" stays silent. A law fill is not a call, though: it closes a claim of LAWS.bend from whichever file holds it, and the root never refers to it. The fill is pushed to book.order inside Helper's range, so the walk never starts there.
WONTFIX says of #776 and #805: "read the note, not the exit code". Here there is no note, so the gate the guide describes ("bend PROOF.bend is the gate: it fails while any law is open or false") reports success for a false law with no signal at all.
A possible fix: seed the walk with every law of the book that was filled outside Base (or at least every law of LAWS.bend when the root is PROOF.bend), not only the root's entries.
Activity
bend PROOF.bend fails only when a law or its proof relies on unsafe o…