Created
October 14, 2012 15:59
-
-
Save ddeaguiar/3889008 to your computer and use it in GitHub Desktop.
One way to identify neighbors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns simple-csp.core | |
( :refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defne arco [x y] | |
([:sa :wa]) | |
([:sa :nt]) | |
([:sa :q]) | |
([:sa :nsw]) | |
([:sa :v]) | |
([:wa :nt]) | |
([:nt :q]) | |
([:q :nsw]) | |
([:nsw :v]) | |
([:t nil])) | |
(defn neighborso [x y] | |
(conde [(arco x y)] | |
[(arco y x)])) | |
(run* [q] (neighborso q :wa)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment