A matrix-based static approach to analysis of finite state machines