CS6133 Software Specification and Verification

Slides:



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

Model Checking Lecture 2. Three important decisions when choosing system properties: 1automata vs. logic 2branching vs. linear time 3safety vs. liveness.
Metodi formali dello sviluppo software a.a.2013/2014 Prof.Anna Labella.
CS 267: Automated Verification Lecture 2: Linear vs. Branching time. Temporal Logics: CTL, CTL*. CTL model checking algorithm. Counter-example generation.
M ODEL CHECKING -Vasvi Kakkad University of Sydney.
Algorithmic Software Verification VII. Computation tree logic and bisimulations.
Partial Order Reduction: Main Idea
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
Temporal Logic and the NuSMV Model Checker CS 680 Formal Methods Jeremy Johnson.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar.
UPPAAL Introduction Chien-Liang Chen.
Model Checking Inputs: A design (in some HDL) and a property (in some temporal logic) Outputs: Decision about whether or not the property always holds.
卜磊 Transition System. Part I: Introduction  Chapter 0: Preliminaries  Chapter 1: Language and Computation Part II: Models  Chapter.
/ PSWLAB Efficient Decentralized Monitoring of Safety in Distributed System K Sen, A Vardhan, G Agha, G Rosu 20 th July 2007 Presented by.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar D D.
Review of topics Final exam : -May 2nd to May 7 th - Projects due on May 7th.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
1 Temporal Logic u Classical logic:  Good for describing static conditions u Temporal logic:  Adds temporal operators  Describe how static conditions.
© Katz, 2007CS Formal SpecificationsLecture - Temporal logic 1 Temporal Logic Formal Specifications CS Shmuel Katz The Technion.
CSE 555 Protocol Engineering Dr. Mohammed H. Sqalli Computer Engineering Department King Fahd University of Petroleum & Minerals Credits: Dr. Abdul Waheed.
Temporal Specification Chris Patel Vinay Viswanathan.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
© Betty HC Cheng. This presentation is available free for non-commercial use with attribution under a creative commons license. Acknowledge: S.
Temporal Logic and Model Checking. Reactive Systems We often classify systems into two types: Transformational: functions from inputs available at the.
Witness and Counterexample Li Tan Oct. 15, 2002.
Review of the automata-theoretic approach to model-checking.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
ESE601: Hybrid Systems Introduction to verification Spring 2006.
Witness and Counterexample Li Tan Oct. 15, 2002.
System Design Research Laboratory Specification-based Testing with Linear Temporal Logic Li Tan Oleg Sokolsky Insup Lee University of Pennsylvania.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Flavio Lerda 1 LTL Model Checking Flavio Lerda. 2 LTL Model Checking LTL –Subset of CTL* of the form: A f where f is a path formula LTL model checking.
1 Temporal Logic-Overview FM Temporal Logic u Classical logic: Good for describing static conditions u Temporal logic: Adds temporal operators Describe.
15-820A 1 LTL to Büchi Automata Flavio Lerda A 2 LTL to Büchi Automata LTL Formulas Subset of CTL* –Distinct from CTL AFG p  LTL  f  CTL. f.
Specification Patterns Early taxonomy for property specifications –safety properties: nothing bad will ever happen –liveness properties: something good.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used.
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
1 Bisimulations as a Technique for State Space Reductions.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Lecture 81 Optimizing CTL Model checking + Model checking TCTL CS 5270 Lecture 9.
卜磊 Transition System. Definitions and notations Reactive System The intuition is that a transition system consists of a set of possible.
Defining Liveness by Bowen Alpern and Fred B. Schneider Presented by Joe Melnyk.
Verification & Validation By: Amir Masoud Gharehbaghi
Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 9, 2003.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Today’s Agenda  Quiz 4  Temporal Logic Formal Methods in Software Engineering1.
6/12/20161 a.a.2015/2016 Prof. Anna Labella Formal Methods in software development.
Model Checking Lecture 2. Model-Checking Problem I |= S System modelSystem property.
Model Checking Lecture 2 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
Basic concepts of Model Checking
CIS 842: Specification and Verification of Reactive Systems
Semantically Equivalent Formulas
Software Verification 2 Automated Verification
CSCI1600: Embedded and Real Time Software
CSEP590 – Model Checking and Automated Verification
Formal Methods in software development
Formal Methods in software development
Computer Security: Art and Science, 2nd Edition
CSCI1600: Embedded and Real Time Software
Introduction to verification
Formal Methods in software development
Program correctness Linear Time Temporal Logic
Formal Methods in software development
Program correctness Branching-time temporal logics
Model Checking Graph Grammars
CSE 503 – Software Engineering
Presentation transcript:

CS6133 Software Specification and Verification Lecture 3 Temporal Logic

Temporal Logic: Overview Temporal Logic was designed for expressing the temporal ordering of events and states within a logical framework State is an assignment of values to the model’s variables. Intuitively, the system state is a snapshot of the system’s execution, in which every variable has some value Event is a trigger (e.g., signal) that can cause a system to change its state and won’t persist CS6133

Trace In temporal logic, the notion of exact time is abstracted away In temporal logic, we keep track of changes to variable values and the order in which they occur A trace σ is an infinite sequence of states that represents a particular execution of the system starts from an initial state s0, which is determined by the initials values of all the variables σ = s0, s1, s2, …… CS6133

Linear Temporal Logic Formula In linear temporal logic (LTL), a formula f is evaluated with respect to a trace σ and a particular state sj in that trace CS6133

LTL Characteristics Time is totally ordered CS6133

LTL Characteristics Time is bounded in the past and unbounded in the future CS6133

LTL Characteristics Time is discrete CS6133

Future Temporal Operators Future temporal operators are shorthand notations that quantify over states CS6133

Henceforth CS6133

Eventually CS6133

Next State CS6133

Until CS6133

Unless CS6133

Examples CS6133

LTL Properties Safety property can be expressed by a temporal formula of the form Response property can be expressed by a temporal formula of the form Precedence (a happens before b happens) CS6133

LTL Properties Precedence Chain (a before b before c) CS6133

LTL Properties P between Q and R or CS6133

Example: A Telephone System Given the predicates CS6133

Examples Using Future Operators I Formalize the following sentences in LTL A user always needs to pick up the phone before dialing After picking up the phone, the user eventually either goes back on hook or dials Whenever a user dialed a number and heard the ring tone, a connection will only result after the other user picks up the phone Immediately after the callee hangs up on a connection, the caller will hear an idle tone, then, the caller will hear a dial tone CS6133

Examples Using Future Operators II Formalize the properties of the elevator in LTL The elevator will eventually terminate, with its doors closed. The elevator shall not keep its doors open indefinitely. Pressing the button at floor 2 guarantees that the elevator will arrive at floor 2 and open its doors. Pressing the button at any floor guarantees that the elevator will arrive at that floor and open its doors. The elevator will not arrive at a floor and open its doors unless it is called. CS6133

Past Temporal Operators Past temporal operators are shorthand notations that quantify over states Past temporal operators are a symmetric counterpart to each of the future temporal operators Has-always-been Once Previous Since Back-to CS6133

Has-always-been f  T if f is true in the current and all past system states F otherwise f iff i. 0  i  j  f f S0 Sj CS6133

Once f  T if f is true in the current or some past system state F otherwise f iff  i. 0  i  j  f f OR S0 Sj f S0 Sj CS6133

Previous f  T if f is true in the previous system state F otherwise f iff  i. i  j -1  f f S0 Sj-1 Sj CS6133

Since f g  T if once g was true and f has been true since the last g to the present F otherwise f g iff k. 0  k  j  g  i. k  i  j  f g f S0 Sk Sk+1 Sj CS6133

Back-to f g  T if f has-always- been true or f since g F otherwise f g iff f g  f f OR S0 Sj f g S0 Sk Sk+1 Sj CS6133

Examples Using Past Operators Formalize the following sentences in LTL When a caller hears the dial tone, the caller must have picked up the phone When the callee hears the ring, a caller must dial the callee’s number and hasn’t hanged up Whenever a user dialed a number and heard the ring tone, a connection is established if the other user picks up the phone CS6133

Linear vs. Branching Views Two ways to think about the computations of reactive system Linear time: LTL Branching time: computation tree logic (CTL) A CTL formula is true/false relative to a state where as an LTL formula is true/false relative to a path CS6133

CTL There are future temporal operators of LTL There are also path quantifiers to describe the branching structure of a computation tree: A and E A means for all computation paths E means for some computation paths CS6133

CTL Syntax If p is an atomic proposition, and f1 and f2 are CTL formulae, then the set of CTL formulae consists of 1. p 2. ¬f1, f1 ∧ f2, f1 ∨ f2, f1 ⇒ f2 3. AX f1, EX f1 4. AG f1, EG f1 5. AF f1, EF f1 6. A [f1Uf2], E [f1Uf2] Note that the path quantifiers and temporal operators are always paired together CS6133

CTL Semantics AX f if on all paths starting at state s, f holds in the next state EX f if there exists a path starting at state s on which f holds at the next state. CS6133

CTL Semantics EF f if f is reachable (i.e., if there exists a path starting at state s, on which f holds in some future state). AF f if f is inevitable (i.e., if on all paths that start at state s, f holds in some future state). CS6133

CTL Semantics EG f if there exists a path starting at state s, on which f holds globally. AG f if f is invariant (i.e., if on all paths that start at state s, f holds globally). CS6133

CTL Semantics E[g U f] if there exists a path starting at state s, on which g holds until f eventually holds. A[g U f] if on all paths that start at state s, g holds until f eventually holds. CS6133

Example of CTL Formulas “It is possible to get to a state where started holds, but ready does not hold.” “For any state, if a request occurs, then it will eventually be acknowledged.” “It is always the case that a certain process is enabled infinitely often on every computation path.” CS6133

LTL vs. CTL In LTL, we could write: FG p There is no equivalent of this formula in CTL. In CTL, we could write: AG EF p There is no equivalent of this formula in LTL. CS6133