Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crucible-syntax: Allow exotic characters in fresh atom names #1266

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

RyanGlScott
Copy link
Contributor

Previously, we used userSymbol to create fresh atom names, but userSymbol will fail if given any characters outside of the very narrow range of characters allowed in What4 solver names. Instead, we now use safeSymbol, which will Z-encode any unallowable characters into something that is allowed in a What4 solver name. This ensures (among other things) that we can write things like (let i-3 (fresh Bool)), as hyphens are not allowed in What4 solver names without Z-encoding them.

Fixes #1024.

Previously, we used `userSymbol` to create fresh atom names, but `userSymbol`
will fail if given any characters outside of the very narrow range of
characters allowed in What4 solver names. Instead, we now use `safeSymbol`,
which will Z-encode any unallowable characters into something that is allowed
in a What4 solver name. This ensures (among other things) that we can write
things like `(let i-3 (fresh Bool))`, as hyphens are not allowed in What4
solver names without Z-encoding them.

Fixes #1024.
@RyanGlScott RyanGlScott force-pushed the T1024-crucible-syntax-exotic-fresh-var-names branch from 303cc61 to 8be1cd0 Compare November 26, 2024 10:34
@RyanGlScott RyanGlScott merged commit 80df1aa into master Nov 26, 2024
32 checks passed
@RyanGlScott RyanGlScott deleted the T1024-crucible-syntax-exotic-fresh-var-names branch November 26, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crucible-syntax: let ... fresh fails to parse when identifier contains a hyphen
2 participants