Specification Mining: New Formalisms, Algorithms And Applications