DFAs with self-loops (very primitive, may need to be improved/generalized)