<< Back to previous view

[LOGIC-75] Combining maps and finite domains in core.logic returns only one result Created: 11/Dec/12  Updated: 28/Jul/13  Resolved: 12/Dec/12

Status: Closed
Project: core.logic
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Frederik De Bleser Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: bug
Environment:

Clojure 1.4.0, core.logic 0.8.0-beta2



 Description   

I'm trying to combine maps with finite domains with some odd results.

A simple query using finite domains correctly returns all values:

(run* [q]
	  (fresh [x]
	    (infd x (interval 1 3))
	    (== q x)))
	
	;=> (1 2 3)

But putting this result in a map returns only the first value:

(run* [q]
	  (fresh [x]
	    (infd x (interval 1 3))
	    (== q {:foo x})))
	
	;=> ({:foo 1})

FYI this works with vectors:

(run* [q]
	  (fresh [x]
	    (infd x (interval 1 3))
	    (== q [x])))
	
	;=> ([1] [2] [3])

But lcons seems to fail as well:

(run* [q]
	  (fresh [x]
	    (infd x (interval 1 3))
	    (== q (lcons x 'foo))))
	
	;=> ((1 . foo))


 Comments   
Comment by David Nolen [ 12/Dec/12 11:53 AM ]

fixed, http://github.com/clojure/core.logic/commit/c96402f3e60b1118446b3e681d98e444e4ce417d

Generated at Mon Apr 21 09:52:36 CDT 2014 using JIRA 4.4#649-r158309.