Permalink
Browse files

LOGIC-96: give up on "efficient" updatec in !=c for now, since it is …

…buggy
  • Loading branch information...
1 parent fb48929 commit 0beb770dc0a072f0dcb888f0df2978a5632d92bf @namin namin committed with swannodette Jan 4, 2013
Showing with 11 additions and 2 deletions.
  1. +2 −2 src/main/clojure/clojure/core/logic.clj
  2. +9 −0 src/test/clojure/clojure/core/logic/tests.clj
@@ -3907,12 +3907,12 @@
(cond
(= xv vv) (recur (next sp) (dissoc p x))
(and (ground-term? xv a) (ground-term? vv a) (not= xv vv)) nil
- :else (recur (next sp) p)))
+ :else (recur (next sp) (assoc (dissoc p x) xv vv))))
p))]
(if p
(when-not (empty? p)
#_((normalize-store (with-prefix this p)) a)
- ((updatecg (with-prefix this p)) a))
+ (bind* a (remcg this) (cgoal (!=c p))))
((remcg this) a))))
ITreeConstraint
(tree-constraint? [_] true)
@@ -965,6 +965,15 @@
(== y 'foo)))
())))
+(deftest test-logic-96-disequality-1
+ (is (= (run* [q]
+ (fresh [x y z]
+ (!= x [y])
+ (== x [z])
+ (== y 'foo)
+ (== z 'bar)))
+ '(_0))))
+
;; -----------------------------------------------------------------------------
;; tabled

0 comments on commit 0beb770

Please sign in to comment.