[LOGIC-77] Finite-domain vars inside a vector crash when constrained. Created: 15/Dec/12 Updated: 24/Dec/12 Resolved: 24/Dec/12 |
|
| Status: | Resolved |
| Project: | core.logic |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Gary Fredericks | Assignee: | David Nolen |
| Resolution: | Completed | Votes: | 0 |
| 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. |
| Comments |
| Comment by David Nolen [ 15/Dec/12 7:43 PM ] |
|
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]) |
| Comment by David Nolen [ 15/Dec/12 9:17 PM ] |
|
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. |
| Comment by David Nolen [ 24/Dec/12 6:14 PM ] |
|
fixed, http://github.com/clojure/core.logic/commit/d4d4cd53edfd76c2f416bd699f4b4d914f880985 |