Software Engineering Center Compositional Safety and Security Analysis of Architecture Models Mike Whalen Program Director University of Minnesota Software.

Slides:



Advertisements
Similar presentations
Translation-Based Compositional Reasoning for Software Systems Fei Xie and James C. Browne Robert P. Kurshan Cadence Design Systems.
Advertisements

ECOE 560 Design Methodologies and Tools for Software/Hardware Systems Spring 2004 Serdar Taşıran.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
By Philippe Kruchten Rational Software
Dagstuhl Intro Mike Whalen. 2 Mike Whalen My main goal is to reduce software verification and validation (V&V) cost and increasing.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture 05.
Architecture Modeling and Analysis for Embedded Systems Oleg Sokolsky CIS700 Fall 2005.
Component-Level Design
The Architecture Design Process
Chess Review May 11, 2005 Berkeley, CA Composable Code Generation for Distributed Giotto Tom Henzinger Christoph Kirsch Slobodan Matic.
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
Software Engineering for Safety : A Roadmap Presentation by: Manu D Vij CS 599 Software Engineering for Embedded Systems.
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
Software Issues Derived from Dr. Fawcett’s Slides Phil Pratt-Szeliga Fall 2009.
Real-Time System Requirements & Design Specs Shaw - Chapters 3 & 4 Homework #2: 3.3.1, 3.4.1, Add Error states to Fig 4.1 Lecture 4/17.
The Software Product Life Cycle. Views of the Software Product Life Cycle  Management  Software engineering  Engineering design  Architectural design.
Principle of Functional Verification Chapter 1~3 Presenter : Fu-Ching Yang.
Course Instructor: Aisha Azeem
NASA Space Launch System (SLS) Independent Verification and Validation (IV&V) Analysis Processes within Enterprise Architecture (EA) September 11, 2013.
Romaric GUILLERM Hamid DEMMOU LAAS-CNRS Nabil SADOU SUPELEC/IETR ESM'2009, October 26-28, 2009, Holiday Inn Leicester, Leicester, United Kingdom.
What is Software Architecture?
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
The Software Development Life Cycle: An Overview
Chapter 6 System Engineering - Computer-based system - System engineering process - “Business process” engineering - Product engineering (Source: Pressman,
Software Engineering Center Compositional Analysis of System Architectures (using Lustre) Mike Whalen Program Director University of Minnesota Software.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
An Introduction to Software Architecture
Team Skill 6: Building the Right System From Use Cases to Implementation (25)
©Ian Sommerville 2000, Mejia-Alvarez 2009 Slide 1 Software Processes l Coherent sets of activities for specifying, designing, implementing and testing.
Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.
Advanced Technology Center Slide 1 Requirements-Based Testing Dr. Mats P. E. Heimdahl University of Minnesota Software Engineering Center Dr. Steven P.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
© Copyright 2014 Rockwell Collins, Inc. All rights reserved. Resolute: An Assurance Case Language for Architecture Models Andrew Gacek, John Backes, Darren.
Introduction to Formal Methods Based on Jeannette M. Wing. A Specifier's Introduction to Formal Methods. IEEE Computer, 23(9):8-24, September,
1 New Development Techniques: New Challenges for Verification and Validation Mats Heimdahl Critical Systems Research Group Department of Computer Science.
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 10 Use Case Design.
Architectural Design lecture 10. Topics covered Architectural design decisions System organisation Control styles Reference architectures.
Large Scale Software Systems Derived from Dr. Fawcett’s Notes Phil Pratt-Szeliga Fall 2010.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
© 2012 xtUML.org Bill Chown – Mentor Graphics Model Driven Engineering.
1 Introduction to Software Engineering Lecture 1.
1 Context-dependent Product Line Practice for Constructing Reliable Embedded Systems Naoyasu UbayashiKyushu University, Japan Shin NakajimaNational Institute.
Page 1 Analysis of Asynchronous Systems Steven P. Miller Michael W. Whalen {spmiller, Advanced Computing Systems Rockwell.
Page 1 Advanced Technology Center HCSS 03 – April 2003 vFaat: von Neumann Formal Analysis and Annotation Tool David Greve Dr. Matthew Wilding Rockwell.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Formal Methods.
Slide 13.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach.
MODEL-BASED SOFTWARE ARCHITECTURES.  Models of software are used in an increasing number of projects to handle the complexity of application domains.
Verification & Validation By: Amir Masoud Gharehbaghi
Lecture 13.  Failure mode: when team understands requirements but is unable to meet them.  To ensure that you are building the right system Continually.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
What’s Ahead for Embedded Software? (Wed) Gilsoo Kim
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
T imed Languages for Embedded Software Ethan Jackson Advisor: Dr. Janos Szitpanovits Institute for Software Integrated Systems Vanderbilt University.
Agenda  Quick Review  Finish Introduction  Java Threads.
© 2009 Artisan Software Tools. All rights reserved. Testing Solutions with UML/SysML Andrew Stuart, Matthew Hause.
Copyright 1999 G.v. Bochmann ELG 7186C ch.1 1 Course Notes ELG 7186C Formal Methods for the Development of Real-Time System Applications Gregor v. Bochmann.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
© Copyright 2010 Rockwell Collins, Inc. All rights reserved. Practical SysML Applications: A Method to Describe the Problem Space Ray Jorgensen David Lempia.
Part 3 Design What does design mean in different fields?
Logical architecture refinement
Multiple Aspect Modeling of the Synchronous Language Signal
John D. McGregor Session 5 Error Modeling
From Use Cases to Implementation
Presentation transcript:

Software Engineering Center Compositional Safety and Security Analysis of Architecture Models Mike Whalen Program Director University of Minnesota Software Engineering Center

Acknowledgements Rockwell Collins (Darren Cofer, Andrew Gacek, Steven Miller, Lucas Wagner) UPenn: (Insup Lee, Oleg Sokolsky) UMN (Mats P. E. Heimdahl) CMU SEI (Peter Feiler) February, 20122IFIP 2012: Mike Whalen

Main Messages February, 2012IFIP 2012: Mike Whalen3 We need a variety of reasoning approaches and partitioning methods for system-level requirements and analysis Your How is My What: requirements vs. design is a often matter of perspective Requirements hierarchies often follow system and software architectures.

Component Level Formal Analysis Efforts February, 2012IFIP 2012: Mike Whalen4

February, 2012IFIP 2012: Mike Whalen5

© 2010 Carnegie Mellon University An Overview of AADL V2 6 Mismatched Assumptions System Engineer Control Engineer Application Developer System User System Under Control System Compute Platform Runtime Architecture Application Software Embedded SW System Engineer Physical Plant Characteristics Lag, proximity Data Stream Characteristics ETE Latency (F16) State delta (NASA) Measurement Units Ariane 4/5 Air Canada Concurrency Communication ITunes crashes on dual-cores Distribution & Redundancy Virtualization of HW (ARPA-Net split) Operator Error Lag, proximity Hardware Engineer Slide from: An Overview of AADL v2 by Peter Feiler, 2010

Vision February, 2012IFIP 2012: Mike Whalen7 System design & verification through pattern application and compositional reasoning COMPUTING RESOURCE SENSOR LRU FAIL-SILENT NODE FROM REPLICAS COMPUTING RESOURCE A COMPUTING RESOURCE B VOTE MULTIPLE DATA SENSOR 1 SENSOR 2 SENSOR 3 VERIFIED AVAILABILITY VERIFIED INTEGRITY ARCHITECTURE MODEL COMPOSITIONAL PROOF OF CORRECTNESS (ASSUME – GUARANTEE) SAFETY, BEHAVIORAL, PERFORMANCE PROPERTIES ABSTRACTION VERIFICATION REUSE COMPOSITION © Copyright 2011 Rockwell Collins, Inc. All rights reserved.

PATTERN & COMP SPEC LIBRARY SYSTEM MODELING ENVIRONMENT INSTANTIATE ARCH PATTERNS & CHECK CONSTRAINTS COMPOSITIONAL REASONING & ANALYSIS SYSTEM MODEL (AADL) AUTO GENERATE SYSTEM IMPLEMENTATION ARCH PATTERN MODELS COMPONENT MODELS ANNOTATE & VERIFY MODELS COMPONENT LIBRARY SPECIFICATIONSYSTEM DEVELOPMENTFOUNDRY Approach 8 Design Flow Complexity-reducing design patterns Capture best solutions to architectural design problems Reuse of formally verified solutions Increase level of design abstraction Complexity-reducing design patterns Capture best solutions to architectural design problems Reuse of formally verified solutions Increase level of design abstraction 2 Compositional verification Reason about system behavior based on contracts and system design model structure Compositional approach scales to large software systems Compositional verification Reason about system behavior based on contracts and system design model structure Compositional approach scales to large software systems 3 System architecture modeling Apply formal specification and analysis tools to system-level design Separate component specification and implementation Automated model translation System architecture modeling Apply formal specification and analysis tools to system-level design Separate component specification and implementation Automated model translation 1 February, 2012IFIP 2012: Mike Whalen © Copyright 2011 Rockwell Collins, Inc. All rights reserved.

Complexity-Reducing Architectural Design Patterns Design pattern = model transformation ◦ p : M  M (partial function) ◦ Applied to system models Reuse of verification is key ◦ Not software reuse ◦ Guaranteed behaviors associated with patterns (and components) Reduce/manage system complexity ◦ Separation of concerns ◦ System logic vs. application logic (e.g., fault tolerance) ◦ Process complexity vs. design complexity Encapsulate & standardize good solutions ◦ Raise level of abstraction ◦ Codify best practices February, 2012IFIP 2012: Mike Whalen9 © Copyright 2011 Rockwell Collins, Inc. All rights reserved.

System Design Through Pattern Application 10 Avionics System Initial System Final System Pattern Application System Hierarchy ReplicateLeader SelectionPALS Replicate Active Standby Pattern Flight Control Flight Guidance © Copyright 2011 Rockwell Collins, Inc. All rights reserved. February, 2012IFIP 2012: Mike Whalen

System verification February, 2012IFIP 2012: Mike Whalen11 PATTERN & COMP SPEC LIBRARY SYSTEM MODELING ENVIRONMENT INSTANTIATE ARCHITECTURAL PATTERNS SYSTEM MODEL AUTO GENERATE SYSTEM IMPLEMENTATION ARCH PATTERN MODELS COMPONENT MODELS ANNOTATE & VERIFY MODELS COMPONENT LIBRARY SPECIFICATIONSYSTEM DEVELOPMENT FOUNDRY COMPOSITIONAL REASONING & ANALYSIS Instantiation: Check structural constraints, Embed assumptions & guarantees in system model Instantiation: Check structural constraints, Embed assumptions & guarantees in system model Compositional Verification: System properties are verified by model checking using component & pattern contracts Compositional Verification: System properties are verified by model checking using component & pattern contracts Reusable Verification: Proof of component and pattern requirements (guarantees) and specification of context (assumptions) Reusable Verification: Proof of component and pattern requirements (guarantees) and specification of context (assumptions) © Copyright 2011 Rockwell Collins, Inc. All rights reserved.

Hierarchical reasoning about systems Avionics system requirement Relies upon ◦ Accuracy of air data sensors ◦ Control commands from FCS  Mode of FGS  FGS control law behavior  Failover behavior between FGS systems  …. ◦ Response of Actuators ◦ Timing/Lag/Latency of Communications February, 2012IFIP 2012: Mike Whalen12 FCS Avionics System Under single-fault assumption, GC output transient response is bounded in time and magnitude AutopilotFGS_LFGS_R ADS_LADS_R … … System Modes Control Laws Co-ord

Compositional Reasoning for Active Standby Want to prove a transient response property ◦ The autopilot will not cause a sharp change in pitch of aircraft. ◦ Even when one FGS fails and the other assumes control Given assumptions about the environment ◦ The sensed aircraft pitch from the air data system is within some absolute bound and doesn’t change too quickly ◦ The discrepancy in sensed pitch between left and right side sensors is bounded. and guarantees provided by components ◦ When a FGS is active, it will generate an acceptable pitch rate As well as facts provided by pattern application ◦ Leader selection: at least one FGS will always be active (modulo one “failover” step) February, 2012IFIP 2012: Mike Whalen13 transient_response_1 : assert true -> abs(CSA.CSA_Pitch_Delta) < CSA_MAX_PITCH_DELTA ; transient_response_2 : assert true -> abs(CSA.CSA_Pitch_Delta - prev(CSA.CSA_Pitch_Delta, 0.0)) < CSA_MAX_PITCH_DELTA_STEP ;

Hierarchical reasoning between analysis domains. Avionics system requirement Relies upon ◦ Guarantees provided by patterns and components ◦ Structural properties of model ◦ Resource allocation feasibility ◦ Probabilistic system-level failure characteristics October 2012 AADL MeetingMike Whalen14 Platform PALS synchronous communication Replication one node operational timing constraints not co-located Flight Control System Leader Selection leader transition managed on failure ASSUMPTIONS GUARANTEES Under single-fault assumption, GC output transient response is bounded in time and magnitude RT sched & latency Error model Behavior StructureResourceProbabilistic Principled mechanism for “passing the buck” © Copyright 2011 Rockwell Collins, Inc. All rights reserved.

Contracts Derived from Property Specification Language (PSL) formalism ◦ IEEE standard ◦ In wide use for hardware verification Assume / Guarantee style specification ◦ Assumptions: “Under these conditions” ◦ Promises (Guarantees): “…the system will do X” Local definitions can be created to simplify properties February, 2012IFIP 2012: Mike Whalen15 Contract: fun abs(x: real) : real = if (x > 0) then x else -x ; const ADS_MAX_PITCH_DELTA: real = 3.0 ; const FCS_MAX_PITCH_SIDE_DELTA: real = 2.0 ; const CSA_MAX_PITCH_DELTA: real = 5.0 ; const CSA_MAX_PITCH_DELTA_STEP: real = 5.0 ; property AD_L_Pitch_Step_Delta_Valid = true -> abs(AD_L.pitch.val - prev(AD_L.pitch.val, 0.0)) < ADS_MAX_PITCH_DELTA ; property AD_R_Pitch_Step_Delta_Valid = true -> abs(AD_R.pitch.val - prev(AD_R.pitch.val, 0.0)) < ADS_MAX_PITCH_DELTA ; property Pitch_lr_ok = abs(AD_L.pitch.val - AD_R.pitch.val) < FCS_MAX_PITCH_SIDE_DELTA ; property some_fgs_active = (FD_L.mds.active or FD_R.mds.active) ; active_assumption: assume some_fgs_active ; transient_assumption : assume AD_L_Pitch_Step_Delta_Valid and AD_R_Pitch_Step_Delta_Valid and Pitch_lr_ok ; transient_response_1 : assert true -> abs(CSA.CSA_Pitch_Delta) < CSA_MAX_PITCH_DELTA ; transient_response_2 : assert true -> abs(CSA.CSA_Pitch_Delta - prev(CSA.CSA_Pitch_Delta, 0.0)) < CSA_MAX_PITCH_DELTA_STEP ; Contract: fun abs(x: real) : real = if (x > 0) then x else -x ; const ADS_MAX_PITCH_DELTA: real = 3.0 ; const FCS_MAX_PITCH_SIDE_DELTA: real = 2.0 ; const CSA_MAX_PITCH_DELTA: real = 5.0 ; const CSA_MAX_PITCH_DELTA_STEP: real = 5.0 ; property AD_L_Pitch_Step_Delta_Valid = true -> abs(AD_L.pitch.val - prev(AD_L.pitch.val, 0.0)) < ADS_MAX_PITCH_DELTA ; property AD_R_Pitch_Step_Delta_Valid = true -> abs(AD_R.pitch.val - prev(AD_R.pitch.val, 0.0)) < ADS_MAX_PITCH_DELTA ; property Pitch_lr_ok = abs(AD_L.pitch.val - AD_R.pitch.val) < FCS_MAX_PITCH_SIDE_DELTA ; property some_fgs_active = (FD_L.mds.active or FD_R.mds.active) ; active_assumption: assume some_fgs_active ; transient_assumption : assume AD_L_Pitch_Step_Delta_Valid and AD_R_Pitch_Step_Delta_Valid and Pitch_lr_ok ; transient_response_1 : assert true -> abs(CSA.CSA_Pitch_Delta) < CSA_MAX_PITCH_DELTA ; transient_response_2 : assert true -> abs(CSA.CSA_Pitch_Delta - prev(CSA.CSA_Pitch_Delta, 0.0)) < CSA_MAX_PITCH_DELTA_STEP ; © Copyright 2011 Rockwell Collins, Inc. All rights reserved.

Reasoning about contracts Notionally: It is always the case that if the component assumption is true, then the component will ensure that the guarantee is true. ◦ G(A  P); An assumption violation in the past may prevent component from satisfying current guarantee, so we need to assert that the assumptions are true up to the current step: ◦ G(H(A)  P) ; September, LCCC 2012: Mike Whalen

Systems of Contracts Architectures are hierarchically composed in layers. ◦ Visually: a box and line diagram ◦ Formally you can view a layer as a system S: S = (A, P, C)  C is a finite set of component contracts C: ℙ (A x P) February, IFIP 2012: Mike Whalen

Reasoning about Contracts Given the set of component contracts: Γ = { G(H(A c )  P c ) | c ∈ C } Architecture adds a set of obligations that tie the system assumption to the component assumptions This process can be repeated for any number of abstraction levels September, LCCC 2012: Mike Whalen

Composition Formulation Suppose we have Then if for all q ∈ Q ◦ Γ  G((Z(H( Θ q )) ^ Δ q )  q) Then: G(q) for all q ∈ Q [Adapted from McMillan] September, LCCC 2012: Mike Whalen

A concrete example Order of data flow through system components is computed by reasoning engine ◦ {System inputs}  {FGS_L, FGS_R} ◦ {FGS_L, FGS_R}  {AP} ◦ {AP}  {System outputs} Based on flow, we establish four proof obligations ◦ System assumptions  FGS_L assumptions ◦ System assumptions  FGS_R assumptions ◦ System assumptions + FGS_L guarantees + FGS_R guarantees  AP assumptions ◦ System assumptions + {FGS_L, FGS_R, AP} guarantees  System guarantees System can also handle circular flows, but user has to choose where to break cycle February, 2012IFIP 2012: Mike Whalen20

Architecture of Generic Infusion Pump GPCA = Generic Patient-Controlled Analgesia Product Family architecture GPCA Pump Pump Hardware Flow Rate Detector Door Pump Position HumidityTemp Air Pressure Battery Power Supply Air In Line Detector Pump Motor Buzzer Pump Controller Software Infusion Command

GPCA Pump Example Property of Interest: ◦ If a “Pump Stop” command is received, then within 1 second, measured flow rate shall be zero. We will prove this property compositionally based on the architecture of the Pump subsystem. With exciting verification demo!

Proof of GPCA Pump GPCA Pump Pump Hardware Flow Rate Detector Pump Position HumidityTemp Battery Power Supply Pump Motor Buzzer Pump Controller Software Infusion Command Assertion: When a “Pump Stop” infusion command is received, then within 1 second, measured flow rate shall be zero. … … …

Proof of Reciprocating Pump GPCA Pump Reciprocating Pump Hardware Flow Rate Detector HumidityTemp Battery Power Supply Pump Motor Buzzer Pump Controller Software Assertion: When a “Pump Stop” infusion command is received, then within 1 second, measured flow rate shall be zero. When pump stop command occurs, pump motor will be switched off when pump motor position reaches no-ambient flow state. Door Assertion: When powered on, pump cycles between ambient and no-ambient flow states every 300 ms. if pump is in no ambient flow position and pump motor is off, then flow rate will be zero within 200 ms

Proof of Rotary Pump GPCA Pump Rotary Pump Hardware Flow Rate Detector HumidityTemp Battery Power Supply Pump Motor Buzzer Pump Controller Software Assertion: When a “Pump Stop” infusion command is received, then within 1 second, measured flow rate shall be zero. When pump stop command occurs, pump motor will be immediately switched off. Door if pump is in no ambient flow position and pump motor is off, then flow rate will be zero within 400 ms

ARCHITECTURE AND REQUIREMENTS February, 2012IFIP 2012: Mike Whalen26

Requirements or Design Information? 1. The patient shall never be infused with a single air bubble more than 5ml volume. 2. When a single air bubble more than 5ml volume is detected, the system shall stop infusion within 0.01 seconds. 3. When a single air bubble more than 5ml volume is detected, the system shall issue an air-embolism command. 4. When air-embolism command is true, the system shall stop infusion. 5. When air-embolism command is received, the system shall stop piston movement within 0.1 second. 9/25/2012Mike Whalen - TwinPeaks

A: Both 1.The patient shall never be infused with a single air bubble more than 5ml volume. 2.When a single air bubble more than 5ml volume is detected, the system shall stop infusion within 0.01 seconds. 3.When a single air bubble more than 5ml volume is detected, the system shall issue an air-embolism command. 4.When air-embolism command is true, the system shall stop infusion. 5.When air-embolism command is received, the system shall stop piston movement within 0.1 seconds PATIENT THERAPY SYSTEM INFUSION SYSTEM AIR BUBBLE SENSOR DRUG DELIVERY HARDWARE PUMP SYSTEM PUMP HARDWARE PUMP CONTROLLER 9/25/2012Mike Whalen - TwinPeaks

9/25/2012Mike Whalen - TwinPeaks

Your How is My What Systems are hierarchically organized Requirements vs. architectural design must be a matter of perspective Need better support for N-level decompositions for requirements and architectural design ◦ Reference model support  How do elements “flow” between world, machine, and specification as we decompose systems? ◦ Certification standard support (DO-178B/C)  Currently: two levels of decomposition: “high” and “low” 9/25/2012Mike Whalen - TwinPeaks

Twin Peaks 9/25/2012Mike Whalen - TwinPeaks

Often, Architecture Comes First Candidate architectures from previous systems ◦ Designer familiarity ◦ Cost amortization Program families Certification or criticality requirements Architectural choices often restrict set of achievable system requirements. 9/25/2012Mike Whalen - TwinPeaks

Flow is Bi-directional 9/25/2012Mike Whalen - TwinPeaks

Requirements Validation and Verification Given hierarchical systems, where are the most serious problems with requirements? ◦ At the component level? ◦ At the top-level? ◦ Somewhere in the middle? A hypothesis: ◦ The most problematic are the layers in the middle ◦ Errors in decomposing system requirements become integration problems. These are requirements to be both verified and validated. 9/25/2012Mike Whalen - TwinPeaks

STRUCTURAL PROPERTIES February, 2012IFIP 2012: Mike Whalen35

Structural Properties Often, we are interested in properties about a model structure ◦ Given the processor resources, is the system schedulable? ◦ Is my software correctly distributed across different physical resources? ◦ Are my end-to-end timing assumptions met? Often these involve checking the mapping between the software and the hardware. February, 2012IFIP 2012: Mike Whalen36

37 Structural Properties Software + HW platform ◦ Process, thread, processors, bus Ex: PALS vertical contract ◦ PALS timing constraints on platform ◦ Check AADL structural properties Guarantees ◦ Sync logic executes at PALS_Period ◦ Synchronous_Communication => “One_Step_Delay” Assumptions (about platform) ◦ Causality constraint: Min(Output time) ≥ 2 ε – μ min ◦ PALS period constraint: Max(Output time) ≤ T - μ max - 2 ε Software Platform February, 2012IFIP 2012: Mike Whalen

38 PALS assumptions in AADL Compute_Execution_Time Latency TiTi T i+1 ( ±  ) Output message Input message available Period Deadline Dispatch_Offset (if imposed) Dispatch_Jitter (if describing max scheduling delay) Output_Time Clock_Jitter Thread execution ( ±  ) Latest period start on other node Earliest output message Min( Output_Time ) Min (Latency) Causality Constraint Thread execution Max( Latency ) ( ±  ) Latest output message Deadline Latest period start Earliest period start on other node Period Max( Output_Time ) PALS Period Constraint February, 2012IFIP 2012: Mike Whalen

39 Structural property checks Contract ◦ Platform model satisfies PALS assumptions Attached at pattern instantiation ◦ Model-independent ◦ Assumptions ◦ Pre/post-conditions Lute theorems ◦ Based on REAL ◦ Eclipse plug-in ◦ Structural properties in AADL model PALS_Threads := {s in Thread_Set | Property_Exists(s, "PALS_Properties::PALS_Id")}; PALS_Period(t) := Property(t, "PALS_Properties::PALS_Period"); PALS_Id(t) := Property(t, "PALS_Properties::PALS_Id"); PALS_Group(t) := {s in PALS_Threads | PALS_Id(t) = PALS_Id(s)}; Max_Thread_Jitter(Threads) := Max({Property(p, "Clock_Jitter") for p in Processor_Set | Cardinal({t in Threads | Is_Bound_To(t, p)}) > 0}); Connections_Among(Set) := {c in Connection_Set | Member(Owner(Source(c)), Set) and Member(Owner(Destination(c)), Set)}; theorem PALS_Period_is_Period foreach s in PALS_Threads do check Property_Exists(s, "Period") and PALS_Period(s) = Property(s, "Period"); end; theorem PALS_Causality foreach s in PALS_Threads do PALS_Group := PALS_Group(s); Clock_Jitter := Max_Thread_Jitter(PALS_Group); Min_Latency := Min({Lower(Property(c, "Latency")) for c in Connections_Among(PALS_Group)}); Output_Delay := {Property(t, "Output_Delay") for t in PALS_Group}; check (if 2 * Clock_Jitter > Min_Latency then Min(Output_Delay) > 2 * Clock_Jitter - Min_Latency else true); end; PALS_Threads := {s in Thread_Set | Property_Exists(s, "PALS_Properties::PALS_Id")}; PALS_Period(t) := Property(t, "PALS_Properties::PALS_Period"); PALS_Id(t) := Property(t, "PALS_Properties::PALS_Id"); PALS_Group(t) := {s in PALS_Threads | PALS_Id(t) = PALS_Id(s)}; Max_Thread_Jitter(Threads) := Max({Property(p, "Clock_Jitter") for p in Processor_Set | Cardinal({t in Threads | Is_Bound_To(t, p)}) > 0}); Connections_Among(Set) := {c in Connection_Set | Member(Owner(Source(c)), Set) and Member(Owner(Destination(c)), Set)}; theorem PALS_Period_is_Period foreach s in PALS_Threads do check Property_Exists(s, "Period") and PALS_Period(s) = Property(s, "Period"); end; theorem PALS_Causality foreach s in PALS_Threads do PALS_Group := PALS_Group(s); Clock_Jitter := Max_Thread_Jitter(PALS_Group); Min_Latency := Min({Lower(Property(c, "Latency")) for c in Connections_Among(PALS_Group)}); Output_Delay := {Property(t, "Output_Delay") for t in PALS_Group}; check (if 2 * Clock_Jitter > Min_Latency then Min(Output_Delay) > 2 * Clock_Jitter - Min_Latency else true); end; February, 2012IFIP 2012: Mike Whalen

40 Tool Chain AADL SysML-AADL translation EDICT: Architectural patterns Lute: Structural verification AGREE: Compositional behavior verification OSATE: AADL modeling Enterprise Architect Eclipse KIND SysML Lustre February, 2012IFIP 2012: Mike Whalen

February, 2012IFIP 2012: Mike Whalen41 Research Challenges

Structural and Behavioral Properties Theorem RMA foreach e in Processor_Set do Proc_Set(e) := { x in Process_Set | Is_Bound_To(x, e) } ; Threads := { x in Thread_Set | Is_Subcomponent_Of(x, Proc_Set) } check (sum (get_property_value (Threads “RTOS_properties::Utilization”)) <= (Cardinal (Threads) * (2 ** (1 / Cardinal (Threads))) -1 ) ) ; End RMA ; Assertion: My system is schedulable using Rate Monotonic Scheduling. Assertion: If a “Pump Stop” command is received, then within 1 second the measured flow rate shall be zero. PSL_contract property no_flow_after_stop : after (not (infusion_control_in.Pump_On)) (exists flow_rate_detector_out.Rate = 0 within STEPS_PER_SECOND *1) ; assert (no_flow_after_stop) ; end PSL_contract; Checkable with LuteCheckable with AGREE Structural (Non-functional) Properties: Analyze conformance, optimization properties for hardware resources and model structure. Behavioral (functional) Properties: Analyze system behavior. Behavioral properties may use structural properties.

Are these the “right” logics? Simpler logics have benefits ◦ Primary benefit: much simpler to analyze ◦ AADL error annex is (mostly) propositional  Makes analysis simpler  Supports useful categorization of errors ◦ Datalog-style logics support “timeless” analysis  The Lute checker is essentially a datalog interpreter More complicated logics are necessary for certain properties ◦ Richer types (e.g., algebraic types for XML messages) ◦ Quantification February, 2012IFIP 2012: Mike Whalen43

Dealing with Time Pure synchrony or asynchrony Uniform discrete time ◦ Choose fixed time quantum between steps ◦ This quantum need not be the same between layers ◦ Adjust process behavior and requirements with clocks. Non-uniform discrete time ◦ Calendar/Timeout automata advance system to next interesting instant Dense time February, 2012IFIP 2012: Mike Whalen44 MOST ACCURATE SIMPLEST

Scaling What do you do when systems and subcomponents have hundreds of requirements? ◦ FGS mode logic: 280 requirements ◦ DWM: >600 requirements Need to create automated slicing techniques for predicates rather than code. ◦ Perhaps this will be in the form of counterexample-guided refinement

Assigning blame Counterexamples are often hard to understand for big models It is much worse (in my experience) for property- based models Given a counterexample, can you automatically assign blame to one or more subcomponents? Given a “blamed” component, can you automatically open the black box to strengthen the component guarantee? SignalStep AD_L.pitch.val AD_L.pitch.validFALSETRUEFALSETRUE FALSE AD_R.pitch.val AD_R.pitch.validTRUEFALSETRUEFALSE TRUE AP.CSA.csa_pitch_delta AP.GC_L.cmds.pitch_delta AP.GC_L.mds.activeTRUEFALSE TRUE AP.GC_R.cmds.pitch_delta AP.GC_R.mds.activeTRUE FALSE Assumptions for APTRUE Assumptions for FCITRUE Assumptions for FGS_LTRUE Assumptions for FGS_RTRUE FGS_L.GC.cmds.pitch_delta FGS_L.GC.mds.activeFALSE TRUEFALSE FGS_L.LSO.leader FGS_L.LSO.validFALSETRUEFALSETRUE FALSE FGS_R.GC.cmds.pitch_delta FGS_R.GC.mds.activeTRUEFALSE FGS_R.LSO.leader FGS_R.LSO.validTRUEFALSETRUEFALSE TRUE leader_pitch_delta System level guaranteesTRUE FALSE February, IFIP 2012: Mike Whalen

“Argument Engineering” Disparate kinds of evidence throughout the system ◦ Probabilistic ◦ Resource ◦ Structural properties of model ◦ Behavioral properties of model How do we tie these things together? Evidence graph, similar to proof graph in PVS ◦ Shows evidential obligations that have not been discharged SRI is working on this: Evidential Tool Bus (ETB) ◦ This seems to be a reasonable approach for tying tool results together ◦ Declarative (like make or ant), but more powerful (uses Datalog) February, 2012IFIP 2012: Mike Whalen47

Integration with AADL Type representations ◦ Currently we use “homebrew” property set for typing information ◦ AADL data modeling annex? Inheritance and Refinement ◦ Extends from same AADL class ◦ Implements from different AADL class ◦ Contracts should preserve behavioral subtyping  Weaken assumptions  Strengthen guarantees ◦ Some subtleties:  For existential properties over traces (CTL), this refinement is generally unsound.  Probably only want to support universal properties (like LTL) Binding of logical system to physical system ◦ Contracts are built on many assumptions involving physical system involving resources. Currently these are not addressed in the temporal logic, but externally ◦ How do we represent physical failures in logical contracts? October 2012 AADL MeetingMike Whalen48

Conclusions AADL is very nice for designing systems ◦ Good way to describe hardware and software ◦ Lots of built-in analysis capabilities Allows new system engineering approaches ◦ Iteration between reqs and design ◦ Specification and use of architectural patterns Looking at behavioral and structural analysis ◦ Still lots of work to do! ◦..but already can do some interesting analysis with tools ◦ Sits in a nice intersection between requirements engineering and formal methods ◦ Starting to apply this to large UAV models for security properties in the SMACCM project February, 2012IFIP 2012: Mike Whalen49

50 System Architectural Modeling & Analysis System Architecture Development Software Component Development February, 2012IFIP 2012: Mike Whalen

Thank you! February, 2012IFIP 2012: Mike Whalen51