Live data from Hacker News

Z3 API in Python: From Sudoku to N-Queens in Under 20 Lines (2015)

ericpony.github.io

1–10 of 16 posts

Re: Z3 API in Python: From Sudoku to N-Queens in Under 20 Lines (2015)

#3
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.

Re: Z3 API in Python: From Sudoku to N-Queens in Under 20 Lines (2015)

#7
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.

Re: Z3 API in Python: From Sudoku to N-Queens in Under 20 Lines (2015)

#9
post #8

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

Re: Z3 API in Python: From Sudoku to N-Queens in Under 20 Lines (2015)

#10
post #8

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!
Post reply on HN