Skip to content

Call ListSpecs lemmas as statements instead of using them as Booleans - #189

Merged
samuelchassot merged 2 commits into
mainfrom
sam/removeHolds
Nov 25, 2026
Merged

samuelchassot merged 2 commits into
mainfrom
sam/removeHolds

Conversation

@samuelchassot

Copy link
Copy Markdown
Contributor

The .holds lemmas of ListSpecs are becoming Unit lemmas with ensuring in the Stainless library. This PR changes the call sites that used them as Booleans so that they verify with both the current and the new library, so it can be merged independently of the Stainless change.

Two rewrites:

  • assert(appendAssoc(...)) / check(rightUnitAppend(...)) → appendAssoc(...) as a statement
  • lemma used inside a Boolean expression → { appendAssoc(...); true }

Files: LeftPad.scala, Queue2.scala, ConcRope.scala, simple-conc/BalanceConc.scala, simple-conc/BalanceConcArr.scala, and ziplex's BalanceConcArr.scala. The other projects that use these lemmas already called them as statements or through stainless.equations.

Verified: all 10 affected projects pass with the current library and with the new one (ziplex restricted to --functions=BalanceConcObj._).

The .holds lemmas of ListSpecs are becoming Unit lemmas with ensuring in
the Stainless library. Calling them as statements (or as '{ lemma; true }'
inside Boolean lemma instantiations) verifies with both versions of the
library.
Copilot AI balanced review requested due to automatic review settings November 24, 2026 15:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@samuelchassot
samuelchassot merged commit ea17adb into main Nov 25, 2026
1 check passed
@samuelchassot
samuelchassot deleted the sam/removeHolds branch November 25, 2026 14:31
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.

2 participants