Title: Hierarchical Design and Analysis of Reactive Systems
1Hierarchical Design and Analysis of Reactive
Systems
Radu Grosu Stony Brook University
www.cs.sunysb.edu/radu
2Reactive Systems
Computer based reactive systems are becoming an
integral part of nearly every engineered product.
They control
3Super Computers with Wings
"Companies that exploit information technology
most effectively will be the most likely to
dominate the aerospace landscape in the 21st
century" Aviation Week, 12/98.
4Talk Outline
- Introduction
- Modeling reactive systems
- Mode diagrams
- From statecharts to mode diagrams
- Modular reasoning
- Model checking
- Wrap-up
5Why Building Models?
- To understand the problem better,
- To communicate with customers,
- To find errors or omissions,
- To plan out the design,
- To generate code.
Modeling is a technique widely used in all
engineering disciplines. In particular, for
reactive systems it allows
6Modeling Reactive Systems
- Software Engineering Methods (e.g. UML, UML-RT)
- mixed visual/textual notations,
- speedup the development cycle,
- improve customer /developer communication
- restricted analysis by simulation and testing,
- restricted confidence in the modeled system.
- Formal Methods (e.g. Model Checkers)
- mathematical models of reactive systems,
- speedup specification/prototyping,
- allow a thorough analysis of the modeled system,
- high confidence in the modeled system.
- Currently there are two main methods
- for modeling reactive systems
- Software engineering methods,
- Formal methods.
7Software Engineering Methods
- Successfully applied in
- Automotive, aerospace and telecommunications
- Logic design
- Tools
- SDL, ROOM, Statemate, Rhapsody, UML-RT
- Cierto VC CoDesign, StateCAD/StateBench
- Companies
- Telelogic, Verilog, ObjecTime, iLogix, Rational
- Cadence, Visual Software Solutions
8Model Checkers
Model Checker
No longer an academic research only. "... model
checking will be the second most important, if
not the most important, tool in the verification
tool suite. Cadence Web
- Advantage
- Fully automated formal verification,
- Effective debugging tool
- Standard approaches
- Enumerative search with reduction heuristics
- Symbolic search using BDDs
9Model Checkers
- Successfully applied in
- Hardware design and analysis
- Finding bugs in cache coherence protocols, video
graphics image chips (gt96 processors) - Tools
- Spin, Murf, Mocha, LMC, XMC,
- FormalCheck, Cospan, VERDICT, SMV, VIS,
- Companies
- Cadence, Lucent, Intel, IBM, Motorola, Siemens
10Unfortunately ?
- There is a considerable gap between the software
engineering and the formal methods. - Scalability is still a challenge for formal
analysis tools.
11Fortunately ? Long Term Research Program
- Close the gap between the software engineering
and the formal methods, - Scale up the analysis tools by exploiting the
software engineering artifacts.
12Talk Outline
- Introduction
- Modeling reactive systems
- Mode diagrams
- From statecharts to mode diagrams
- Modular reasoning
- Model checking
- Wrap-up
13Mode Diagrams
- Visual language for hierarchic reactive machines
- hierarchic modes, mode sharing,
- group transitions, history,
- mixed and/or hierarchies.
- 2. Observational trace semantics
- mode refinement,
- modular reasoning.
- 3. Model checker
- exploits the hierarchy information,
- exploits the type information.
14Telephone Exchange Architecture
- Characteristics
- Description is hierarchic.
- Well defined interfaces.
- Supports black-box view.
- Model checking
- Modular reasoning.
- E.g. in SMV, Mocha,
15Telephone Exchange Behavior
16Talk Outline
- Introduction
- Modeling reactive systems
- Mode diagrams
- From statecharts to mode diagrams
- Modular reasoning
- Model checking
- Wrap-up
17Statecharts
- Formalism
- Introduced 1987 by David Harel,
- Related notations Rsml, Modecharts, Roomcharts,
- Key component in OO Methods UML, ROOM, OMT, etc.
- Software
- ILogix, ObjecTime, Rational, etc.
- Application Area
- Automotive industry, avionics,
telecommunications, etc.
- Semantics
- Many attempts (more than 24 semantics),
- All operational no trace semantics, no
refinement rules.
18From Statecharts to Modes
Obstacles in achieving modularity
- Regular transitions connect deep nested modes.
- Group transitions implicitly connect deep nested
modes.
- State reference -gt Scoping of variables (data
interface)
- Nested state references break encapsulation.
19Talk Outline
- Introduction
- Modeling reactive systems
- Mode diagrams
- From statecharts to mode diagrams
- Modular reasoning
- Model checking
- Wrap-up
20Operational Semantics
- Macro transitions (mT)
- Form (e,s) -gt (x,t)
- Obtained (e0,s0)-gt (c1,s1)-gt -gt (en,sn)
- Operational semantics
- Control points, variables, macro transitions.
21Denotational Semantics
- Execution of m
- (e0,s0)-gt (x0,t0)-gt (e1,s1)-gt (x1,t1)-gt -gt
(xn,tn) - For even i, (ei,si)-gt (xi,ti) is in mT
- For odd i, siVp si1Vp
- Set of Traces Lm of m
- Projection of executions on global variables.
- Denotational semantics
- Control points, global vars, Lm.
- Refinement m lt n
- Inclusion of the sets of traces Lm ? Ln
22Modular Reasoning
23Talk Outline
- Introduction
- Modeling reactive systems
- Mode diagrams
- From statecharts to mode diagrams
- Modular reasoning
- Model checking
- Wrap-up
24Symbolic Search
A
R0
Ok1 Rk1 Rk Rk1 Rk (Ok T)
25Model Checking
- Graphical editor and both an enumerative and a
symbolic model checker. - Reachability analysis exploits the structure
- Reached state space indexed by control points
- Transition relation is indexed by control points
- Transition type exploited
- Mode definitions are shared among instances.
26Example Generic Hierarchic System
27The Reached Set
- The reached set is indexed by control points
- Each reached control point has an associated
- multi valued binary decision diagram (mdd),
- The set of variables of an mdd depends on
- the scope of the control point.
28The Transition Relation
- The transition relation is indexed by control
- points (gt conjunctively partitioned mdds)
- Each transition has an associated mdd,
- The set of variables of an mdd depends on
- the scope of the transition,
- Type information no identity extension
necessary, - Variable scoping enables early quantification.
29Results
- As expected, the model checker for modes is
superior to current model checkers when - sequential behavior is hierarchical,
- modes have local variables.
30GHS Space Requirements
31GHS Time Requirements
32Wrap-Up
- Hierarchic Reactive Machines
- Compositional semantics CSD98, POPL00
- Model checking CAV00
- Hybrid Systems
- Compositional semantics FTRTFT98, WRTP98,
- Hybrid mode diagrams in CHARON HSCC00
- Message Sequence Charts
- Semantics CSI98, OOPSLA97
- Automatic translation to SM DIPES00,
GP19837871, - Hybrid sequence charts WORDS99, ISORC00
Bridging the gap between software engineering and
formal methods provides a wealth of research
opportunities
33Wrap-Up
- Automating Modular Reasoning
- Refinement check of asynchronous systems
FMCAD00 - Modeling Mobile Systems
- Dynamic reconfiguration Amast96, NWPT96,
- Mobility HICSS98
- Formal Foundation of OO Methods
- UML TAA98, ECOOP97
- UML-RT JUCS00, JOOP00, OOPSLA98, BSBS99
34(No Transcript)
35Mocha Tool
- Mode diagrams will be integrated in Mocha.
- Mocha itself is currently recoded in Java
- for a better support for
- software engineering aspects,
- modular reasoning.
36Semantics of Modes
- Game Semantics
- Environment round from exit points to entry
points. - Mode round from entry points to exit
points.
- The set of traces of a mode
- Constructed solely from the traces of the
sub-modes and the modes transitions.
- Refinement
- Defined as usual by inclusion of trace sets.
- Is compositional w.r.t. mode encapsulation.
37Wrap-up
- Consider alternative state space representation
for mode diagrams (e.g. indexing the mdds by
modes), - Allow optional compilation of modes to their
macro transition relation, - Automate modular reasoning for mode diagrams,
- Fully integrate mode diagrams with Mocha,
- Consider abstraction mechanisms for modes,
- Consider applications of and/or mode
hierarchies, - Extension to hybrid mode diagrams,
- Integration with sequence diagrams,
38Modeling in UML
- Class Diagrams
- Object Diagrams
Modeling in UML consists of building several
models according to five views
- Sequence Diagrams
- Collaboration Diagrams
- Statechart Diagrams
- Activity Diagrams
39Modeling in UML
- Class Diagrams
- Object Diagrams
- Sequence Diagrams
- Collaboration Diagrams
- Statechart Diagrams
- Activity Diagrams
40Motivation
- Scalable analysis demands modular reasoning
- modeling language has to support syntactically
and semantically modular constructs, - model checking has to exploit modular design.
- Close the gap between
- software design languages (UML, Statecharts,
Rsml), - model checking languages (Spin, SMV, Mocha).
41Talk Outline
- Introduction
- Modeling reactive systems
- Mode diagrams
- From statecharts to mode diagrams
- Modular reasoning
- Conjunctive modes
- Implementation
- Wrap-up
42Modular Reasoning
- Terminology
- Compositional and assume/guarantee reasoning
based on observable behaviors.
- Application area
- Only recently is being automated by model
checkers, - Until now restricted to architecture hierarchies.
- Compositional Reasoning
- Central to many formalisms CCS, I/O
Automata,TLA, etc.
- Circular Assume/Guarantee Reasoning
- Valid only when the interaction of a module with
its environment is non-blocking.
43Compositional Reasoning
44Assume/Guarantee Reasoning
45Talk Outline
- Introduction
- Modeling reactive systems
- Mode diagrams
- From statecharts to mode diagrams
- Modular reasoning
- Conjunctive modes
- Implementation
- Wrap-up
46Conjunctive Modes
Synchronous semantics State s (i1, i2, o1,
o2, p1, p2) Execution
s0
47And/Or Hierarchies
The ability to express conjunctive modes
is important for the construction of
arbitrary and/or hierarchies. Consider a
hypothetical search and rescue robot operating
on a battle field
48Mocha Tool Architecture
Integrated Development Environment Manager
49Wrap-up
Bridging the gap between software engineering and
formal methods provides a wealth of research
opportunities
- Allow to express architectural design patterns
- add process arrays,
- exploit symmetry,
- add abstraction mechanisms,
- automate modular reasoning,
- add dynamic architectures,
- architecture algebra.
50Wrap-up
- Popular in requirements capture and testing
- sequence diagrams for shared memory,
- sequence diagrams for hybrid systems,
- automatic translation to mode diagrams,
- analysis of sequence diagrams,
- consistency of sequence/mode diagrams,
- interaction algebra.
- Sequence Diagrams
- Collaboration Diagrams
51Wrap-up
- Essential component in all methods
- explore alternative representations,
- optional compilation of modes,
- explore better sharing schemes,
- automate modular reasoning,
- add abstraction mechanisms,
- consider implications of and/or hierarchies,
- integrate with architecture diagrams,
- behavior algebra.
52Wrap-up
- Consider differential equations for activities
- Hybrid hierarchic modes,
- Avionics, robotics, automotive industry.
- Global and modular symulation,
- Exploit hierarchy in analysis,
- Relate to hybrid sequence diagrams.
53Wrap-up
- Modeling and analysis of
- Distributed reactive systems,
- Mobile reactive systems.
54A Macro Step
Ek1
gcs
inc
skp
z
id
Xk
55A Macro Step
Ek1
z
gcs
skp
inc
skp
w0
w1
z
id
inc
Xk
56A Macro Step
Ek1
z
gcs
skp
inc
skp
w0
w1
z
id
inc
Xk
w1
inc
v2
v3
skp
57A Macro Step
Ek1
z
gcs
skp
inc
skp
w0
w1
z
id
inc
Xk
v3
w1
inc
skp
skp
v2
v3
skp
inc
inc
58A Macro Step
Ek1
z
gcs
skp
inc
skp
w0
w1
z
id
inc
Xk
v3
w1
inc
skp
skp
v2
v3
skp
inc
inc
59A Macro Step
Ek1
z
gcs
skp
inc
skp
w0
w1
z
id
inc
Xk
v3
w1
inc
skp
skp
v2
v3
skp
inc
inc
60A Macro Step
Ek1
z
gcs
skp
inc
skp
w0
w1
z
id
inc
Xk
v3
w1
inc
skp
skp
v2
v3
skp
inc
inc
61A Macro Step
Ek1
z
gcs
skp
inc
skp
w0
w1
z
id
inc
Xk
v3
w1
inc
skp
skp
v2
v3
skp
inc
inc
62A Macro Step
Ek1
z
gcs
skp
inc
skp
w0
w1
z
id
inc
Xk Xk1
v3
w1
inc
skp
skp
v2
v3
skp
inc
inc
63A Macro Step
Ek1
z
gcs
skp
inc
skp
w0
w1
z
id
inc
Xk Xk1 Xk1
v3
w1
inc
skp
skp
v2
v3
skp
inc
inc