Generalized automata datatype