Hybrid and Embedded Systems: Generalized Hybrid Systems

Slides:



Advertisements
Similar presentations
Modelos de Computação Básicos Prof. Dr. César Augusto Missio Marcon Parcialmente extraído de trabalhos de Axel Jantch, Edward Lee e Alberto Sangiovanni-Vincentelli.
Advertisements

CS 290C: Formal Models for Web Software Lecture 4: Implementing and Verifying Statecharts Specifications Using the Spin Model Checker Instructor: Tevfik.
Rule Based Operational Semantics Specification in Ptolemy Yanwar Asrigo COMP 763B - Modeling and Simulation Based Design 30 th April 2008.
The Operational Semantics of Hybrid Systems Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS, UC Berkeley With contributions from: Adam.
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
Discrete Event Models: Getting the Semantics Right Edward A. Lee Robert S. Pepper Distinguished Professor Chair of EECS UC Berkeley With thanks to Xioajun.
ACM SIGPLAN 2001 Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES'2001) Jun 22-23, 2001, Snowbird, Utah, USA Embedded Software from.
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.
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.
Type System, March 12, Data Types and Behavioral Types Yuhong Xiong Edward A. Lee Department of Electrical Engineering and Computer Sciences University.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Leveraging Synchronous Language Principles for Hybrid System Models Haiyang Zheng and.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley Behavioral Types for Actor-Oriented Design Edward A. Lee.
February 11, 2010 Center for Hybrid and Embedded Software Systems Ptolemy II - Heterogeneous Concurrent Modeling and Design.
Chess Review October 4, 2006 Alexandria, VA Edited and presented by Advanced Tool Architectures Edward A. Lee UC Berkeley.
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.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
Hybrid System Modeling: Operational Semantics Issues Edward A. Lee Professor UC Berkeley Center for Hybrid and embedded software systems OMG Technical.
EECE Hybrid and Embedded Systems: Computation T. John Koo, Ph.D. Institute for Software Integrated Systems Department of Electrical Engineering and.
EECE Hybrid and Embedded Systems: Computation T. John Koo, Ph.D. Institute for Software Integrated Systems Department of Electrical Engineering and.
An Extensible Type System for Component-Based Design
Mixing Models of Computation Jie Liu Palo Alto Research Center (PARC) 3333 Coyote Hill Rd., Palo Alto, CA joint work with Prof. Edward.
Models of Computation for Embedded System Design Alvise Bonivento.
Discrete Event Models: Getting the Semantics Right Edward A. Lee Robert S. Pepper Distinguished Professor Chair of EECS UC Berkeley With special thanks.
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.
Heterochronous Dataflow in Ptolemy II Brian K. Vogel EE249 Project Presentation, Dec. 4, 1999.
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.
Chess Review May 11, 2005 Berkeley, CA Discrete-Event Systems: Generalizing Metric Spaces and Fixed-Point Semantics Adam Cataldo Edward Lee Xiaojun Liu.
Tool Integration of Ptolemy II EE290N Class Project Haiyang Zheng May
MOBIES Project Progress Report Engine Throttle Controller Design Using Multiple Models of Computation Edward Lee Haiyang Zheng with thanks to Ptolemy Group.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley The Ptolemy II Framework for Visual Languages Xiaojun Liu.
Operational Semantics of Hybrid Systems Edward A. Lee and Haiyang Zheng With contributions from: Adam Cataldo, Jie Liu, Xiaojun Liu, Eleftherios Matsikoudis.
Composing Models of Computation in Kepler/Ptolemy II Summary. A model of computation (MoC) is a formal abstraction of execution in a computer. There is.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Composing Models of Computation in Kepler/Ptolemy II
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
Actor Networks Edward A. Lee Robert S. Pepper Distinguished Professor Chair of EECS UC Berkeley Invited Talk Workshop Foundations and Applications of Component-based.
CSCI1600: Embedded and Real Time Software Lecture 7: Modeling II: Discrete Systems Steven Reiss, Fall 2015.
Ptolemy & Models of Computation -by Hao Chen, Zhuang Fan, Jin Xiao School of Computer Science University of Waterloo Claudius Ptolemaeus, the second century.
CS3773 Software Engineering Lecture 06 UML State Machines.
11Fall 2015, arz1 CPE555A: Real-Time Embedded Systems Lecture 11 Ali Zaringhalam Stevens Institute of Technology.
Ptolemy Project Vision Edward A. Lee Robert S. Pepper Distinguished Professor Eighth Biennial Ptolemy Miniconference April 16, 2009 Berkeley, CA, USA.
CPE555A: Real-Time Embedded Systems
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Event Relation Graphs and Extensions in Ptolemy II
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Code Generation for Ptolemy II
Model Transformation with Hierarchical Discrete-Event Control
Model Transformation with Hierarchical Discrete-Event Control
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung
Retargetable Model-Based Code Generation in Ptolemy II
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Concurrent Models of Computation for Embedded Software
332:437 Lecture 8 Verilog and Finite State Machines
Embedded Systems: A Focus on Time
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Model Transformation with the Ptera Controller
CSCI1600: Embedded and Real Time Software
Compositional Refinement for Hierarchical Hybrid Systems
Concurrent Models of Computation
332:437 Lecture 8 Verilog and Finite State Machines
STATE MACHINE AND CONCURRENT PROCESS MODEL
STATE MACHINE AND CONCURRENT
Presentation transcript:

Hybrid and Embedded Systems: Generalized Hybrid Systems Edward A. Lee Robert S. Pepper Distinguished Professor UC Berkeley CPS Action Webs Meeting July 23, 2010 Berkeley, CA

Online Online interactive versions of many of the examples in this talk can be accessed by clicking on the figures in the second paper here: http://www.eecs.berkeley.edu/Pubs/TechRpts/2009/EECS-2009-151.html

In a sense, the work here aims to generalize: Statecharts [Harel 87] Argos [Maraninchi 91] Esterel [Berry & Gonthier 92] Abstract state machines [Gurevich 93] Hybrid systems [Puri & Varaiya 94, Henzinger 99] Timed automata [Alur & Dill 94] SyncCharts [Andre 96] I/O Automata [Lynch 96] *Charts [Girault, Lee, & Lee 99]

Motivating Example: Hybrid System Finite State Machine Concurrent Model Concurrent Model

Meta Model for FSMs in Ptolemy II Actor Ports Guard (trigger) and actions FSM Transition Ports State Initial state Final state Initial state indicated in bold Guards are expressions that can reference inputs and variables Output values can be functions of inputs and variables Transition can update variable values (“set” actions) Final state terminates execution of the actor

Extended State Machines Reference and manipulate variables on guards and transitions. Extended state machines can operate on variables in the model, like “count” in this example. 0, 1, 2, 3, 4, 5, 5, 5, · · · Variable “Set” actions are distinct from “output” actions. We will see why.

Modal Model Meta Model Hierarchical Composition Actor Ports FSM An actor’s behavior may be defined by an arbitrarily deep nesting of FSMs and refinements. State Transition Ports Refinement Refinement Director determines semantics of the submodel

Ptolemy II Enables Hierarchical Mixtures of MoCs This model has two simple synchronous/reactive (SR) models as mode refinements and models their timed environment using a discrete-event (DE) director SR Director SR Director

AND states Using a synchronous/reactive (SR) director yields Statechart-like semantics for concurrent state machines. Here, two FSMs are composed under a synchronous/reactive director, resulting in Statecharts-like AND states.

Operational Semantics: Firing Fire An actor’s behavior may be defined by an arbitrarily deep nesting of FSMs and refinements. Current state Evaluate guards and choose transition Fire Produce outputs (maybe) Execute output actions Execute sub-model according to local MoC

Operational Semantics: Postfiring Postfire State changes are committed only in postfire, enabling fixed point iteration by using only firing. Current state Make this the new current state Postfire Set variable values Commit state changes

Fixed-Point Semantics of SR is Enabled by Fire/Postfire Separation Using a synchronous/reactive (SR) director yields Statechart-like semantics for concurrent state machines. Result is a constructive semantics. The example here requires multiple firings of the FSM actors to converge to the least fixed point.

Directors Benefiting from Fire/Postfire Separation (which we call the Actor Abstract Semantics) Synchronous/Reactive (SR) Execution at each tick is defined by a least fixed point of monotonic functions on a finite lattice, where bottom represents “unknown” (getting a constructive semantics) Discrete Event (DE) Extends SR by defining a “time between ticks” and providing a mechanism for actors to control this. Time between ticks can be zero (“superdense time”). Continuous Extends DE with a “solver” that chooses time between ticks to accurately estimate ODE solutions, and fires all actors on every tick. [Lee & Zheng, EMSOFT 07]

The Modal Model Muddle It’s about time After trying several variants on the semantics of modal time, we settled on this: A mode refinement has a local notion of time. When the mode refinement is inactive, local time does not advance. Local time has a monotonically increasing gap relative to global time.

Modal Time Example Discrete event director places ticks on a (superdense) time line. DiscreteClock generates regularly spaced events that trigger mode transitions. These transitions are “history” transitions, so mode refinements preserve state while suspended. Produce irregularly spaced events in this mode. Produce regularly spaced events in this mode.

Modal Time Example Mode transitions triggered at times 0, 2.5, 5, 7.5, etc. Events with value 1 produced at (local times) 0, 1, 2, 3, etc. First regular event generated at (global time) 0, then transition is immediately taken. First irregular event generated at (global time) 0, one tick later (in superdense time). Local time 1 corresponds to global time 3.5 here.

Variant using Preemptive Transition First regular event is not produced until global time 2.5 (local time 0). Preemptive transition

Time Delays in Modal Models Triggers transitions at (global times) 0, 1, 2, 3, … First output is the second input to the modal model, which goes through the noDelay refinement Second output is the first input to the modal model, which goes through the delay refinement, which is inactive from time 0 to 1.

Variants for the Semantics of Modal Time that we Tried or Considered, but that Failed Mode refinement executes while “inactive” but inputs are not provided and outputs are not observed. Time advances while mode is inactive, and mode refinement is responsible for “catching up.” Mode refinement is “notified” when it has requested time increments that are not met because it is inactive. When a mode refinement is re-activated, it resumes from its first missed event. All of these led to some very strange models… Final solution: Local time does not advance while a mode is inactive. Growing gap between local time and global time.

More Variants of Modal Models Supported in Ptolemy II Reset transition (vs. history transition) Transition may be a reset transition Destination refinement is initialized Multiple states can share a refinement Facilitates sharing internal actor state across modes A state may have multiple refinements Executed in sequence (providing imperative semantics)

Still More Variants Transition may have a refinement Refinement is fired when transition is chosen Postfired when transition is committed Time is that of the environment

And Still More Variants Fault model Dataflow model Transition may be a “default transition” Taken if no non-default transition is taken Compare with priorities in SyncCharts FSMs may be nondeterminate Can mark transitions to permit nondeterminism This example is a hierarchical FSM showing a thermostat with a nondeterminate fault mode. Nondeterminate transitions Default transition

Conclusion Modal models (in Ptolemy II, Statecharts, SyncCharts, Argos, etc.) provide a hierarchical mixture of imperative logic and declarative composition. Humans are very capable of reasoning both imperatively (algorithms, recipes, etc.) and declaratively (equations, synchronous composition, etc.). We use these reasoning tools for different (complementary) tasks. Hybrid systems combine such reasoning: Declarative differential equations, Imperative FSMs. The abstract semantics given here generalizes them to other MoCs.

Acknowledgments Contributors to the modal model mechanisms in Ptolemy II: Thomas Huining Feng Xiaojun Liu Haiyang Zheng Graphical editor in Vergil for state machines: Stephen Neuendorffer Hideo John Reekie Semantics of modal time: Joern Janneck Stavros Tripakis Online interactive examples and Ptolemy II infrastructure: Christopher Brooks Other: David Hermann & Zoltan Kemenczy (from RIM): transition refinements Jie Liu: hybrid systems Ye Zhou: modal dataflow models

Syntax of AND States In Statecharts, communication between concurrent state machines is specified by name matching. Example from Reinhard von Hanxleden, Kiel University Can you tell whether there is feedback? Communication path (This might be called the modal model meta model muddle).

Syntax of AND States In Ptolemy II, communication between concurrent state machines is explicit. Now can you tell whether there is feedback? This is also more modular because names don’t need to match at the source and destination of a connection.