Skip to content

Prove a guarantee that says is not in the tab, below and above the value (FA-91) - #231

Open
humuhumu33 wants to merge 1 commit into
mainfrom
fix/guarantee-is-not
Open

humuhumu33 wants to merge 1 commit into
mainfrom
fix/guarantee-is-not

Conversation

@humuhumu33

Copy link
Copy Markdown
Contributor

Why

The live site refuses a true guarantee when its conditions say is not. The in-tab prover reads a guarantee's conditions as one box, and a box can't say is not: it keeps every value of the field. So the guarantee is checked over the excluded value too.

Seen on https://uor-foundation.github.io/foundry/ with the parking-fee fixture. INV-004, "always premium over eight hours unless the vehicle is a motorcycle", is true, and the studio's own checker accepts it. Approving answered "Not proved. Lean's kernel refused INV-004", because motorcycles park free.

What changes

  • The lemma. ruleHolds_split in studio/proof/PrismLive/Regions.lean joins proofs of a guarantee below the value and above it into a proof of the guarantee as written. A whole number other than v is either less than v or greater. RuleHolds names ruleJudge_sound's conclusion, and ruleJudge_holds restates the theorem in that form. Lean 4.32.1 proves it on propext and Quot.sound, and Axioms.lean prints it; the CI count moves from 3 to 4.
  • The prover. A guarantee with is not is proved as two boxes, its halves are joined with ruleHolds_split, and the kernel checks the join. Guarantees without is not are written exactly as before.
  • The library. It is re-exported with the three new roots. With main's roots, the same export reproduces main's library byte for byte first (a22cb8e5…). The pinned kernel judges the new library whole (2,126 declarations), and the manifest and binding are updated.
  • FA-91 and its test. The test runs prism.prove in Node with the shipped kernel and library and the pinned guest. INV-004 is proved, and a variant a motorcycle breaks is refused and named. The test sits in the FA-86 suite and FA-91's Rust test beside FA-86's, as FA-90's is, so audit-prism sees no new file.
  • Offsetting the growth. The in-browser bench prototype (v2/in-tab-kernel/web) goes, so non-Prism code shrinks by 61 lines.

Evidence

  • Planted defects. With main's prover, the FA-91 test fails on INV-004. With the join given the wrong value, the kernel refuses it. Restored, the test passes.
  • Gates, run locally.
    • On this commit: the whole conformance suite (148 tests), check-model, foundry_model --check, audit-prism and cargo fmt --check pass.
    • The in-tab and prover suites pass (33 tests).
    • studio/proof builds, and all four printed theorems rest on propext and Quot.sound.

Not covered

Guarantees that compare two fields still can't be proved in the tab; the rule judge compares a field with a value. Not run here: the studio.yml steps that need the SDK image.

🤖 Generated with Claude Code

The in-tab prover read a guarantee's conditions as one box, and a box
cannot say is not, so a true guarantee was checked over the excluded
value too and refused. The parking-fee fixture's INV-004 (always premium
over eight hours unless the vehicle is a motorcycle) was refused on the
live site.

ruleHolds_split, proved in studio/proof on propext and Quot.sound, joins
proofs of the guarantee below the value and above it into a proof of
the guarantee as written. The prover proves each half as a box and the
kernel checks the join; guarantees without is not are written as before.
The library is re-exported with the lemma (the export reproduces main's
library byte for byte first), and the pinned kernel judges it whole.

The FA-91 test runs prism.prove in Node with the shipped kernel and the
pinned guest: INV-004 is proved, a variant a motorcycle breaks is
refused. Planted, main's prover and a join with the wrong value are each
refused. The in-browser bench prototype (v2/in-tab-kernel/web) goes, so
non-Prism code shrinks by 61 lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant