Created
February 15, 2021 15:49
-
-
Save fffej/ac431a23764a93c16556dde0db0bc76c 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
(defun tree-search (states goal-p successors combiner) | |
"Find a state that satisfies goal-p. Start with states, | |
and search according to successors and combiner." | |
(dbg :search "~&;; Search: ~a" states) | |
(cond ((null states) fail) | |
((funcall goal-p (first states)) (first states)) | |
(t (tree-search | |
(funcall combiner | |
(funcall successors (first states)) | |
(rest states)) | |
goal-p successors combiner)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment