Replies: 4 comments 14 replies
-
We also tried using |
Beta Was this translation helpful? Give feedback.
-
The solver interface is a general interface that can cover different backends with each their characteritics. You can for example try:
You will then see some unusual state printed for both s and s1. |
Beta Was this translation helpful? Give feedback.
-
I am not sure what "new_eq_eh for our theory" means. The code I can find online https://github.com/ankitku/SeqSolve/tree/master/model-analyses/lisp-z3/src/z3 only references external APIs. Line 6541 in aa05298 They can be used to pick up variable assignments to Boolean and Bit-vectors and allow callbacks. The Python bindings go through the hoops of registering callback functions. An application of this newer API is sketched here: http://theory.stanford.edu/~nikolaj/supercharging.html It is generally suitable for supporting ad-hoc global propagators. |
Beta Was this translation helpful? Give feedback.
-
If you are somehow losing axioms you have asserted it could be because they get removed during a pop.
The big catch in your case is that I don't support user propagators for string sorts because there is no notion of when a string variable gets assigned a constant string. It could however track equalities without tracking assignments. As you have your tentacles deep inside the solver already you do have access to the internal state of assertions. This state is accessed by the "copy" method and you can determine which parts should be relevant for you. |
Beta Was this translation helpful? Give feedback.
-
We are working on integrating our string solver SeqSolve written in ACL2s and Lisp with Z3. SeqSolve solves both string and length constraints using another instance of Z3 as a backend (Linear Integer Arithmetic) LIA solver.
The integration works by loading a modified version of Z3 containing a custom theory that we developed. This theory invokes SeqSolve and passes constraints as a SMTLIB string using a function pointer. SeqSolve then uses Z3_eval_smtlib2_string to parse the SMT2LIB string it received and solves it. We have attached a diagram showing the SeqSolve stack below.
Our issue stems from the fact that we would like the C API Z3_solver that the Lisp function will end up using to have access to the constraints that exist in the original problem or have been added by other theories. One way we considered getting these constraints is by using the C API inside of the Lisp function. However, SeqSolve’s invocation of Z3_eval_smtlib2_string creates its own C++ solver instance, and it's not clear that it is possible to access all of the information needed to make a C Z3_solver_ref struct that refers to the "same" solver. We also tried using smt_context::get_assertions inside of our custom theory, but that simply dumps all the assertions seen in the input smt2 file. If there is any way to get a reference to the Z3_Solver from within a theory inside Z3, such that it can be passed on to the lisp function in an ffi call? The goal here is to copy the current Z3_solver being used inside a theory of Z3, and send the copy's reference for use by the lisp procedure so it can use it independently.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions