Skip to content

Add Ranges as a constructor using a provided total order on characters - #172

Merged
samuelchassot merged 46 commits into
mainfrom
sam/characterDescriptors
Nov 26, 2026
Merged

samuelchassot merged 46 commits into
mainfrom
sam/characterDescriptors

Conversation

@samuelchassot

@samuelchassot samuelchassot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Add a new case ElementRange[C](from: C, to: C, ord: Ordering[C]) to represent ranges of characters in an efficient way. Indeed, ElementSet[C](s: Set[C]) requires to compute the set belonging relation to match a character, while ElementRange only requires two comparison computations.

Adding this construct requires to remove firstChars and charsOf as these need to explicitly enumerate used characters, which is impossible with ranges on generic types. This means that the separator token concept and related proofs are also removed.

This verifies locally with stainless with internally mutable objects (epfl-lara/stainless#1787) which is not merged yet. EDIT it is merged now :)

If we want separator tokens back, we can roll back to this commit.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 16:54

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 and others added 5 commits November 25, 2026 15:55
# Conflicts:
#	lexers/regex/.DS_Store
#	lexers/regex/ziplex/src/main/scala/com/ziplex/lexer/LexerInterface.scala
#	lexers/regex/ziplex/src/main/scala/com/ziplex/lexer/Main.scala
#	lexers/regex/ziplex/src/main/scala/com/ziplex/lexer/VerifiedLexer.scala
#	lexers/regex/ziplex/src/main/scala/com/ziplex/lexer/VerifiedRegex.scala
#	lexers/regex/ziplex/stainless.conf
#	lexers/regex/ziplex/verify.sh
@samuelchassot
samuelchassot merged commit 936eed2 into main Nov 26, 2026
1 check passed
@samuelchassot
samuelchassot deleted the sam/characterDescriptors branch November 26, 2026 14:15
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