-
Notifications
You must be signed in to change notification settings - Fork 113
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
Z3 from string #226
Z3 from string #226
Conversation
I have two additional comments which came up while I was attempting this. First, I was wondering if instead of creating a solver object, the api here should be mutating an already existing solver object with some smtlib2 string-based assertions? Second, I noticed some of the surrounding unsafe code does explicit null checks on the pointers it gets from the ffi. Should some of the Z3 pointers instead be wrapped in https://doc.rust-lang.org/std/ptr/struct.NonNull.html ? |
For the first question, I would look to see what the other language bindings for Z3 do. for the second, I am not very familiar with that, so I haven’t thought about it before. Want to Kay out some arguments in favor in a separate issue? |
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.
Can you rebase this into fewer commits? Some of the changes modify the earlier commits in the sequence, but shouldn't be needed in the history...
patch add new_from_smtlib2 to Solver This makes it consistent with the Optimize impl.
37896f3
to
5a95c9f
Compare
I am interested in pushing through #194.
The changes I made are:
Into<Vec<u8>>
which is the most general type CString expects. This allows one to pass a &str to this function as shown in the tests. (Comment in Expose Z3_solver_from_string and Z3_optimize_from_string #194 (comment))Self::wrap
for construction.Z3_solver_from_string
to bec_str
which matches the cpp api https://github.com/Z3Prover/z3/blob/a0f3727e90c4446ba2c1fa7e4392637587ad9632/src/api/api_solver.cpp#L358-L369 and makes more sense to me