Model Engineering using Multimodeling

Similar documents
OVERVIEW OF THE PTOLEMY PROJECT

Parallel, Concurrent, and Distributed Software in Cyber-Physical Systems

Addressing Modeling Challenges in Cyber-Physical Systems

Modeling Kahn Process Networks in the Dynamic Dataflow Formalism

The Ptolemy Project. Modeling and Design of Reactive Systems. Edward A. Lee Professor. UC Berkeley Dept. of EECS. tektronix.fm

Source Code Translation

System Behaviour Analysis with UML and Ptolemy. Scope and goals

Java (12 Weeks) Introduction to Java Programming Language

Designing Real-Time and Embedded Systems with the COMET/UML method

Embedded Software. Edward A. Lee,

fakultät für informatik informatik 12 technische universität dortmund Data flow models Peter Marwedel Informatik 12 TU Dortmund Germany

Modeling Techniques, Programming Languages, and Design Toolsets for Hybrid Systems

Complexities of Simulating a Hybrid Agent-Landscape Model Using Multi-Formalism

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Programming and Software Development CTAG Alignments

CPO Semantics of Timed Interactive Actor Networks

Chap 1. Introduction to Software Architecture

A UML Introduction Tutorial

INSTITUT FÜR INFORMATIK

Compliance and Requirement Traceability for SysML v.1.0a

Designing a Home Alarm using the UML. And implementing it using C++ and VxWorks

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

i. Node Y Represented by a block or part. SysML::Block,

UML-based Test Generation and Execution

Feasibility of a Software Process Modeling Library based on MATLAB / Simulink

Model-Driven Software Development for Robotics: an overview

Fundamentals of Java Programming

Software Synthesis from Dataflow Models for G and LabVIEW

Software Development Methodologies

Chapter 4 Software Lifecycle and Performance Analysis

Layered Approach to Development of OO War Game Models Using DEVS Framework

Introduction to Simulink & Stateflow. Coorous Mohtadi

Communications Software Engineering Design Model

Computer Programming I & II*

EVALUATION. WA1844 WebSphere Process Server 7.0 Programming Using WebSphere Integration COPY. Developer

BUSINESS RULES CONCEPTS... 2 BUSINESS RULE ENGINE ARCHITECTURE By using the RETE Algorithm Benefits of RETE Algorithm...

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

µfup: A Software Development Process for Embedded Systems

Implementing reusable software components for SNOMED CT diagram and expression concept representations

Modeling Web Applications Using Java And XML Related Technologies

Chapter 13: Program Development and Programming Languages

The Designer's Guide to VHDL

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

SCADE Suite in Space Applications

From UML to HDL: a Model Driven Architectural Approach to Hardware-Software Co-Design

Kirsten Sinclair SyntheSys Systems Engineers

Some Issues on Ajax Invocation

Invitation to Ezhil : A Tamil Programming Language for Early Computer-Science Education 07/10/13

Ptolemy Ptutorial. Edward A. Lee UC Berkeley. This tutorial is aimed at the software developer planning to use Ptolemy as a platform.

Chapter 13: Program Development and Programming Languages

#820 Computer Programming 1A

What is a life cycle model?

2. Analysis, Design and Implementation

Applying 4+1 View Architecture with UML 2. White Paper

Module 10. Coding and Testing. Version 2 CSE IIT, Kharagpur

System modeling. Budapest University of Technology and Economics Department of Measurement and Information Systems

7. Classification. Business value. Structuring (repetition) Automation. Classification (after Leymann/Roller) Automation.

Application of UML in Real-Time Embedded Systems

Scicos is a Scilab toolbox included in the Scilab package. The Scicos editor can be opened by the scicos command

School of Computer Science

VHDL Test Bench Tutorial

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

Formal Engineering for Industrial Software Development

Kepler: An Extensible System for Design and Execution of Scientific Workflows

Best Practises for LabVIEW FPGA Design Flow. uk.ni.com ireland.ni.com

From Control Loops to Software

Overview. Stakes. Context. Model-Based Development of Safety-Critical Systems

Integrating Legacy Code / Models with Model Based Development Using Rhapsody

Code Generation for High-Assurance Java Card Applets

Composing Concerns with a Framework Approach

Introduction to LabVIEW Design Patterns

On the Modeling and Verification of Security-Aware and Process-Aware Information Systems

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Object Oriented Programming. Risk Management

2. Analysis, Design and Implementation

Converting Models from Floating Point to Fixed Point for Production Code Generation

Lumousoft Visual Programming Language and its IDE

Computer Programming I

A Static Analyzer for Large Safety-Critical Software. Considered Programs and Semantics. Automatic Program Verification by Abstract Interpretation

How To Draw A Cell Phone Into A Cellphone In Unminimal Diagram (Uml)

The SPES Methodology Modeling- and Analysis Techniques

Chapter 6: Programming Languages

Chapter 19. Activity Diagrams

Software Development in the Fields of Embedded Systems, Safety, and Security

StateFlow Hands On Tutorial

Transcription:

Model Engineering using Multimodeling Christopher Brooks (UC Berkeley) Chih-Hong Cheng (UC Berkeley & TU Munich) Thomas Huining Feng (UC Berkeley) Edward A. Lee (UC Berkeley) Reinhard von Hanxleden (Christian-Albrechts-Univ. Kiel) 1st International Workshop on Model Co-Evolution and Consistency Management (MCCM 2008) September 30, 2008 Toulouse, France

Summary: Model Engineering This project is about model engineering for model-based design of scalable systems of systems. Analogous to software engineering, which enables scaling up software development efforts, model engineering enables scaling up of model-based design. Our approach focuses on technologies rather than design process. Specifically, we are concerned with models of system dynamics (such as actor models) more than with static structure (such as UML class diagrams), with data ontologies (which associate data structures with their meaning) more than data types (which associate data structures with their layout in memory), and with heterogeneous systems (such as hybrid systems and multimodeling) more than homogenized systems. Acknowledgement: This work is heavily influenced by our colloboration with Lockheed Martin, particularly Trip Denton and Edward Jones. Lee, Berkeley 2

Our Premise: Components are Actors rather than Objects The established: Object-oriented: class name data methods What flows through an object is sequential control call return Things happen to objects The alternative: Actor oriented: actor name data (state) parameters ports Actors make things happen What flows through an object is evolving data Input data Output data Lee, Berkeley 3

Ptolemy II: Our Open-Source Laboratory for Experiments with Actor-Oriented Design http://ptolemy.org Concurrency management supporting dynamic model structure. Director from a library defines component interaction semantics Large, behaviorallypolymorphic component library. Type system for transported data Visual editor supporting an abstract syntax Lee, Berkeley 4

Approach: Concurrent Composition of Software Components, which are themselves designed with Conventional Languages (Java, C, C++ MATLAB, Python) Lee, Berkeley 5

Multimodeling Simultaneous use of multiple modeling techniques. hierarchical multimodeling: hierarchical compositions of distinct modeling styles, combined to take advantage of the unique capabilities and expressiveness of each style. multi-view modeling: distinct and separate models of the same system are constructed to model different aspects of the system. Lee, Berkeley 6

Hierarchical Multimodeling Hierarchical compositions of models of computation. Maintaining temporal semantics across MoCs is a key challenge. The example here was developed in a collaborative project with Lockheed- Martin. Lee, Berkeley 7

Background on Hierarchical Multimodeling Statecharts [Harel 87] Ptolemy Classic [Buck, Ha, Lee, Messerschmitt 94] SyncCharts [André 96] *Charts [Girault, Lee, Lee 99] Colif [Cesario, Nicolescu, Guathier, Lyonnard, Jerraya 01] Metropolis [Goessler, Sangiovanni-Vincentelli 02] Ptolemy II [Eker, et. al. 03] Safe State Machine (SSM) [André 03] SCADE [Berry 03] ForSyDe [Jantsch, Sander 05] ModHelX [Jantsch, Sander 07] Lee, Berkeley 8

Simple Traffic Light Example in Statecharts Case study Pred: pedestrian red signal Pgrn(0): turn pedestrian green off Cgrn: car green Sec: one second time 2 Sec: two seconds time Pgo/Pstop: pedestrian go/stop Lee, Berkeley 9

Traffic Light Example in Ptolemy II Whereas Statecharts lumps together the state machine semantics and the concurrency model, Ptolemy II separates these. Here we have chosen the SR Director, which realizes a true synchronous fixed point semantics. Lee, Berkeley 10

Concurrent State Machines in Ptolemy II In Ptolemy II, we have implemented an SR Director (for synchronous concurrent models) and an FSM Director (for sequential decision logic). Rather than combining them into one language (like Statecharts), Ptolemy II supports hierarchical combinations of MoCs. Lee, Berkeley 11

Stepping Outside Statecharts: Modeling the Environment The above model places the TrafficLight model in a discrete-event testbench that clocks the light an injects faults according to a stochastic model. Lee, Berkeley 12

What Makes This Possible: The Ptolemy II Actor Abstract Semantics Abstract Syntax Concrete Syntax Type System Abstract Semantics Concrete Semantics Lee, Berkeley 13

Abstract Semantics (Informally) of Actor-Oriented Models of Computation Actor-Oriented Models of Computation that follow this: execution control init() fire() data transport dataflow (several variants) process networks distributed process networks Click (push/pull) continuous-time CSP (rendezvous) discrete events distributed discrete events synchronous/reactive time-driven (several variants) Lee, Berkeley 14

How Does This Work? Execution of Ptolemy II Actors Flow of control: Preinitialization Initialization Execution Finalization Lee, Berkeley 15

How Does This Work? Execution of Ptolemy II Actors Flow of control: Preinitialization Initialization Execution Finalization E.g., Partial evaluation (esp. higher-order components), set up type constraints, etc. Anything that needs to be done prior to static analysis (type inference, scheduling, ) Lee, Berkeley 16

How Does This Work? Execution of Ptolemy II Actors Flow of control: Preinitialization Initialization Execution Finalization E.g., Initialize actors, produce initial outputs, etc. E.g., set the initial state of a state machine. Initialization may be repeated during the run (e.g. if the reset parameter of a transition is set and the destination state has a refinement). Lee, Berkeley 17

How Does This Work? Execution of Ptolemy II Actors Flow of control: Preinitialization Initialization Execution Finalization Iterate If (prefire()) { } fire(); postfire(); In fire(), an FSM first fires the refinement of the current state (if any), then evaluates guards, then produces outputs specified on an enabled transition. In postfire(), it postfires the current refinement (if any), executes set actions on an enabled transition, and takes Lee, the Berkeley transition. 18

How Does This Work? Execution of Ptolemy II Actors Flow of control: Preinitialization Initialization Execution Finalization Lee, Berkeley 19

A Consequence of Our Abstract Semantics: Behavioral Polymorphism Data polymorphism: Add numbers (int, float, double, Complex) Add strings (concatenation) Add composite types (arrays, records, matrices) Add user-defined types Behavioral polymorphism: In dataflow, add when all connected inputs have data In a synchronous/reactive model, add when the clock ticks In discrete-event, add when any connected input has data, and add in zero time In process networks, execute an infinite loop in a thread that blocks when reading empty inputs In rendezvous, execute an infinite loop that performs rendezvous on input or output In push/pull, ports are push or pull (declared or inferred) and behave accordingly By not choosing among these when defining the component, we get a huge increment in component reusability. Abstract semantics ensures that the component will work in all these circumstances. Lee, Berkeley 20

More Interestingly, Hierarchical Models are Also Behaviorally Polymorphic The same FSM infrastructure works in DE and SR! (and also continuous time, dataflow, etc.) Lee, Berkeley 21

Separable Tool Archictecture Abstract Syntax Concrete Syntax Type System Abstract Semantics Concrete Semantics Lee, Berkeley 22

Concrete Models of Computation Implemented in Ptolemy II CI Push/pull component interaction Click Push/pull with method invocation CSP concurrent threads with rendezvous Continuous continuous-time modeling with fixed-point semantics CT continuous-time modeling DDF Dynamic dataflow FSMs can be embedded in all DE discrete-event systems of these (including FSMs). DDE distributed discrete events Many of these (but not all) can DPN distributed process networks be embedded within state FSM finite state machines refinements of FSMs and/or DT discrete time (cycle driven) within composite actors. See Giotto synchronous periodic [Goderis, Brooks, Altintas, Lee, GR 3-D graphics Goble, 2007] PN process networks Rendezvous extension of CSP SDF synchronous dataflow SR synchronous/reactive TM timed multitasking Lee, Berkeley 23

Multimodeling Simultaneous use of multiple modeling techniques. hierarchical multimodeling: hierarchical compositions of distinct modeling styles, combined to take advantage of the unique capabilities and expressiveness of each style. multi-view modeling: distinct and separate models of the same system are constructed to model different aspects of the system. Lee, Berkeley 24

Multi-View Modeling: Distinct and separate models of the same system are constructed to model different aspects of the system. Functional model in Statecharts Deployment model in Ptolemy II Verification model in SMV Functional model in Ptolemy II The example here was developed in a collaborative project with Lockheed-Martin. Reliability model in Excel Lee, Berkeley 25

Background on Multi-View Modeling Ptolemy Classic [Buck, Ha, Lee, Messerschmitt 94] UML [Various, 90s] Model-integrated computing [Sztipanovits, Karsai, Franke 96] SyncCharts [André 96] *Charts [Girault, Lee, Lee 99] Colif [Cesario, Nicolescu, Guathier, Lyonnard, Jerraya 01] Metropolis [Goessler, Sangiovanni-Vincentelli 02] KIEL [Prochnow, von Hanxleden 07] Lee, Berkeley 26

Model synthesis is one way to maintain model consistency Verification model in SMV Lee, Berkeley 27

But Model Synthesis is not always possible. Constructing a Deployment Model This is the top level of a deployment model, which maps the car light and pedestrian light logic into two distinct compute platforms that communicate via a wireless link. The same models are used for the functional logic, leveraging actor-oriented classes in Ptolemy II. Lee, Berkeley 28

Inside The Car Light Model The above model shows the construction of a radio packet for transmission on the wireless link. Inside, it eventually uses the same behavioral model of the traffic light, so changing the behavior in one model is automatically reflected in the other. Lee, Berkeley 29

Actor-Oriented Classes [Lee, Liu, Neuendorffer 07] A class definition (right) has instances in multiple models. Changes to the class definition automatically propagate to the instances. In the functional model above, an instance communicates directly with the pedestrian light. The deployment model (right) constructs a radio packet and models wireless communication. Lee, Berkeley 30

Multimodeling Simultaneous use of multiple modeling techniques. hierarchical multimodeling: hierarchical compositions of distinct modeling styles, combined to take advantage of the unique capabilities and expressiveness of each style. multi-view modeling: distinct and separate models of the same system are constructed to model different aspects of the system. multi-specialization: a single model is used to synthesize multiple distinct specialized models. Lee, Berkeley 31

To support multi-specialization, we have built an extensible type system for model ontologies that performs property inference. In the system at the right, green indicates that a port is inferred or declared to be constant Thanks to Thomas Mandl, Research & Technology Center, Bosch, Palo Alto. Lee, Berkeley 32

Demo: Model Properties as a Type Inference Problem In the system at the right, one of the constant sources has been replaced with a non-constant source. This affects the inferred properties downstream. Thanks to Thomas Mandl, Research & Technology Center, Bosch, Palo Alto. Lee, Berkeley 33

Conclusion Multimodeling takes distinct forms. An abstract semantics can support this rigorously This is not the same as just being noncommittal about the semantics! Tool support still needs a lot of work Lee, Berkeley 34

Syntax Comparisons The Ptolemy II model and the Statecharts model differ in syntax. Some issues to consider when evaluating a syntax: Rendering on a page Showing dependencies in concurrent models Scalability to complex models Reusability (e.g. with other concurrency models) Special notations (e.g. 3 Sec ). Lee, Berkeley 35

Simple Traffic Light Example in Statecharts, from Reinhard von Hanxleden, Kiel University Case study for Ptolemy II Design In StateCharts, the communication between concurrent components is not represented graphically, but is rather represented by name matching. Can you tell whether there is feedback? Lee, Berkeley 36

Syntax comparisons Now can you tell whether there is feedback? Lee, Berkeley 37

Semantics Comparisons The Ptolemy II model and the Statecharts model have similar semantics, but combined in different ways. Some issues to consider: Separation of concurrency from state machines Nesting of distinct models of computation Expanding beyond synchronous + FSM to model the (stochastic) environment and deployment to hardware. Styles of synchronous semantics (Ptolemy II realizes a true fixed-point constructive semantics). Lee, Berkeley 38