add Prolog meta-logical predicates bagof, setof, findall
Description
Environment
Attachments
Activity
It's been quite a while, but here's a short patch to implement `findall` if anyone wants to review.
No worries! Glad Datomic is working out for you
Having switched to Datomic which has bagof/setof type aggregation and subqueries (though the switch wasn't for those specifically) I don't know if or when I'll get back to this. Sorry!
Glad to hear you're OK! No worries, will take a patch whenever you get around to one.
After a car accident, travel to London and Morocco, getting caught up at work and getting caught up on the apparently very busy stream of core.logic activity (great work!), I'm back on this.
I found some bugs in my implementation after porting the patch forwards and realized these issues highlighted my sloppy understanding of some of the semantics I had created.
I'm fairly convinced now that we don't want to name this after run
or run*
. It's too much of a strain to try to make it mean the same thing in a nested context.
The current mechanism is still not quite a match for findall
/bagof
/setof
, however, so I'm seeing what a good fit would be. I'll post meaningful thoughts for review as I have them.
This can be done by annotating logic variables and embedding a run within a run by passing in the current substitution, running on it, and extracting out the reified values and unifying it back into the current substitution.