Department of Electrical Engineering and Computer Sciences University of California at Berkeley Behavioral Types for Actor-Oriented Design Edward A. Lee.

Slides:



Advertisements
Similar presentations
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
Advertisements

Discrete-Event Modeling and Design of Embedded Software Edward Lee UC Berkeley Workshop on Discrete Event Systems WODES 2000 Ghent, Belgium August,
UC Berkeley Mobies Technology Project PI: Edward Lee CoPI: Tom Henzinger Process-Based Software Components for Networked Embedded Systems.
ACM SIGPLAN 2001 Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES'2001) Jun 22-23, 2001, Snowbird, Utah, USA Embedded Software from.
Mobies Phase 1 UC Berkeley 1 Process-Based Software Components Mobies Phase 1, UC Berkeley Edward A. Lee and Tom Henzinger PI Meeting, New York July 24,
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
Process-Based Software Components for Networked Embedded Systems Edward A. Lee, PI UC Berkeley Core Technical Team (Mobies, SEC, and GSRC): Christopher.
Component Technologies for Embedded Systems Johan Eker.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Causality Interfaces for Actor Networks Ye Zhou and Edward A. Lee University of California,
SRC ETAB Summer Study Colorado Springs, June 25-26, 2001 Model-Based Approaches to Embedded Software Design Edward A. Lee UC Berkeley & GSRC.
Chess Review May 8, 2003 Berkeley, CA Classes and Inheritance in Actor- Oriented Models Stephen Neuendorffer Edward Lee UC Berkeley.
Berkeley, CA, March 12, 2002 Modal Models in Vehicle-Vehicle Coordination Control Xiaojun Liu The Ptolemy Group EECS Department, UC Berkeley.
Advanced Tool Architectures Supporting Interface-Based Design
Integrated Design and Analysis Tools for Software-Based Control Systems Shankar Sastry (PI) Tom Henzinger Edward Lee University of California, Berkeley.
NSF Foundations of Hybrid and Embedded Software Systems UC Berkeley: Chess Vanderbilt University: ISIS University of Memphis: MSI A New System Science.
Mobies Phase 1 UC Berkeley 1 Agenda 8:00-8:30 Continental breakfast 8:30-9:00 Overview of Mobies Phase 1 effort (Edward A. Lee) 9:00-9:40 Introduction.
Type System, March 12, Data Types and Behavioral Types Yuhong Xiong Edward A. Lee Department of Electrical Engineering and Computer Sciences University.
Behavioral Types as Interface Definitions for Concurrent Components Center for Hybrid and Embedded Software Systems Edward A. Lee Professor UC Berkeley.
Building Unreliable Systems out of Reliable Components: The Real Time Story Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS CHESS: Center.
February 11, 2010 Center for Hybrid and Embedded Software Systems Ptolemy II - Heterogeneous Concurrent Modeling and Design.
Component-Based Design of Embedded Control Systems Luca Dealfaro Chamberlain Fong Tom Henzinger Christopher Hylands John Koo Edward A. Lee Jie Liu Xiaojun.
Chess Review October 4, 2006 Alexandria, VA Edited and presented by Advanced Tool Architectures Edward A. Lee UC Berkeley.
Chess Review November 21, 2005 Berkeley, CA Edited and presented by Advanced Tool Architectures Edward A. Lee UC Berkeley.
Heterogeneous Modeling and Design in Ptolemy II Johan Eker UC Berkeley with material courtesy of Edward Lee and the Ptolemy group ECE Seminar Series, Carnegie.
6th Biennial Ptolemy Miniconference Berkeley, CA May 12, 2005 Ptolemy Project Status and Overview Edward A. Lee Ptolemy Project Director, UC Berkeley.
Modeling Heterogeneous Systems Edward Lee UC Berkeley Design for Safety Workshop NASA Ames Research Center Mountain View, CA 11 October, Design.
Are “Embedded Systems" Just Systems Made with Small Computers? Chess: Center for Hybrid and Embedded Software Systems Invited Talk Artist International.
Mobies Phase 1 UC Berkeley 1 Process-Based Software Components Mobies Phase 1, UC Berkeley Edward A. Lee and Tom Henzinger PI Meeting, Boca Raton January.
System-Level Design Languages: Orthogonalizing the Issues Edward A. Lee UC Berkeley The GSRC Semantics Project Tom Henzinger Luciano Lavagno Edward Lee.
February 12, 2009 Center for Hybrid and Embedded Software Systems Encapsulated Model Transformation Rule A transformation.
Review of “Embedded Software” by E.A. Lee Katherine Barrow Vladimir Jakobac.
Actor-Oriented Design: A focus on domain-specific languages for embedded systems Edward A. Lee Professor, UC Berkeley Director, Center for Hybrid and Embedded.
Building Unreliable Systems out of Reliable Components: The Real Time Story Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS CHESS: Center.
An Extensible Type System for Component-Based Design
Defining Domains Edward A. Lee Professor, UC Berkeley Ptolemy Ptutorial, Feb. 12, 2007.
Mixing Models of Computation Jie Liu Palo Alto Research Center (PARC) 3333 Coyote Hill Rd., Palo Alto, CA joint work with Prof. Edward.
The Gigascale Silicon Research Center Edward A. Lee UC Berkeley The GSRC Semantics Project Tom Henzinger Luciano Lavagno Edward Lee Alberto Sangiovanni-Vincentelli.
Models of Computation for Embedded System Design Alvise Bonivento.
Chess Review November 21, 2005 Berkeley, CA Edited and presented by Causality Interfaces and Compositional Causality Analysis Rachel Zhou UC Berkeley.
MoBIES PI-Meeting, July 2001, Jackson Hole Controller Design Using Multiple Models of Computation Edward Lee Johan Eker with thanks to Paul Griffiths,
NSF Foundations of Hybrid and Embedded Software Systems UC Berkeley: Chess Vanderbilt University: ISIS University of Memphis: MSI A New System Science.
Ptolemy Miniconference May 9, 2003 Berkeley, CA Ptolemy Project Plans for the Future Edward A. Lee Professor Ptolemy Project Director.
SEC PI Meeting Annapolis, May 8-9, 2001 Component-Based Design of Embedded Control Systems Edward A. Lee & Jie Liu UC Berkeley with thanks to the entire.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley System-Level Types for Component-Based Design Edward A.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley Concurrent Component Patterns, Models of Computation, and.
February 12, 2009 Center for Hybrid and Embedded Software Systems Model Transformation Using ERG Controller Thomas H. Feng.
MoBIES Working group meeting, September 2001, Dearborn Ptolemy II The automotive challenge problems version 4.1 Johan Eker Edward Lee with thanks.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 PTIDES: A Programming Model for Time- Synchronized Distributed Real-time Systems Yang.
Concurrent Models of Computation in System Level Design Edward Lee UC Berkeley Forum on Design Languages Workshop on System Specification & Design Languages.
State of the Art Lecture IEEE Instrumentation and Measurement Technology Conference Budapest, Hungary, May 21-23, 2001 Computing for Embedded Systems Edward.
5 th Biennial Ptolemy Miniconference Berkeley, CA, May 9, 2003 The Component Interaction Domain: Modeling Event-Driven and Demand- Driven Applications.
Embedded Software Challenges for the Next 10 Years Chess: Center for Hybrid and Embedded Software Systems Infineon Embedded Software Days Munich, Sept.
Panel: What Comes After C++ in System-Level Specification Edward Lee UC Berkeley Forum on Design Languages Workshop on System Specification & Design Languages.
Lee & Henzinger ESWG #1 UC Berkeley Mobies Technology Project Process-Based Software Components for Networked Embedded Systems PI: Edward Lee CoPI: Tom.
MOBIES Project Progress Report Engine Throttle Controller Design Using Multiple Models of Computation Edward Lee Haiyang Zheng with thanks to Ptolemy Group.
Model-Driven Development From Object-Oriented Design to Actor-Oriented Design Chess: Center for Hybrid and Embedded Software Systems Edward A. Lee Professor.
System-Level Types for Component-Based Design Paper by: Edward A. Lee and Yuhong Xiong Presentation by: Dan Patterson.
Models of Computation as Program Transformations Chris Chang
Department of Electrical Engineering and Computer Sciences University of California at Berkeley The Ptolemy II Framework for Visual Languages Xiaojun Liu.
Composing Models of Computation in Kepler/Ptolemy II
Design Languages in 2010 Chess: Center for Hybrid and Embedded Software Systems Edward A. Lee Professor UC Berkeley Panel Position Statement Forum on Design.
Actor Networks Edward A. Lee Robert S. Pepper Distinguished Professor Chair of EECS UC Berkeley Invited Talk Workshop Foundations and Applications of Component-based.
Ptolemy & Models of Computation -by Hao Chen, Zhuang Fan, Jin Xiao School of Computer Science University of Waterloo Claudius Ptolemaeus, the second century.
Actor Oriented Programming with CAL -designing embedded system components Johan Eker Department of Automatic Control, Lund University Chris Chang, Jörn.
What’s Ahead for Embedded Software? (Wed) Gilsoo Kim
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Retargetable Model-Based Code Generation in Ptolemy II
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Presentation transcript:

Department of Electrical Engineering and Computer Sciences University of California at Berkeley Behavioral Types for Actor-Oriented Design Edward A. Lee with special thanks to: Luca de Alfaro, Tom Henzinger, and Yuhong Xiong Invited talk, FMCAD, Fourth International Conference on Formal Methods in Computer-Aided Design, November 6-8, 2002, Portland, Oregon

E. A. Lee, UC Berkeley 2 Actor-Oriented Design Object orientation: class name data methods call return What flows through an object is sequential control Actor orientation: actor name data (state) ports Input data parameters Output data What flows through an object is data streams

E. A. Lee, UC Berkeley 3 Examples of Actor-Oriented Component Frameworks Simulink (The MathWorks) Labview (National Instruments) OCP, open control platform (Boeing) SPW, signal processing worksystem (Cadence) System studio (Synopsys) ROOM, real-time object-oriented modeling (Rational) Port-based objects (U of Maryland) I/O automata (MIT) VHDL, Verilog, SystemC (Various) Polis & Metropolis (UC Berkeley) Ptolemy & Ptolemy II (UC Berkeley) …

E. A. Lee, UC Berkeley 4 Actor View of Producer/Consumer Components Models of Computation: continuous-time dataflow rendezvous discrete events synchronous time-driven publish/subscribe … Key idea: The model of computation defines the component interaction patterns and is part of the framework, not part of the components themselves.

E. A. Lee, UC Berkeley 5 Contrast with Object Orientation Call/return imperative semantics Concurrency is realized by ad-hoc calling conventions Concurrent patterns are supported by futures, proxies, monitors, and semaphores Object orientation emphasizes inheritance and procedural interfaces. Actor orientation emphasizes concurrency and communication abstractions.

E. A. Lee, UC Berkeley 6 Actor Orientation with a Visual Syntax Actor-oriented model of two real-time control systems sharing a single CPU under a priority-driven RTOS scheduler. Model by Jie Liu

E. A. Lee, UC Berkeley 7 Our Evolving Software Laboratory Ptolemy II: A framework supporting experimentation with actor- oriented design, concurrent semantics, and visual syntaxes. continuous environment modal model discrete controller example Ptolemy model: hybrid control system Model by Johan Eker

E. A. Lee, UC Berkeley 8 Realization of a Model of Computation is a “Domain” in Ptolemy II The “laws of physics” of component interaction communication semantics flow of control constraints In astrophysics: a “domain” is a region of the universe where a certain set of “laws of physics” applies. Multiple domains may be combined hierarchically depends on the concept of “domain polymorphism”

E. A. Lee, UC Berkeley 9 Ptolemy II Domains Define the flow(s) of control “execution model” Realized by a Director class Define communication between components “interaction model” Realized by a Receiver class

E. A. Lee, UC Berkeley 10 Example Domains Communicating Sequential Processes (CSP): rendezvous-style communication Process Networks (PN): asynchronous communication, determinism Synchronous Data Flow (SDF): stream-based communication, statically scheduled Discrete Event (DE): event-based communication Synchronous/Reactive (SR): synchronous, fixed point semantics Time Driven (Giotto): synchronous, time-driven multitasking Timed Multitasking (TM): priority-driven multitasking, deterministic communication Continuous Time (CT): numerical differential equation solver

E. A. Lee, UC Berkeley 11 Receiver Object Model

E. A. Lee, UC Berkeley 12 Receiver Interface These polymorphic methods implement the communication semantics of a domain in Ptolemy II. The receiver instance used in communication is supplied by the director, not by the component.

E. A. Lee, UC Berkeley 13 Behavioral Types – Codification of Domain Semantics Capture the dynamic interaction of components in types Obtain benefits analogous to data typing. Call the result behavioral types. Communication has data types behavioral types Components have data type signatures behavioral type signatures Components are data polymorphic domain polymorphic

E. A. Lee, UC Berkeley 14 A Behavioral Type System With Contravariant Inputs and Outputs Based on Interface automata Proposed by de Alfaro and Henzinger Concise composition (vs. standard automata) Alternating simulation provides contravariance Compatibility checking Done by automata composition Captures the notion “components can work together” Subtyping & polymorphism Alternating simulation (from Q to P) All input steps of P can be simulated by Q, and All output steps of Q can be simulated by P. Used to build a partial order among types

E. A. Lee, UC Berkeley 15 Simple Example: One Place Buffer Showing Consumer Interface Only gget hThasToken tToken hTTReturn True from hasToken hTFReturn False from hasToken Outputs: Inputs: Model of the interaction of a one-place buffer, showing the interface to a consumer actor. consumer interface Buffer:

E. A. Lee, UC Berkeley 16 Two Candidate Consumer Actors Consumer with check: Consumer without check: buffer interface gget hThasToken tToken hTTReturn True from hasToken hTFReturn False from hasToken Inputs: Outputs:

E. A. Lee, UC Berkeley 17 Composition: Behavioral Type Check Consumer with check: Buffer: Illegal states are pruned out of the composition. A composite state is illegal if an output produced by one has no corresponding input in the other.

E. A. Lee, UC Berkeley 18 Composition: Behavioral Type Check Buffer: Consumer without check: An empty composition means that all composite states are illegal. E.g., here, 0_0 is illegal, which results in pruning all states.

E. A. Lee, UC Berkeley 19 Subclassing and Polymorphism Buffer : Buffer with Default: Alternating simulation relation We can construct a type lattice by defining a partial order based on alternating simulation. It properly reflects the desire for contravariant inputs and outputs.

E. A. Lee, UC Berkeley 20 Contravariance of Inputs and Outputs in a Classical Type System public Complex foo(Double arg) BaseClass public Double foo(Complex arg) DerivedClass Can accept more general inputs … and deliver more specific outputs DerivedClass remains a valid drop- in substitution for BaseClass.

E. A. Lee, UC Berkeley 21 Representing Models of Computation Synchronous Dataflow (SDF) Domain receiver interface director interface

E. A. Lee, UC Berkeley 22 Consumer Actor With Firing- Type Definition fRReturn from fire gget hThasToken ffire tToken hTTReturn True from hasToken hTFReturn False from hasToken Inputs: Outputs: Such actors are passive, and assume that input is available when they fire. execution interface communication interface

E. A. Lee, UC Berkeley 23 Type Checking – Compose SDF Consumer Actor with SDF Domain Compose SDF Domain SDF Consumer Actor

E. A. Lee, UC Berkeley 24 Type Definition – SDF Consumer Actor in SDF Domain 1. receives token from producer interface to producer actor 2. accept token 3. internal action: fire consumer 4. internal action: call get() 5. internal action: get token 6. internal action: return from fire

E. A. Lee, UC Berkeley 25 Representing Models of Computation – Discrete Event (DE) Domain This domain may fire actors without first providing inputs

E. A. Lee, UC Berkeley 26 Recall Component Behavior SDF Consumer Actor 1.is fired 2.calls get() 3.gets a token 4.returns

E. A. Lee, UC Berkeley 27 Type Checking – Compose SDF Consumer Actor with DE Domain Empty automaton indicates incompatibility Composition type has no behaviors Compose DE Domain SDF Consumer Actor

E. A. Lee, UC Berkeley 28 Subtyping Relation Alternating Simulation: SDF  DE SDF Domain DE Domain

E. A. Lee, UC Berkeley 29 Domain Polymorphic Type Definition – Consumer Actor with Firing 1. is fired 2. calls hasToken() 3. true 3. false 4. return 4. call get() 5. get token 6. return This actor checks for token availability before attempting to get the token.

E. A. Lee, UC Berkeley 30 Domain Polymorphic Actor Composes with the DE Domain Compose DE Domain Poly Actor

E. A. Lee, UC Berkeley 31 Domain Polymorphic Actor Also Composes with the SDF Domain Compose Poly Actor SDF Domain

E. A. Lee, UC Berkeley 32 Summary of Behavioral Types Results We capture patterns of component interaction in a type system framework: behavioral types We describe interaction types and component behavior using interface automata. We do type checking through automata composition (detect component incompatibilities) Subtyping order is given by the alternating simulation relation, supporting polymorphism. A behavioral type system is a set of automata that form a lattice under alternating simulation.

E. A. Lee, UC Berkeley 33 Scalability Automata represent behavioral types Not arbitrary program behavior Descriptions are small Compositions are small Scalability is probably not an issue Type system design becomes an issue What to express and what to not express Restraint! Will lead to efficient type check and type inference algorithms

E. A. Lee, UC Berkeley 34 Issues and Ideas Composition by name-matching awkward, limiting. use ports in hierarchical models? Rich subtyping: extra ports interfere with alternating simulation. projection automata? use ports in hierarchical models? Synchronous composition: composed automata react synchronously. modeling mutual exclusion is awkward use transient states? hierarchy with transition refinements?

E. A. Lee, UC Berkeley 35 More Speculative We can reflect component dynamics in a run-time environment, providing behavioral reflection. admission control run-time type checking fault detection, isolation, and recovery (FDIR) Timed interface automata may be able to model real-time requirements and constraints. checking consistency becomes a type check generalized schedulability analysis Need a language with a behavioral type system Visual syntax given here is meta modeling Use this to build domain-specific languages