streaming finite state machines