1. A machine-readable medium that is not a transitory propagating signal, the machine-readable medium including instructions that, when executed by a machine, cause the machine to perform operations comprising: obtaining an automaton created from source code, the automaton comprising states and transitions between the states; identifying a target device, the target device including hardware elements and connections between hardware elements; fitting the automaton to the target device by mapping the states of the automaton to hardware elements of the target device and identifying at least one of a conflict or an optimization between the automaton and the target device during the fitting; modifying the automaton to resolve the at least one of the conflict or the optimization to create a modified automaton; and mapping the modified automaton to the target device.