Source: https://www.csl.sri.com/users/tiwari/papers/stateflow.pdf