Synthesis of Finite State Machines