core-logic

dominicm 2017-12-16T00:18:45.000087Z

Maybe I need to figure out aggregates properly, and this will go away. I'm using core logic as a query engine, so I'm doing a sort of "get this relationship or else return nothing", all centred around a main entity.

2017-12-16T00:27:08.000176Z

you should look at the string contains constraint in jiralog

2017-12-16T00:33:47.000027Z

when writing a core.logic connector to some datastore, what I recommend starting with, which is the simplest thing, is to not have much of a query optimizer. just pull everything out of the datastore, feed it through to-stream

2017-12-16T00:38:46.000022Z

the way to write that is as a relation like (edge a b), the simple implementation being something that takes a and looks in your datastore for the edges, then does the to-stream magic to generate a stream of results where b is bound to each edge

2017-12-16T00:39:18.000039Z

but at some point you will want to write a logic program where a is not ground at the point where the search reaches that goal

2017-12-16T00:39:46.000038Z

and you can't send a logic variable to your datastore for searching

2017-12-16T00:42:00.000089Z

instead of a normal relation goal you can write a constraint, which can sort of delay its actions until a and b are both ground, constraints can't generate possible solutions in the search tree, they only prune it

2017-12-16T00:42:31.000159Z

(I could be misremembering that, but I don't think I am)

2017-12-16T00:46:56.000073Z

depending on what exactly you are doing, you may be better off writing your own datalog, which would feel similar to core.logic but give you more control over the guts

2017-12-16T14:06:38.000029Z

is it possible to define ordering in the results of a run* call?

2017-12-16T14:07:33.000043Z

i'm using core.logic to query data structures that are basically vectors of maps

2017-12-16T14:08:08.000016Z

and right now i'm doing it from the outside, using sort-by for example

2017-12-16T14:09:46.000029Z

considering run* accepts lvars and expressions to constrain the result it doesn't really make sense i suppose, but i'd like to confirm