Browse files

LOGIC-103: another `<=fd` non-termination bug

Add supporting fns `interval-<=` and `interval->=`. Remove silly logic
from `<=fdc` implementation, just use `interval-<=`.
  • Loading branch information...
1 parent f04cc55 commit e882be8dce190873431d61aefe89a025ab9c0cb6 @swannodette swannodette committed Jan 10, 2013
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/main/clojure/clojure/core/logic.clj
View
10 src/main/clojure/clojure/core/logic.clj
@@ -322,9 +322,15 @@
(defn interval-< [i j]
(< (ub i) (lb j)))
+(defn interval-<= [i j]
+ (<= (ub i) (lb j)))
+
(defn interval-> [i j]
(> (lb i) (ub j)))
+(defn interval->= [i j]
+ (>= (lb i) (ub j)))
+
(declare domain sorted-set->domain
difference* intersection* disjoint?*
unify-with-domain* finite-domain?)
@@ -3444,9 +3450,7 @@
(-relevant? [this s]
(let-dom s [u du v dv]
(if (and (domain? du) (domain dv))
- (if (and (singleton-dom? du) (singleton-dom? dv))
- (not (<= du dv))
- (not (interval-< du dv)))
+ (not (interval-<= du dv))
true)))))
(defn <=fd

0 comments on commit e882be8

Please sign in to comment.