-
Notifications
You must be signed in to change notification settings - Fork 46
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
String formulae #250
String formulae #250
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this PR. Overall it is clean and simple.
It would be nice to merge after fixing a few small points:
- the set of supported methods from String theory. Maybe we should add some more operations, like
concat
,length
, andlessThan
/greaterThan
. - missing tests.
src/org/sosy_lab/java_smt/basicimpl/AbstractFormulaManager.java
Outdated
Show resolved
Hide resolved
+ Native.sortToString(z3context, pSort) | ||
+ " with sort " | ||
+ sortKind); | ||
if (Native.isStringSort(z3context, pSort)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an enum value for Z3_STRING_SORT
? I could only find Z3_RE_SORT
, is this the same sort and would match here, too?
@kfriedberger I've updated the PR with your suggestions (both in code and more tests), and I've gone all the way to also introduce regular expressions. |
Please always apply 'ant format-diff' before committing to avoid such changes later.
And simple JUnit tests.
… Strings or Regexs, add range operations.
There are several operations on Strings and Regexs and the number of JUnit tests might increase.
…arameters. This fulfills our Checkstyle criteria.
CVC4 seems to support the full range of String and Regex operations, so JavaSMT can provide them. We should add some more tests for String theory.
Current status of this PR:
The following parts are still missing or incomplete or can be improved:
|
…String seem to be important.
I've removed I don't know very well how to check the current model evaluation. As far as I understand, it should work on Z3, but I don't know how to add more tests in the corresponding file. As a third question: what do you mean as conversion between the Int and String theories? |
Hi @serras
Best. |
and simplification, and formatting, and fix JavaDoc.
Unicode with non-ascii chars remains an open problem for now.
AbstractBaseFormulaManager
…ern. The only way to build up a regex is directly in JavaSMT from basic blocks. The support to convert a real Java regex to SMTLIB regex is missing (this is no simple step!).
We should think about updating Z3, because the new version 4.8.13 seems to provide several bugfixes. See sosy-lab#249 for details.
With the support for formula visitation, this PR looks sufficient for a merge. |
- extract common constant. - simplify replaceAll-test, cubic runtime in a test is too much :-).
…uantifiers. There seems to be a bug in CVC4 that weakens its reasoning, such that UNKNOWN/INCOMPLETE is returned from the SAT check. As CVC4 is no longer actively maintained (there is already CVC5), disabling the tests and having a basic support for String theory is a quick and reasonable step.
This PR adds initial support for strings, the only available operations are creation of constants and equality. A concrete implementation of the theory for Z3 is also provided.
Note: there are some attempts at implementing the theory for SMTInterpol. However, this comment suggests that the string theory is not really supported. For that reason, those changes have been reverted (but you may want to squash everything).