A knowledge-based approach to specification acquisition and construction