How to test for data-type constructor via API? #5277
Replies: 1 comment 1 reply
-
Maybe the following: You could try to enumerate consequences. For instance you If you want to hack your own solver (of course you do), then use the new API for user-propagation. You need to register the atomic formulas you want to track. Basic example usage is given here in Section 7: http://theory.stanford.edu/~nikolaj/navigate.html Of course, all of this can be explained much better on a bench at Scripps. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
[my apologies in advance for posting this q here -- LMK if you prefer it on e.g. stackoverflow or similar!]
Thanks again for fixing that odd regression in record time!
I have an unrelated question I wanted to ask you, about encoding "computation" in Z3.
You might recall a talk I gave at the workshop in Essaouira several years ago
https://ranjitjhala.github.io/static/reasoning-about-functions.pdf
the high-level bit is one can have user defined functions and the above describes an algorithm to "run" those functions on symbolic inputs via SMT queries (without axioms
fuel etc.) We've been really pushing it quite a bit and people are writing large functions with hundreds of computation steps which take rather too long using the SMT-LIB interface.
What I'm wondering is whether it would be faster if we had access to the congruence closure context e.g. via the C/Python API. Abstractly, the procedure would look like this:
So basically I want to assert a bunch of equalities e.g.
Then check if some terms are constructors e.g.
and then depending on the result of the above, add more equalities and continue.
Do you have any advice for how I might go about doing this?
The key missing piece in the API seems to be how to check whether a term is
of a given constructor --
isCons
-- maybe I just missed it?Any tips would be most welcome!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions