Simple pattern matcher in LISP (Artificial Intelligence, Spring 2013)