Skip to content

Pass mkDischarge through PyAnalyzeConfig to verifyProgram#1200

Merged
MikaelMayer merged 4 commits into
mainfrom
issue-1199-mkdischarge-parameterization-lost-in-squ
May 20, 2026
Merged

Pass mkDischarge through PyAnalyzeConfig to verifyProgram#1200
MikaelMayer merged 4 commits into
mainfrom
issue-1199-mkdischarge-parameterization-lost-in-squ

Conversation

@MikaelMayer
Copy link
Copy Markdown
Contributor

@MikaelMayer MikaelMayer commented May 20, 2026

The mkDischarge parameter was accepted by Core.verifyProgram but not exposed through PyAnalyzeConfig or the CLI verify command, so callers could not supply a custom solver discharge function.

This PR:

  • Adds mkDischarge to PyAnalyzeConfig (defaulting to Core.mkDischargeFn) and forwards it to the verification call.
  • Adds mkDischarge as a parameter to verifyCommand and passes it through to the verify call.
  • Adds mkDischarge as a parameter to pyAnalyzeLaurelCommand (same pattern), so downstream executables can override the discharge function without redefining the command.

Tested: existing tests pass, build succeeds.

Fixes #1199

Add mkDischarge field to PyAnalyzeConfig with default Core.mkDischargeFn,
and forward it to Core.verifyProgram in the verification phase. This allows
callers of runPyAnalyzePipeline to supply a custom solver discharge function.
@MikaelMayer
Copy link
Copy Markdown
Contributor Author

Thanks for the quick fix! This covers the pyAnalyzeLaurel path via PyAnalyzeConfig, which is great.

However, the verify command in StrataMainLib.lean also needs the same treatment — it calls verify pgm inputCtx proceduresToVerify opts (in SimpleAPI) without passing mkDischarge. Could you also either:

  1. Parameterize verifyCommand with mkDischarge (same pattern), or
  2. Add a similar config struct for the verify path

so that downstream executables can override the discharge function for both commands?

@MikaelMayer
Copy link
Copy Markdown
Contributor Author

🤖 Addressed — verifyCommand now accepts a mkDischarge parameter (defaulting to Core.mkDischargeFn) and passes it through to the verify call. See commit 141b2ed.

@MikaelMayer MikaelMayer marked this pull request as ready for review May 20, 2026 22:00
@MikaelMayer MikaelMayer requested a review from a team May 20, 2026 22:00
@MikaelMayer MikaelMayer enabled auto-merge May 20, 2026 22:00
aqjune-aws
aqjune-aws previously approved these changes May 20, 2026
@MikaelMayer
Copy link
Copy Markdown
Contributor Author

One more request: could pyAnalyzeLaurelCommand also be parameterized with mkDischarge (same pattern as verifyCommand)? It currently constructs PyAnalyzeConfig internally, so a downstream exe cannot override config.mkDischarge without redefining the entire command.

-def pyAnalyzeLaurelCommand : Command where
+def pyAnalyzeLaurelCommand (mkDischarge : Core.MkDischargeFn := Core.mkDischargeFn) : Command where

and inside the callback where PyAnalyzeConfig is constructed:

-    let config : PyAnalyzeConfig := { ... }
+    let config : PyAnalyzeConfig := { ..., mkDischarge }

With both commands parameterized, a downstream exe is just:

commandMap
  |>.insert "verify" (verifyCommand (mkDischarge := myFn))
  |>.insert "pyAnalyzeLaurel" (pyAnalyzeLaurelCommand (mkDischarge := myFn))

@MikaelMayer MikaelMayer disabled auto-merge May 20, 2026 22:04
@MikaelMayer
Copy link
Copy Markdown
Contributor Author

🤖 Done — pyAnalyzeLaurelCommand now takes mkDischarge with the same pattern as verifyCommand. Commit: 2b5b4f9

Copy link
Copy Markdown
Contributor Author

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖🔍 Clean, minimal PR. The mkDischarge parameter is threaded correctly through PyAnalyzeConfig, pyAnalyzeLaurelCommand, and verifyCommand, all with appropriate defaults preserving backward compatibility. The existing call sites at lines 1426/1431 continue to work without arguments. No issues found.

@MikaelMayer MikaelMayer added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit beb9b9c May 20, 2026
22 checks passed
@MikaelMayer MikaelMayer deleted the issue-1199-mkdischarge-parameterization-lost-in-squ branch May 20, 2026 23:37
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.

mkDischarge parameterization lost in squash merge of #1046

3 participants