Replies: 1 comment
-
The help(parse_smt2_string) should give an idea of how to use it. for your example, the following works:
Also, declare-var is really not SMTLIB2 standard. It is included to support parsing Horn clauses without having to quantify variables all the time they are use in a rule. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What I want to do is parse a SMT-LIB file and change some assertions and then use an z3 to solve this new problem with the changed assertions.
My Idea was to essentially parse every line/command in the SMT file, and if it does not need changing use parse_smt2_string (in python API) to add it to the problem. So something similar to the following:
However this leads to an error that z3 expects a declaration or constant.
On the other hand the following works:
Now, obviously I could do the whole thing by string manipulation. That is, first parsing the SMT file, changing the assertions I want to change and pretty-printing everything into a string (using formatstrings and concatenation) again and using parse_smt2_string to parse the final string (like in the second code fragment, but longer). But I was wondering if there is a more elegant way of doing this.
Beta Was this translation helpful? Give feedback.
All reactions