Defining invariant that CachedAnalysis must hold, update PrecondElim#704
Defining invariant that CachedAnalysis must hold, update PrecondElim#704MikaelMayer wants to merge 8 commits intomainfrom
Conversation
… call graph (#702) PrecondElim generates WF procedures but did not update the cached call graph, which prevented FilterProcedures from being used after PrecondElim in the selective verification pipeline. - Add CallGraph.addLeafNode for inserting nodes with no callees - Update PrecondElim to register generated WF procedures in the call graph - Move the second FilterProcedures.run after PrecondElim in the Verifier - Document the CachedAnalyses call graph invariant
…ysis-m # Conflicts: # Strata/Languages/Core/CallGraph.lean # Strata/Transform/PrecondElim.lean
…ysis-m # Conflicts: # Strata/Languages/Core/Verifier.lean
|
after this patch, is FilterProcedure usable instead of the manual filtering introduced in #687? |
|
Not yet — this patch only maintains the call-graph invariant for For This PR lays the groundwork for that by documenting the invariant and showing the pattern ( |
|
Good catch — the PR description was overclaiming. I've updated it to remove the bullet about moving |
Fixes #702
Problem
PrecondElimgenerates WF (well-formedness) checking procedures but did not update the cached call graph. This meant any downstream transform relying on the call graph would see stale data afterPrecondElim.Solution
CachedAnalysesinvariant: when the call graph is present, it must reflect the current program's procedure call structure. Transforms must update it or invalidate it.CallGraph.addLeafNodefor inserting nodes with no callees.PrecondElimto register generated WF procedures as leaf nodes in the call graph (they contain only assert/assume statements and make no procedure calls).Note: the manual filtering in the Verifier's selective verification pipeline remains because
CallElimdoes not yet maintain the call-graph invariant. OnceCallElimalso updates the call graph (removing call edges when it inlines contracts),FilterProcedurescould replace the manual filtering entirely. This PR lays the groundwork by documenting the invariant and showing the pattern.Testing
All existing tests pass.