Stop re-verifying prelude in pyAnalyzeLaurel#687
Open
MikaelMayer wants to merge 17 commits intomainfrom
Open
Conversation
Two changes: 1. Verifier: when proceduresToVerify is set, after CallElim inlines contracts at call sites, drop every procedure not in the target list. Previously the second FilterProcedures used a stale call-graph closure and kept prelude procedures, causing them to be re-verified for every test file. 2. CLI: filter prelude results from pyAnalyzeLaurel output. Only user-specific obligations are displayed and counted in the summary. Prelude failures are still reported if they occur. Prelude correctness is checked once by PreludeVerifyTest. All 39 expected_laurel test files updated (22 prelude lines removed from each, DETAIL counts adjusted).
aa0177b to
59b94eb
Compare
59b94eb to
0f6bc8f
Compare
The verifier fix (dropping non-target procedures after CallElim) is sufficient — no prelude VCs are generated, so CLI-level filtering is unnecessary and could mask bugs.
0f6bc8f to
fde0822
Compare
PrecondElim generates precondition-check VCs at call sites within user procedures that call prelude functions. These VCs inherit the callee's metadata (empty file path = prelude). Filter them from the displayed output and summary. Prelude failures are still reported.
PrecondElim generates WF-checking procedures for functions with preconditions. Prelude functions (List_get, PFloorDiv, etc.) have preconditions and were still in the program as .func declarations, causing PrecondElim to generate VCs for them. Strip preconditions from non-target functions before PrecondElim so no WF procedures are generated for them. The function definitions themselves are kept (needed for SMT encoding). Revert the CLI-level filtering since the verifier fix is now sufficient.
PrecondElim must run before filtering so that call-site precondition checks (e.g. List_get index bounds) are inserted into user procedure bodies. The filter then discards WF-checking procedures and prelude procedures, keeping only the target user procedures which now contain all necessary precondition assertions.
andrewmwells-amazon
previously approved these changes
Mar 27, 2026
aqjune-aws
reviewed
Mar 27, 2026
…tion' into feat/conservative-python-translation
Per review feedback, use FilterProcedures.run instead of a manual filter to keep CachedAnalyses valid.
aqjune-aws
previously approved these changes
Mar 27, 2026
joscoh
previously approved these changes
Mar 27, 2026
…k via call-graph closure
Tests with only prelude results now produce empty verification results after filtering.
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
The prelude was being re-verified for every Python test file, wasting time and cluttering test output with 22 identical prelude lines per file.
Changes
Verifier (
Strata/Languages/Core/Verifier.lean): WhenproceduresToVerifyis set, afterCallEliminlines contracts at call sites, drop every procedure not in the target list. Previously the secondFilterProceduresused a stale call-graph closure and kept prelude procedures, causing them to be re-verified every time.Expected files: All 39
expected_laureltest files updated — 22 prelude lines removed from each, DETAIL counts adjusted.Prelude correctness is verified once by the dedicated
PreludeVerifyTest.Testing
lake build StrataMainpassesPreludeVerifyTestpassesFailingAssertion,Axioms,AlwaysRunSMT,RemoveIrrelevantAxioms)