core.logic

Finite-domain vars inside a vector crash when constrained.

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    clojure 1.5.0-beta1 with core.logic 0.8.0-beta3

Description

I don't know a lot about the finite domain code, but it surprised me that this crashes:

(run 1 [r a b x]
  (== r [a b])
  (infd a b x (domain 1 2))
  (<fd a b)
  (firsto r x))

This was the most minimal example I could come up with.

Activity

Hide
David Nolen added a comment -

This commit http://github.com/clojure/core.logic/commit/07f2f6ac42ad13ed7476f70669b98e76a84f2455 fixes the exception. However I'm still not seeing the expected result which I believe is:

([[1 2] 1 2 1])
Show
David Nolen added a comment - This commit http://github.com/clojure/core.logic/commit/07f2f6ac42ad13ed7476f70669b98e76a84f2455 fixes the exception. However I'm still not seeing the expected result which I believe is:
([[1 2] 1 2 1])
Hide
David Nolen added a comment -

This is bug results from the trickiness of aliasing of logic vars in the presence of constraints. Currently when two constrained vars are unified, we point one var to the other var and migrate the constraints. However this is not enough we also need to merge their domains - this is not currently being done.

Show
David Nolen added a comment - This is bug results from the trickiness of aliasing of logic vars in the presence of constraints. Currently when two constrained vars are unified, we point one var to the other var and migrate the constraints. However this is not enough we also need to merge their domains - this is not currently being done.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: