For some reason (likely influenced by https://stackoverflow.com/a/50042635) I thought that I needed to prefix vars in defne/matche patterns with ? to have them be implicitly declared, but it seems that is not the case. It's mentioned in the https://github.com/clojure/core.logic/blob/master/CHANGES.md#enhancements-11 facepalm
> (macroexpand '(l/defne test-rel [a b]
([a [c . d]] (other-rel a d))))
(def
test-rel
(clojure.core.logic/fnm
clojure.core.logic/conde
[a b]
([a [c . d]] (other-rel a d))))
> (macroexpand '(clojure.core.logic/fnm
clojure.core.logic/conde
[a b]
([a [c . d]] (other-rel a d))))
(fn*
([a b]
(clojure.core.logic/conde
((clojure.core.logic/fresh
[]
(clojure.core.logic/== a a)
(clojure.core.logic/fresh
[c d]
(clojure.core.logic/== (clojure.core.logic/llist c d) b)
(other-rel a d)))))))It's clear from the fresh block.