Search over state machines