State machine reduction.