Slides presented on June 27, 2018 at ECMFA in Toulouse, France.
Paper available for download from: https://link.springer.com/chapter/10.1007%2F978-3-319-92997-2_4
Expressing Measurement Uncertainty in OCL/UML Models
1. Expressing Measurement Uncertainty
in OCL/UML Models
Toulouse, June 27, 2018
M. F. Bertoa1, N. Moreno1, G. Barquero1, L. Burgueño1, J.Troya2 and A. Vallecillo1
1 Atenea Research Group, Univ. Málaga, Spain
2 ISA Group, Univ. Sevilla, Spain
ECMFA 2018
2. Motivation
Uncertainty in Engineering Disciplines
Engineers naturally think about:
uncertainty associated with measured values
Uncertainty is explicitly defined in their models
and considered in model-based simulations
2
5. Uncertainty in Software Engineering
Very limited support for representing uncertainty in software models
No support for considering such properties in model-based simulations
Not part of their type systems!
Motivation
Measure
value : Real
What is the uncertainty of the
measurement method?
How is this uncertainty propagated when
making calculations with uncertain
values?
5
6. Abstraction vs Precision
“Being abstract is something profoundly different from being
vague... The purpose of abstraction is not to be vague, but to
create a new semantic level in which one can be absolutely
precise.”
Edsger Dijkstra
6
7. (Magnitudes and) Uncertainty Representation of Uncertainty
Definition: Standard Uncertainty [GUM]
Uncertainty of the result of a measurement 𝑥𝑥 expressed as a standard
deviation 𝑢𝑢 of the possible variation of the values of 𝑥𝑥.
Representation: 𝑥𝑥 ± 𝑢𝑢 or 𝑥𝑥, 𝑢𝑢
Examples:
[GUM] JCGM 100:2008. Evaluation of measurement data – Guide to the expression of uncertainty in measurement.
http://www.bipm.org/utils/common/documents/jcgm/JCGM_100_2008_E.pdf
Normal distribution: (𝑥𝑥, 𝜎𝜎) with mean 𝑥𝑥, standard deviation 𝜎𝜎
Interval 𝑎𝑎, 𝑏𝑏 : Uniform or rectangular distribution is assumed
(𝑥𝑥, 𝑢𝑢) with 𝑥𝑥 =
𝑎𝑎+𝑏𝑏
2
, 𝑢𝑢 =
(𝑏𝑏−𝑎𝑎)
2 3
7
8. Measurement Uncertainty Operations
Computations with uncertain values have to respect the propagation of
uncertainty (uncertainty analysis)
Two Methods for Computing Aggregated Uncertainty
Normal or Uniform distribution: Analytical (closed-form) solutions
General case: Using samples (SIPMath Std.)
A. Vallecillo, C. Morcillo, and P. Orue. Expressing Measurement Uncertainty in Software Models. In Proc. of
QUATIC 2016, pages 1–10, 2016.
8
11. UReal
UReal are pairs (x, u)
x : Real represents the (expected, estimated or actual) value
u : Real represents the uncertainty, expressed as a standard deviation of the
possible variation of the values of 𝑥𝑥.
Real numbers correspond to pairs (x, 0.0)
Example:
(2.0, 0.3)
(2.5, 0.25)
11
14. UInteger and UUnlimitedNatural
UInteger
Pairs (n, u)
n : Integer represents the (expected, estimated or actual) value
u : Real represents the uncertainty, expressed as a standard deviation of the possible
variation of the values of n.
Integer numbers correspond to pairs (n, 0.0)
UInteger operations
Behavior defined by lifting the operation to UInteger and then projecting the result if
needed
UUnlimitedNatural
non-negative Integer or a special unlimited value (*)
(n, u) where n:Integer, u:Real, n≥0
The uncertainty of * is always 0.0
Operations not involving special value * are defined by lifting them to UInteger
Comparison operations need to consider the particular case of special value *,
lifting the operation to the supertype if this value is not involved
14
15. UBoolean
UBooleans are pairs (b, c)
where b:Boolean and c:Real, c ϵ [0, 1]
c represents the confidence that the actual value of the value is indeed b
Canonical form: (true, c)
Equivalence relation: (b, c) = (not b, 1 - c)
Constants
UBoolean(true, 0.999), UBoolean(false, 0.001)
Operations
Redefined basic operations: and, or, not
Redefined secondary operations: implies, equivalent, xor
Kept equals (=) and distinct (<>) w/o uncertainty and,
Added operations uEquals():UBoolean and uDistinct():UBoolean
Conversion operations: toBoolean() and toBooleanC(c:Real)
15
16. UBoolean
Operations
Two implementations:
Assuming all values are independents: Analytical specification:
When no assumption can be made about the independence: Monte-Carlo simulation
method:
16
17. Collections
Extension based on the extended operators for the primitive datatypes
uForAll(), uExists(), uIncludes(), uExcludes(), uSelect(), …
Examples:
17
18. Trains
* Note that in the implementation in USE the uncertain types are included as basic primitive data types, as well as their native operations
19. Trains
Train arrival time: T = 44.560 ± 10.581
User arrival time: M= 40.045 ± 5.704
Their diference: T-M = 4.515 ± 12.374
M + 3 <= T (true; 0.887)
The probability that the user catches the train is 0.887
19
20. MARTE and SysML
Compatibility problems when combining MARTE and SysML models
NOTE: Of course, simulation tools (Modelica, Matlab/Simulink) and mathematic languages (Mathematica) provide
support for units, dimensions and uncertainty, but they are at a different abstraction level
MARTE has stereotypes to decorate values with information
about the units and with measurement uncertainty
(“precision”)
However:
It is simply “decorative information”: no type checking, no
operations for aggregating uncertainty values
SysML 1.4 provides the QUDV (Quantities, Units,
Dimensions) and ISO 80000 library with all units and
dimensions.
However:
No support for dealing with measurement uncertainty
20
21. Conclusions and future work
Extension of OCL/UML datatypes to capture and manipulate properties of physical
systems, in particular measurement uncertainty
Implementations available for Java and USE
21
22. Conclusions and future work
Extension of OCL/UML datatypes to capture and manipulate properties of
physical systems, in particular measurement uncertainty
Implementations available for Java and USE
Ongoing and Future Work
Cover the rest of the UML/OCL datatypes: String and Enum
Mathematical properties
Mappings from our specifications to simulation languages (Modelica, Simulink)
Further validation of our proposal:
case studies
expressiveness
applicability
22
23. Expressing Measurement Uncertainty
in OCL/UML Models
Toulouse, June 27, 2018
M. F. Bertoa1, N. Moreno1, G. Barquero1, L. Burgueño1, J.Troya2 and A. Vallecillo1
1 Atenea Research Group, Univ. Málaga, Spain,
2 ISA Group, Univ. Sevilla, Spain
ECMFA 2018
Thanks!