[LOGIC-104] -merge-doms for ::nom is not closed under composition Created: 11/Jan/13 Updated: 11/Jan/13 Resolved: 11/Jan/13 |
|
| Status: | Resolved |
| Project: | core.logic |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Nada Amin | Assignee: | David Nolen |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
(run* [q]
(nom/fresh [a b c d]
(fresh [x y z]
(== (nom/tie a (nom/tie b y)) (nom/tie b (nom/tie a x)))
(== (nom/tie c (nom/tie d x)) (nom/tie d (nom/tie c z)))
(== x y)
(== z x))))
The snippet above fails with a no implementation of method -merge-doms for LazySeq, because -merge-doms for ::nom is implemented for vectors but returns a lazy seq, not a vector. The simplest fix is to change `concat` to `into` in the -merge-doms implementation of nominal.clj. However, while I am at it, I will replace the vector with a set, which makes more sense given how it's used anyways. Patch will be attached shortly. |
| Comments |
| Comment by Nada Amin [ 11/Jan/13 7:59 AM ] |
|
Patch logic-104.diff contains improved ::nom dom representation and test for this bug. |
| Comment by David Nolen [ 11/Jan/13 8:35 AM ] |
|
fixed, http://github.com/clojure/core.logic/commit/9f0f0c70b9d02cabe7ac1dd0d10106d84e7c3870 |