1/28/2016COSC-4301-01, Lecture 81 Real-Time Systems, COSC-4301-01, Lecture 8 Stefan Andrei.

Slides:



Advertisements
Similar presentations
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Advertisements

Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
First Order Logic Resolution
Timed Automata.
The Theory of NP-Completeness
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
The Theory of NP-Completeness
Formal Verification Group © Copyright IBM Corporation 2008 IBM Haifa Labs SAT-based unbounded model checking using interpolation Based on a paper “Interpolation.
Technion 1 (Yet another) decision procedure for Equality Logic Ofer Strichman and Orly Meir Technion.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Propositional Calculus Math Foundations of Computer Science.
Formal Analysis and Verification of Real-Time Systems Albert M. K. Cheng Real-Time Systems Laboratory University of Houston.
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
9/17/2015COSC , Lecture 131 Real-Time Systems, COSC , Lecture 13 Stefan Andrei.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
10/6/2015COSC , Lecture 11 Real-Time Systems, COSC , Lecture 1 Stefan Andrei.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Lecture 22 More NPC problems
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Logic Circuits Chapter 2. Overview  Many important functions computed with straight-line programs No loops nor branches Conveniently described with circuits.
CS6133 Software Specification and Verification
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
Pattern-directed inference systems
Logical Agents Logic Propositional Logic Summary
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
1 Parallel Model Checking Game for CTL Lecture 6 – Lecturer: Orna Grumberg.
Tommy Messelis * Stefaan Haspeslagh Patrick De Causmaecker *
Reasoning about the Behavior of Semantic Web Services with Concurrent Transaction Logic Presented By Dumitru Roman, Michael Kifer University of Innsbruk,
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 9: Test Generation from Models.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
1/30/2016COSC , Lecture 111 Real-Time Systems, COSC , Lecture 11 Stefan Andrei.
28.
Quality Assurance in the Presence of Variability Kim Lauenroth, Andreas Metzger, Klaus Pohl Institute for Computer Science and Business Information Systems.
2/16/2016COSC , Lecture 101 Real-Time Systems, COSC , Lecture 10 Stefan Andrei.
2/19/2016COSC , Lecture 91 Real-Time Systems, COSC , Lecture 9 Stefan Andrei.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Complexity of Compositional Model Checking of Computation Tree Logic on Simple Structures Krishnendu Chatterjee Pallab Dasgupta P.P. Chakrabarti IWDC 2004,
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Chapter 6: Real-Time Logic
Knowledge Representation and Reasoning
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Specification and Validation of Real-Time Programs ©A. Mok 2009
Propositional Calculus: Boolean Algebra and Simplification
Albert M. K. Cheng Real-Time Systems Laboratory and
Chapter 1: Introduction to Real-Time Systems
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Resolution Proofs for Combinational Equivalence
Back to “Serious” Topics…
Stefan Andrei1 Albert M. K. Cheng2
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Real-Time Systems, COSC , Lecture 18
Presentation transcript:

1/28/2016COSC , Lecture 81 Real-Time Systems, COSC , Lecture 8 Stefan Andrei

1/28/2016 COSC , Lecture 8 2 Reminder of the last lecture Wind River Tornado Environment

1/28/2016 COSC , Lecture 8 3 Overview of This Lecture Validation of Real-Time Systems Specification:  Real-time logic  Graph-theoretic analysis

1/28/2016 COSC , Lecture 8 4 References Chapter 6 of [Che2002] Cheng, A.M.K.: Real-time systems. Scheduling, Analysis, and Verification. Wiley-Interscience, 2002 [JaM87] Jahanian, F., Mok, A.: A Graph-Theoretic Approach for Timing Analysis and its Implementation. IEEE Transactions on Computers. Vol. C-36, No. 8, 1987 [RiC99] Rice, L.E.P., Cheng, A.M.K.: Timing Analysis of the X-38 Space Station Crew Return Vehicle Avionics. Proceedings of the 5-th IEEE-CS Real-Time Technology and Applications Symposium, pp , 1999

1/28/2016 COSC , Lecture 8 5 Specification of real-time systems Structurally and functionally specification (how the real-time system components work as well as their functions and operations):  Mechanical components  Electrical components  Electronic components Behavioral specification  Sequences of events in response to actions

1/28/2016 COSC , Lecture 8 6 Example: real-time anti-lock braking system in an automobile Structural-functional specification refers to:  Braking system components and sensors  How they are interconnected, and  How the actions of each component affects the other  Example: how to connect the wheel sensors to the central decision-making computer that controls the brake mechanism. Behavioral specification refers to:  Events and effects  Example: when the wheel sensors detect wet road conditions, the decision-making computer will instruct the brake mechanism to pump the brakes at a higher frequency within 100ms.

1/28/2016 COSC , Lecture 8 7 Timing Constraints Behavioral specification without the complexity of the structural specification often suffices; We restrict the specification language to handle only timing relations.

1/28/2016 COSC , Lecture 8 8 Specification and safety assertion An implementation of a real-time system is built from the structural-functional specification; An implementation is correct (faithful) if  the behavioral specification (denoted as SP) implies safety assertions (denoted as SA).  In other words, we have to check whether SP  SA is a theorem or not.

1/28/2016 COSC , Lecture 8 9 Verification of Timing Properties In checking SP → SA, we may have the cases:  (safe) SA is a theorem derivable from SP;  (inherently unsafe) SA is unsatisfiable with respect to SP;  (safe if additional constraints are added) the negation of SA is satisfiable under certain conditions.

1/28/2016 COSC , Lecture 8 10 Event-action model [Hen80] Heninger, K.L.: Specifying Software Requirements for Complex Systems: New Techniques and Their Applications. IEEE Trans. Software Engineering. vol. SE-6, no. 1 (1980) 2-13 Heninger captured the data dependency and temporal ordering of computational actions that must be taken in response to events in a real-time application.

1/28/2016 COSC , Lecture 8 11 Concepts of event-action model Syntax of Actions:  = | ; | “||”  Examples: TRAIN_APPROACH; DOWN_GATE is sequential execution of two primitive actions, i.e. a composite action; DOWN_GATE || RING_BELL – parallel execution of two primitive actions, i.e. a composite action; State predicate: Event x Time  Bool  Example: GATE_IS_DOWN is true if the gate is in the down position

1/28/2016 COSC , Lecture 8 12 Concepts of event-action model (cont) Event  External: APPLY_BRAKE  Start: the start of DOWN_GATE  Stop: the end of DOWN_GATE  Transition: GATE_IS_DOWN becomes true when gate is moved down Timing constraint (absolute timing of system events)  Example: the timing difference between the start and the end of DOWN_GATE may take at least 15 seconds

1/28/2016 COSC , Lecture 8 13 Real-Time Logic (RTL) Motivation: event-action model cannot be easily manipulated by a computer ([JaM87]); RTL = first-order logic with special features to capture the (absolute) timing requirements; RTL is based on the event-action Event x Occurrence  Time, where Occurrence=Nat-{0} and Time=Nat. Semantics: i) = t means the i-th occurrence of event e occurs at time t.   e  Event,  i  is defined

1/28/2016 COSC , Lecture 8 14 Real-Time Logic (cont) Three types of RTL constants:  Actions: a subaction B i of a composite action A is denoted by A.B i  Events constants are temporal markers External Events:  event-name Start Events:  event-name Stop Events:  event-name Transition Events: change in certain attributes of the system state;  Integers: used for timing constraints.

1/28/2016 COSC , Lecture 8 15 Example of a real-time system: railroad crossing Structural-functional specification:  Field measurements, mechanical characteristics of the train, train sensor, gate controller, gate; The goal of gate controller: when train is crossing the intersection, no car is on the intersection; Simplified goal (safety assertion): when train is crossing, the gate is in the down position.

1/28/2016 COSC , Lecture 8 16 Behavioral Specification (English) When train approaches sensor, a signal will initiate the lowering of gate, and Gate is moved to down position within 30s from being detected by the sensor, and The gate needs at least 15s to lower itself to the down position.

1/28/2016 COSC , Lecture 8 17 Safety Assertion (English) If  train needs at least 45s to travel from sensor to the railroad crossing, and  the train crossing is completed within 60s from being detected by sensor, then  we are assured that at the start of the train crossing, gate has moved down and  that the train leaves the railroad crossing within 45s from the time the gate has completed moving down.

1/28/2016 COSC , Lecture 8 18 Railroad crossing (animation) 60s 45s

1/28/2016 COSC , Lecture 8 19 Behavioral Specification (RTL)  x x)  DownGate, x)  DownGate, x) x) + 30 )  y  DownGate, y) + 15  DownGate, y) )

1/28/2016 COSC , Lecture 8 20 Safety Assertion (RTL)  t  u t) + 45  TrainCrossing, u)  TrainCrossing, u) t) + 60  TrainCrossing, u)  DownGate, t)  TrainCrossing, u)  DownGate, t) + 45 ) In a simplified version, we can consider u = t

1/28/2016 COSC , Lecture 8 21 Presburger Arithmetic Formulae Is built from constraints using:            A constraint is a series of expression lists, connected with:            If var is a variable, int is an integer, and e, e 1, e 2 are expressions, then var, int, e, e 1 +e 2, e 1 -e 2, int*e 2, -e and (e) are expressions; is replaced by a function f e (i), where e is an event and i is an integer or a variable.

1/28/2016 COSC , Lecture 8 22 Presburger Arithmetic Formulae Specification (SP)   x (f(x)  g 1 (x)  g 2 (x)  f(x) + 30)   y (g 1 (y) + 15  g 2 (y)) Safety Assertion (SA)   t  u ( f(t) + 45  h 1 (u)  h 2 (u) < f(t) + 60  g 2 (t)  h 1 (u)  h 2 (u)  g 2 (t) + 45 )

1/28/2016 COSC , Lecture 8 23 Restricted RTL formulas The problem SP  SA is in general undecidable for the full set of RTL formulas [JaM87] motivated that RTL formulas of many real- time systems:  Consist in arithmetic inequalities involving two terms and an integer constant in which a term is either a variable or a function (difference constraints)  Do not contain arithmetic expressions that have a function taking an instance of itself as an argument  [WaM94] Wang, F., Mok, A. K.: RTL and Refutation by Positive Cycles. Proceedings of Formal Methods Europe Symposium, 873, Lecture Notes in Computer Science, pp , 1994

1/28/2016 COSC , Lecture 8 24 The path-RTL formulas [JaM87, WaM94] The general form of path-RTL formulas: functionOccurrence  integerConstant  functionOccurrence Industrial real-time systems:  Railroad crossing [JaM87], [JaS88], [Che2002]  Moveable control rods in a reactor [JaM87]  Boeing 777 Integrated Airplane Information Management System [MTR96]  X-38, an autonomous spacecraft build by NASA [RiC99]

1/28/2016 COSC , Lecture 8 25 References This kind of Presburger Formulas was studied in many papers, such as:  [Pug94] Pugh, W.: Counting Solutions to Presburger Formulas: How and Why. PLDI’94. ACM SIGPLAN 94-6/94 (1994)  [LLPY97] Larsen, K.G., Larsson, F., Pettersson, P., Yi, W.: Efficient Verification of Real-Time Systems: Compact Data Structure and State-Space Reduction. IEEE RTSS’97, CS Press (1997)  [Min2001] Min é, A.: A New Numerical Abstract Domain Based on Difference-Bound Matrices. Program as Data Objects II. LNCS 2053 (2001)

1/28/2016 COSC , Lecture 8 26 Behavioral Specification implies Safety Assertions SP  SA is tautology iff  (SP  SA) is unsatisfiable;  (SP  SA)   (  SP  SA)  SP    SA Therefore, SP  SA is tautology iff SP    SA is unsatisfiable.

1/28/2016 COSC , Lecture 8 27 Clausal Form Specification (SP):   x  y (f(x)  g 1 (x)  g 2 (x) - 30  f(x)  g 1 (y) + 15  g 2 (y)) Negation of Safety Assertions (  SA):  t  u (f(t) + 45  h 1 (u)  h 2 (u) < f(t) + 60  (h 1 (u) < g 2 (t)  g 2 (t) + 45 < h 2 (u)));  Skolem normal form of RTL formulas [T/t][U/u]: f(T) + 45  h 1 (U)  h 2 (U) – 59  f(T)  (h 1 (U) + 1  g 2 (T)  g 2 (T) + 46  h 2 (U))

1/28/2016 COSC , Lecture 8 28 [JaM87] Strategy F – the initial RTL Formula; F’ – the corresponding Presburger Formula; F’’ – the Clausal Formula corresponding to SP    SA, that is: C 1  C 2  …  C n, where C i = L i,1  L i,2  …  L i,n and each L i,j has the general form: v 1   I  v 2, I being a positive integer constant.

1/28/2016 COSC , Lecture 8 29 Constraint Graph Construction For each literal v 1  I  v 2, we construct a node labeled v 1, a node labeled v 2, and an edge with weight  I from node v 1 to node v 2 ; If the constraint graph contains a cycle with positive weight, then F’’ is unsatisfiable.

1/28/2016 COSC , Lecture 8 30 Railroad Crossing Constraint Graph (animation) f(x) g 1 (x) 0 15 g 2 (x) h 1 (U) f(T) h 2 (U) g 2 (T) 1

1/28/2016 COSC , Lecture 8 31 Positive cycles lead to unsatisfiability Let X i,1, X i,2,…, X i,n i the i-th positive cycle. The sum of weights of edges is positive, so P i =X i,1  X i,2  …  X i,n i is unsatisfiable ([JaM87]); therefore,  P i is tautology; Therefore, F’’ is (un)satisfiable iff F’’  {  P i | for all positive cycle i} is (un)satisfiable;

1/28/2016 COSC , Lecture 8 32 Railroad Crossing Satisfiability A= f(x)  g 1 (x) B= g 2 (x) - 30  f(x) C= g 1 (y) + 15  g 2 (y) D= f(T) + 45  h 1 (U) E = h 2 (U) – 59  f(T) F = h 1 (U) + 1  g 2 (T) G = g 2 (T) + 46  h 2 (U) F’’ has the positive clauses: A, B, C, D, E, F  G

1/28/2016 COSC , Lecture 8 33 Positive cycles lead to unsatisfiability (cont) A positive/negative clause contains only positive/negative literals (for example, F  G is a positive clause, whereas  B    D    F is a negative clause); F’’ contains positive clauses corresponding to all edges, and negative clauses corresponding to a positive cycle; The CNF satisfiability is NP-complete even if each clause is positive or negative ([JaM87]).

1/28/2016 COSC , Lecture 8 34 Railroad Crossing Satisfiability (cont) Three positive cycles in the constraint graph imply that F’’ has the negative clauses:   B    D    F   F    G    E    D   A    C    G    E

1/28/2016 COSC , Lecture 8 35 Search tree The Resolution Method works for F’’, but it is not so efficient; More efficient, [JaM87] transformed the set of negative clauses from conjunctive normal form into disjunctive normal form; This corresponds to a tree, where each leaf will be checked to at least one positive clause or by itself; By considering the negation of unitary clauses as early as possible, the strategy of building the tree can be improved even more.

1/28/2016 COSC , Lecture 8 36 Search tree for Railroad Crossing root BB DD FF FF DD EE GG AA EE GG CC F’’ = A  B  C  D  E  (F  G)  (  B    D   F)  (  F    G    E    D)  (  A    C    G   E) F’’ is unsatisfiable, so SP  SA is tautology;

1/28/2016 COSC , Lecture 8 37 Conclusions of Part 1 So far, the presentation was based on [JaM87] and [Che2002]; We discuss another strategy based on counting the number of true instances of F’’. This will tell us how “far away” is the current specification from satisfying the safety assertion; The addition of a new positive cycle may result from a modification of the specification and/or safety assertions. This is useful for incremental debugging, in which bugs in problematic areas are fixed one at a time until the system is correct. Special thanks to Professor Albert CHENG

1/28/2016 COSC , Lecture 8 38 Summary Real-time logic Graph-theoretic analysis

1/28/2016 COSC , Lecture 8 39 Reading suggestions From [Cheng; 2002]  Chapter 6, sections 6.1, 6.2

1/28/2016 COSC , Lecture 8 40 Coming up next Counting true instances Incremental verification of the real-time systems specifications  Andrei, S., Chin, W.-N.: Incremental Satisfiability Counting for Real-Time Systems. The 10 th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS’04), Toronto, Canada, 25 May – 28 May, , 2004RTAS’04

1/28/2016 COSC , Lecture 8 41 Thank you for your attention! Questions?