Support for more regular expression operations #275
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #272
(First two commits) My attempt at adding the new regular expression operations:
power
,allchar
, anddiff
. I also noticed thatoption
was exposed but not implemented so I've added that as well.(Third commit) I was looking to test my inclusions to the code base but I realized that I'm not sure about the semantics of regular expressions in Z3? I ran into some weird behavior I don't understand so I just added a simple test from https://z3prover.github.io/api/html/z3py_8py_source.html#l11172 to get some advice.
test_regex_union
works as expected, checking that(a|b)
matches witha
andb
but notc
. However, I found that I getSatResult::Sat
in more cases than I expect like intest_regex_union2
which just checks thatc
matches with(a|b)
. I would expect to getSatResult::Unsat
but I don't?