Permalink
Browse files

* src/main/clojure/clojure/core/logic.clj: remove dead code and some …

…now useless tests.
  • Loading branch information...
1 parent 27eef8c commit f437c6463d07e605217aeb3420aef76802b8b0f7 David Nolen committed Jul 31, 2012
@@ -3321,17 +3321,7 @@
(defn *fd [u v w]
(cgoal (fdc (*fdc u v w))))
-(defn exclude-from-dom [dom1 xs s]
- (if dom1
- (loop [xs (seq xs) gs []]
- (if xs
- (let [x (first xs)
- dom2 (walk s x)]
- (if (domain? dom2)
- (recur (next xs) (conj gs (process-dom x (difference dom2 dom1))))
- (recur (next xs) gs)))
- (reduce composeg gs)))
- s#))
+;; TODO: maybe remove
(defn update-procg [proc]
(fn [^Substitutions a]
@@ -491,7 +491,7 @@
s#))
(defn big-sudokufd [init]
- (let [vs (->> (range 1 82) (map #(lvar (symbol (str %)))))
+ (let [vs (repeatedly 81 lvar)
grid (->> vs (partition 9) (map vec) (into []))
rows grid
cols (apply map vector grid)
@@ -2023,17 +2023,6 @@
(is (false? (list-sorted? < [1 1 3])))
(is (false? (list-sorted? < [1 5 4 1]))))
-(deftest test-exclude-from-dom
- (let [dom1 (domain 1 3 5 7 9)
- x (lvar 'x)
- y (lvar 'y)
- s (-> empty-s
- (unify x (interval 2 4))
- (unify y (interval 6 8)))
- s ((exclude-from-dom dom1 [x y] s) s)]
- (is (= (walk s x) (multi-interval 2 4)))
- (is (= (walk s y) (multi-interval 6 8)))))
-
(deftest test-with-id
(let [x (lvar 'x)
y (lvar 'y)
@@ -2042,16 +2031,6 @@
(is (= (id c) 1))
(is (= (id (proc c)) 1))))
-#_(deftest test-update-procg
- (let [x (lvar 'x)
- y (lvar 'y)
- n* (sorted-set 1 3 5)
- c (fdc (-distinctfdc #{x y} n*))
- s ((addcg c) empty-s)
- s ((update-procg (with-id (fdc (-distinctfdc #{x} (conj n* 7))) 0)) s)]
- (is (= (var-rands (get (.cm (.cs s)) 0))
- [x]))))
-
(deftest test-distinctfd
(is (= (run* [q]
(fresh [x y z]

0 comments on commit f437c64

Please sign in to comment.