Home›Hillel Wayne›Article

Some Silly Z3 Scripts I Wrote

Feb 23, 2026

As part of writing Logic for Programmers I produced a lot of “chaff”, code samples and sections I wrote up and then threw away. Sometimes I found a better example for the same topic, sometimes I threw the topic away entirely. It felt bad to let everything all rot on my hard drive, so I’m sharing a bunch of chaff for a tool called “Z3”, which has all sorts of uses in software research.

First an explanation of what this tool actually is, and then some scripts in order of increasing interestingness. All examples will use the Python bindings (pip install z3-solver).

What is Z3?

Keep reading

Out of respect for the author only the opening is shown here. Read the rest on the original site, or in HorizonReader with highlights, notes and AI help.

More from Hillel Wayne

A Crash Course in Predicate Logic

I started writing Logic for Programmers because there weren’t any good resources on logic for, uh, programmers. Now that the book’s out, the new problem is that there aren’t any good free resources on logic for programmers. So, to solve tha

Logic for Programmers is Now Available

I am delighted to announce that my book, Logic for Programmers, is now available! You can check out the release site here or go directly to buy the ebook or print versions. If you bought any of the early access versions, you can get the 1.0

Chicago vs New York Pizza is the Wrong Argument

It’s April Cools! It’s like April Fools, except instead of cringe comedy you make genuine content that’s different from what you usually do. For example, last year I talked about The best introductory video games for non-gamers. This year I

A Very Early History of Algebraic Data Types

Been quiet around here! I’ve been putting almost all of my writing time into Logic for Programmers and my whole brain is book-shaped. Trust me, you do not want to read my 2000-word rant on Sphinx post-build LaTeX customization. But I spent

Gamer Games for Non-Gamers

It’s April Cools! It’s like April Fools, except instead of cringe comedy you make genuine content that’s different from what you usually do. For example, last year I talked about the 3400-year history of the name “Daniel”. This year I wrote