Closed rix0rrr closed 5 months ago
You are completely right here, and yes right now you need to filter yourself to see the result. But I agree what you had is a legit use case and we should probably have something like evaluate-query
to support this.
Alternatively, you can do
(ruleset print)
(rule ((path 1 x))
((extract x)) :ruleset print)
(run print 1)
I'm just getting my feet wet with egglog, trying to see if I can adapt it for a problem I have. I'm pretty new to this space, but have some familiarity with Prolog, and was hoping to start in a familiar place.
So I started with the graph reachability example:
I then wanted to find all the nodes that are reachable from node 1, so I did the following:
And egglog responds with:
I was hoping to get an assignment, something like
(x 2) (x 3) (x 4)
; but instead it seems like it's extracting the unit return values of the function calls(path 1 2)
,(path 1 3)
and(path 1 4)
. Am I understanding correctly what's happening here? I looked around for other functions that could do what I wanted, but I didn't find any.Am I misunderstanding how this is supposed to work? It looks like Egglog is supposed to be used differently from Datalog, is that right? How should I query my fact database? (I saw
print-function
, but that requires me to filter myself)Thank you for any help!