core-logic 2019-07-25

@javazquez has joined the channel

Hi everyone, I just started digging into core.logic and trying to wrap my brain around it. I created a family tree that looks like the following (def facts (pldb/db [parento :james :jerry] [parento :jerry :jordan] [parento :jerry :richard] [parento :jerry :harry] [parento :jerry :jackson] [parento :george :james])) Jerry has multiple kiddos and George is the great grand father to jordan, richard, harry and jackson. I have been struggling to write code that given one of these children, would produce all the ancestors without dups ex. given :jackson return jerry, james, george any help would be greatly appreciated 🙂

something of the form (defn accesto [foo q] (l/conde [(parento q foo)][(l/fresh [x] (parento q x) (parento x foo))])) but I haven't really used pldb and I am pretty rusty

but unique results can be difficult to achieve, just because of the iterative way queries run

Thank you!

Out of curiosity and learning, would you model the data differently?