Live data from Hacker News

A Dumb Introduction to Z3 (2025)

ar-ms.me

21–29 of 29 posts

Re: A Dumb Introduction to Z3 (2025)

#21
post #8
post #7

Earlier quoted context omitted.

I personally like to avoid the “writing in C++” experience. :/

The authors of a powerful solver package thought differently.

The authors of a powerful solver package were solving a different problem than the users of a powerful solver package, and so different tools may be appropriate.

Re: A Dumb Introduction to Z3 (2025)

#22
post #4

Z3 struggles with larger problems. CVC5 or Bitwuzla do a lot better once you get into anything complex. If you're familiar with the Z3 Python API, you'll find the CVC5 one familiar. Caveat: I mostly do logic design, maybe there are some software verification tasks where Z3 comes out ahead. I've never seen one though.

What would u recommend for freight/trucking optimiser? not real time.

(scaling to 100s-1000s of units)

Re: A Dumb Introduction to Z3 (2025)

#23
post #2

If the tutorial uses Rust, why didn't they use a solver written in Rust? Z3 was written in C++.

I'm not sure I understand your argument. Z3's API is canonically C. There's a C++ wrapper that works pretty well. I don't have experience with the Rust wrapper, but I'd imagine that works pretty well too.

Re: A Dumb Introduction to Z3 (2025)

#24
post #4

Z3 struggles with larger problems. CVC5 or Bitwuzla do a lot better once you get into anything complex. If you're familiar with the Z3 Python API, you'll find the CVC5 one familiar. Caveat: I mostly do logic design, maybe there are some software verification tasks where Z3 comes out ahead. I've never seen one though.

That’s interesting. I’m a logic designer too. How do you make use of it?

Re: A Dumb Introduction to Z3 (2025)

#25
post #12

Earlier quoted context omitted.

It might have more to do with the first release of Z3 being in 2012, with the first stable Rust release being in 2015. Rather than the authors of Z3 passing some kind of judgment on Rust…

Z3 uses a sophisticated and fast garbage collection scheme internally that doesn't mesh well with Rust idioms.

It's reference-counted at the boundaries. See https://github.com/Z3Prover/z3/blob/daf2506b6002149d531cb6c9...

Re: A Dumb Introduction to Z3 (2025)

#26
post #24
post #4

Z3 struggles with larger problems. CVC5 or Bitwuzla do a lot better once you get into anything complex. If you're familiar with the Z3 Python API, you'll find the CVC5 one familiar. Caveat: I mostly do logic design, maybe there are some software verification tasks where Z3 comes out ahead. I've never seen one though.

That’s interesting. I’m a logic designer too. How do you make use of it?

One of two cases: pushing Verilog through yosys-smtbmc to check design assertions/properties, or writing a lil Python model of some optimisation trick and checking it's equivalent to a more direct implementation.

For the former it's useful when there's already a well-defined contract at some interface, like "this bus interface follows these basic AHB5 manager rules" or "if x_valid is asserted, it remains asserted until x_ready is asserted, and the other x_foobar are stable during that time" or "a FIFO is never both empty and full".

Simple properties + exhaustive checking is good bang-for-buck because it often teases out subtle tangential issues without having to write checks for implementation details. This isn't "formal verification" per se but using formal checks in a lightweight way to help find bugs and inconsistencies in your design.

Re: A Dumb Introduction to Z3 (2025)

#27
post #4

Z3 struggles with larger problems. CVC5 or Bitwuzla do a lot better once you get into anything complex. If you're familiar with the Z3 Python API, you'll find the CVC5 one familiar. Caveat: I mostly do logic design, maybe there are some software verification tasks where Z3 comes out ahead. I've never seen one though.

I'm curious as to why Z3 is so much more popular than CVC5 if CVC5 is better for solving complex problems. Is it because Z3 is older?

Re: A Dumb Introduction to Z3 (2025)

#29
post #4

Z3 struggles with larger problems. CVC5 or Bitwuzla do a lot better once you get into anything complex. If you're familiar with the Z3 Python API, you'll find the CVC5 one familiar. Caveat: I mostly do logic design, maybe there are some software verification tasks where Z3 comes out ahead. I've never seen one though.

I'm curious as to why Z3 is so much more popular than CVC5 if CVC5 is better for solving complex problems. Is it because Z3 is older?

mostly because nobody ever mentioned CVC5 before
Post reply on HN