Consider the following relation
```
(define (membero x l)
  (conde
   ((caro l x))
   ((fresh (d) (cdro l d) (membero x d)))))
```
Is it possible to construct a negation of it in miniKanren?
My first idea is to swap conj and disj, `==` and `=/=`
First, I simplified this relation
```
(define (membero x l)
  (fresh (a d)
         (== l (cons a d))
         (conde
          ((== l a))
          ((membero x d)))))
```
Then I did the swapping
```
(define (not-membero x l)
  (fresh (a d)
         (conde
          ((=/= l (cons a d)))
          ((=/= l a) (not-membero x d)))))
```
But the second conde clause did not look right.
Later I found that `fresh` also needs to be changed, but miniKanren does 
not have a `forall`

My second idea is implement miniKanren itself in miniKanren, then `(runo 
(membero x l) '())`. Even if this idea works, the performance will suffer.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/minikanren/538db70d-2069-4323-a7a2-f41419128669n%40googlegroups.com.

Reply via email to