fix: sync task template signatures with proven theorems#20
Merged
Conversation
9 of the 15 Generated task files had drifted from the actual proven theorems in Proofs.lean. Key issues fixed: - Remove references to undefined `stronglyAcyclic` (4 files) — replaced with `uniquePredecessor` which is the actual defined predicate used in the proofs - Remove unnecessary hypotheses (`hPreAcyclic`, `hFreshInList`, `hNoSelfLoop`, `hOwnerNePrev`, `hOldNePrev`) that the proofs derive internally from `ownerListInvariant` + `uniquePredecessor` - Add missing hypotheses (`hUniquePred`, `hPrevNZ`, `hZeroInert`) that the proofs actually require - Fix acyclicity tasks (addOwner, removeOwner, swapOwner) to match the proof which needs no pre-state invariant hypotheses — acyclicity is a tautology proven by `acyclic_generic` - Fix InListReachable to match proof signature (remove unused `_hPreSentNZ`, use inlined conclusion form)
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.
Summary
Fixes 9 Generated task template files whose theorem signatures had drifted from the actual proven theorems in
Proofs.lean. These were flagged by Codex and Cursor Bugbot in #18.Issues fixed
4 files reference undefined
stronglyAcyclic—RemoveOwnerInListReachable,RemoveOwnerOwnerListInvariant,SwapOwnerInListReachable,SwapOwnerOwnerListInvariantall referencestronglyAcyclicwhich has no definition in the codebase. Replaced withuniquePredecessor(defined inSpecs.lean:142), which is what the actual proofs use.Unnecessary hypotheses removed — Several tasks included
hPreAcyclic : acyclic s,hFreshInList : freshInList s owner,hNoSelfLoop,hOwnerNePrev,hOldNePrevthat the proofs derive internally fromownerListInvariant+uniquePredecessor.Missing hypotheses added —
hUniquePred : uniquePredecessor s,hPrevNZ : prevOwner ≠ zeroAddress,hZeroInert : next s zeroAddress = zeroAddresswere missing from tasks but required by the actual proofs.Acyclicity tasks simplified —
addOwner_acyclicity,removeOwner_acyclicity,swapOwner_acyclicityhad unnecessary pre-state invariant hypotheses. Acyclicity is a tautology (proven byacyclic_genericfor any state).InListReachable — Removed unused
_hPreSentNZhypothesis, matched conclusion form to proof.Affected files (9 of 15 tasks)
AddOwnerAcyclicityhPreAcyclic,hFreshInListAddOwnerOwnerListInvarianthAcyclic,hFreshInListInListReachable_hPreSentNZ, match conclusion formRemoveOwnerAcyclicityhPreAcyclicRemoveOwnerInListReachablestronglyAcyclic→uniquePredecessor, addhPrevNZ/hZeroInert, removehAcyclicRemoveOwnerOwnerListInvariantstronglyAcyclic→uniquePredecessor, removehAcyclic/hOwnerNePrev/hNoSelfLoopSwapOwnerAcyclicityhPreAcyclic,hFreshSwapOwnerInListReachablestronglyAcyclic→uniquePredecessor, useownerListInvariantinstead ofinListReachable, addhPrevNZ/hZeroInert, removehAcyclic/hOldNePrev/hFreshSwapOwnerOwnerListInvariantstronglyAcyclic→uniquePredecessor, removehAcyclic/hOldNePrev/hFresh/hNoSelfLoopTest plan
lake buildstill succeeds (task files are template stubs, not compiled)theoreminProofs.leanNote
Low Risk
Changes only adjust generated Lean task template theorem signatures and comments to match existing proved theorems/invariants, without modifying contract logic. Risk is low, mainly around downstream tooling expecting the old hypothesis lists.
Overview
Updates the generated
OwnerManagerReachtask templates to match the proven theorem interfaces: removes unused preconditions (e.g.acyclic,freshInList, self-loop and inequality facts), drops an unused_hPreSentNZ, and standardizes conclusions to use the inline post-state expression.Replaces references to the nonexistent
stronglyAcyclicassumption withuniquePredecessorand adds missing required hypotheses (hPrevNZ,hZeroInert) forremoveOwner/swapOwnerreachability and invariant preservation tasks.Simplifies the
*_acyclicitytasks to require only Solidity guard-style hypotheses, documenting that acyclicity follows generically (acyclic_generic) rather than from pre-state invariants.Reviewed by Cursor Bugbot for commit 54d6cb0. Bugbot is set up for automated code reviews on this repo. Configure here.