Looks like a Cojurer was interested in adding these collecting goals
to core.logic a while ago, but eventually lost interest:

http://dev.clojure.org/jira/browse/LOGIC-68

As I recall it isn't hard to implement these in miniKanren, although
it may require some lower-level programming.


On Fri, Feb 13, 2015 at 2:11 PM, William Byrd <[email protected]> wrote:
> Hi Mark!
>
> Sorry for the late response.
>
> I think what you want is a "collecting goal", such as the
> 'setof'/'bagof' predicates in Prolog.  I implemented these predicates
> years ago in miniKanren.  I've had recent thoughts on making
> relational variants of these operators in miniKanren, so I'm
> interested in revisiting the topic.  Let me see if I can throw
> together non-relational versions of 'setof' and 'bagof' for you.
>
> --Will
>
> On Sun, Feb 1, 2015 at 8:31 PM, Mark Addleman <[email protected]> wrote:
>> I'm using the core.logic implementation of minikanren.
>>
>> I have a goal, element, that produces three values on output:  (l/run* [q]
>> (element q)) => (1 2 3)
>>
>> I'd like to write a goal that builds a list of all of the values generated
>> by element: (l/run 1 [q] (build q)) => ((1 2 3))
>>
>> The best I can come up with is
>> https://gist.github.com/markaddleman/f2e9394f15bf704ca043 but it's obviously
>> wrong.  I'm thinking that I should use condu instead of conde for the build
>> goal but I can't seem to wrap my head around how committed-choice works.
>>
>> Any insights?  Thanks in advance
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "minikanren" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/minikanren.
>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"minikanren" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/minikanren.
For more options, visit https://groups.google.com/d/optout.

Reply via email to