Hey Will -  thanks for responding

I'm not very familiar with Prolog but setof/bagof seems right.  Ultimately, 
my use case involves a reduce operation but it seems like I should be able 
to compose a recursive conde goal with a bagof goal to achieve what I'm 
looking for.

> Let me see if I can throw together non-relational versions of 'setof' and 
'bagof' for you. 

That would be great!  Right now, I'm leveraging core.logic's very nice 
Clojure integration to create a non-relational goal that calls out to a 
reduce operation from a run* sequence.  I'm pretty sure I don't actually 
need a fully relational goal for my use case but my current approach feels 
awfully dirty and I like the options that a relational goal would offer.

ps -  - I'm several videos behind on your minikanren uncourse but I'm 
loving it!  I'm assuming from your response that condu is not the right 
approach to my problem making me think I've got the wrong notion of condu. 
 Do you cover condu in a later video?

On Friday, February 13, 2015 at 1:11:07 PM UTC-8, William Byrd 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] 
> <javascript:>> 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] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > 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