implements the backend code base of sequence recognizing automata