SlideShare a Scribd company logo
Action Languages for UML execution
Where we are and where we are heading
Federico Ciccozzi
Assistant Professor, Mälardalen University (Sweden)
Contact: federico.ciccozzi@mdh.se
Embedded Systems@MDH
Dependable
systems
Real-time
systems
Robotics and
avionics
Sensor
systems and
health
Software
engineering
Verification
and
validation
Mälardalen University (MDH)
Embedded Systems Research Environment
Embedded Systems@MDH
Dependable
systems
Real-time
systems
Robotics and
avionics
Sensor
systems and
health
Software
engineering
Verification
and
validation
Mälardalen University (MDH)
Embedded Systems Research Environment
Embedded Systems@MDH
Dependable
systems
Real-time
systems
Robotics and
avionics
Sensor
systems and
health
Software
engineering
Verification
and
validation
Models, components, MDE, CBSE, UML, ALF...
Mälardalen University (MDH)
Embedded Systems Research Environment
5
● 15+18 full professors
● 70+ senior researchers (PhDs)
● 80+ PhD students
● Research volume 20 MCAD/yr
● ~80% of research in co-production projects
Mälardalen University (MDH)
Embedded Systems Research Environment
Companies we work with
● ABB AB ● AbsInt Angewandte Informatik GmbH ● Ada
Core ● Addiva ●Aensys Informatikai ● AICAS GMBH ●
Akhela ● Algo Rego ● Algosystems S.A. ● Alten ● Arcticus
Systems AB ● ATEGO SAS ● Atlas Copco ● Attendo ●
Austrian Institute of Technology ● AVL ● Bexen Cardio ●
Bombardier Transportation ● Bruhnspace AB ● Cambio
Healthcare Systems ● Cea List ● Critical Software ●
CrossControl AB ● Delphi France ● DELTA AB ● Ericsson
AB ● Eskilstuna Elektronikpartner AB ● Etteplan ●
European Aeronautic Defence and Space Company ●
Fonsazione Bruno Kessler ● Giraff AB ● GMV Innovating
Solutions ● Hök instrument AB ● Ingenieria de Sistemas
Intensivos en Software, S.L ● Intecs Informatica e
Tecnologia del Software ● JC Development ● Magillem ●
Maximatecc ● Medfield Diagnostics AB ● Meeq AB ●
Microsoft Sverige ● Motion Control ● Munktell Science Park
● Oilfield Technology Group ● Peerialism ● Physiotest ●
Prevas AB ● Prover
● Qtema ● Quality Pharma ● Quviq ● Resiltech ●
Saab ● Scania ● SEMA-TEC ● SICS Swedish ICT -
the Swedish institute of computer science ●
SignalGeneriX ● SINTEF ● SP Technical Research
Institute of Sweden ● Swedish Defence Research
Agency (FOI) ● Swedsoft ● Svensk Elektronik ● T2
Data ● TATA Consulting Services ● TeliaSonera ●
Thales Alenia Space ● Thales Communications and
Security SAS ● Thales Group ● The Swedish National
Road and Transport Research Institute ● Tidorum ●
Traintic ● TTTech Computertechnik AG ● ULMA
Embedded Solutions ● Vendolocus Development ●
VG Power AB ● Virtual Vehicle ● Vitrociset ● Volvo AB
● Volvo Cars ● Volvo Construction Equipment ● Volvo
Group Trucks Technology ● Västerås Science Park ●
X/Open Company Limited ● Xdin
Agenda
7
● Background
● Why Action Languages (ALs)?
● Some history about ALs for UML
● Introduction on Action Language for Foundational UML (ALF)
● Current support for ALF
● Some experiences from executing ALF
● Future perspectives
Background
8
Background
9
● Software too complex for hand-writing machine code
Background
10
● Software too complex for hand-writing machine code
● Abstraction from programming languages (3GLs) was the
solution 
Background
11
● Software too complex for hand-writing machine code
● Abstraction from programming languages (3GLs) was the
solution 
● Programming languages, stars of software engineering
from early 70s
12
Background
13
● Software complexity growing very fast
3GLs not enough
Machine-oriented
Too prescriptive (not useful for communication)
Too specific
…
Background
14
● Software complexity growing very fast
● 3GLs not enough
● Machine-oriented
● Too prescriptive (not useful for communication)
● Too specific
● …
Background
15
● A solution: Model-Driven Engineering (MDE) 
● More abstraction
● Automation
● Separation of concerns (domain-specific modelling
languages)
● Prescriptive AND descriptive
● Human-oriented
Many general-purpose and domain-specific modelling
languages
Background
16
● A solution: Model-Driven Engineering (MDE) 
● More abstraction
● Automation
● Separation of concerns (domain-specific modelling
languages)
● Prescriptive AND descriptive
● Human-oriented
● Many general-purpose and domain-specific modelling
languages
1994
17
UML1.[0-4] (1997-2003)
● Primarily for problem understanding and
documentation (descriptive)
18
UML1.[0-4] (1997-2003)
● Primarily for problem understanding and
documentation (descriptive)
● Practitioner saw possibilities for executing models
19
UML1.[0-4] (1997-2003)
● Primarily for problem understanding and
documentation (descriptive)
● Practitioner saw possibilities for executing models
But..
20
UML1.[0-4] (1997-2003)
● To execute models you need precise modelling!
21
UML1.[0-4] (1997-2003)
● To execute models you need precise modelling!
● What’s precise modelling?
● Well-defined abstract syntax for modelling structure 
● Well-defined abstract syntax for modelling (algorithmic)
behaviours 
● Intra-model consistency
● Inter-model consistency
● Well-defined model execution semantics 
22
Precise modelling?
23
● UML was not able to describe precise complex behaviours
and did not have well-defined execution semantics
Answer of practitioners and tool vendors..
3GLs (C/C++, Java, …)
3GLs could and we had all the tools for executing them
already
Precise modelling?
24
● UML was not able to describe precise complex behaviours
and did not have well-defined execution semantics
● Answer of practitioners and tool vendors..
3GLs (C/C++, Java, …)
3GLs could what UML couldn’t
Precise modelling?
25
● UML was not able to describe precise complex behaviours
and did not have well-defined execution semantics
● Answer of practitioners and tool vendors..
3GLs (C/C++, Java, …)
● 3GLs could what UML couldn’t
3GLs for action code – the less good
26
● Consistency between action code and surrounding model
(inter-model consistency)
● Hard to check
● Very hard to maintain
● Limited cross-domain reusability (think of CPS, IoT, etc..)
Imagine to write Java actions in Ada structural code…
(Why would you even do that?..)
3GLs for action code – the less good
27
● Consistency between action code and surrounding model
(inter-model consistency)
● Hard to check
● Very hard to maintain
● Limited cross-domain reusability (think of CPS, IoT, etc..)
● Imagine to write Java actions in Ada structural code…
● (Why would you even do that?..)
UML1.[0-4] (1997-2003)
● Tools (e.g., from IBM) start supporting executable
variants of UML
● Executability relied on custom semantics
(implicit profiles) in combination with 3GLs for action
code
28
Thereby..
● Tools not fully compliant with the UML standard
● End users forced into a “vendor lock-in”
predicament
29
Anyhow..
30
● If you are here, you see potential in ALs
● Let’s talk about them!
”The tale of ALs for UML”
31
● No princess nor prince on white horse
● No crystal shoe
But (hopefully) a happy ending
DISCLAIMER 1: The coming list of ALs is not meant to be exhaustive, but
rather significative
DISCLAIMER 2: I won’t touch upon other kinds of textual languages used
with/for UML (e.g., Umple, TextUML, txtUML, ..)
”The tale of ALs for UML”
32
● No princess nor prince on white horse
● No crystal shoe
● But (hopefully) a happy ending
DISCLAIMER 1: The coming list of ALs is not meant to be exhaustive, but
rather significative
DISCLAIMER 2: I won’t touch upon other kinds of textual languages used
with/for UML (e.g., Umple, TextUML, txtUML, ..)
”The tale of ALs for UML”
33
● No princess nor prince on white horse
● No crystal shoe
● But (hopefully) a happy ending
DISCLAIMER 1: The coming list of ALs is not meant to be exhaustive, but
rather significative
DISCLAIMER 2: I won’t touch upon other kinds of textual languages used
with/for UML (e.g., Umple, TextUML, txtUML, ..)
”The tale of ALs for UML”
34
● No princess nor prince on white horse
● No crystal shoe
● But (hopefully) a happy ending
DISCLAIMER 1: The coming list of ALs is not meant to be exhaustive, but
rather significative
DISCLAIMER 2: I won’t touch upon other kinds of textual languages used
with/for UML (e.g., Umple, TextUML, txtUML, ..)
1997: Shlaer-Mellor Action Language (SMALL)
35
● The first AL for UML!
● Data flow-based execution similar to fUML
● UML did not have an execution semantics to adhere to
● The language was never implemented in practice..
2003
36
UML 1.5
2003
37
UML 1.5
● More precise than previous UML1.x
● UML action semantics
2003: Action Specification Language (ASL)
38
● Part of the OOA tool
● Fairly capable AL for its time
● Not aligned to UML1.5 action semantics
● Development stopped in 2009
2004: Platform Independent Action Language
(PAL)
39
● Part of the PathMATE tool
● Still there
● Not aligned to UML1.5 action semantics
2005
40
UML 2.0
2005
41
UML 2.0
● (Much) more precise than UML1.5
● First step towards a precise execution semantics
2007: OCLX4 action language (OCLX4)
42
● OCL enriched with meta-actions for changing system
state
● Not aligned with UML2 action semantics
2007: Action Language for Business Logic
(ABL)
43
● Java-inspired
● Meant to be converted to UML actions
● Includes non-UML concepts
● Not aligned with UML2 action semantics
2008: +CAL
44
● In line with UML1.5 action semantics
● Domain-specific (distributed systems)
2009
45
fUML 1.0
2009
46
fUML 1.0
● Foundational Subset for Executable UML
● Finally a precise execution semantics for UML
UMLfUML
2009
47
fUML 1.0
● Foundational Subset for Executable UML
● Finally a precise execution semantics for UML
UMLfUML
Classes, activities,
composite structures
State-machines,
etc..
2011: UML Action Language (UAL)
48
● IBM behind it
● Still there (?)
2013 Action Language for Foundational
UML (ALF)
49
● Evolution of UAL
● OMG standard since 2013
● Materialization of great ideas in SMALL (Shlaer-Mellor
action language), 15 years later
The (r)evolution of UML2
● Semantically more precise than previous UML when
it comes to execution
Provide fUML, a formal specification of the executable
semantics for a subset of UML2
Provide ALF, a textual action language based on fUML
50
The (r)evolution of UML2
● Semantically more precise than previous UML when
it comes to execution
● Provide fUML, a formal specification of the execution
semantics for a subset of UML
Provide ALF, a textual action language based on fUML
51
The (r)evolution of UML2
● Semantically more precise than previous UML when
it comes to execution
● Provide fUML, a formal specification of the execution
semantics for a subset of UML
● Provide ALF, a textual action language based on fUML
52
ALF: what is it?
53
● ALF is a Java-like textual surface representation for UML
Execution semantics is given by mapping ALF's concrete
syntax to the abstract syntax of fUML
Primary goal: specifying executable behaviors within UML
structural model
ALF has an extended notation to represent structure too
It is possible to describe a UML model entirely using ALF
ALF: what is it?
54
● ALF is a Java-like textual surface representation for UML
● Execution semantics is given by mapping ALF's concrete
syntax to the abstract syntax of fUML
Primary goal: specifying executable behaviors within UML
structural model
ALF has an extended notation to represent structure too
It is possible to describe a UML model entirely using ALF
ALF: what is it?
55
● ALF is a Java-like textual surface representation for UML
● Execution semantics is given by mapping ALF's concrete
syntax to the abstract syntax of fUML
● Primary goal: specifying executable behaviors within
UML structural model
ALF has an extended notation to represent structure too
It is possible to describe a UML model entirely using ALF
ALF for behaviour
56
ALF
UML
ALF: what is it?
57
● ALF is a Java-like textual surface representation for UML
● Execution semantics is given by mapping ALF's concrete
syntax to the abstract syntax of fUML
● Primary goal: specifying executable behaviors within
UML structural model
● ALF has an extended notation to represent structure too
It is possible to describe a UML model entirely using ALF
ALF: what is it?
58
● ALF is a Java-like textual surface representation for UML
● Execution semantics is given by mapping ALF's concrete
syntax to the abstract syntax of fUML
● Primary goal: specifying executable behaviors within
UML structural model
● ALF has an extended notation to represent structure too
● It is possible to describe a complete (precise) model
entirely using ALF
ALF for structure + behaviour
59
ALF for structure + behaviour
60
ALF for structure + behaviour
61
ALF code is a model!
62
=
ALF v1.0.1
63
● Lexical structure
● Punctuation, operators, literals, reserved words..
Expressions
Behavioural unit that evaluates to a collection of values
Can have side effects (e.g. change values)
Statements
Behavioural segments producing an effect
Primary units od sequencing and control
Units
Structural elements (mostly within fUML) for defining structural
models
for(Integer i in intList){
x = x + i;
}
ALF v1.0.1
64
● Lexical structure
● Punctuation, operators, literals, reserved words..
● Expressions
● Behavioural unit that evaluates to a collection of values
● Can have side effects (e.g. change values)
Statements
Behavioural segments producing an effect
Primary units od sequencing and control
Units
Structural elements (mostly within fUML) for defining structural
models
for(Integer i in intList){
x = x + i;
}
ALF v1.0.1
65
● Lexical structure
● Punctuation, operators, literals, reserved words..
● Expressions
● Behavioural unit that evaluates to a collection of values
● Can have side effects (e.g. change values)
● Statements
● Behavioural segments producing an effect
● Primary units of sequencing and control
Units
Structural elements (mostly within fUML) for defining structural
models
for(Integer i in intList){
x = x + i;
}
ALF v1.0.1
66
● Lexical structure
● Punctuation, operators, literals, reserved words..
● Expressions
● Behavioural unit that evaluates to a collection of values
● Can have side effects (e.g. change values)
● Statements
● Behavioural segments producing an effect
● Primary units of sequencing and control
● Units
● Structural elements (mostly within fUML)
package Pkg{
active class ClassA{..}
}
ALF v1.0.1: syntactic conformance
67
● Minimum conformance
● subset of ALF to write textual action language snippets within
a larger graphical UML model
● includes only capabilities available in traditional, procedural
programming language
Full conformance
complete action language for representing behaviours within a
UML structural model
Extended conformance
includes structural modelling capabilities (ALF units)
ALF v1.0.1: syntactic conformance
68
● Minimum conformance
● subset of ALF to write textual action language snippets within
a larger graphical UML model
● includes only capabilities available in traditional, procedural
programming language
● Full conformance
● complete action language for representing behaviours within
a UML structural model
Extended conformance
includes structural modelling capabilities (ALF units)
ALF v1.0.1: syntactic conformance
69
● Minimum conformance
● subset of ALF to write textual action language snippets within
a larger graphical UML model
● includes only capabilities available in traditional, procedural
programming language
● Full conformance
● complete action language for representing behaviours within
a UML structural model
● Extended conformance
● includes structural modelling capabilities (ALF units)
ALF v1.0.1: (execution) semantic
conformance
70
● Interpretive execution
● modelling tool directly interprets and executes ALF
Compilative execution
modelling tool compiles ALF and executes it according to the
semantics specified in fUML
context of the execution of a larger model that may not conform to
fUML
Translational execution
modelling tool translates ALF and surrounding UML model into an
executable non-UML format, and executes the translation on that
platform
a.k.a. code generation
ALF v1.0.1: (execution) semantic
conformance
71
● Interpretive execution
● modelling tool directly interprets and executes ALF
● Compilative execution
● modelling tool compiles ALF and executes it according to the
semantics specified in fUML
● context of the execution of the surrounding model may not
conform to fUML
Translational execution
modelling tool translates ALF and surrounding UML model into an
executable non-UML format, and executes the translation on that
platform
a.k.a. code generation
ALF v1.0.1: (execution) semantic
conformance
72
● Interpretive execution
● modelling tool directly interprets and executes ALF
● Compilative execution
● modelling tool compiles ALF and executes it according to the
semantics specified in fUML
● context of the execution of the surrounding model may not
conform to fUML
● Translational execution
● modelling tool translates ALF and surrounding UML model into
an executable non-UML format, and executes the translation on
that platform
● a.k.a. code generation
ALF standard implementations
73
● ALF reference implementation
● By Ed Seidewitz (basically the father of ALF)
● Text-based, terminal
● Interpretive execution
ALF standard implementations
74
● ALF reference implementation
● By Ed Seidewitz (basically the father of ALF)
● Text-based, terminal
● Interpretive execution
● ALF implementation in Eclipse/Papyrus
● CEA list (France) in collaboration with Ed Seidewitz
● Model-based interpretive execution (MOKA)
State-of-the-practice in Industry
75
● UML-based MDE is still relying on 3GLs for action code
Pragmatism..
Reuse of existing models with PL action code (e.g., C++)
Domain specificity
Expertise
Time
State-of-the-practice in Industry
76
● UML-based MDE is still relying on 3GLs for action code
Why?
● Pragmatism..
● Reuse of existing models with 3GLs action code
● Domain specificity
● Expertise
● Time/money
State-of-the-practice in Industry
77
and..
● ALs have had a bad reputation!
● Before ALF
● Huge amount of different ALs throughout the years
● No efforts in standard (except OMG)
● No traction from research and practice
How do we know (besides experience)?
78
● Systematic review (SR)
● The first systematic investigation of the states of the
art and practice of the execution of UML models
● Over 4,500 papers and tools were scrutinized
● 70 papers and tools were selected for answering the
research questions that we identified
Scrutinized tools
79
IBM RSA
IBM RSARTE
IBM Rational Rose
IBM Rational Rhapsody
MentorGraphics BridgePoint
Fujaba
Papyrus - Qompass
Papyrus - Moka
Syntony
Moliz
FXU
Modeldriven.org
IBM Tau
ARTISAN Studio Sysym
CHESS
Conformiq Designer
GENCODE
Sparx Enterprise Architect
BOUML
Cameo Simulation toolkit
QM
TOPCASED Model Simulation
SOL SOLoist
Democles
ALF-verifier
IPANEMA
Telelogic Tau
ARTISAN Studio
AndroMDA
Anylogic
CODESIMULINK
Context-Serv
Genertica
GENESYS
Gentleware Poseidon
OMEGA-IFX
UML2SC
AONIX AMEOS
Astah Professional
CodeCooker
Altova Umodel
Visual Paradigm
Borland Together Architect
Compuware OptimalJ
Magic Draw UML Professional
Pragsoft UML Studio
ArgoUML
Yatta UML Lab
Microsoft Visual Studio
Provide execution
Do not provide execution
Results: ALs
● Many solutions leverage non-standard action
languages
Results: fUML
● Very few solutions based on fUML (growing)
ALF..
82
●  Increasing industrial interest
●  Adoption in well-established industrial UML-based
development
● Far from painless and swift
● Use of 3GLs in models deeply rooted in UML-based MDE
What to do?
83
● Introducing such a change with brute force is
unthinkable!
Our goal is to support and boost ALF adoption process
by exploiting ALF as a complement to existing UML-based MDE
processes leveraging programming languages
An example: a process producing executable C++ from UML
with C++ as action code.
Could reuse legacy models (or parts of them)
At the same time, new models (or parts of them) couldb be entirely defined
using UML and ALF
What to do?
84
● Introducing such a change with brute force is
unthinkable!
● Research community must support and boost ALF
adoption process
How?
● Industrial-grade innovation
● Focus on industrial needs
● Constructive rather than disruptive
MDH contribution
85
● Standalone solutions for translational execution of ALF to C++
ALF transformation: system defined only in terms of ALF (.alf)
The complete ALF model is translated to C++
UML-ALF transformation: system modelled with UML (+ profiles),
bodies of operations as opaque behaviours defined in ALF
Opaque behaviours in ALF are translated to C++
Basic support for ALF units
(partially) Namespace, package, class, operation, property
Support for translation of minimum conformance (no complete yet)
Except allInstances(), BitString
Limitations for casting and collections management (all collections
currently translated to C++ vectors)
MDH contribution
86
● Standalone solutions for translational execution of ALF to C++
1. ALF transformation: system defined only in terms of ALF (.alf)
● The complete ALF model is translated to C++
UML-ALF transformation: system modelled with UML (+ profiles),
bodies of operations as opaque behaviours defined in ALF
Opaque behaviours in ALF are translated to C++
Basic support for ALF units
(partially) Namespace, package, class, operation, property
Support for translation of minimum conformance (no complete yet)
Except allInstances(), BitString
Limitations for casting and collections management (all collections
currently translated to C++ vectors)
MDH contribution
87
● Standalone solutions for translational execution of ALF to C++
1. ALF transformation: system defined only in terms of ALF (.alf)
● The complete ALF model is translated to C++
2. UML-ALF transformation: system modelled with UML (+ profiles),
operation bodies as opaque behaviours defined in ALF
● Opaque behaviours in ALF are translated to C++
Basic support for ALF units
(partially) Namespace, package, class, operation, property
Support for translation of minimum conformance (no complete yet)
Except allInstances(), BitString
Limitations for casting and collections management (all collections
currently translated to C++ vectors)
MDH contribution
88
● Standalone solutions for translational execution of ALF to C++
1. ALF transformation: system defined only in terms of ALF (.alf)
● The complete ALF model is translated to C++
2. UML-ALF transformation: system modelled with UML (+ profiles),
operation bodies as opaque behaviours defined in ALF
● Opaque behaviours in ALF are translated to C++
● Basic support for ALF units
● (partially) Namespace, package, class, operation, property
Support for translation of minimum conformance (no complete yet)
Except allInstances(), BitString
Limitations for casting and collections management (all collections
currently translated to C++ vectors)
MDH contribution
89
● Standalone solutions for translational execution of ALF to C++
1. ALF transformation: system defined only in terms of ALF (.alf)
● The complete ALF model is translated to C++
2. UML-ALF transformation: system modelled with UML (+ profiles),
operation bodies as opaque behaviours defined in ALF
● Opaque behaviours in ALF are translated to C++
● Basic support for ALF units
● (partially) Namespace, package, class, operation, property
● Support for translation of minimum conformance
● Except allInstances(), BitString
● Limitations for casting and collections management (all collections
currently translated to C++ vectors)
MDH contribution
90
● Type deduction mechanisms
● Dynamic typing
● Access to members (e.g., a.b in ALF to a.b or ab or a::b in C++?)
● Imported scopes
● Nested scopes
● ….
MDH contribution
91
● Implementation based on Eclipse/Papyrus Mars 1.0
● Set of Eclipse plugins (solution 1 and 2 are separated)
● Translation as model-to-text transformations in Xtend
● First of its kind
Transforming ALF
92
● Transformation steps
● a.-b. structure transformation
● Solution 1: from ALF units
● Solution 2: external generator
Transforming ALF
93
● Transformation steps
● a.-b. structure transformation
● b’. Action code in ALF (blocks) is
translated automatically to C++
● Solution 1: stored during structure
transformation and then translated
● Solution 2: UML model is navigated and opaque
behaviours in ALF are translated to C++
Transforming ALF
94
● Transformation steps
● a.-b. structure transformation
● b’. Action code in ALF (blocks) is
translated automatically to C++
● b’’. Action code in C++ can be copied to
the output code files
Transforming ALF
95
● Transformation steps
● a.-b. structure transformation
● b’. Action code in ALF (blocks) is
translated automatically to C++
● b’’. Action code in C++ can be copied to
the output code files
● CppTree
● Intermediate structural representation
for C++ (Xtend/Java)
● Leverages TypeDeduction
Main transformation steps
96
● Structural translation: produces corresponding C++
skeleton code
Check for each UML operation if there is a fine-grained
behaviour defined in terms of a UML opaque behaviour
Opaque behaviour in C++: copies as it is to resulting .cpp file
Opaque behaviour in ALF: triggers M2T transformation for
translation from ALF to C++.cpp file
Opaque behaviour in other (not supported) languages: no action
Main transformation steps
97
● Structural translation: produces corresponding C++
skeleton code
● Check for each UML operation if there is a fine-grained
behaviour defined in terms of a UML opaque behaviour
Opaque behaviour in C++: copies as it is to resulting .cpp file
Opaque behaviour in ALF: triggers M2T transformation for
translation from ALF to C++.cpp file
Opaque behaviour in other (not supported) languages: no action
Main transformation steps
98
● Structural translation: produces corresponding C++
skeleton code
● Check for each UML operation if there is a fine-grained
behaviour defined in terms of a UML opaque behaviour
● Opaque behaviour in C++: copies it as it is to resulting .cpp file
Opaque behaviour in ALF: triggers M2T transformation for
translation from ALF to C++.cpp file
Opaque behaviour in other (not supported) languages: no action
Main transformation steps
99
● Structural translation: produces corresponding C++
skeleton code
● Check for each UML operation if there is a fine-grained
behaviour defined in terms of a UML opaque behaviour
● Opaque behaviour in C++: copies it as it is to resulting .cpp file
● Opaque behaviour in ALF: triggers M2T transformation for
translation from ALF to C++ .cpp file
Opaque behaviour in other (not supported) languages: no action
Main transformation steps
100
● Structural translation: produces corresponding C++
skeleton code
● Check for each UML operation if there is a fine-grained
behaviour defined in terms of a UML opaque behaviour
● Opaque behaviour in C++: copies it as it is to resulting .cpp file
● Opaque behaviour in ALF: triggers M2T transformation for
translation from ALF to C++ .cpp file
● Opaque behaviour in other (not supported) language: no action
Solution 1
101
ALF
Solution 1
102
ALF
C++
M2T
Solution 2
103
ALF
C++
Solution 2
104
M2T
Scope
105
● SMARTCore project (funded by Swedish national agency, KKS)
● Project leader:
● Mälardalen University (Federico Ciccozzi)
● Industrial partners:
● ABB CR (Tiberiu Seceleanu)
● Ericsson AB (Diarmuid Corcoran)
● Alten Sweden (Detlef Scholle)
● Linked to Papyrus Industry Consortium initiative
Two interesting aspects
106
● Memory management in ALF vs. C++
● Execution semantics misalignment between ALF and C++
Memory management in ALF vs. C++
107
● ALF does not enforce a specific memory management mechanism
Two possibilities
Create and destroy objects explicitly
Constrain an object's lifecycle to ”execution locus” unless they are not
explicitly destroyed
If all links to an object are destroyed, object can be re-trieved anytime
using class extent expressions (in C++, ”unreachable" objects and
thereby memory leaks)
No univocal way to to bridge memory management mechanisms in
ALF and C++
Memory management in ALF vs. C++
108
● ALF does not enforce a specific memory management mechanism
● Two possibilities
1. Create and destroy objects explicitly
2. Constrain an object's lifecycle to ”execution locus” unless they are not
explicitly destroyed
If all links to an object are destroyed, object can be re-trieved anytime
using class extent expressions (in C++, ”unreachable" objects and
thereby memory leaks)
No univocal way to to bridge memory management mechanisms in
ALF and C++
Memory management in ALF vs. C++
109
● ALF does not enforce a specific memory management mechanisms
● Two possibilities
1. Create and destroy objects explicitly
2. Constrain an object's lifecycle to ”execution locus” unless they are not
explicitly destroyed
● If all links to an object are destroyed, object can be retrieved using
class extent expressions
● in C++, ”unreachable" objects and thereby memory leaks
No univocal way to bridge memory management mechanisms in ALF
and C++
Memory management in ALF vs. C++
110
● ALF does not enforce a specific memory management mechanisms
● Two possibilities
1. Create and destroy objects explicitly
2. Constrain an object's lifecycle to ”execution locus” unless they are not
explicitly destroyed
● If all links to an object are destroyed, object can be retrieved using
class extent expressions
● in C++, ”unreachable" objects and thereby memory leaks
● No univocal way to bridge memory management mechanisms in
ALF and C++
Memory management in ALF vs. C++
111
● Our goal was to generate C++ code free from memory
overflows/leaks
For practical reasons (industrial applications), we were restricted to
C++11
Three possibilities:
Allocate basic typed variables on the stack and more complex objects on the
heap
Pros: good code performance and easy to implement
Cons: no prevention from stack overflows
Allocate everything on the heap through ”smart pointers”
Pros: good code performance, medium to implement, prevents stack overflows and memory
leaks
Cons: not optimised memory usage
Perform a smart allocation on heap and stack
Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage
Cons: complex to implement and maintain
Memory management in ALF vs. C++
112
● Our goal was to generate C++ code free from memory
overflows/leaks
● For practical reasons (industrial applications), we were restricted to
C++11
Three possibilities:
Allocate basic typed variables on the stack and more complex objects on the
heap
Pros: good code performance and easy to implement
Cons: no prevention from stack overflows
Allocate everything on the heap through ”smart pointers”
Pros: good code performance, medium to implement, prevents stack overflows and memory
leaks
Cons: not optimised memory usage
Perform a smart allocation on heap and stack
Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage
Cons: complex to implement and maintain
Memory management in ALF vs. C++
113
● Our goal was to generate C++ code free from memory
overflows/leaks
● For practical reasons (industrial applications), we were restricted to
C++11
● Three possibilities:
● Allocate basic typed variables on the stack and more complex objects on
the heap
● Pros: good code performance and easy to implement
● Cons: no prevention from stack overflows
Allocate everything on the heap through ”smart pointers”
Pros: good code performance, medium to implement, prevents stack overflows and memory
leaks
Cons: not optimised memory usage
Perform a smart allocation on heap and stack
Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage
Cons: complex to implement and maintain
Memory management in ALF vs. C++
114
● Our goal was to generate C++ code free from memory
overflows/leaks
● For practical reasons (industrial applications), we were restricted to
C++11
● Three possibilities:
● Allocate basic typed variables on the stack and more complex objects on
the heap
● Pros: good code performance and easy to implement
● Cons: no prevention from stack overflows
● Allocate everything on the heap through ”smart pointers”
● Pros: good code performance, medium to implement, prevents stack overflows
● Cons: not optimised memory usage
Perform a smart allocation on heap and stack
Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage
Cons: complex to implement and maintain
Memory management in ALF vs. C++
115
● Our goal was to generate C++ code free from memory
overflows/leaks
● For practical reasons (industrial applications), we were restricted to
C++11
● Three possibilities:
● Allocate basic typed variables on the stack and more complex objects on
the heap
● Pros: good code performance and easy to implement
● Cons: no prevention from stack overflows
● Allocate everything on the heap through ”smart pointers”
● Pros: good code performance, medium to implement, prevents stack overflows
● Cons: not optimised memory usage
● Perform a smart allocation on heap and stack
● Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage
● Cons: complex to implement and maintain
Memory management in ALF vs. C++
116
● Our goal was to generate C++ code free from memory
overflows/leaks
● For practical reasons (industrial applications), we were restricted to
C++11
● Three possibilities:
● Allocate basic typed variables on the stack and more complex objects on
the heap
● Pros: good code performance and easy to implement
● Cons: no prevention from stack overflows
● Allocate everything on the heap through ”smart pointers”
● Pros: good code performance, medium to implement, prevents stack overflows and memory
leaks
● Cons: not optimised memory usage
● Perform a smart allocation on heap and stack
● Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage
● Cons: complex to implement and maintain
Execution semantics misalignment
117
● ALF and C++ have different semantics
Translating from one to the other does not bridge this
Ad-hoc solutions can be enforced, but are not optimal
3GL compilers (e.g. for C++) optimise according to 3GL semantics
Execution semantics misalignment
118
● ALF and C++ have different semantics
ALF
let a : ClassA = …;
let param : Integer = null;
a.addItem(param);
a.printItems();
Execution semantics misalignment
119
● ALF and C++ have different semantics
ALF
let a : ClassA = …;
let param : Integer = null;
a.addItem(param); Execution stops here!
a.printItems();
Execution semantics misalignment
120
● ALF and C++ have different semantics
C++
ClassA a = …;
int param = null;
a.addItem(param);
a.printItems();
Execution semantics misalignment
121
● ALF and C++ have different semantics
● addItem() is called; there might be a null pointer exception
C++
ClassA a = …;
int param = null;
a.addItem(param);
a.printItems();
Execution semantics misalignment
122
● ALF and C++ have different semantics
● Translating from one to the other does not bridge this
Ad-hoc solutions can be enforced, but are not optimal
3GL compilers (e.g. for C++) optimise according to 3GL semantics
Execution semantics misalignment
123
● ALF and C++ have different semantics
● Translating from one to the other does not bridge this
● Ad-hoc solutions need to be enforced, but are not optimal
3GL compilers (e.g. for C++) optimise according to 3GL semantics
Execution semantics misalignment
124
● ALF and C++ have different semantics
● Translating from one to the other does not bridge this
● Ad-hoc solutions need to be enforced, but are not optimal
● 3GL compilers unaware of UML/ALF semantics
Execution semantics misalignment
125
● ALF and C++ have different semantics
● Translating from one to the other does not bridge this
● Ad-hoc solutions need to be enforced, but are not optimal
● 3GL compilers unaware of UML/ALF semantics
● 3GL compilers optimise according to 3GL semantics
So..
126
● Code generation is not the best way to go..
So..
127
● Code generation is not the best way to go..
● Translating UML/ALF to C++ is almost like translating C++ to
C to reuse a C compiler
So..
128
● Code generation is not the best way to go..
● Translating UML/ALF to C++ is almost like translating C++ to
C to reuse a C compiler
● Do you remember CFront? And what happened with it?
So..
129
● Code generation is not the best way to go..
● Translating UML/ALF to C++ is almost like translating C++ to
C to reuse a C compiler
● Do you remember CFront? And what happened with it?
CFront
Why didn’t CFront succeed?
130
● Overcomplex generated compiler code
● Suboptimal executables (based on C semantics)
Let’s compile models instead 
131
Why compiling?
132
● Full control over the manipulations that models undergo
Optimisations based on model semantics
Maximised semantics-preservation from model to executable
Produced executables semantically more consistent to source models
than with any translational approach
Consistency enhances model observability (e.g., model debugging,
models@runtime
More predictable generated executables
Boost adoption of UML/ALF for embedded real-time and safety-critical
systems
Why compiling?
133
● Full control over the manipulations that models undergo
● Optimisations based on model semantics
Maximised semantics-preservation from model to executable
Produced executables semantically more consistent to source models
than with any translational approach
Consistency enhances model observability (e.g., model debugging,
models@runtime
More predictable generated executables
Boost adoption of UML/ALF for embedded real-time and safety-critical
systems
Why compiling?
134
● Full control over the manipulations that models undergo
● Optimisations based on model semantics
● Maximised semantics-preservation from model to executable
● Produced executables semantically more consistent to source models
than with any translational approach
● Enhanced model-executable consistency
● Better model observability (e.g., model debugging, models@runtime)
More predictable generated executables
Boost adoption of UML/ALF for embedded real-time and safety-critical
systems
Why compiling?
135
● Full control over the manipulations that models undergo
● Optimisations based on model semantics
● Maximised semantics-preservation from model to executable
● Produced executables semantically more consistent to source models
than with any translational approach
● Enhanced model-executable consistency
● Better model observability (e.g., model debugging, models@runtime)
● More predictable generated executables
● Boost adoption of UML/ALF for embedded real-time safety-critical
systems (e.g. CPS)
Solutions for UML/ALF compilation
136
Solutions for UML/ALF compilation
137
The waving guys
138
● Who are they?
● Mälardalen University (myself, project leader)
● Alten Sweden AB
● Saab Group – Defence and Security
● Academia-industry cooperative project (2017-2020)
● Swedish national funding
● Goals
● Development of predictable safety-critical software-intensive systems
● Compilation of (f)UML/ALF
● Optimised memory management
● Minimisation of dynamic memory handling
● Optimal allocation on heap and stack
● Driven by model-based analysis
Other (to be) hot research topics in
UML/ALF execution
139
● Ability to execute partial models (early verification)
● Modelling uncertainty (flexible development of CPS, IoT)
● Enhanced observability of model execution
● Enhanced control of model execution
● Support for executing models based on UML profiles
● Integration of UML simulators into heterogeneous (multi-paradigm)
simulation systems (CPS)
● Use of model-reference approaches at runtime (models@runtime)
Summarising..
140
(f)UML+ALF = Precise modelling
141
UML
Well-defined syntax for structural details
Profiles specific for different concerns/domains in a CPS
ALF
Well-defined syntax for algorithmic behaviours
Platform-independent -> deployment to different platforms of the same
functions
fUML
Well-defined execution semantics
Gives tools for producing predictable software (mission-critical CPS, IoT,
safety-critical systems in general)
UML + fUML + ALF
consistent abstract syntaxes (fUML as common base)
inter-model consistency by-construction
What’s precise modelling?
• Well-defined abstract
syntax for structure
• Well-defined abstract
syntax for behaviour
• Well-defined model
execution semantics
• Intra-model consistency
(f)UML+ALF = Precise modelling
142
● UML
● Well-defined syntax for structural details
● Profiles specific for different concerns/domains in a CPS
ALF
Well-defined syntax for algorithmic behaviours
Platform-independent -> deployment to different platforms of the same
functions
fUML
Well-defined execution semantics
Gives tools for producing predictable software (mission-critical CPS, IoT,
safety-critical systems in general)
UML + fUML + ALF
consistent abstract syntaxes (fUML as common base)
inter-model consistency by-construction
What’s precise modelling?
• Well-defined abstract
syntax for structure
• Well-defined abstract
syntax for behaviour
• Well-defined model
execution semantics
• Intra-model consistency
(f)UML+ALF = Precise modelling
143
● UML
● Well-defined syntax for structural details
● Profiles specific for different concerns/domains in a CPS
● ALF
● Well-defined syntax for algorithmic behaviours
● Platform-independent -> deployment to different platforms of the same
functions (heterogeneous systems -> CPS)
fUML
Well-defined execution semantics
Gives tools for producing predictable software (mission-critical CPS, IoT,
safety-critical systems in general)
UML + fUML + ALF
consistent abstract syntaxes (fUML as common base)
inter-model consistency by-construction
What’s precise modelling?
• Well-defined abstract
syntax for structure
• Well-defined abstract
syntax for behaviour
• Well-defined model
execution semantics
• Intra-model consistency
(f)UML+ALF = Precise modelling
144
● UML
● Well-defined syntax for structural details
● Profiles specific for different concerns/domains in a CPS
● ALF
● Well-defined syntax for algorithmic behaviours
● Platform-independent -> deployment to different platforms of the same
functions (heterogeneous systems -> CPS)
● fUML
● Well-defined execution semantics
● Gives tools for producing predictable software (mission-critical CPS, IoT,
safety-critical systems in general)
UML + fUML + ALF
consistent abstract syntaxes (fUML as common base)
inter-model consistency by-construction
What’s precise modelling?
• Well-defined abstract
syntax for structure
• Well-defined abstract
syntax for behaviour
• Well-defined model
execution semantics
• Intra-model consistency
(f)UML+ALF = Precise modelling
145
● UML
● Well-defined syntax for structural details
● Profiles specific for different concerns/domains in a CPS
● ALF
● Well-defined syntax for algorithmic behaviours
● Platform-independent -> deployment to different platforms of the same
functions (heterogeneous systems -> CPS)
● fUML
● Well-defined execution semantics
● Gives tools for producing predictable software (mission-critical CPS, IoT,
safety-critical systems in general)
● UML + fUML + ALF
● consistent abstract syntaxes (fUML as common base)
● intra-model consistency by-construction (need support by modelling tool)
What’s precise modelling?
• Well-defined abstract
syntax for structure
• Well-defined abstract
syntax for behaviour
• Well-defined model
execution semantics
• Intra-model consistency
ALF instead of 3GLs for action code
146
● ALF standard action language for UML (and profiles)
● Abstraction
● Model consistency and maintainability (full awareness of
surrounding model elements)
● Model reusability (several targets from same input model)
● Model analisability (simulation, execution, etc..)
ALF instead of 3GLs for action code
147
● ALF standard action language for UML (and profiles)
● Abstraction
● Model consistency and maintainability (full awareness of
surrounding model elements)
● Model reusability (several targets from same input model)
● Model analisability (simulation, execution, etc..)
● Shift to ALF in industrial UML-based MDE leveraging
3GLs for action code is not trivial
Joint effort
148
● A myriad of UML tools in 20 years
● More or less wild customisation, enhancement, creation of
dialects
● Innovation reduced to minimum, portability issues, language
implementations discrepancy, …
● Modelling tool landscape which in many ways contradicts UML's
creed (UNIFICATION)
What do we need?
UML = unification technology  unified intents and efforts
Open-source common baseline
Domain-specific customised variations
Synergic effort between developers, users and researchers from
industry and academia is vital
Joint effort
149
● A myriad of UML tools in 20 years
● More or less wild customisation, enhancement, creation of
dialects
● Innovation reduced to minimum, portability issues, language
implementations discrepancy, …
● Modelling tool landscape which in many ways contradicts UML's
creed (UNIFICATION)
● What do we need?
● UML = unification technology  unified intents and efforts
● Common baseline
● Domain-specific customised variations (even user-defined)
● Synergic effort between developers, users and researchers from
industry and academia is vital
Thanks for the attention!
150Contact: federico.ciccozzi@mdh.se
Acknowledgements
Thanks for fruitful discussions and cooperation to:
• Bran Selic (Malina Software Corp.)
• Ivano Malavolta (Vrije University)
• Mikael Sjödin (MDH)
• Alfonso Pierantonio (University of L’Aquila)
• Antonio Cicchetti (MDH)
• Francis Bordeleau (Ericsson)
• Diarmuid Corcoran (Ericsson)
• Thomas Åkerlund (Knightec)
• Alessio Bucaioni (MDH)
• Detlef Scholle (Alten Sweden)
• Tiberiu Seceleanu (ABB Corporate Research)
• SMARTCore (www.es.mdh.se/projects/377-SMARTCore)
• Papyrus IC (wiki.polarsys.org/Papyrus_IC)

More Related Content

PPT
Ecmfa2013
PPT
02 uml
PDF
Formally Defining and Iterating Infinite Models (MODELS 2012)
ODP
A brief look inside UML
PDF
[2016/2017] Architectural languages
PPSX
Programming in UML: An Introduction to fUML and Alf
PPTX
UML: Once More with Meaning
PPT
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1
Ecmfa2013
02 uml
Formally Defining and Iterating Infinite Models (MODELS 2012)
A brief look inside UML
[2016/2017] Architectural languages
Programming in UML: An Introduction to fUML and Alf
UML: Once More with Meaning
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1

Similar to Action Languages for UML execution: Where we are and where we are heading (20)

PDF
Code Generation 2014 - ALF, the Standard Programming Language for UML
PPTX
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
PPSX
UML: This Time We Mean It!
PPT
Executable UML – UML2
PPT
IntroductionToUML.ppt
PPTX
Unified Modeling Language
PDF
Modeling software with UML
PPTX
Executable UML Roadmap (as of September 2014)
PPT
Uml introduciton
PPT
Chapteroneofunifiedmodelinglanguage1.ppt
PPT
Chapter 1.ppt
PPTX
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
PDF
4 (uml basic)
PPTX
Unified Modeling Language
PPTX
Introduction to Unified Modeling Language
PDF
UML with Action Semantics
PDF
OOAD and An effort by IBM (Rational) Dynamic parts of UML models: “behavior o...
PPTX
Unified Modelling Languageeeeeeeeeeeeeee
PDF
PhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdf
Code Generation 2014 - ALF, the Standard Programming Language for UML
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
UML: This Time We Mean It!
Executable UML – UML2
IntroductionToUML.ppt
Unified Modeling Language
Modeling software with UML
Executable UML Roadmap (as of September 2014)
Uml introduciton
Chapteroneofunifiedmodelinglanguage1.ppt
Chapter 1.ppt
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
4 (uml basic)
Unified Modeling Language
Introduction to Unified Modeling Language
UML with Action Semantics
OOAD and An effort by IBM (Rational) Dynamic parts of UML models: “behavior o...
Unified Modelling Languageeeeeeeeeeeeeee
PhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdf
Ad

Recently uploaded (20)

PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
ai tools demonstartion for schools and inter college
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
System and Network Administration Chapter 2
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Introduction to Artificial Intelligence
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Essential Infomation Tech presentation.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Odoo POS Development Services by CandidRoot Solutions
ai tools demonstartion for schools and inter college
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
System and Network Administration Chapter 2
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How Creative Agencies Leverage Project Management Software.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Introduction to Artificial Intelligence
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Choose the Right IT Partner for Your Business in Malaysia
CHAPTER 2 - PM Management and IT Context
PTS Company Brochure 2025 (1).pdf.......
wealthsignaloriginal-com-DS-text-... (1).pdf
Essential Infomation Tech presentation.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Ad

Action Languages for UML execution: Where we are and where we are heading

  • 1. Action Languages for UML execution Where we are and where we are heading Federico Ciccozzi Assistant Professor, Mälardalen University (Sweden) Contact: federico.ciccozzi@mdh.se
  • 2. Embedded Systems@MDH Dependable systems Real-time systems Robotics and avionics Sensor systems and health Software engineering Verification and validation Mälardalen University (MDH) Embedded Systems Research Environment
  • 3. Embedded Systems@MDH Dependable systems Real-time systems Robotics and avionics Sensor systems and health Software engineering Verification and validation Mälardalen University (MDH) Embedded Systems Research Environment
  • 4. Embedded Systems@MDH Dependable systems Real-time systems Robotics and avionics Sensor systems and health Software engineering Verification and validation Models, components, MDE, CBSE, UML, ALF... Mälardalen University (MDH) Embedded Systems Research Environment
  • 5. 5 ● 15+18 full professors ● 70+ senior researchers (PhDs) ● 80+ PhD students ● Research volume 20 MCAD/yr ● ~80% of research in co-production projects Mälardalen University (MDH) Embedded Systems Research Environment
  • 6. Companies we work with ● ABB AB ● AbsInt Angewandte Informatik GmbH ● Ada Core ● Addiva ●Aensys Informatikai ● AICAS GMBH ● Akhela ● Algo Rego ● Algosystems S.A. ● Alten ● Arcticus Systems AB ● ATEGO SAS ● Atlas Copco ● Attendo ● Austrian Institute of Technology ● AVL ● Bexen Cardio ● Bombardier Transportation ● Bruhnspace AB ● Cambio Healthcare Systems ● Cea List ● Critical Software ● CrossControl AB ● Delphi France ● DELTA AB ● Ericsson AB ● Eskilstuna Elektronikpartner AB ● Etteplan ● European Aeronautic Defence and Space Company ● Fonsazione Bruno Kessler ● Giraff AB ● GMV Innovating Solutions ● Hök instrument AB ● Ingenieria de Sistemas Intensivos en Software, S.L ● Intecs Informatica e Tecnologia del Software ● JC Development ● Magillem ● Maximatecc ● Medfield Diagnostics AB ● Meeq AB ● Microsoft Sverige ● Motion Control ● Munktell Science Park ● Oilfield Technology Group ● Peerialism ● Physiotest ● Prevas AB ● Prover ● Qtema ● Quality Pharma ● Quviq ● Resiltech ● Saab ● Scania ● SEMA-TEC ● SICS Swedish ICT - the Swedish institute of computer science ● SignalGeneriX ● SINTEF ● SP Technical Research Institute of Sweden ● Swedish Defence Research Agency (FOI) ● Swedsoft ● Svensk Elektronik ● T2 Data ● TATA Consulting Services ● TeliaSonera ● Thales Alenia Space ● Thales Communications and Security SAS ● Thales Group ● The Swedish National Road and Transport Research Institute ● Tidorum ● Traintic ● TTTech Computertechnik AG ● ULMA Embedded Solutions ● Vendolocus Development ● VG Power AB ● Virtual Vehicle ● Vitrociset ● Volvo AB ● Volvo Cars ● Volvo Construction Equipment ● Volvo Group Trucks Technology ● Västerås Science Park ● X/Open Company Limited ● Xdin
  • 7. Agenda 7 ● Background ● Why Action Languages (ALs)? ● Some history about ALs for UML ● Introduction on Action Language for Foundational UML (ALF) ● Current support for ALF ● Some experiences from executing ALF ● Future perspectives
  • 9. Background 9 ● Software too complex for hand-writing machine code
  • 10. Background 10 ● Software too complex for hand-writing machine code ● Abstraction from programming languages (3GLs) was the solution 
  • 11. Background 11 ● Software too complex for hand-writing machine code ● Abstraction from programming languages (3GLs) was the solution  ● Programming languages, stars of software engineering from early 70s
  • 12. 12
  • 13. Background 13 ● Software complexity growing very fast 3GLs not enough Machine-oriented Too prescriptive (not useful for communication) Too specific …
  • 14. Background 14 ● Software complexity growing very fast ● 3GLs not enough ● Machine-oriented ● Too prescriptive (not useful for communication) ● Too specific ● …
  • 15. Background 15 ● A solution: Model-Driven Engineering (MDE)  ● More abstraction ● Automation ● Separation of concerns (domain-specific modelling languages) ● Prescriptive AND descriptive ● Human-oriented Many general-purpose and domain-specific modelling languages
  • 16. Background 16 ● A solution: Model-Driven Engineering (MDE)  ● More abstraction ● Automation ● Separation of concerns (domain-specific modelling languages) ● Prescriptive AND descriptive ● Human-oriented ● Many general-purpose and domain-specific modelling languages
  • 18. UML1.[0-4] (1997-2003) ● Primarily for problem understanding and documentation (descriptive) 18
  • 19. UML1.[0-4] (1997-2003) ● Primarily for problem understanding and documentation (descriptive) ● Practitioner saw possibilities for executing models 19
  • 20. UML1.[0-4] (1997-2003) ● Primarily for problem understanding and documentation (descriptive) ● Practitioner saw possibilities for executing models But.. 20
  • 21. UML1.[0-4] (1997-2003) ● To execute models you need precise modelling! 21
  • 22. UML1.[0-4] (1997-2003) ● To execute models you need precise modelling! ● What’s precise modelling? ● Well-defined abstract syntax for modelling structure  ● Well-defined abstract syntax for modelling (algorithmic) behaviours  ● Intra-model consistency ● Inter-model consistency ● Well-defined model execution semantics  22
  • 23. Precise modelling? 23 ● UML was not able to describe precise complex behaviours and did not have well-defined execution semantics Answer of practitioners and tool vendors.. 3GLs (C/C++, Java, …) 3GLs could and we had all the tools for executing them already
  • 24. Precise modelling? 24 ● UML was not able to describe precise complex behaviours and did not have well-defined execution semantics ● Answer of practitioners and tool vendors.. 3GLs (C/C++, Java, …) 3GLs could what UML couldn’t
  • 25. Precise modelling? 25 ● UML was not able to describe precise complex behaviours and did not have well-defined execution semantics ● Answer of practitioners and tool vendors.. 3GLs (C/C++, Java, …) ● 3GLs could what UML couldn’t
  • 26. 3GLs for action code – the less good 26 ● Consistency between action code and surrounding model (inter-model consistency) ● Hard to check ● Very hard to maintain ● Limited cross-domain reusability (think of CPS, IoT, etc..) Imagine to write Java actions in Ada structural code… (Why would you even do that?..)
  • 27. 3GLs for action code – the less good 27 ● Consistency between action code and surrounding model (inter-model consistency) ● Hard to check ● Very hard to maintain ● Limited cross-domain reusability (think of CPS, IoT, etc..) ● Imagine to write Java actions in Ada structural code… ● (Why would you even do that?..)
  • 28. UML1.[0-4] (1997-2003) ● Tools (e.g., from IBM) start supporting executable variants of UML ● Executability relied on custom semantics (implicit profiles) in combination with 3GLs for action code 28
  • 29. Thereby.. ● Tools not fully compliant with the UML standard ● End users forced into a “vendor lock-in” predicament 29
  • 30. Anyhow.. 30 ● If you are here, you see potential in ALs ● Let’s talk about them!
  • 31. ”The tale of ALs for UML” 31 ● No princess nor prince on white horse ● No crystal shoe But (hopefully) a happy ending DISCLAIMER 1: The coming list of ALs is not meant to be exhaustive, but rather significative DISCLAIMER 2: I won’t touch upon other kinds of textual languages used with/for UML (e.g., Umple, TextUML, txtUML, ..)
  • 32. ”The tale of ALs for UML” 32 ● No princess nor prince on white horse ● No crystal shoe ● But (hopefully) a happy ending DISCLAIMER 1: The coming list of ALs is not meant to be exhaustive, but rather significative DISCLAIMER 2: I won’t touch upon other kinds of textual languages used with/for UML (e.g., Umple, TextUML, txtUML, ..)
  • 33. ”The tale of ALs for UML” 33 ● No princess nor prince on white horse ● No crystal shoe ● But (hopefully) a happy ending DISCLAIMER 1: The coming list of ALs is not meant to be exhaustive, but rather significative DISCLAIMER 2: I won’t touch upon other kinds of textual languages used with/for UML (e.g., Umple, TextUML, txtUML, ..)
  • 34. ”The tale of ALs for UML” 34 ● No princess nor prince on white horse ● No crystal shoe ● But (hopefully) a happy ending DISCLAIMER 1: The coming list of ALs is not meant to be exhaustive, but rather significative DISCLAIMER 2: I won’t touch upon other kinds of textual languages used with/for UML (e.g., Umple, TextUML, txtUML, ..)
  • 35. 1997: Shlaer-Mellor Action Language (SMALL) 35 ● The first AL for UML! ● Data flow-based execution similar to fUML ● UML did not have an execution semantics to adhere to ● The language was never implemented in practice..
  • 37. 2003 37 UML 1.5 ● More precise than previous UML1.x ● UML action semantics
  • 38. 2003: Action Specification Language (ASL) 38 ● Part of the OOA tool ● Fairly capable AL for its time ● Not aligned to UML1.5 action semantics ● Development stopped in 2009
  • 39. 2004: Platform Independent Action Language (PAL) 39 ● Part of the PathMATE tool ● Still there ● Not aligned to UML1.5 action semantics
  • 41. 2005 41 UML 2.0 ● (Much) more precise than UML1.5 ● First step towards a precise execution semantics
  • 42. 2007: OCLX4 action language (OCLX4) 42 ● OCL enriched with meta-actions for changing system state ● Not aligned with UML2 action semantics
  • 43. 2007: Action Language for Business Logic (ABL) 43 ● Java-inspired ● Meant to be converted to UML actions ● Includes non-UML concepts ● Not aligned with UML2 action semantics
  • 44. 2008: +CAL 44 ● In line with UML1.5 action semantics ● Domain-specific (distributed systems)
  • 46. 2009 46 fUML 1.0 ● Foundational Subset for Executable UML ● Finally a precise execution semantics for UML UMLfUML
  • 47. 2009 47 fUML 1.0 ● Foundational Subset for Executable UML ● Finally a precise execution semantics for UML UMLfUML Classes, activities, composite structures State-machines, etc..
  • 48. 2011: UML Action Language (UAL) 48 ● IBM behind it ● Still there (?)
  • 49. 2013 Action Language for Foundational UML (ALF) 49 ● Evolution of UAL ● OMG standard since 2013 ● Materialization of great ideas in SMALL (Shlaer-Mellor action language), 15 years later
  • 50. The (r)evolution of UML2 ● Semantically more precise than previous UML when it comes to execution Provide fUML, a formal specification of the executable semantics for a subset of UML2 Provide ALF, a textual action language based on fUML 50
  • 51. The (r)evolution of UML2 ● Semantically more precise than previous UML when it comes to execution ● Provide fUML, a formal specification of the execution semantics for a subset of UML Provide ALF, a textual action language based on fUML 51
  • 52. The (r)evolution of UML2 ● Semantically more precise than previous UML when it comes to execution ● Provide fUML, a formal specification of the execution semantics for a subset of UML ● Provide ALF, a textual action language based on fUML 52
  • 53. ALF: what is it? 53 ● ALF is a Java-like textual surface representation for UML Execution semantics is given by mapping ALF's concrete syntax to the abstract syntax of fUML Primary goal: specifying executable behaviors within UML structural model ALF has an extended notation to represent structure too It is possible to describe a UML model entirely using ALF
  • 54. ALF: what is it? 54 ● ALF is a Java-like textual surface representation for UML ● Execution semantics is given by mapping ALF's concrete syntax to the abstract syntax of fUML Primary goal: specifying executable behaviors within UML structural model ALF has an extended notation to represent structure too It is possible to describe a UML model entirely using ALF
  • 55. ALF: what is it? 55 ● ALF is a Java-like textual surface representation for UML ● Execution semantics is given by mapping ALF's concrete syntax to the abstract syntax of fUML ● Primary goal: specifying executable behaviors within UML structural model ALF has an extended notation to represent structure too It is possible to describe a UML model entirely using ALF
  • 57. ALF: what is it? 57 ● ALF is a Java-like textual surface representation for UML ● Execution semantics is given by mapping ALF's concrete syntax to the abstract syntax of fUML ● Primary goal: specifying executable behaviors within UML structural model ● ALF has an extended notation to represent structure too It is possible to describe a UML model entirely using ALF
  • 58. ALF: what is it? 58 ● ALF is a Java-like textual surface representation for UML ● Execution semantics is given by mapping ALF's concrete syntax to the abstract syntax of fUML ● Primary goal: specifying executable behaviors within UML structural model ● ALF has an extended notation to represent structure too ● It is possible to describe a complete (precise) model entirely using ALF
  • 59. ALF for structure + behaviour 59
  • 60. ALF for structure + behaviour 60
  • 61. ALF for structure + behaviour 61
  • 62. ALF code is a model! 62 =
  • 63. ALF v1.0.1 63 ● Lexical structure ● Punctuation, operators, literals, reserved words.. Expressions Behavioural unit that evaluates to a collection of values Can have side effects (e.g. change values) Statements Behavioural segments producing an effect Primary units od sequencing and control Units Structural elements (mostly within fUML) for defining structural models for(Integer i in intList){ x = x + i; }
  • 64. ALF v1.0.1 64 ● Lexical structure ● Punctuation, operators, literals, reserved words.. ● Expressions ● Behavioural unit that evaluates to a collection of values ● Can have side effects (e.g. change values) Statements Behavioural segments producing an effect Primary units od sequencing and control Units Structural elements (mostly within fUML) for defining structural models for(Integer i in intList){ x = x + i; }
  • 65. ALF v1.0.1 65 ● Lexical structure ● Punctuation, operators, literals, reserved words.. ● Expressions ● Behavioural unit that evaluates to a collection of values ● Can have side effects (e.g. change values) ● Statements ● Behavioural segments producing an effect ● Primary units of sequencing and control Units Structural elements (mostly within fUML) for defining structural models for(Integer i in intList){ x = x + i; }
  • 66. ALF v1.0.1 66 ● Lexical structure ● Punctuation, operators, literals, reserved words.. ● Expressions ● Behavioural unit that evaluates to a collection of values ● Can have side effects (e.g. change values) ● Statements ● Behavioural segments producing an effect ● Primary units of sequencing and control ● Units ● Structural elements (mostly within fUML) package Pkg{ active class ClassA{..} }
  • 67. ALF v1.0.1: syntactic conformance 67 ● Minimum conformance ● subset of ALF to write textual action language snippets within a larger graphical UML model ● includes only capabilities available in traditional, procedural programming language Full conformance complete action language for representing behaviours within a UML structural model Extended conformance includes structural modelling capabilities (ALF units)
  • 68. ALF v1.0.1: syntactic conformance 68 ● Minimum conformance ● subset of ALF to write textual action language snippets within a larger graphical UML model ● includes only capabilities available in traditional, procedural programming language ● Full conformance ● complete action language for representing behaviours within a UML structural model Extended conformance includes structural modelling capabilities (ALF units)
  • 69. ALF v1.0.1: syntactic conformance 69 ● Minimum conformance ● subset of ALF to write textual action language snippets within a larger graphical UML model ● includes only capabilities available in traditional, procedural programming language ● Full conformance ● complete action language for representing behaviours within a UML structural model ● Extended conformance ● includes structural modelling capabilities (ALF units)
  • 70. ALF v1.0.1: (execution) semantic conformance 70 ● Interpretive execution ● modelling tool directly interprets and executes ALF Compilative execution modelling tool compiles ALF and executes it according to the semantics specified in fUML context of the execution of a larger model that may not conform to fUML Translational execution modelling tool translates ALF and surrounding UML model into an executable non-UML format, and executes the translation on that platform a.k.a. code generation
  • 71. ALF v1.0.1: (execution) semantic conformance 71 ● Interpretive execution ● modelling tool directly interprets and executes ALF ● Compilative execution ● modelling tool compiles ALF and executes it according to the semantics specified in fUML ● context of the execution of the surrounding model may not conform to fUML Translational execution modelling tool translates ALF and surrounding UML model into an executable non-UML format, and executes the translation on that platform a.k.a. code generation
  • 72. ALF v1.0.1: (execution) semantic conformance 72 ● Interpretive execution ● modelling tool directly interprets and executes ALF ● Compilative execution ● modelling tool compiles ALF and executes it according to the semantics specified in fUML ● context of the execution of the surrounding model may not conform to fUML ● Translational execution ● modelling tool translates ALF and surrounding UML model into an executable non-UML format, and executes the translation on that platform ● a.k.a. code generation
  • 73. ALF standard implementations 73 ● ALF reference implementation ● By Ed Seidewitz (basically the father of ALF) ● Text-based, terminal ● Interpretive execution
  • 74. ALF standard implementations 74 ● ALF reference implementation ● By Ed Seidewitz (basically the father of ALF) ● Text-based, terminal ● Interpretive execution ● ALF implementation in Eclipse/Papyrus ● CEA list (France) in collaboration with Ed Seidewitz ● Model-based interpretive execution (MOKA)
  • 75. State-of-the-practice in Industry 75 ● UML-based MDE is still relying on 3GLs for action code Pragmatism.. Reuse of existing models with PL action code (e.g., C++) Domain specificity Expertise Time
  • 76. State-of-the-practice in Industry 76 ● UML-based MDE is still relying on 3GLs for action code Why? ● Pragmatism.. ● Reuse of existing models with 3GLs action code ● Domain specificity ● Expertise ● Time/money
  • 77. State-of-the-practice in Industry 77 and.. ● ALs have had a bad reputation! ● Before ALF ● Huge amount of different ALs throughout the years ● No efforts in standard (except OMG) ● No traction from research and practice
  • 78. How do we know (besides experience)? 78 ● Systematic review (SR) ● The first systematic investigation of the states of the art and practice of the execution of UML models ● Over 4,500 papers and tools were scrutinized ● 70 papers and tools were selected for answering the research questions that we identified
  • 79. Scrutinized tools 79 IBM RSA IBM RSARTE IBM Rational Rose IBM Rational Rhapsody MentorGraphics BridgePoint Fujaba Papyrus - Qompass Papyrus - Moka Syntony Moliz FXU Modeldriven.org IBM Tau ARTISAN Studio Sysym CHESS Conformiq Designer GENCODE Sparx Enterprise Architect BOUML Cameo Simulation toolkit QM TOPCASED Model Simulation SOL SOLoist Democles ALF-verifier IPANEMA Telelogic Tau ARTISAN Studio AndroMDA Anylogic CODESIMULINK Context-Serv Genertica GENESYS Gentleware Poseidon OMEGA-IFX UML2SC AONIX AMEOS Astah Professional CodeCooker Altova Umodel Visual Paradigm Borland Together Architect Compuware OptimalJ Magic Draw UML Professional Pragsoft UML Studio ArgoUML Yatta UML Lab Microsoft Visual Studio Provide execution Do not provide execution
  • 80. Results: ALs ● Many solutions leverage non-standard action languages
  • 81. Results: fUML ● Very few solutions based on fUML (growing)
  • 82. ALF.. 82 ●  Increasing industrial interest ●  Adoption in well-established industrial UML-based development ● Far from painless and swift ● Use of 3GLs in models deeply rooted in UML-based MDE
  • 83. What to do? 83 ● Introducing such a change with brute force is unthinkable! Our goal is to support and boost ALF adoption process by exploiting ALF as a complement to existing UML-based MDE processes leveraging programming languages An example: a process producing executable C++ from UML with C++ as action code. Could reuse legacy models (or parts of them) At the same time, new models (or parts of them) couldb be entirely defined using UML and ALF
  • 84. What to do? 84 ● Introducing such a change with brute force is unthinkable! ● Research community must support and boost ALF adoption process How? ● Industrial-grade innovation ● Focus on industrial needs ● Constructive rather than disruptive
  • 85. MDH contribution 85 ● Standalone solutions for translational execution of ALF to C++ ALF transformation: system defined only in terms of ALF (.alf) The complete ALF model is translated to C++ UML-ALF transformation: system modelled with UML (+ profiles), bodies of operations as opaque behaviours defined in ALF Opaque behaviours in ALF are translated to C++ Basic support for ALF units (partially) Namespace, package, class, operation, property Support for translation of minimum conformance (no complete yet) Except allInstances(), BitString Limitations for casting and collections management (all collections currently translated to C++ vectors)
  • 86. MDH contribution 86 ● Standalone solutions for translational execution of ALF to C++ 1. ALF transformation: system defined only in terms of ALF (.alf) ● The complete ALF model is translated to C++ UML-ALF transformation: system modelled with UML (+ profiles), bodies of operations as opaque behaviours defined in ALF Opaque behaviours in ALF are translated to C++ Basic support for ALF units (partially) Namespace, package, class, operation, property Support for translation of minimum conformance (no complete yet) Except allInstances(), BitString Limitations for casting and collections management (all collections currently translated to C++ vectors)
  • 87. MDH contribution 87 ● Standalone solutions for translational execution of ALF to C++ 1. ALF transformation: system defined only in terms of ALF (.alf) ● The complete ALF model is translated to C++ 2. UML-ALF transformation: system modelled with UML (+ profiles), operation bodies as opaque behaviours defined in ALF ● Opaque behaviours in ALF are translated to C++ Basic support for ALF units (partially) Namespace, package, class, operation, property Support for translation of minimum conformance (no complete yet) Except allInstances(), BitString Limitations for casting and collections management (all collections currently translated to C++ vectors)
  • 88. MDH contribution 88 ● Standalone solutions for translational execution of ALF to C++ 1. ALF transformation: system defined only in terms of ALF (.alf) ● The complete ALF model is translated to C++ 2. UML-ALF transformation: system modelled with UML (+ profiles), operation bodies as opaque behaviours defined in ALF ● Opaque behaviours in ALF are translated to C++ ● Basic support for ALF units ● (partially) Namespace, package, class, operation, property Support for translation of minimum conformance (no complete yet) Except allInstances(), BitString Limitations for casting and collections management (all collections currently translated to C++ vectors)
  • 89. MDH contribution 89 ● Standalone solutions for translational execution of ALF to C++ 1. ALF transformation: system defined only in terms of ALF (.alf) ● The complete ALF model is translated to C++ 2. UML-ALF transformation: system modelled with UML (+ profiles), operation bodies as opaque behaviours defined in ALF ● Opaque behaviours in ALF are translated to C++ ● Basic support for ALF units ● (partially) Namespace, package, class, operation, property ● Support for translation of minimum conformance ● Except allInstances(), BitString ● Limitations for casting and collections management (all collections currently translated to C++ vectors)
  • 90. MDH contribution 90 ● Type deduction mechanisms ● Dynamic typing ● Access to members (e.g., a.b in ALF to a.b or ab or a::b in C++?) ● Imported scopes ● Nested scopes ● ….
  • 91. MDH contribution 91 ● Implementation based on Eclipse/Papyrus Mars 1.0 ● Set of Eclipse plugins (solution 1 and 2 are separated) ● Translation as model-to-text transformations in Xtend ● First of its kind
  • 92. Transforming ALF 92 ● Transformation steps ● a.-b. structure transformation ● Solution 1: from ALF units ● Solution 2: external generator
  • 93. Transforming ALF 93 ● Transformation steps ● a.-b. structure transformation ● b’. Action code in ALF (blocks) is translated automatically to C++ ● Solution 1: stored during structure transformation and then translated ● Solution 2: UML model is navigated and opaque behaviours in ALF are translated to C++
  • 94. Transforming ALF 94 ● Transformation steps ● a.-b. structure transformation ● b’. Action code in ALF (blocks) is translated automatically to C++ ● b’’. Action code in C++ can be copied to the output code files
  • 95. Transforming ALF 95 ● Transformation steps ● a.-b. structure transformation ● b’. Action code in ALF (blocks) is translated automatically to C++ ● b’’. Action code in C++ can be copied to the output code files ● CppTree ● Intermediate structural representation for C++ (Xtend/Java) ● Leverages TypeDeduction
  • 96. Main transformation steps 96 ● Structural translation: produces corresponding C++ skeleton code Check for each UML operation if there is a fine-grained behaviour defined in terms of a UML opaque behaviour Opaque behaviour in C++: copies as it is to resulting .cpp file Opaque behaviour in ALF: triggers M2T transformation for translation from ALF to C++.cpp file Opaque behaviour in other (not supported) languages: no action
  • 97. Main transformation steps 97 ● Structural translation: produces corresponding C++ skeleton code ● Check for each UML operation if there is a fine-grained behaviour defined in terms of a UML opaque behaviour Opaque behaviour in C++: copies as it is to resulting .cpp file Opaque behaviour in ALF: triggers M2T transformation for translation from ALF to C++.cpp file Opaque behaviour in other (not supported) languages: no action
  • 98. Main transformation steps 98 ● Structural translation: produces corresponding C++ skeleton code ● Check for each UML operation if there is a fine-grained behaviour defined in terms of a UML opaque behaviour ● Opaque behaviour in C++: copies it as it is to resulting .cpp file Opaque behaviour in ALF: triggers M2T transformation for translation from ALF to C++.cpp file Opaque behaviour in other (not supported) languages: no action
  • 99. Main transformation steps 99 ● Structural translation: produces corresponding C++ skeleton code ● Check for each UML operation if there is a fine-grained behaviour defined in terms of a UML opaque behaviour ● Opaque behaviour in C++: copies it as it is to resulting .cpp file ● Opaque behaviour in ALF: triggers M2T transformation for translation from ALF to C++ .cpp file Opaque behaviour in other (not supported) languages: no action
  • 100. Main transformation steps 100 ● Structural translation: produces corresponding C++ skeleton code ● Check for each UML operation if there is a fine-grained behaviour defined in terms of a UML opaque behaviour ● Opaque behaviour in C++: copies it as it is to resulting .cpp file ● Opaque behaviour in ALF: triggers M2T transformation for translation from ALF to C++ .cpp file ● Opaque behaviour in other (not supported) language: no action
  • 105. Scope 105 ● SMARTCore project (funded by Swedish national agency, KKS) ● Project leader: ● Mälardalen University (Federico Ciccozzi) ● Industrial partners: ● ABB CR (Tiberiu Seceleanu) ● Ericsson AB (Diarmuid Corcoran) ● Alten Sweden (Detlef Scholle) ● Linked to Papyrus Industry Consortium initiative
  • 106. Two interesting aspects 106 ● Memory management in ALF vs. C++ ● Execution semantics misalignment between ALF and C++
  • 107. Memory management in ALF vs. C++ 107 ● ALF does not enforce a specific memory management mechanism Two possibilities Create and destroy objects explicitly Constrain an object's lifecycle to ”execution locus” unless they are not explicitly destroyed If all links to an object are destroyed, object can be re-trieved anytime using class extent expressions (in C++, ”unreachable" objects and thereby memory leaks) No univocal way to to bridge memory management mechanisms in ALF and C++
  • 108. Memory management in ALF vs. C++ 108 ● ALF does not enforce a specific memory management mechanism ● Two possibilities 1. Create and destroy objects explicitly 2. Constrain an object's lifecycle to ”execution locus” unless they are not explicitly destroyed If all links to an object are destroyed, object can be re-trieved anytime using class extent expressions (in C++, ”unreachable" objects and thereby memory leaks) No univocal way to to bridge memory management mechanisms in ALF and C++
  • 109. Memory management in ALF vs. C++ 109 ● ALF does not enforce a specific memory management mechanisms ● Two possibilities 1. Create and destroy objects explicitly 2. Constrain an object's lifecycle to ”execution locus” unless they are not explicitly destroyed ● If all links to an object are destroyed, object can be retrieved using class extent expressions ● in C++, ”unreachable" objects and thereby memory leaks No univocal way to bridge memory management mechanisms in ALF and C++
  • 110. Memory management in ALF vs. C++ 110 ● ALF does not enforce a specific memory management mechanisms ● Two possibilities 1. Create and destroy objects explicitly 2. Constrain an object's lifecycle to ”execution locus” unless they are not explicitly destroyed ● If all links to an object are destroyed, object can be retrieved using class extent expressions ● in C++, ”unreachable" objects and thereby memory leaks ● No univocal way to bridge memory management mechanisms in ALF and C++
  • 111. Memory management in ALF vs. C++ 111 ● Our goal was to generate C++ code free from memory overflows/leaks For practical reasons (industrial applications), we were restricted to C++11 Three possibilities: Allocate basic typed variables on the stack and more complex objects on the heap Pros: good code performance and easy to implement Cons: no prevention from stack overflows Allocate everything on the heap through ”smart pointers” Pros: good code performance, medium to implement, prevents stack overflows and memory leaks Cons: not optimised memory usage Perform a smart allocation on heap and stack Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage Cons: complex to implement and maintain
  • 112. Memory management in ALF vs. C++ 112 ● Our goal was to generate C++ code free from memory overflows/leaks ● For practical reasons (industrial applications), we were restricted to C++11 Three possibilities: Allocate basic typed variables on the stack and more complex objects on the heap Pros: good code performance and easy to implement Cons: no prevention from stack overflows Allocate everything on the heap through ”smart pointers” Pros: good code performance, medium to implement, prevents stack overflows and memory leaks Cons: not optimised memory usage Perform a smart allocation on heap and stack Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage Cons: complex to implement and maintain
  • 113. Memory management in ALF vs. C++ 113 ● Our goal was to generate C++ code free from memory overflows/leaks ● For practical reasons (industrial applications), we were restricted to C++11 ● Three possibilities: ● Allocate basic typed variables on the stack and more complex objects on the heap ● Pros: good code performance and easy to implement ● Cons: no prevention from stack overflows Allocate everything on the heap through ”smart pointers” Pros: good code performance, medium to implement, prevents stack overflows and memory leaks Cons: not optimised memory usage Perform a smart allocation on heap and stack Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage Cons: complex to implement and maintain
  • 114. Memory management in ALF vs. C++ 114 ● Our goal was to generate C++ code free from memory overflows/leaks ● For practical reasons (industrial applications), we were restricted to C++11 ● Three possibilities: ● Allocate basic typed variables on the stack and more complex objects on the heap ● Pros: good code performance and easy to implement ● Cons: no prevention from stack overflows ● Allocate everything on the heap through ”smart pointers” ● Pros: good code performance, medium to implement, prevents stack overflows ● Cons: not optimised memory usage Perform a smart allocation on heap and stack Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage Cons: complex to implement and maintain
  • 115. Memory management in ALF vs. C++ 115 ● Our goal was to generate C++ code free from memory overflows/leaks ● For practical reasons (industrial applications), we were restricted to C++11 ● Three possibilities: ● Allocate basic typed variables on the stack and more complex objects on the heap ● Pros: good code performance and easy to implement ● Cons: no prevention from stack overflows ● Allocate everything on the heap through ”smart pointers” ● Pros: good code performance, medium to implement, prevents stack overflows ● Cons: not optimised memory usage ● Perform a smart allocation on heap and stack ● Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage ● Cons: complex to implement and maintain
  • 116. Memory management in ALF vs. C++ 116 ● Our goal was to generate C++ code free from memory overflows/leaks ● For practical reasons (industrial applications), we were restricted to C++11 ● Three possibilities: ● Allocate basic typed variables on the stack and more complex objects on the heap ● Pros: good code performance and easy to implement ● Cons: no prevention from stack overflows ● Allocate everything on the heap through ”smart pointers” ● Pros: good code performance, medium to implement, prevents stack overflows and memory leaks ● Cons: not optimised memory usage ● Perform a smart allocation on heap and stack ● Pros: best code performance, can prevent stack overflows and leaks, optimal memory usage ● Cons: complex to implement and maintain
  • 117. Execution semantics misalignment 117 ● ALF and C++ have different semantics Translating from one to the other does not bridge this Ad-hoc solutions can be enforced, but are not optimal 3GL compilers (e.g. for C++) optimise according to 3GL semantics
  • 118. Execution semantics misalignment 118 ● ALF and C++ have different semantics ALF let a : ClassA = …; let param : Integer = null; a.addItem(param); a.printItems();
  • 119. Execution semantics misalignment 119 ● ALF and C++ have different semantics ALF let a : ClassA = …; let param : Integer = null; a.addItem(param); Execution stops here! a.printItems();
  • 120. Execution semantics misalignment 120 ● ALF and C++ have different semantics C++ ClassA a = …; int param = null; a.addItem(param); a.printItems();
  • 121. Execution semantics misalignment 121 ● ALF and C++ have different semantics ● addItem() is called; there might be a null pointer exception C++ ClassA a = …; int param = null; a.addItem(param); a.printItems();
  • 122. Execution semantics misalignment 122 ● ALF and C++ have different semantics ● Translating from one to the other does not bridge this Ad-hoc solutions can be enforced, but are not optimal 3GL compilers (e.g. for C++) optimise according to 3GL semantics
  • 123. Execution semantics misalignment 123 ● ALF and C++ have different semantics ● Translating from one to the other does not bridge this ● Ad-hoc solutions need to be enforced, but are not optimal 3GL compilers (e.g. for C++) optimise according to 3GL semantics
  • 124. Execution semantics misalignment 124 ● ALF and C++ have different semantics ● Translating from one to the other does not bridge this ● Ad-hoc solutions need to be enforced, but are not optimal ● 3GL compilers unaware of UML/ALF semantics
  • 125. Execution semantics misalignment 125 ● ALF and C++ have different semantics ● Translating from one to the other does not bridge this ● Ad-hoc solutions need to be enforced, but are not optimal ● 3GL compilers unaware of UML/ALF semantics ● 3GL compilers optimise according to 3GL semantics
  • 126. So.. 126 ● Code generation is not the best way to go..
  • 127. So.. 127 ● Code generation is not the best way to go.. ● Translating UML/ALF to C++ is almost like translating C++ to C to reuse a C compiler
  • 128. So.. 128 ● Code generation is not the best way to go.. ● Translating UML/ALF to C++ is almost like translating C++ to C to reuse a C compiler ● Do you remember CFront? And what happened with it?
  • 129. So.. 129 ● Code generation is not the best way to go.. ● Translating UML/ALF to C++ is almost like translating C++ to C to reuse a C compiler ● Do you remember CFront? And what happened with it? CFront
  • 130. Why didn’t CFront succeed? 130 ● Overcomplex generated compiler code ● Suboptimal executables (based on C semantics)
  • 131. Let’s compile models instead  131
  • 132. Why compiling? 132 ● Full control over the manipulations that models undergo Optimisations based on model semantics Maximised semantics-preservation from model to executable Produced executables semantically more consistent to source models than with any translational approach Consistency enhances model observability (e.g., model debugging, models@runtime More predictable generated executables Boost adoption of UML/ALF for embedded real-time and safety-critical systems
  • 133. Why compiling? 133 ● Full control over the manipulations that models undergo ● Optimisations based on model semantics Maximised semantics-preservation from model to executable Produced executables semantically more consistent to source models than with any translational approach Consistency enhances model observability (e.g., model debugging, models@runtime More predictable generated executables Boost adoption of UML/ALF for embedded real-time and safety-critical systems
  • 134. Why compiling? 134 ● Full control over the manipulations that models undergo ● Optimisations based on model semantics ● Maximised semantics-preservation from model to executable ● Produced executables semantically more consistent to source models than with any translational approach ● Enhanced model-executable consistency ● Better model observability (e.g., model debugging, models@runtime) More predictable generated executables Boost adoption of UML/ALF for embedded real-time and safety-critical systems
  • 135. Why compiling? 135 ● Full control over the manipulations that models undergo ● Optimisations based on model semantics ● Maximised semantics-preservation from model to executable ● Produced executables semantically more consistent to source models than with any translational approach ● Enhanced model-executable consistency ● Better model observability (e.g., model debugging, models@runtime) ● More predictable generated executables ● Boost adoption of UML/ALF for embedded real-time safety-critical systems (e.g. CPS)
  • 136. Solutions for UML/ALF compilation 136
  • 137. Solutions for UML/ALF compilation 137
  • 138. The waving guys 138 ● Who are they? ● Mälardalen University (myself, project leader) ● Alten Sweden AB ● Saab Group – Defence and Security ● Academia-industry cooperative project (2017-2020) ● Swedish national funding ● Goals ● Development of predictable safety-critical software-intensive systems ● Compilation of (f)UML/ALF ● Optimised memory management ● Minimisation of dynamic memory handling ● Optimal allocation on heap and stack ● Driven by model-based analysis
  • 139. Other (to be) hot research topics in UML/ALF execution 139 ● Ability to execute partial models (early verification) ● Modelling uncertainty (flexible development of CPS, IoT) ● Enhanced observability of model execution ● Enhanced control of model execution ● Support for executing models based on UML profiles ● Integration of UML simulators into heterogeneous (multi-paradigm) simulation systems (CPS) ● Use of model-reference approaches at runtime (models@runtime)
  • 141. (f)UML+ALF = Precise modelling 141 UML Well-defined syntax for structural details Profiles specific for different concerns/domains in a CPS ALF Well-defined syntax for algorithmic behaviours Platform-independent -> deployment to different platforms of the same functions fUML Well-defined execution semantics Gives tools for producing predictable software (mission-critical CPS, IoT, safety-critical systems in general) UML + fUML + ALF consistent abstract syntaxes (fUML as common base) inter-model consistency by-construction What’s precise modelling? • Well-defined abstract syntax for structure • Well-defined abstract syntax for behaviour • Well-defined model execution semantics • Intra-model consistency
  • 142. (f)UML+ALF = Precise modelling 142 ● UML ● Well-defined syntax for structural details ● Profiles specific for different concerns/domains in a CPS ALF Well-defined syntax for algorithmic behaviours Platform-independent -> deployment to different platforms of the same functions fUML Well-defined execution semantics Gives tools for producing predictable software (mission-critical CPS, IoT, safety-critical systems in general) UML + fUML + ALF consistent abstract syntaxes (fUML as common base) inter-model consistency by-construction What’s precise modelling? • Well-defined abstract syntax for structure • Well-defined abstract syntax for behaviour • Well-defined model execution semantics • Intra-model consistency
  • 143. (f)UML+ALF = Precise modelling 143 ● UML ● Well-defined syntax for structural details ● Profiles specific for different concerns/domains in a CPS ● ALF ● Well-defined syntax for algorithmic behaviours ● Platform-independent -> deployment to different platforms of the same functions (heterogeneous systems -> CPS) fUML Well-defined execution semantics Gives tools for producing predictable software (mission-critical CPS, IoT, safety-critical systems in general) UML + fUML + ALF consistent abstract syntaxes (fUML as common base) inter-model consistency by-construction What’s precise modelling? • Well-defined abstract syntax for structure • Well-defined abstract syntax for behaviour • Well-defined model execution semantics • Intra-model consistency
  • 144. (f)UML+ALF = Precise modelling 144 ● UML ● Well-defined syntax for structural details ● Profiles specific for different concerns/domains in a CPS ● ALF ● Well-defined syntax for algorithmic behaviours ● Platform-independent -> deployment to different platforms of the same functions (heterogeneous systems -> CPS) ● fUML ● Well-defined execution semantics ● Gives tools for producing predictable software (mission-critical CPS, IoT, safety-critical systems in general) UML + fUML + ALF consistent abstract syntaxes (fUML as common base) inter-model consistency by-construction What’s precise modelling? • Well-defined abstract syntax for structure • Well-defined abstract syntax for behaviour • Well-defined model execution semantics • Intra-model consistency
  • 145. (f)UML+ALF = Precise modelling 145 ● UML ● Well-defined syntax for structural details ● Profiles specific for different concerns/domains in a CPS ● ALF ● Well-defined syntax for algorithmic behaviours ● Platform-independent -> deployment to different platforms of the same functions (heterogeneous systems -> CPS) ● fUML ● Well-defined execution semantics ● Gives tools for producing predictable software (mission-critical CPS, IoT, safety-critical systems in general) ● UML + fUML + ALF ● consistent abstract syntaxes (fUML as common base) ● intra-model consistency by-construction (need support by modelling tool) What’s precise modelling? • Well-defined abstract syntax for structure • Well-defined abstract syntax for behaviour • Well-defined model execution semantics • Intra-model consistency
  • 146. ALF instead of 3GLs for action code 146 ● ALF standard action language for UML (and profiles) ● Abstraction ● Model consistency and maintainability (full awareness of surrounding model elements) ● Model reusability (several targets from same input model) ● Model analisability (simulation, execution, etc..)
  • 147. ALF instead of 3GLs for action code 147 ● ALF standard action language for UML (and profiles) ● Abstraction ● Model consistency and maintainability (full awareness of surrounding model elements) ● Model reusability (several targets from same input model) ● Model analisability (simulation, execution, etc..) ● Shift to ALF in industrial UML-based MDE leveraging 3GLs for action code is not trivial
  • 148. Joint effort 148 ● A myriad of UML tools in 20 years ● More or less wild customisation, enhancement, creation of dialects ● Innovation reduced to minimum, portability issues, language implementations discrepancy, … ● Modelling tool landscape which in many ways contradicts UML's creed (UNIFICATION) What do we need? UML = unification technology  unified intents and efforts Open-source common baseline Domain-specific customised variations Synergic effort between developers, users and researchers from industry and academia is vital
  • 149. Joint effort 149 ● A myriad of UML tools in 20 years ● More or less wild customisation, enhancement, creation of dialects ● Innovation reduced to minimum, portability issues, language implementations discrepancy, … ● Modelling tool landscape which in many ways contradicts UML's creed (UNIFICATION) ● What do we need? ● UML = unification technology  unified intents and efforts ● Common baseline ● Domain-specific customised variations (even user-defined) ● Synergic effort between developers, users and researchers from industry and academia is vital
  • 150. Thanks for the attention! 150Contact: federico.ciccozzi@mdh.se Acknowledgements Thanks for fruitful discussions and cooperation to: • Bran Selic (Malina Software Corp.) • Ivano Malavolta (Vrije University) • Mikael Sjödin (MDH) • Alfonso Pierantonio (University of L’Aquila) • Antonio Cicchetti (MDH) • Francis Bordeleau (Ericsson) • Diarmuid Corcoran (Ericsson) • Thomas Åkerlund (Knightec) • Alessio Bucaioni (MDH) • Detlef Scholle (Alten Sweden) • Tiberiu Seceleanu (ABB Corporate Research) • SMARTCore (www.es.mdh.se/projects/377-SMARTCore) • Papyrus IC (wiki.polarsys.org/Papyrus_IC)

Editor's Notes

  • #27: Make examples
  • #28: Make examples
  • #32: Acti
  • #33: Acti
  • #34: Acti
  • #35: Acti
  • #51: Provided ALF, a textual action language based on fUML for compact and complete specification of complex behaviors including their algorithmic parts
  • #52: Provided ALF, a textual action language based on fUML for compact and complete specification of complex behaviors including their algorithmic parts
  • #53: Provided ALF, a textual action language based on fUML for compact and complete specification of complex behaviors including their algorithmic parts
  • #140: *
  • #141: *