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

Support for more regular expression operations #275

Merged
merged 4 commits into from
May 31, 2024

Conversation

Pat-Lafon
Copy link
Contributor

Fixes #272

(First two commits) My attempt at adding the new regular expression operations: power, allchar, and diff. I also noticed that option 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 with a and b but not c. However, I found that I get SatResult::Sat in more cases than I expect like in test_regex_union2 which just checks that c matches with (a|b). I would expect to get SatResult::Unsat but I don't?

Copy link
Contributor

@waywardmonkeys waywardmonkeys left a comment

Choose a reason for hiding this comment

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

In upstream Z3, you have to look at some of the SMTLIB tests to find things that actually exercise this code (rather than via the native API).

@waywardmonkeys
Copy link
Contributor

@Pat-Lafon Do you want to try rebasing this on top of current master and see if CI passes? We're preparing for a new release.

@waywardmonkeys waywardmonkeys merged commit 14d5bef into prove-rs:master May 31, 2024
11 checks passed
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.

Support for regular expression "mk_re_all" and "mk_re_allchar"
2 participants