Uploaded image for project: 'core.logic'
  1. LOGIC-162

FD logic doesn't always return all solutions

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
    • Environment:

      org.clojure/core.logic 0.8.8

      Description

      Given the following code

      (run* [x11 x12 x13 
             x21 x22     x24
             x31     x33 x34
                 x42 x43 x44]
            (fd/in x11 x12 x13 x21 x22 x24 x31 x33 x34 x42 x43 x44 (fd/interval 1 9))
            (fd/eq (= (+ x11 (/ x12 x13))   5)
                   (= (+ x21 (/ x22   2)) x24)
                   (= (+ x31 (/   6 x33)) x34)
                   (= (+   4 (/ x42 x43)) x44)
                   (= (+ x11 (/ x21 x31))   4)
                   (= (* x12 (/ x22   6)) x42)
                   (= (+ x13 (-   2 x33)) x43)
                   (= (+ (-  5 x24) x34)  x44)))
      

      I have ([1 4 1 3 6 6 1 1 7 4 2 6] [2 6 2 4 6 7 2 1 8 6 3 6]) as a result.

      However, as soon as I change (fd/interval 1 9) to (fd/interval 0 9), the result becomes an empty sequence. However, I expect it to include at least the two aforementioned solutions.

        Attachments

          Activity

            People

            • Assignee:
              dnolen David Nolen
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: