It's worth noting these notes are 11 years old. The first give-away was the comment that in Python 3/2 is an integer, which is indeed true in Python 2 but not in Py3.
For modern users of Z3, you'd want to do `pip install z3-solver` rather than use `Z3Py` mentioned at the very bottom of this doc.
Solvers are something that still kind of feel like magic to me. I have done a fair amount of Isabelle, and the "sledgehammer" tool in there (which uses solvers to see if an existing proof can be made to work to solve your subgoal) is something that impresses me every single time I use it.
Page 19 in https://smt.st/SAT_SMT_by_example.pdf shows an example in both Python and SMTLIB. After looking at a guide like TFA this book is a good next step.
It's worth noting these notes are 11 years old. The first give-away was the comment that in Python 3/2 is an integer, which is indeed true in Python 2 but not in Py3.
For modern users of Z3, you'd want to do `pip install z3-solver` rather than use `Z3Py` mentioned at the very bottom of this doc.
I'm a fan. I've been building a proof assistant directly on the z3py api. https://pypi.org/project/knuckledragger/0.1.3/
"SAT/SMT by Example" also contains many Z3 examples (and has a new URL): https://smt.st/
I have created a Python library called "z4-solver" that adds some nice utility functions on top of z3: https://github.com/Tyilo/z4
I always use that instead of the z3-solver directly.
Have you tried to compare Z3 with cvc5? https://cvc5.github.io/docs/cvc5-1.1.2/api/python/pythonic/p...
It offers basically the same API and could be faster in many cases
I was about to comment the same. Z3 always takes all the credit but cvc5 is just as great!
Solvers are something that still kind of feel like magic to me. I have done a fair amount of Isabelle, and the "sledgehammer" tool in there (which uses solvers to see if an existing proof can be made to work to solve your subgoal) is something that impresses me every single time I use it.
https://www.hakank.org/z3/
Thank you for the link.
That’s a very clean API.
It's very close to the SMTLIB API.
Page 19 in https://smt.st/SAT_SMT_by_example.pdf shows an example in both Python and SMTLIB. After looking at a guide like TFA this book is a good next step.
Very good to see all this in one short page!