CIS 540 Principles of Embedded Computation Spring 2014 Instructor: Rajeev Alur

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

Analysis of Computer Algorithms
Reliable Scripting Using Push Logic Push Logic David Greaves, Daniel Gordon University of Cambridge Computer Laboratory Reliable Scripting.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Timed Automata.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CSE 5522: Survey of Artificial Intelligence II: Advanced Techniques Instructor: Alan Ritter TA: Fan Yang.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Modeling and Verification of Embedded Software Rajeev Alur POPL Mentoring Workshop, Jan 2012 University of Pennsylvania.
Systems Engineering for Automating V&V of Dependable Systems John S. Baras Institute for Systems Research University of Maryland College Park
Integrated Design and Analysis Tools for Software-Based Control Systems Shankar Sastry (PI) Tom Henzinger Edward Lee University of California, Berkeley.
About the Course Lecture 0: Sep 2 AB C. Plan  Course Information and Arrangement  Course Requirement  Topics and objectives of this course.
Are “Embedded Systems" Just Systems Made with Small Computers? Chess: Center for Hybrid and Embedded Software Systems Invited Talk Artist International.
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
Models of Computation for Embedded System Design Alvise Bonivento.
NSF Foundations of Hybrid and Embedded Software Systems UC Berkeley: Chess Vanderbilt University: ISIS University of Memphis: MSI A New System Science.
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.
Designing Predictable and Robust Systems Tom Henzinger UC Berkeley and EPFL.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
CS 581: Introduction to the Theory of Computation Lecture 1 James Hook Portland State University
Frequently asked questions about software engineering
Computer Network Fundamentals CNT4007C
General information CSE : Probabilistic Analysis of Computer Systems
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
ECE 720T5 Winter 2014 Cyber-Physical Systems Rodolfo Pellizzoni.
CS 103 Discrete Structures Lecture 01 Introduction to the Course
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Reliable Design of Safety Critical Systems Dr. Abhik Roychoudhury School of Computing
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Copyright John C. Knight SOFTWARE ENGINEERING FOR DEPENDABLE SYSTEMS John C. Knight Department of Computer Science University of Virginia.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
© 2012 xtUML.org Bill Chown – Mentor Graphics Model Driven Engineering.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Cheating The School of Network Computing, the Faculty of Information Technology and Monash as a whole regard cheating as a serious offence. Where assignments.
Data Structures and Algorithms in Java AlaaEddin 2012.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
COE 200 Fundamentals of Computer Engineering Instructor: Syed Z. Shazli
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Principles of Imperative Computation Lecture 1 January 15 th, 2012.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
Sub-fields of computer science. Sub-fields of computer science.
Lecture on Digital Logic Design
Computer Organization and Machine Language Programming CPTG 245
EE 249 Embedded Systems Design
Principles of Computing – UFCFA Lecture-1
Frequently asked questions about software engineering
Autonomous Cyber-Physical Systems: Course Introduction
Autonomous Cyber-Physical Systems: Synchronous Components: II
CSCI1600: Embedded and Real Time Software
Spring CS 599. Instructor: Jyo Deshmukh
CS 501: Software Engineering Fall 1999
Distributed Control Applications Within Sensor Networks
An overview of the CHESS Center
Principles of Imperative Computation
Principles of Computing – UFCFA Week 1
Autonomous Cyber-Physical Systems: Course Introduction
Presentation transcript:

CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur

Embedded Software Systems Everywhere! CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15 Software Inside

From Desktops to Cyber-Physical Systems  Traditional computers: Stand-alone device running software applications (e.g. data processing)  Traditional controllers: Devices interacting with physical world via sensors and actuators (e.g. thermostat)  Embedded Systems  Special-purpose system with integrated microcontroller/software  Cameras, watches, washing machines…  Cyber-physical systems  Computing devices communicating with one another and interacting with the physical world via sensors/actuators  Computing + Control + Communication  Example: Team of autonomous robots CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Foundations of Cyber-Physical Systems  CPS emerging as a distinct academic discipline recently  Conferences: Embedded Systems Week, Cyber-Physical Systems Week  Research priority for Government agencies  CPS in industry  Technologies for low-cost devices available, but…  Challenge: Managing complexity to produce reliable systems  Foundations for traditional computing  Limits of computation: Turing machines …  Efficiency of problem solving: Algorithms and complexity  Correctness: Formal specification and verification  Complexity of software: Programming abstractions  Does design of CPS need new theoretical foundations?  What are the distinguishing features of CPS? CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Functional vs Reactive Computation  Classical model of computation: Functional  Given inputs, a program produces outputs  Desired functionality described by a mathematical function  Example: Sorting of names, Shortest paths in a weighted graph  Theory of computation provides foundation for this view  Reactive  System interacts with its environment via inputs and outputs in an ongoing manner  Desired behaviors: which sequences of observed input/output interactions are acceptable?  Example: Cruise controller in a car  CPS: Reactive CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Sequential vs Concurrent Computation  Classical model of computation: Sequential  A computation is a sequence of instructions executed one at a time  Well understood and canonical model: Turing machines  Concurrent Computation  Multiple components/processes exchanging information and evolving concurrently  Logical vs physical concurrency  Broad range of formal models for concurrent computation  Key distinction: Synchronous vs Asynchronous CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Feedback Control of the Physical World CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15 Discrete Control (Software) Physical Plant (Continuous Dynamics) Sensors Actuators  Classical control theory: Continuous-time systems  Key ingredient: Modeling of dynamical systems by differential equations  Theory of linear systems for design and analysis  Hybrid systems: Discrete + continuous dynamics  Multiple modes of operation  Discrete software

Real-Time Computation  Traditional computing infrastructure (programming languages, operating systems, and processor architecture) do not support real time explicitly  Efficient, flexible and portable implementations  Suitable for general purpose computing tasks, but not for CPS  Real-Time  Timing of events critical to correctness  Need a way to predict and model delays at design time  Key: Predictable and timely performance  Need to worry about resource contention and allocation CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Safety-Critical Applications  Traditional verification and validation approach  Design, implementation, followed by extensive testing  Software bugs are common-place  Fixing of bugs can be expensive  Safety-critical applications  Bugs lead to catastrophic failures  Establishing correctness at design time a high priority  Formal methods  Formalize correctness requirements in a precise manner  Develop a model of system and its environment at design time  Establish that the system meets the requirements CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Ariane 5 Explosion “It took the European Space Agency 10 years and $7 billion to produce Ariane 5. All it took to explode that rocket less than a minute into its maiden voyage last June, scattering fiery rubble across the mangrove swamps of French Guiana, was a small computer program trying to stuff a 64-bit number into a 16-bit space” A bug and a crash, J. Gleick, New York Times, Dec 1996 CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Prius Brake Problems Blamed on Software Glitches “Toyota officials described the problem as a "disconnect" in the vehicle's complex anti-lock brake system (ABS) that causes less than a one-second lag. With the delay, a vehicle going 60 mph will have traveled nearly another 90 feet before the brakes begin to take hold” CNN Feb 4, 2010 CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Software: The Achilles’ Heel Software everywhere means bugs everywhere 2002 study by NIST: Software bugs cost US economy $60 billion annually (0.6% of GDP) Lack of trust in software as technology barrier Would you use an autonomous software-controlled round-the-clock monitoring and drug-delivery device? Grand challenge for computer science: Technology for designing “correct” cyber-physical systems CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Course Topics  Goal: Introduction to principles of design, specification, analysis and implementation of CPS  Disciplines  Model-based design  Concurrency theory  Distributed algorithms  Formal specification  Verification techniques and tools  Control theory  Real-time systems  Hybrid systems  Emphasis on mathematical concepts CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Theme 1: Formal Models  Mathematical abstractions to describe system designs  Modeling formalisms  Synchronous models (Chapter 2)  Asynchronous models (Chapter 4)  Continuous-time dynamical systems (Chapter 5)  Timed models (Chapter 7)  Hybrid systems (Chapter 9)  Modeling concepts  Syntax vs semantics  Composition  Input/output interfaces  Nondeterminism, fairness, … CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Theme 2: Specification and Analysis  Formal techniques to ensure correctness at design time  Requirements  Safety (invariants, monitors)  Liveness (temporal logic, automata over infinite sequences)  Stability  Schedulability  Analysis techniques  Deductive: Inductive invariants and ranking functions  Enumerative and symbolic search for state-space exploration  Model checking  Linear-algebra-based analysis of dynamical systems  Verification of timed and hybrid systems CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Theme 3: Model-based Design  Design and analysis of illustrative computing problems  Design methodology  Structured modeling (bottom-up, top-down)  Requirements-based design and design-space exploration  Case studies  Distributed coordination: mutual exclusion, consensus, leader election  Communication: Reliable transmission, synchronization  Control design: PID, cruise controller  CPS: Obstacle avoidance for robots, multi-hop control network CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Course Logistics (1)  TA: Rahul Vasist  Office Hours: Alur 4-5 Tues(Levine 609); Rahul Mon 4-5  Recitation: Fridays (starting Jan 24)  Review + Problem solving + Question/Answer  Grading  Six Homeworks (theory problems): 30%  Three Projects (Modeling + Analysis Tools): 15%  Midterm (March 5, in-class): 20%  Final Exam (May 9): 35%  Avoid all forms of academic cheating!  If stuck, contact me or Rahul  Course participation  Ask questions! Answer questions!  Use of laptops, mobile phones etc during class is not allowed CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Course Logistics (2)  Textbook: Principles of Cyber-Physical Systems  Draft copy available  me comments, corrections …  Complementary courses and course material  Introduction to embedded systems; Lee/Seshia,UC Berkeley  Foundations of cyber-physical systems; Platzer, CMU  Modeling/analysis software  SPIN model checker  MATLAB  Stateflow/Simulink by Mathworks  Theory course  Emphasis on Abstract thinking + Rigorous reasoning CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Model-Based Design  Block Diagrams  Widely used in industrial design  Tools: Simulink, Modelica, RationalRose…  Key question: what is the execution semantics?  What is a base component  How do we compose components to form complex components? CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

Synchronous Models  All components execute in a sequence of (logical) rounds in a lock-step manner  Example: Component blocks in digital hardware circuit  Clock drives all components in a synchronized manner  Key idea in synchronous languages:  Design system using such a synchronous round-based computation  Benefit: Design is simpler (why?)  Challenge: Implementation platform need not be synchronous single-chip hardware  CPS example: time-triggered CAN bus for communication in a modern automobile CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15

First Example: Delay  Input variable: in of type Boolean CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15 bool in bool out bool x := 0 out:=x ; x:= in  Output variable: in of type Boolean  State variable: x of type Boolean  Initialization of state variables: assignment x:=0  In each round, in response to an input, produce output and update state by executing the update code: out:=x; x:=in

Delay: Round-based Execution  Initialize state to 0 CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15 bool in bool x := 0 out:=x ; x:= in  Repeatedly execute rounds. In each round: Choose a value for the input variable in Execute the update code to produce output out and change state  Sample execution: 0 1 / / / / / 0 1 bool out

Synchrony Hypothesis  Assumption: The time needed to execute the update code is negligible compared to delay between successive input arrivals  Logical abstraction:  Execution of update code takes zero time  Production of outputs and reception of inputs occurs at same time  When multiple components are composed, all execute synchronously and simultaneously  Implementation must make sure that this design-time assumption is valid CIS 540 Principles of Embedded Computation; Spring 2014; Lecture Jan 15