Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
appendo.clj
(defne appendo [x y z]
([() _ y])
([[?a . ?d] _ [?a . ?r]] (appendo ?d y ?r)))
;; -----
(defn appendo [x y z]
(fn [a8289]
(inc
(mplus
(bind a8289 (exist [] (fn [a__3142__auto__]
(if-let [b__3143__auto__ (unify a__3142__auto__ () x)]
b__3143__auto__
nil)) (exist [] (fn [a__3142__auto__]
(if-let [b__3143__auto__ (unify a__3142__auto__ y z)]
b__3143__auto__
nil)))))
(fn []
(bind
a8289
(exist
[?a ?d]
(fn [a__3142__auto__]
(if-let [b__3143__auto__ (unify a__3142__auto__ (llist ?a ?d) x)]
b__3143__auto__
nil))
(exist [?r] (fn [a__3142__auto__]
(if-let [b__3143__auto__ (unify a__3142__auto__ (llist ?a ?r) z)]
b__3143__auto__
nil)) (appendo ?d y ?r)))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.