feat: SAT-based semantic check of class diagrams + OCL constraints - #183
Open
pponzio wants to merge 6 commits into
Open
feat: SAT-based semantic check of class diagrams + OCL constraints#183pponzio wants to merge 6 commits into
pponzio wants to merge 6 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An implementation of SAT-based semantic checking for BUML class diagrams with OCL constraints. The semantic check of class diagrams and OCL constraints is based on a characterization of these modeling elements into the Alloy formal notation, and the use of SAT solving (via Alloy Analyzer) for consistency checking.
We added documentation in the following files briefly explaining how to use the new features:
Why
This is a new feature of BESSER. Semantic checking goes beyond just checking correct syntax of a model: it allows developers to check for logical consistency of model constraints, and thus to identify overlooked contradictions and inconsistencies in constraints.
How
The implementation is rather straightforward. The new functionality splits the original Quality Check functionality into Syntactic Check (existing check) and the newly implemented SAT-based check, under Semantic Check. The implementation also allows the user to generate the translation from model and constraints into Alloy, under Generate - Formal Notations - Alloy Specification.
Finally, in the Object Editor, there is an additional functionality, associated with the button “Semantic generation”. This allows the user to generate an object diagram compliant with the OCL constraints, witnessing the consistency of the class diagram and OCL constraints. This object diagram is generated by resorting to SAT solving, via Alloy Analyzer instance generation.
Testing
Manually tested with multiple examples, including sample models provided with the BESSER distribution, and newly added models, exercising various aspects of the OCL notation.
Screenshots / Recordings
Added Menu: Generate -> Formal Notations -> Alloy Specification
Generates an Alloy specification from a Class diagram.
After:
Before:
Added Menus:
Quality Check -> Syntactic Check (old Quality Check)
Quality Check -> Semantic Check
Semantic consistency checks of Class diagrams.
After:
Before:
Added Button: Semantic generation
Automatic generation of an object diagram
After:
Before: