Skip to content

[Property Coverage] Prove view-function correctness & read-only properties for Counter and Vault - #2056

Merged
Th0rgal merged 2 commits into
mainfrom
proof/counter-preview-view-functions
Jun 23, 2026
Merged

[Property Coverage] Prove view-function correctness & read-only properties for Counter and Vault#2056
Th0rgal merged 2 commits into
mainfrom
proof/counter-preview-view-functions

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Increases the proven fragment by 9 fully-proven theorems (zero sorry, zero new axioms) covering view-family functions on two example contracts that previously had no proofs. Proven theorem count: 291 → 300.

Counter preview view functions (+3)

  • previewAddTwice_correct — closed-form result: previewAddTwice delta returns add (add (count) delta) delta.
  • previewAddTwice_preserves_statepreviewAddTwice is read-only (state unchanged).
  • previewOps_preserves_state — the pure arithmetic pipeline previewOps is read-only (state unchanged).

Vault view functions (+6)

  • totalAssets_meets_spec / totalAssets_preserves_state — slot-0 read meets totalAssets_spec; read-only.
  • totalSupply_meets_spec / totalSupply_preserves_state — slot-1 read meets totalSupply_spec; read-only.
  • balanceOf_meets_spec / balanceOf_preserves_state — mapping (slot 2) read meets balanceOf_spec; read-only.

Each *_meets_spec is proven against the existing spec surface in Contracts.Vault.Spec / Contracts.Counter.Spec; each *_preserves_state establishes the function never writes storage.

Changes

  • Contracts/Counter/Proofs/Preview.lean (new) — the three Counter theorems.
  • Contracts/Counter.lean — import the new Counter proofs module.
  • Contracts/Vault/Proofs/Correctness.lean — replace placeholder with the six Vault view-function theorems.
  • test/property_exclusions.json — list the nine read-only/closed-form lemmas as coverage exclusions (consistent with existing read-only/preservation exclusions).
  • Regenerated: test/property_manifest.json, PrintAxioms.lean, artifacts/verification_status.json, docs/VERIFICATION_STATUS.md, README/llms.txt theorem counts.

Test plan

  • lake build Contracts.Counter and lake build Contracts.Vault.Proofs.Correctness compile green, zero warnings (proofs verified by the Lean kernel).
  • python3 scripts/property_pipeline.py check — manifest/coverage/lean-sync all pass.
  • generate_verification_status.py --check, generate_print_axioms.py --check, update_doc_numbers.py --check, check_verification_status_doc.py, lean_lint --only proof_length all pass.
  • Zero sorry; zero new custom axioms (AXIOMS.md unchanged).

Add three kernel-verified theorems (zero sorry, zero new axioms) for the
Counter contract's previously-unproven preview view functions:
- previewAddTwice_correct: closed-form result add (add count delta) delta
- previewAddTwice_preserves_state: read-only (state unchanged)
- previewOps_preserves_state: pure arithmetic pipeline is read-only

Regenerate manifest, PrintAxioms, verification_status, and doc theorem
counts (291 -> 294 proven). List the three lemma-style properties in
property_exclusions.json, consistent with existing Counter read-only
exclusions.

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

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
verity Ready Ready Preview, Comment Jun 23, 2026 9:09am

Request Review

…tions

Adds six fully-proven theorems (zero sorry, zero new axioms) for the Vault
example's view functions, which previously had no proofs:

- totalAssets_meets_spec / totalAssets_preserves_state
- totalSupply_meets_spec / totalSupply_preserves_state
- balanceOf_meets_spec   / balanceOf_preserves_state

Each meets_spec establishes the closed-form read result against the existing
Contracts.Vault.Spec; each preserves_state establishes the function is
read-only. Regenerates manifest, exclusions, verification status, PrintAxioms,
and README/llms.txt theorem counts (294 -> 300 proven).
@Th0rgal Th0rgal changed the title [Property Coverage] Prove correctness and read-only properties for Counter preview view functions [Property Coverage] Prove view-function correctness & read-only properties for Counter and Vault Jun 23, 2026
@Th0rgal
Th0rgal merged commit bc4435b into main Jun 23, 2026
22 checks passed
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