Created
April 1, 2023 22:58
-
-
Save hgvk94/4832f73107eb739672669c7ac7b9dea8 to your computer and use it in GitHub Desktop.
demonstrating difference in printing in z3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import z3 | |
s = z3.Solver() | |
s.from_file(sys.argv[1]) | |
l = s.assertions() | |
for c in l: | |
print(c.sexpr()) # this print command uses ast_smt2_pp | |
s.check() | |
print(s.to_smt2()) # this print command uses ast_smt_pp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you run this code with z3master on this input, it will output:
The first line is the result of print on line 8 and the rest is the result of print on line 10. The first print uses
src/ast/ast_smt2_pp.cpp
to print. The second print usessrc/ast/ast_smt_pp.cpp
to print. The first print is invalid according to SMTlib. Z3 itself cannot parse it. The second print is valid and accepted by both z3 and cvc4