Resolve Laurel in Python pipeline#638
Merged
keyboardDrummer merged 101 commits intomainfrom Mar 30, 2026
Merged
Conversation
atomb
previously requested changes
Mar 27, 2026
Contributor
atomb
left a comment
There was a problem hiding this comment.
I suggested two small changes, and two comments (thanks to Kiro) that could potentially lead to more substantive changes.
StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean
Outdated
Show resolved
Hide resolved
MikaelMayer
reviewed
Mar 30, 2026
Contributor
MikaelMayer
left a comment
There was a problem hiding this comment.
Thorough review of the PR. The architecture is well-designed: moving definitions from Core to Laurel, SCC-based ordering for recursive functions, and the invokeOn mechanism are all clean. A few items to address below.
StrataTest/Languages/Python/expected_laurel/test_missing_models.expected
Show resolved
Hide resolved
joscoh
previously approved these changes
Mar 30, 2026
joscoh
approved these changes
Mar 30, 2026
MikaelMayer
approved these changes
Mar 30, 2026
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.
Note: it would be possible to extract the Laurel changes in this PR, the top 5 bullets, into a separate PR. They're also easy to review in isolation though since they only affect files in Laurel folders.
Changes
Laurel
if/then/elsein Laurel to match that of Core expressions (but not statements) and Lean.{and}is now only for blocksinvokeOnproperty to Laurel procedures, which acts like a Verusbroadcastand creates an axiom for the procedure's postconditionPython
Caveats
Core currently requires all recursive functions to specify a
casesargument. Laurel will simply use the first datatype argument as the cases argument, which could be incorrect. In a future PR, I will use the decreases clauses from Laurel to determine the cases argument. Initially, we will only support a decreases clause that contains just a single datatype parameter, because of the restrictions of Core.Currently, Core library/factory functions need to have their signature be redefined in a Laurel prelude file, which creates some duplication. In a future PR, we should enable Laurel to automatically import these Core functions. Example of the code duplication:
PythonLaurelCorePrelude.leanstill exists, because it contains two functions that have a signature with function types, that Laurel can't express yet. I will enable and move those functions in a follow-up PR.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.