Re: core.logic: Help with insertion sort

2015-08-02 Thread Tassilo Horn
Nicolás Berger writes: Hi Nicolás, >> I've simplified the code a bit so that I don't need the `cconso` > >> relation. > > That's great. It's easier to understand this way. To simplify a tiny > bit more, the `nf` lvar can also be removed: it's unified with `f`, so > f can be used instead of nf in

Re: core.logic: Help with insertion sort

2015-08-01 Thread Nicolás Berger
Hi Tassilo, > I've simplified the code a bit so that I don't need the `cconso` > relation. That's great. It's easier to understand this way. To simplify a tiny bit more, the `nf` lvar can also be removed: it's unified with `f`, so f can be used instead of nf in `(conso nf nr nl)` > Ok, and now t

Re: core.logic: Help with insertion sort

2015-07-30 Thread Tassilo Horn
Nicolás Berger writes: Hi Nicolás, > Sounds interesting :). I hope I get some time to take a look into it > soon. I appreciate your feedback! > In the meantime, have you tried playing with the log and trace > "goals"? I mean log, trace-s and trace-lvar. They might be of help > in trying to d

Re: core.logic: Help with insertion sort

2015-07-29 Thread Nicolás Berger
Hi, Sounds interesting :). I hope I get some time to take a look into it soon. In the meantime, have you tried playing with the log and trace "goals"? I mean log, trace-s and trace-lvar. They might be of help in trying to discover where it's going that makes it hang. El 29/07/2015 11:40, "Tassilo

core.logic: Help with insertion sort

2015-07-29 Thread Tassilo Horn
Hi all, I've just implemented insertion sort with core.logic: --8<---cut here---start->8--- (declare inserto) (defn isorto "A relation where sl is a sorted version of the list l." ([l sl] (isorto l () sl)) ([l acc sl] (conde [(== l ()) (== acc s