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

#420: More operations in string theory #422

Merged
merged 10 commits into from
Dec 31, 2024
Merged

Conversation

kfriedberger
Copy link
Member

@kfriedberger kfriedberger commented Dec 26, 2024

This PR adds support for conversion between strings and integers based on code points.
See #420 for the requirement of this API extension in String theory.

Open issues from here:

  • Princess has some missing features for String theory, aka crashes on simple tests.
  • how does SMTLIB escape escaped Unicode? e.g., how could a user specify "\u{1234}" as String directly?

Unicode characters were not handled in the same way in SMT solvers.
Z3, CVC4, and CVC5 require proper escaping.
Z3 also supports Java-based Unicode characters.
Princess only allows 16bit-sized Unicode, i.e., up to 0x0FFFF, which misses surrogate pairs up to 0x2FFFF as defined in SMTLIB.
Copy link
Contributor

@daniel-raffler daniel-raffler left a comment

Choose a reason for hiding this comment

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

Looks good to me! There is some overlap with #412, but I think it's fine to do it as part of this pull request.

And I think we still need to add the new operations to FunctionDeclarationKind for the visitor?

@@ -300,6 +300,8 @@ public enum FunctionDeclarationKind {
STR_IN_RE,
STR_TO_INT,
INT_TO_STR,
STR_FROM_CODE,
STR_TO_CODE,
STR_LT,
Copy link
Member Author

@kfriedberger kfriedberger Dec 31, 2024

Choose a reason for hiding this comment

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

I added the mentioned operations already here.
And Junit tests assure that the operations are visited correctly.

@kfriedberger kfriedberger merged commit e41fac8 into master Dec 31, 2024
2 of 3 checks passed
@kfriedberger kfriedberger deleted the 420-more-string-theory branch December 31, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants