Created
July 3, 2009 21:00
-
-
Save fffej/140303 to your computer and use it in GitHub Desktop.
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
(defn tree-search | |
"Find a state that satisfies goal? Start with states, and search | |
according to successors and combiner" | |
[states goal? successors combiner] | |
(dbg :search "Search %s" states) | |
(cond | |
(empty? states) nil | |
(goal? (first states)) (first states) | |
:else (recur | |
(combiner (successors (first states)) (rest states)) | |
goal? | |
successors | |
combiner))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment