Implementing automata using Clojure and core.logic