<< Back to previous view

[LOGIC-104] -merge-doms for ::nom is not closed under composition Created: 11/Jan/13  Updated: 28/Jul/13  Resolved: 11/Jan/13

Status: Closed
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: File logic-104.diff    

 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

Generated at Wed Jul 23 11:22:51 CDT 2014 using JIRA 4.4#649-r158309.