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: optimizing an automaton created from source code elements including combining redundant states; mapping states of the automaton to hardware elements of a target device; identifying at least one of a conflict or further optimization between the automaton and the hardware elements of the target device during the mapping; modifying the automaton to resolve the at least one of the conflict or the optimization to create a modified automaton, the modified automaton including at least one of a state unrolled into multiple states or multiple states collapsed to a special purpose state corresponding to special purpose hardware element to resolve the optimization or conflict; and mapping the modified automaton to the target device.