Skip to content

Instantly share code, notes, and snippets.

@onthestairs
Created May 30, 2013 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onthestairs/5681569 to your computer and use it in GitHub Desktop.
Save onthestairs/5681569 to your computer and use it in GitHub Desktop.
(ns logic-introduction.mine
(:refer-clojure :exclude [==])
(:use [clojure.core.logic]))
(defn grow [x]
(* 1.5 x))
(defn shrink [x]
(* 0.5 x))
(defn increasingo [f]
(fresh [g]
(project [g]
(== f g)
(if (> (g 1) 1)
succeed
fail))))
(run* [q]
(membero q [grow shrink])
(increasingo q))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment