z3 - How to access vars in theory arithmetic in the user theory plug-ins? -


In user theory plug-in, let's say I have a customer sort of "T" and I call the function "f" Is defined on the " Z3_func_decl " on the T, which takes the argument of such kind of argument and "InterCode" (" Z3_mk_int_sort " I also returned the IT value to other There are constraints.

In the search, I want to get concrete value of return value in some callback (like new_assignment or new_a q Callback) so that I can make additional arguments to solve the rational value. But the problem is that callback will not be applied in search.

I saw SAT solution's Z3_context arithmetic in principle, I noticed:

wars: v0 # 24 Lo: -o, up: 4 , Value: 0, Opportunity: 0, atom: 1, int, non-base, shared: 0, activity: 0, assigned: 0, rel: 1, def: # 24

"# 24" is my work and "4" is shown in "up" set solution of value in exchange for my function.

My question is how can I get "4" in search? In callback of final_check , it tried to find in the equivalence sections of # 24, but no luck.

Thank you! Unfortunately, you can not do this in Z3, in one theory, from internal theories used in other principles. Do not reach. The principle only knows that the shared words are the same (inconvenient) or not, this design decision allows us to change the implementation of the theory without affecting others. Arithmetic theory is a good example. We'll change the current implementation with a more efficient one. The new implementation will use different datastores. In the above example, there is a known lower and upper limit for low and above the term # 24 . It is just a coincidence that Z3 has selected 4 (upper bound) as the interpretation for # 24 .

In addition to this, in the current version of Z3, Z3 has started building models after setting the problem of satisfactory to the model. Therefore, the actual interpretations given by the theory arithmetic can not really be used to help other theories.

Comments