Skip to content

Instantly share code, notes, and snippets.

@frenchy64
Created July 20, 2011 12:14
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 frenchy64/1094850 to your computer and use it in GitHub Desktop.
Save frenchy64/1094850 to your computer and use it in GitHub Desktop.
(ns logic-introduction.core
(:refer-clojure :exclude [inc reify ==])
(:use [clojure.core.logic minikanren prelude nonrel match disequality]))
(defn geto [key env value]
"Succeed if type association [key :- value] is found in vector env."
(matche [env]
([[[key :- value] . _]])
([[_ . ?rest]] (geto key ?rest value))))
(comment
(run* [q]
(geto 'f
[['f :- Integer]]
Integer)
(== q true))
;=> (true)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment