Skip to content

Support return statements in Laurel functions#486

Merged
keyboardDrummer merged 45 commits intomainfrom
remy/functionControlFlow
Mar 10, 2026
Merged

Support return statements in Laurel functions#486
keyboardDrummer merged 45 commits intomainfrom
remy/functionControlFlow

Conversation

@keyboardDrummer
Copy link
Contributor

@keyboardDrummer keyboardDrummer commented Feb 26, 2026

Changes

Functional:

  • Adds a new EliminateReturnsInExpression pass that tries to eliminate return statements.
  • Adds not supported message for assert, assume, and local variable declarations without an initializer, that occur in expressions.

Refactoring:

  • Introduces a MetaData type abbreviation and refactors the disallowed helper signature
  • Renames boogie* variables to core* in translateStmt

Performance:

  • Partitions liftImperativeExpressions to skip functional procedures. This does not change the outcome of the pipeline but it might reduce work a bit.

Testing

  • Added cases to T3_ControlFlow
  • Added T3_ControlFlowError to clarify that assert and assume are not yet supported in functions

joehendrix
joehendrix previously approved these changes Mar 4, 2026
Copy link
Contributor

@joehendrix joehendrix left a comment

Choose a reason for hiding this comment

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

I left one performance comment, but I don't consider it blocking.

fabiomadge
fabiomadge previously approved these changes Mar 4, 2026
fabiomadge
fabiomadge previously approved these changes Mar 5, 2026
joehendrix
joehendrix previously approved these changes Mar 5, 2026
shigoel
shigoel previously approved these changes Mar 5, 2026
Copy link
Contributor

@shigoel shigoel left a comment

Choose a reason for hiding this comment

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

LGTM in general; left two minor comments aren't blocking.

@keyboardDrummer keyboardDrummer added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit d00b0f6 Mar 10, 2026
15 checks passed
@keyboardDrummer keyboardDrummer deleted the remy/functionControlFlow branch March 10, 2026 11:14
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.

5 participants