;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This file contains starter macros and functions for a very ;; simple first order logic implementation ;;; A simple function that returns all the symbols interned in a set ;;; of packages. If no packages are specified then symbols from the ;;; USER package are returned. For this assignment feel free to call ;;; with no arguments. (defun get-lisp-symbols (&rest packages) (unless packages (setf packages '(user))) (let ((ret nil)) (dolist (package packages ret) (do-symbols (sym package) (push sym ret))))) ;;; A simple macro that accepts a first order sentence in LISP syntax ;;; and a domain, executing that sentence in that domain. ;;; ;;; In particular, prove executes domain and stores the result in the ;;; global variable *domain* which is accessible by executing the ;;; form: (domain) (defvar *domain* nil) (defmacro prove (form domain) `(let ((*domain* ,domain)) ,form)) (defun domain () *domain*)