Last active
December 22, 2015 03:19
-
-
Save slpsys/6409864 to your computer and use it in GitHub Desktop.
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 generativity | |
(:use [cascalog api])) | |
(defn one_of [seq] (vec (map vector seq))) | |
(deffilterop forbid | |
([var comparator val] | |
(not (comparator var val))) | |
([var op val comparator comparee] | |
(not (comparator (op var val) comparee)))) | |
(def generativity | |
(<- | |
[?alice ?bob ?claire] | |
((one_of [1 2 3]) ?alice) | |
((one_of [1 2 3]) ?bob) | |
((one_of [1 2 3]) ?claire) | |
(cross-join) | |
(forbid ?alice = ?bob) (forbid ?bob = ?claire) (forbid ?alice = ?claire) | |
(forbid ?bob = 3) | |
(forbid ?alice - ?claire = 1) (forbid ?claire - ?alice = 1) | |
(forbid ?claire < ?bob))) | |
; (?- (stdout) generativity) | |
; | |
; RESULTS | |
; ----------------------- | |
; 1 2 3 | |
; ----------------------- |
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
(defproject generativity "0.0.1" | |
:source-path "src" | |
:dependencies [[cascalog "1.8.8-SNAPSHOT"]] | |
:profiles { | |
:provided { | |
:dependencies [[org.apache.hadoop/hadoop-core "0.20.2-dev"]] | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment