Thank you for the response and for core.logic. I assumed '(a b c) was equal
to (list a b c) which I now see is a wrong assumption.
On Wednesday, 1 January 2014 15:57:38 UTC, Milton Silva wrote:
>
> Given this:
>
> (defn nullo [l]
> (== '() l))
>
> (defn all-uno [l]
> (conde
>[(nullo l) s#
On Wed, Jan 1, 2014 at 10:57 AM, Milton Silva wrote:
>
> unifies q with 1 and
>
> (run* [q]
> (all-uno '(1 q 1 q)))
>
> doesn't?
>
Nothing to do with vectors and lists. In this case you have a list
containing 1 and the *symbol* q, not the logic variable q.
David
--
--
You received this
Given this:
(defn nullo [l]
(== '() l))
(defn all-uno [l]
(conde
[(nullo l) s#]
[(fresh [f r]
* (firsto l 1)*
(resto l r)
(all-uno r))]))
why is it that
(run* [q]
(all-uno [1 q 1 q]))
unifies q with 1 and
(run* [q]
(all-uno '(1 q 1 q)))
doesn't?
More