swift automaton