Ngā tūemi rite: Theory of automata and formal languages