Skip to content

Commit

Permalink
* src/main/clojure/clojure/core/logic.clj: remove dead code and some …
Browse files Browse the repository at this point in the history
…now useless tests.
  • Loading branch information
David Nolen authored and David Nolen committed Jul 31, 2012
1 parent 27eef8c commit f437c64
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
12 changes: 1 addition & 11 deletions src/main/clojure/clojure/core/logic.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/main/clojure/clojure/core/logic/bench.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 0 additions & 21 deletions src/test/clojure/clojure/core/logic/tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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]
Expand Down

0 comments on commit f437c64

Please sign in to comment.