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