Glaesser 2003
Glaesser 2003
www.elsevier.com/locate/comnet
b,*
, A. Prinz
a
School of Computing Science, Simon Fraser University, Burnaby, British Columbia, Canada V5A 1S6
Department of Computer Science, University of Kaiserslautern, FB Informatik, Postfach 3049, D-67653 Kaiserslautern, Germany
c
DResearch Digital Media Systems GmbH, D-10319 Berlin, Germany
Abstract
In November 1999, the current version of specification and description language (SDL), commonly referred to as
SDL-2000, passed through ITU-T. In November 2000, the formal semantics of SDL- 2000 was officially approved to
become part of the SDL language definition. It covers both the static and the dynamic semantics, and is based on the
formalism of abstract state machines (ASMs). To support executability, the formal semantics defines, for each SDL
specification, reference ASM code, which enables an SDL-to-ASM-compiler.
In this paper, we briefly survey and compare existing approaches to define the semantics of SDL formally. The ITUT approach is then outlined in more detail, addressing the following steps: (1) mapping of non-basic language constructs to the core language, (2) checking of static semantics conditions, (3) definition of the SDL abstract machine
(SAM), and (4) definition of the SDL virtual machine (SVM). The paper concludes with experiences from the SDL-toASM-compiler project. It is proposed that the SDL-2000 semantics can be adapted and extended to formally define the
meaning of UML 2.0 class, composite structure, and statechart diagrams.
! 2003 Elsevier Science B.V. All rights reserved.
Keywords: SDL; Distributed systems; System design; Formal semantics; Abstract state machines
1. Introduction
Over a period of more than 20 years, Specification and Description Language (SDL) [1] has
matured from a simple graphical notation for describing a set of communicating finite state machines to a sophisticated specification technique
with graphical syntax, (abstract) data types,
structuring mechanisms, object-oriented features,
support for reuse, companion notations, and
*
Corresponding author. Tel.: +49-631-2053426; fax: +49631-2052640.
E-mail address: gotzhein@informatik.uni-kl.de (R. Gotzhein).
1389-1286/03/$ - see front matter ! 2003 Elsevier Science B.V. All rights reserved.
doi:10.1016/S1389-1286(03)00247-0
344
1
Inspection by analytical means requires the formalism itself
to be defined in terms of mathematical logic so that the
underlying semantic basis is well established and understood.
To cope with complexity, the formalism needs to be abstract
allowing one to focus on key properties rather than on technical
details. Finally, being operational, it supports the execution of
abstract models in a direct manner avoiding implementation
overhead.
345
346
There have been a variety of competing attempts to formalize the SDL semantics using various formal methods. According to their principle
objectives, one can distinguish two basically different directions of research activities: (1) machinesupported analysis and verification of SDL system
specifications; (2) documentation, maintenance
and validation of the language definition.
thors claim to have convincing pragmatic justification for their choices; for instance, they argue
that a dramatically simplified version of SDL
and an adequate semantics for it are prerequisites
for advanced analysis and formal verification.
Broy [13], Holz and Stlen [14], and Hinkel [15]
model various subsets of (essentially) Basic SDL
using stream processing functions of FOCUS [16].
While it may be natural to model SDL process
communication as discrete streams of signals, the
functional view neither supports the concept of
system states and state transitions nor allows the
stream formalism for an adequate treatment of
time. Even the most comprehensive model [15]
builds on a fundamentally restricted notion of
global system time which is inadequate for expressing time quantities explicitly.
part then would have the role of providing additional explanations that may be sufficient as reference whenever an ultimate degree of detail and
precision is not needed. Obviously, this would
avoid the notorious correctness problem, achieving correctness by construction.
2.2. Related work
yet readable and understandable. This work provides a conceptual framework which has further
been developed and extended by combining it with
the compilation-based view of [18] as well as fundamental concepts from [17] resulting in the formal semantics of SDL-2000 presented in more
detail in Section 3.
347
Well-formedness conditions: Like most languages, the SDL concrete syntax is given in a
context-free way. Additional constraints are imposed using context conditions.
Transformations: In order to cope with the complexity of the language SDL, the standard Z.100
identifies certain concepts to be core concepts
and defines transformations of various other
concepts into these core concepts.
Concrete Syntax
(textual/graphical)
Parsing
Abstract Syntax (AS0)
Transformations
Mapping
348
Sig2, Sig3
Sig2
=1=>
Sig3
Sig2
Sig3
Signal
Flow
Agents
Runtime
System
Behavior
Primitives
Concurrency
Asynchronicity
349
Time
350
schedule(g)
g
t4
t3
signals in transit
t2
t1
g GATE
ti TIME
j > i implies tj > ti
queue(g)
now
Fig. 5. Signal arrivals at a gate relative to the current system
time now.
si cannot cause a duplication of the signal. Technically, this property is ensured by the underlying
concurrency model (cf. the coherence condition in
the definition of partially ordered runs [7]).
Note that the resulting signal flow model architecture is fairly robust allowing for the incorporation of additional features in future versions
of SDL. For instance, one may have channels with
more complex properties (like unreliable transmission behavior) and a dynamically changing
communication infrastructure (with channels being added and removed at run time). Such extensions can be easily expressed on the basis of the
decentralized signal flow model without any major
revision of the current definitions.
3.2.1.5. Real time. SDL is promoted for the specification and design of distributed real-time systems. However, its support for real-time behavior
is essentially limited to the use of timers and the
underlying notion of global system time. Taking
into account current activities within ITU focusing
on more sophisticated concepts for the specification and analysis of timing behavior [22] (see also
[23]), our modeling framework builds on a notion of dense time, where time values are represented as real numbers. For further details, see [21]
and [5].
3.2.1.6. Timers and exceptions. A particularly
concise way of modeling timers is by identifying
timer objects with timer signals. More precisely,
each active timer is represented by a corresponding
timer signal in the schedule associated with the
input port of the related process instance. Like
timers, exceptions are identified with exception
signals.
3.2.2. SDL virtual machine
The SVM provides typical operating system
functionality on top of the logical hardware of the
SAM. Under the control of the SVM, ASM programs that are associated with link agents, SDL
agents and SDL agent sets, respectively, are run.
The SVM defines suitable abstractions by a set of
macros and functions, which capture the structure
of an SDL system at runtime and thus determine
the dynamic architecture of the SAM, the struc-
351
352
353
State-machine
S12
S13
i2
7.
6.
S11
CSTD3
4.
3.
S111
S112
i3
i4
S111
i1
2.
i1
5.
i1
i5
S11
CSTD1
CSTD2
Legend
i4
refined by
S111
inherits from
CSTD4
state graph
i5
1.
S11
state node
S1111
4. True executability
A central design objective for the SDL formal
semantics definition is executability. This objective
has guided the choice of the underlying mathematical formalism. Finally, the ASM formalism
was selected, due to the existence of tools for the
execution of ASM models. The formal semantics
defines, for each SDL specification, a mapping to
reference ASM code, which can be executed with
these tools. Since size and complexity of the
mapping rule out the manual translation of SDL
specifications to ASM code, a compiler generator
was conceived and implemented. Taking the SDL
formal semantics definition (a Word document) as
input, it automatically generates an SDL-to-ASM
compiler. Thus, modifications to the formal semantics definition can easily be taken into account. Below, we briefly comment on the steps to
generate a compiler (see Fig. 7).
As a first step, all formal text is extracted from
the SDL standard (a Word document). This step
has to be performed for all the formal parts of the
SDL standard, i.e., the syntax descriptions within
the main body of the SDL standard (Z.100) and
the formal texts within the formal semantics annex
Z.100.F. The result of this step are several plain
text files.
From the extracted texts, an SDL lexer and
a parser are constructed using the standard compiler construction tools lex and yacc. Moreover,
to easily handle syntax trees, a tool called kc
354
spec in
SDL
SDL
Language
Description
(Z.100)
Lexis
lex
Concrete Syntax
yacc
SDL Formal
Semantics
(Z.100.F)
parser
AS0 tree
Abstract Syntax
Transformations
Constraints
Compilation
lexer
kc
Rewrite /
Check
AS1 tree
SAM and SVM
in ASM
AsmL
Generate
ASM
spec in
ASM
(kimwitu) is used for all syntax tree related activities: construction of syntax trees, tree parsing, tree
transformation and tree rewriting. This step already allows the construction of an AS0 syntax
tree from a given syntactically correct SDL specification.
In a subsequent step, the AS0 tree is processed
according to the static semantics rules: checking
and transformation (cf. Section 3.1). In the implementation, this is all covered by the kc tool,
which generates a tree checking function from the
well-formedness conditions and tree rewriting
functions from the transformation rules. The result of this step is an AS1 tree, if the specification is
semantically correct.
The last step of the generated SDL compiler
is the ASM format generation according to the
355
356
systems technology, the language has been improved over the past 25 years, evolving from a
primitive graphical notation to a sophisticated
formal description technique. Typically, every 4
years a new version of SDL is released (e.g., SDL88, SDL-92, SDL-96, SDL-2000). Such dynamics
in the definition of a rich language like SDL clearly
demands robustness of the formalization approach
as a prerequisite for practicability. Conciseness
and flexibility therefore were of primary importance for the choice of the modeling framework.
Despite of the richness of SDL, the SVM model
is intelligible and maintainable. This is a direct
result of the innovative modeling concepts, namely:
the abstract operational view, the compiler-based
approach, the organization of the abstract machine model, and the consequent use of parameterized ASM rule macros. To further improve
the maintainability of the SDL semantics definition, we intend to introduce an even more concise
formal model defined on top of the existing one as
a means for illustrating the overall organization of
the language definition. This model is supposed to
be readable and understandable without requiring
any formal background.
Finally, it should be stressed that the definition
of the formal semantics has not just been an academic exercise, but has taken place in a real-life
industrial setting. In our opinion, it is this kind of
result that academic efforts should eventually lead
to. The successful application of mathematical
formalisms to real-world problems and their approval by industry is a strong selling point for
having formalisms at all. In this sense, the work
reported in this paper is an important achievement.
Acknowledgements
We thank Egon B
orger and Yuri Gurevich for
inspiring and valuable discussions on fundamental
aspects of our ASM model of SDL, Joachim Fischer and Franz Rammig for their continuous
support throughout the entire project, Anders
Olsen for providing input on the former SDL semantics, and Rick Reed and Thomas Weigert as
responsible SDL Rapporteurs of ITU-T Study
Group 17 WP 3/17 for providing valuable clarifi-
357
358