Hi!

You've run into one of the little sticky places where the seams between
Scheme and miniKanren are showing. Here's what's going on. Because the body
of the lambda has an "implicit begin" Scheme lets us have multiple
expressions in the body. These are evaluated for their effects, but the
value of a begin block is the value of its final expression. So, what's
intended to be the first equation in your program isn't ever tested against
the substitution. So this works just as well.

(run* (x)
  ((lambda (x)
     (== 'square 'circle)
     (== x 2))
   x))

What I think you're going to want to do is to add a (fresh () ...) as the
body of that lambda. That makes it so that you have one single body that
has multiple goals in it, and miniKanren will see that conjunction.


(run* (x)
  ((lambda (x)
     (fresh ()
       (== x 1)
       (== x 2)))
   x))

Now I believe that program will fail as I think you expect.

Lemme know if not, or if something else is amiss!

JBH

On Fri, Mar 10, 2017 at 10:47 AM, Cev Ing <[email protected]> wrote:

> The problem has to do something with the lambda:
>
> (run* (x)
>   (== x 1)
>   (== x 2))     ;; => ()
>
>
> (run* (x)
>   ((lambda (x)
>      (== x 1)
>      (== x 2))
>    x))          ;; => (2)
>
> Is the above the correct behavior of minikanren?
>
> --
> You received this message because you are subscribed to the Google Groups
> "minikanren" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/minikanren.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
JBH

-- 
You received this message because you are subscribed to the Google Groups 
"minikanren" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/minikanren.
For more options, visit https://groups.google.com/d/optout.

Reply via email to