Professional Documents
Culture Documents
Sww11 Preliminary Report
Sww11 Preliminary Report
COMPARISON OF SPECIFICATIONS
Requirements
Essential
• Extend the UI
In order to incorporate the computation of the differencing functionality we
will need to alter the Alloy Analyzer UI. We will need to add in a button to
select the two Alloy Modules opened in different tabs. We would need to add a
new view or revamp the existing editor views to allow side by side viewing of
the imported models, along with the required UI elements to initiate
comparison.
• Generate an Alloy Module
Once the files have been loaded and the comparison process has initiated, we
will need to perform a merger of the two alloy modules into one so that the
required constraints expressed in either of the modules can be converted into
two predicates, each depicting the constraints of one or the other module.
• Support run Commands
In the interest of comparing the two modules, we will need to find a way to
build the run command keeping in mind how scopes are defined in different
versions.
Recommended
• Version Tracking
So that easier comparison can be made between different versions of a module,
we will implement a version tracking system into Alloy Analyzer to load older
changes of a module and possibly diff check with the current version to point
out the changes in syntax.
• Handle Unique Signatures and Fields
There could be differences between the specification versions where a
signature or a field within the signature could be defined in one and not the
other. We will need to alter our algorithm to keep such discrepancies in
reference and decide if they impact the semantics of either versions.
• Support run Commands with Assertions
We will also extend, if possible, the support for run command as mentioned in
the Essential Requirements section to ascertain the described assertions in
either modules.
Optional
• Highlight and Map Semantic differences to Syntactic
It would be helpful and productive to know what changes in the syntax
caused a particular change in the meaning of the specification of the system.
We would try and accomplish this by pointing out the differences in the
generated predicate and as a result highlighting what changes in the original
syntax of the versions of syntax caused the change.
Challenges
• Alloy – Learn the Alloy specification and understand how its automated analyses
work.
• Research – Research available material on Alloy and explain how Alloy is best
suited for the differencing problem.
• Implementation – Implementation of an algorithm to compute differences not
limited to syntactic but also semantic inconsistencies.
• Modelling –
o Provide an easy to understand real world specification of a system and
annotate it in the Alloy Analyzer.
o Produce syntactically different but semantically similar versions of the
same model.
o Provide enough examples of different versions to prove that proposed
solutions work.
Reading List
[1] Daniel Jackson. 2006: Software Abstractions: Logic, Language, and Analysis.
Cambridge, Massachusetts, London: MIT Press.
[2] Maoz, Shahar and Ringert, Jan and Rumpe, Bernhard. (2010). A Manifesto for
Semantic Model Differencing. 6627. 194-203. 10.1007/978-3-642-21210-9_19.
[3] Daniel Jackson. (2002). Alloy: a lightweight object modelling notation. ACM Trans.
Softw. Eng. Methodol. 11. 256-290. 10.1145/505145.505149
[4] Daniel Jackson. (2019). Alloy: a language and tool for exploring software designs.
Commun. ACM 62. 66-76. 10.1145/3338843
[5] Maoz, Shahr and Ringert, Jan. (2015). A framework for relating syntactic and
semantic model differences. In Proceedings of the 18th International Conference on
Model Driven Engineering Languages and Systems (MODELS '15). IEEE Press,
Piscataway, NJ, USA, 24-33.
[6] Grönniger, H., Ringert, J.O. and Rumpe, B. (2009). System Model-Based Definition of
Modeling Language Semantics. Formal Techniques for Distributed Systems, pp.152–166
[7] Tim Nelson, Natasha Danas, Daniel J. Dougherty, Shriram Krishnamurthi: The power
of "why" and "why not": enriching scenario exploration with provenance.
ESEC/SIGSOFT FSE 2017: 106-116
Methodology
An Example
Consider the following example of different versions of a Customer and their Addresses
specification modelled using Alloy:
module ca1 module ca2
fact { fact {
all c1, c2: Customer | livesAt in Customer
c1.livesAt = c2.livesAt lone -> lone Address
implies c1 = c2 }
}
run {} for 5
run {} for 5
As it is easily noticeable, the fact clause in both modules is drastically different in terms
how it is denoted syntactically. However, in terms of semantics, both these declarations
are same. Both clauses constraint that only one Customer must live at a single Address.
How the proposed solution works
We will build an algorithm to merge both the versions of the specifications as follows:
module caMerged
sig Customer{
livesAt: lone Address,
}
sig Address{}
pred pred1 {
all c1, c2: Customer |
c1.livesAt = c2.livesAt implies c1 = c2
}
pred pred2 {
livesAt in Customer
lone -> lone Address
}
Where pred1 and pred2 are predicates generated by converting the constraints (fact)
from two different versions of the specification. Simultaneously, a run command is also
generated to execute instances for the generated predicates. The implication of this
command is for the Alloy Analyzer to find instances of the model specification where the
constraints from the first predicate pred1 hold true but not from those of pred2. If an
instance of such a command can be executed, we can say that there is a difference in the
semantics of both the versions. However, if no such instance could be generated, this
would imply that both the versions are semantically similar.
Testing
An Incremental and Iterative approach towards development and implementation will
be taken to tackle and achieve the requirements. Each task as discussed in the Project
Plan below, incorporates testing and validation of the task before marked as being
complete. A final rigorous and complete testing of all accumulative tasks and functions
will be performed to ensure that changes to the codebase hasn’t impacted the original
functionality of Alloy and the Analyzer in a negative manner.
Plan