NL2OCL Project
Simplifying the process of software modelling with improved accuracy to generate robust models
NL2AlloyviaOCL (A NL to Alloy Transformation via OCL) |
NL2Alloy is a tool that integrates
NL2OCLviaSBVR and
UML2Alloy
project. UML2Alloy is the outcome of a research which attempts to
formalise the UML (Unified Modeling
Language) with the help of
Alloy, using the MDA (Model
Driven Architecture) technology. NL2Alloy
is a tool that generates first OCL (Object
Constraint Language) constraints via SBVR (Semantic Business Vocabulary and Rules)
from English text and then transforms UML + OCL to Alloy finally. .
Abstract:
UML is the de facto modelling language that is used by the industry to model mainly software systems. UML (Unified Modeling Language) is diagram based. OCL (Object Constraint Language) is a textual notation that is used to impose constraints over the UML model. However users of those notations are not able to reason about the soundness of their models, before the model is implemented. This happens because of the semi-formal nature of UML. On the other hand users who are acquainted with formal methods are able to specify models in a formal notation (e.g. Z) and reason about certain properties. The drawback of formal methods is the fact that they are not easy to learn and understand. NL2Alloy helps modellers by automating the process of generating Alloy expressions from natural language (English) text.
UML2Alloy bridges this gap between the popularity and semi-formalism of UML. Using UML2Alloy users are able to use two critical functionalities of the Alloy Analyzer simulation and verification. Simulation ensures the model is not inconsistent and verification enables modellers to reason that certain critical properties of the model are satisfied. In NL2Alloy, UML2Alloy has been integrated to generate Alloy expressions from natural language (English) text.
Used Approach:
The NL2Alloy is a modular NL-based software tool that generates Alloy expressions from English text with respect to a target UML (Unified Modeling Language) and OCL (Object Constraint Language). It takes two inputs: a single English statement and a UML model. Output of the tool is a complete Alloy expression.
1.
Obtain a text document that is Natural Language (English) description of a constraint and a target UML model.2.
Use a NLP module to syntactically and semantically analyse the informal constraint text and keep all the intermediate analyses result for further analysis.3.
Use the UML (.ecore or .xmi) model to extract the SBVR (Semantic Business Vocabulary and Rules) vocabulary. Use the results produced by NLP module to extract SBVR elements e.g. noun concept, object type, Individual concept, verb concept, etc.4. Map the SBVR elements and SBVR vocabulary to ensure that the target SBVR business rule will be from the defined business model (UML Model).
5.
Use the SBVR vocabulary and SBVR elements to generate SBVR (Semantic Business Vocabulary and Rules) business rule.6.
From the SBVR business rules generate OCL expressions using model transformation based on SiTra library.7. Use OCL (Object Constraint Language) and UML (Unified Modeling Language) to generate
Alloy using model transformation based on SiTra library.The following Figure illustrates the main steps of the NL2Alloy approach. These steps can be summarized as follows:
Screen-shots:
The screen shots of output windows for SBVR vocabulary and SBVR rules have been shown in the following figures:
Figure 1- NL to Alloy Generator via OCL
Figure 2- Input UML model parsed by NL2Alloy
Figure 3- Input natural language (English) text
Figure 4- SBVR business vocabulary generated by NL2Alloy
Figure 5- SBVR business rule generated by NL2Alloy
Figure 6- OCL invariant generated from SBVR business rule
Figure 7- Alloy code generated from UML/OCL model