Created
July 9, 2011 20:20
-
-
Save swannodette/1073927 to your computer and use it in GitHub Desktop.
appendo.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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