On Mon, Jun 9, 2014 at 2:11 AM, JD <jesus.diama...@gmail.com> wrote:

> When I try to use core.logic's fact function I am getting a symbol not
> found error.  What is the idiomatic way to do something like:
>
> (logic/fact Orbits :mercury :sun)
>
> Orbits here was previously bound in a defrel, which I ended up replacing
> with pldb/db-rel.
>


(ns logic.orbit
  (:refer-clojure :exclude [==])
  (:use [clojure.core.logic])
  (:require [clojure.core.logic.pldb :as pldb]))


(pldb/db-rel orbits satellite body)

(def orbit-facts
  (pldb/db-facts pldb/empty-db
                 [orbits :mercury :sun]
                 [orbits :venus :sun]
                 [orbits :earth :sun]
                 [orbits :mars :sun]

                 [orbits :moon :earth]
                 [orbits :phobos :mars]
                 [orbits :deimos :mars]))


(pldb/with-db orbit-facts
  (run* [moon]
    (fresh [planet]
      (orbits moon planet)
      (orbits planet :sun))))

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to