Skip to content

Instantly share code, notes, and snippets.

@mfdela
Created December 10, 2025 08:08
Show Gist options
  • Select an option

  • Save mfdela/8633a5c8d39d961a0ed2bc76277e1df8 to your computer and use it in GitHub Desktop.

Select an option

Save mfdela/8633a5c8d39d961a0ed2bc76277e1df8 to your computer and use it in GitHub Desktop.
Z3 example
(declare-const b0 Int)
(declare-const b1 Int)
(declare-const b2 Int)
(declare-const b3 Int)
(declare-const b4 Int)
(declare-const b5 Int)
(assert (>= b0 0))
(assert (>= b1 0))
(assert (>= b2 0))
(assert (>= b3 0))
(assert (>= b4 0))
(assert (>= b5 0))
(assert (= (+ b4 b5) 3))
(assert (= (+ b1 b5) 5))
(assert (= (+ b2 b3 b4) 4))
(assert (= (+ b0 b1 b3) 7))
(minimize (+ b0 b1 b2 b3 b4 b5))
(check-sat)
(get-model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment