The Regulator Theory for Finite Automata