-
Notifications
You must be signed in to change notification settings - Fork 139
WIP: Add bindings to the user propagator #344
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
base: master
Are you sure you want to change the base?
Conversation
ignores Macos' DS_Store and some `nix` related files
Not tested yet, so there are probably many typos around still
many things are not ready yet, notably I'm not sure of the lifetimes of things. I skipped fresh entirely
Some things can likely still be improved, but this is a good initial implementation
This way there is no need for handles, it also makes it easier to add the `on_clause` API
|
So apparently Ubuntu ships with a version of |
The previous version half assumed there was no multithreading (no requierement for Sync), half assumed there was (it was using `ref` everywhere). This commit fully goes for the no multithreading version. - &mut where it makes sense - the UPSolver now owns the UserPropagators, to prevent potential aliasings
|
So I discovered that we can get null pointer back from z3 with my implementation of TL;DR: current lifetimes don't match Currently, it actually returns the null pointer that z3 gives back. This was done on purpose because implementing this function causes me huge lifetimes problems. To give an idea of the problem. The C++ implementation for
In practice, z3 gives a new These problems tend to cascade effects to the rest of the user propagator API. I'm switching this into a draft since I don't have an immediate solution. If you are using |
|
It may be worth revisiting this in light of #401, #404, and #417. Now that contexts are refcounted and implicit, there shouldn't be an issue dealing with arcane lifetimes. The trick would be designing the API to ensure correctness and memory safety in the face of callbacks that use Contexts we do not control. I haven't done a detailed read of the contribution you have here, but going from your description of the difficulty, there's a general approach that I think could work:
This would ensure that no |
|
Amazing! It sounds like this does indeed solve most of my issues! I'll have a try at this Weekend |
This adds bindings and an API for the user propagator and the
on_clausecallback.I would consider this still experimental, as I'm not fully sure of what
z3might do with my objects (e.g., weird lifetimes and thread safety).This also closes #343