thank you @norman, i've found a way to obtain the correct solution, see this ticket if interested https://dev.clojure.org/jira/browse/LOGIC-185
I've got another question
I'm going thru the reasoned schemer and i've noticed that the order of excecution differ sometimes in core.logic. in particular 'conde' seems to behave differently, looks like it tries all branch before doing any recursion. Any toughts on this?
(defn pairo [x]
(fresh [y] (firsto x y)))
(defn unwrapo [x y]
(conde
[(pairo x) (fresh [a] (firsto x a) (unwrapo a y))]
[(== x y)]))
(run* [q] (unwrapo '(((pizza))) q))
; ((((pizza)))
; ((pizza))
; (pizza)
; pizza
; )
;while in TRS it returns
; (pizza
; (pizza)
; ((pizza))
; (((pizza)))
; )
;both:
(run 1 [q] (unwrapo q 'pizza))
;and
(run 1 [q] (unwrapo (list (list q)) 'pizza))
;returns:
;=> (pizza)
;while in TRS it returns
;=> ()
the wiki actually explain this difference, i've missed it, sorry