Formal specification and documentation using Z : a case study approach