Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created October 13, 2012 01:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swannodette/3882891 to your computer and use it in GitHub Desktop.
Save swannodette/3882891 to your computer and use it in GitHub Desktop.
eqfd.clj
(defn simple-eqfd []
(run* [q]
(fresh [x y]
(infd x y (interval 0 9))
(eqfd
(= (+ x y) 9)
(= (+ (* x 2) (* y 4)) 24))
(== q [x y]))))
(simple-eqfd) ;; => ([6 3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment