Specification Mining For Machine Improvisation With Formal Specifications