simple implementation of the term rewrite engine in common lisp