I've finally got around to adding a negation as failure operator `nafc` to
core.logic. The constraint framework has allowed this to be done while
avoided the many pitfalls you might encounter with this operator in Prolog.
You can now write things like the following:

(run* [q]
  (membero q '(:a :b :c :d))
  (nafc membero q '(:a :b :c)))
;; => (:d)

As you can see nafc can take a goal (or constraint) and list of arguments
and produce a negated goal. The main limitation is that negated goals will
not run until the arguments are ground (fully instantiated). This is to
avoid the issues normally found in Prolog.

This is very experimental but I'm excited that it will simplify the writing
of many interesting core.logic programs.

This is available in master. Feedback very welcome!

David

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to