Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated core.logic

  • Loading branch information...
commit 5e58b59cecc9d5d959e975f13c2c03cb9def1612 1 parent 2209ddb
@ykomatsu ykomatsu authored
View
2  project.clj
@@ -2,4 +2,4 @@
:description "A Very Gentle Introduction to Relational and Functional Programming"
:dependencies [[org.clojure/clojure "1.4.0"]
[org.clojure/tools.macro "0.1.1"]
- [core.logic "0.6.1-SNAPSHOT"]])
+ [org.clojure/core.logic "0.7.5"]])
View
8 src/logic_tutorial/tut1.clj
@@ -1,6 +1,6 @@
(ns logic-tutorial.tut1
- (:refer-clojure :exlude [reify == inc])
- (:use [clojure.core.logic minikanren prelude]))
+ (:refer-clojure :exlude [==])
+ (:use [clojure.core.logic]))
(defrel parent x y)
(defrel male x)
@@ -20,11 +20,11 @@
(female x)))
(defn grandparent [x y]
- (exist [z]
+ (fresh [z]
(parent x z)
(parent z y)))
(defn granddaughter [x y]
- (exist [z]
+ (fresh [z]
(daughter x z)
(child z y)))
View
6 src/logic_tutorial/tut2.clj
@@ -1,11 +1,11 @@
(ns logic-tutorial.tut2
- (:refer-clojure :exlude [reify == inc])
- (:use [clojure.core.logic minikanren prelude]))
+ (:refer-clojure :exlude [==])
+ (:use [clojure.core.logic :exclude [appendo]]))
(defn appendo [l1 l2 o]
(conde
((== l1 ()) (== l2 o))
- ((exist [a d r]
+ ((fresh [a d r]
(conso a d l1)
(conso a r o)
(appendo d l2 r)))))
View
4 src/logic_tutorial/tut3.clj
@@ -1,6 +1,6 @@
(ns logic-tutorial.tut3
- (:refer-clojure :exlude [reify == inc])
- (:use [clojure.core.logic minikanren prelude]
+ (:refer-clojure :exlude [==])
+ (:use [clojure.core.logic]
[clojure.tools.macro :as macro]))
(defne righto [x y l]
Please sign in to comment.
Something went wrong with that request. Please try again.