Reasoning on UML class diagrams