Function isValidTransition

Returns true if toState is a valid transition from current state of sm