(in-package :cs325-user) (defun mt (lst1 lst2) (valid (mapcar 'mi lst1 lst2))) (defun mi (x y) (and (or (eql x y) (var-p x)) (list x y))) (defun valid (bdgs) (and (every (lambda (bdg) bdg) bdgs) bdgs)) ;;; don't worry about how this works (defun var-p (x) (and (symbolp x) (eql (char (symbol-name x) 0) #\?))) (defun show-mt (lst1 lst2) (format t "~%~S ~S => ~S" lst1 lst2 (mt lst1 lst2))) (defun test-mt () (show-mt '(a b c) '(a b c)) (show-mt '(a b c) '(a b b)) (show-mt '(?x b c) '(a b c)) (show-mt '(?x ?y ?z) '(a b c)) (show-mt '(?x b ?x) '(a b c)) )