Automating Proofs with State Machine Inference