Refactored mkAutomaton to isolate essential aspects of rules from
program logic