Details
-
Type:
Defect
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
The predc number constraint fails to be enforced here.
(is (= (run* [q]
(fresh [x]
(== q x)
(predc q number? `number?)
(== x "foo")))
())) ;; false -- actual is ((_0 :- number?))
Inverting the first two goals gives the expected result.
(is (= (run* [q]
(fresh [x]
(predc q number? `number?)
(== q x)
(== x "foo")))
())) ;; OK
Actually, the problem is not specific to predc. It's an issue that addcg can overwrite a precious binding. Here is another example without predc:
(is (= (run* [q] (fresh [x y z] (== q x) (distinctfd [q y]) (== y x) (infd q x y (interval 1 3)))) ()) ;; false -- actual is [1 2 3]I have a fix that I'll submit shortly.
(is (= (run* [q] (fresh [x y z] (== q x) (distinctfd [q y]) (== y x) (infd q x y (interval 1 3)))) ()) ;; false -- actual is [1 2 3]