<< Back to previous view

[LOGIC-109] custom defc constraint does not run Created: 28/Jan/13  Updated: 28/Jul/13  Resolved: 29/Jan/13

Status: Closed
Project: core.logic
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Kevin Downey Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


I have a custom constrain defined using defc, it looks like

(defc string-containsc [x y]
  (and (string? x)
       (.contains x y)))

I have a little core.logic program

(defn t []
  (logic/run* [q]
    (c/string-containsc q "foo")
    (logic/== q 1)))

the result of calling t is (1)

if I change the order of the goals:

(defn t []
  (logic/run* [q]
    (logic/== q 1)
    (c/string-containsc q "foo")))

the result of (t) is ()

Comment by David Nolen [ 28/Jan/13 10:50 PM ]

Possible fix in master, http://github.com/clojure/core.logic/commit/c0a5ea982624c9e9af869be0b653bf83f60de062

Does this work for you?

Comment by Kevin Downey [ 29/Jan/13 11:07 AM ]

yep, thanks

Comment by David Nolen [ 29/Jan/13 11:26 AM ]


Generated at Wed Oct 18 09:49:53 CDT 2017 using JIRA 4.4#649-r158309.