Program correctness Branching-time temporal logics

Slides:



Advertisements
Similar presentations
Tutorial I – An Introduction to Model Checking Peng WU INRIA Futurs LIX, École Polytechnique.
Advertisements

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.
1 Computation Tree Logic (CTL). 2 CTL Syntax P - a set of atomic propositions, every p  P is a CTL formula. f, g, CTL formulae, then so are  f, f 
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
François Fages MPRI Bio-info 2006 Formal Biology of the Cell Modeling, Computing and Reasoning with Constraints François Fages, Constraints Group, INRIA.
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.
CS6133 Software Specification and Verification
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.
1 Temporal Claims A temporal claim is defined in Promela by the syntax: never { … body … } never is a keyword, like proctype. The body is the same as for.
卜磊 Transition System. Part I: Introduction  Chapter 0: Preliminaries  Chapter 1: Language and Computation Part II: Models  Chapter.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar D D.
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.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
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.
1 CTL Model Checking David L. Dill. 2 CTL syntax: AP -- atomic propositions p  AP is a formula f  g is a formula, if f and g are ¬f is a formula AX.
¹ -Calculus Based on: “Model Checking”, E. Clarke and O. Grumberg (ch. 6, 7) “Symbolic Model Checking: 10^20 States and Beyond”, Burch, Clark, et al “Introduction.
Review of the automata-theoretic approach to model-checking.
ESE601: Hybrid Systems Introduction to verification Spring 2006.
Witness and Counterexample Li Tan Oct. 15, 2002.
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.
1 Carnegie Mellon UniversitySPINFlavio Lerda Bug Catching SPIN An explicit state model checker.
A Simple Model Checker for CTL. The problem n We need efficient algorithms to solve the problems [1]M,s  [2]M,s  where M should have finitely many states,
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.
1 Introduction to SMV and Model Checking Mostly by: Ken McMillan Cadence Berkeley Labs Small parts by: Brandon Eames ISIS/Vanderbilt.
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.
Survey on Trace Analyzer (2) Hong, Shin /34Survey on Trace Analyzer (2) KAIST.
Automatic Verification of Finite-State Concurrent Systems Using Temporal Logic Specifications 1.
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
Lecture 81 Optimizing CTL Model checking + Model checking TCTL CS 5270 Lecture 9.
CS 267: Automated Verification Lecture 3: Fixpoints and Temporal Properties Instructor: Tevfik Bultan.
卜磊 Transition System. Definitions and notations Reactive System The intuition is that a transition system consists of a set of possible.
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.
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.
Complexity of Compositional Model Checking of Computation Tree Logic on Simple Structures Krishnendu Chatterjee Pallab Dasgupta P.P. Chakrabarti IWDC 2004,
Basic concepts of Model Checking
CTL model checking algorithms
CIS 842: Specification and Verification of Reactive Systems
Semantically Equivalent Formulas
CSCI1600: Embedded and Real Time Software
CSEP590 – Model Checking and Automated Verification
Formal Methods in software development
Software Verification 2 Automated Verification
Formal Methods in software development
CSCI1600: Embedded and Real Time Software
Computer Security: Art and Science, 2nd Edition
CSCI1600: Embedded and Real Time Software
Program correctness SAT and its correctness
Translating Linear Temporal Logic into Büchi Automata
Introduction to verification
Program correctness Axiomatic semantics
Formal Methods in software development
Program correctness Linear Time Temporal Logic
Formal Methods in software development
Model Checking CS 680 Formal Methods Jeremy Johnson.
Program correctness Model-checking CTL
Instructor: Aaron Roth
Model Checking Graph Grammars
Presentation transcript:

Program correctness Branching-time temporal logics Spring 2007 Program correctness Branching-time temporal logics  Marcello Bonsangue

CTL CTL = Computational Tree Logic the temporal combinators are under the immediate scope of the path quantifiers Why CTL? The truth of CTL formulas depends only on the current state and not on the current execution! Benefit: easy and efficient model checking Disadvantages: hard for describing individual path Slide 2

The language Path quantifiers allows to speaks about sets of executions. The model of time is tree-like: many futures are possible from a given state Inevitably A from the current state all executions satisfy  Possibly E from the current state there exists an execution satisfying  Slide 3

CTL - Syntax  ::= p1 | p2 | … T |  |  |    |    |    | AX | AF | AG | A[ U ] | EX | EF | EG | E[ U ] . Slide 4

AGp1  EGp2 is not the same as AG(p1EGp2) CTL - Priorities Unary connectives bind most tightly , AG, EG, AF, EF, AX, and EX Next come , and  Finally come, AU and EU Example: AGp1  EGp2 is not the same as AG(p1EGp2) Slide 5

CTL - yes or no? Yes No Yes or no? EFE[p U q] A[p U EF q] EF(p U q) FG p Yes or no? AG(p  A[p U (p  A[p U q])]) AF[(p U q)  (q U p)] Slide 6

A is not G A states that all the executions starting from the current state will satisfy  G state that  holds at every state of the execution considered A and E quantify over paths in a tree G and F quantify over positions along a given path in a tree Slide 7

Combining E and F (I) EF “it is possible that  will hold in the future”  Slide 8

Combining E and F (II) “it is possible that  will always hold” EG=EF “it is possible that  will always hold”    Slide 9

Combining E and F (III) AF=EF “it is inevitable that  will hold in the future”    Slide 10

Combining E and F (IV) “ is always true” AG=EF In this case  is an invariant, that is, a property that is true continuously Slide 11

Example All executions starting from 0 satisfy AFEXerror Why? Because from 0 all executions traverse 1 and may go to 2 There exists an execution which does not satisfy AFAXerror. Which one? 1 ok 2 error warm, ok Slide 12

Examples AGEF Along every execution (A) from every state (G) it is possible (E) that we will encounter a state (F) satisfying  that is,  is always reachable Slide 13

We will define it by induction CTL - Satisfaction Let M = <S,,l> be a transition system with l(s) the set of atomic propositions satisfied by a state s S. Idea for a model: A CTL formula refers to a given state of a given transition system M,s   means “ is true at state s” We will define it by induction on the structure of  Slide 14

CTL - Semantics (I) M,s  T for all s in S M,s  p iff p  l(s) M,s   iff not M,s   M,s  1  2 iff M,s  1 and M,s  2 : Slide 15

CTL - Semantics (II) M,s  AX iff for all s’ such that s  s’ we have M,s’   M,s  EX iff there exists s’ such that s  s’ and M,s’   Slide 16

CTL - Semantics (III) M,s  AG iff for all executions s0  s1  s2  s3 … with s = s0 we have M,si   M,s  EG iff there exists an execution s = s0 and such that M,si   Slide 17

CTL - Semantics (IV) M,s  AF iff for all executions s0s1s2s3 … with s = s0 there is i such that M,si   M,s  EF iff there exists an execution s0s1s2s3… with s=s0 and there is i such that M,si   Slide 18

CTL - Semantics (V) M,s  A[1U2] iff for all executions ss1s2s3 … there is i such that M,si  2 and for each j < i M,sj  1 M,s  E[1U2] iff there exists an execution ss1s2s3… and there is i such that M,si  2 and for each j < i M,sj  1 Slide 19

CTL equivalences De Morgan-based Until reduction AF  EG EF  AG AX  EX X-self duality: on a path each state has a unique successor Until reduction AF  A[T U ] EF  E[T U ] Slide 20

CTL: Adequate sets of connectives Theorem: The set of operators T,, , {AX or EX}, {EG,AF or AU}, and EU is adequate for CTL. A[U]  (E[ U(  )]  EG ) Slide 21

CTL: Weak until and release Use LTL equivalence to define: A[R]  E[U ] E[R]  A[U ] A[W]  A[R(  )] E[W]  E[R(  )] Slide 22

Other CTL equivalences EG    EX EG AG    AX AG AF    AX AF EF    EX EF A[U]    (  AXA[U]) E[U]    (  EXE[U]) PenC - Spring 2006 Slide 23

CTL* - Syntax State formulas (evaluated in states)  ::= T | p |  |    | A | E Path formulas (evaluated along paths)  ::=  |   |    | X | F | G |  U Slide 24

Examples AGF Along every execution (A) from every state (G) we will encounter a state (F) satisfying  that is,  is satisfied infinitely often Slide 25

Model Let M = <S,,l> be a transition system with l(s) the set of atomic propositions satisfied by a state s S. Idea for a model: A formula of temporal logic refers to an instant i of an execution  of a transition system M M,,i   means “ is true at position i of path  of M” Slide 26

Semantics (I) M,,i  T always M,,i  p iff p  l((i)) M,,i   iff not M,,i   M,,i  1  2 iff M,,i  1 and M,,i  2 Slide 27

Semantics (II) M,,i  X iff M,,i+1   M,,i  F iff there exists ij such that M,,j   M,,i  G iff M,,j  for all ij M,,i  1U2 iff there exists ij such that M,,j  2 and for all ik<j we have M,,k  1 Slide 28

Semantics (III) M,,i  E iff there exists ’ such that (0)... (i)= ’(0)... ’(i) and M,’,i   M,,i  A iff for all ’ such that (0)... (i) = ’(0)... ’(i) we have M,’,i   Slide 29

 ::= T | p |  |    | A | E LTL and CTL  CTL* Semantically, an LTL formula  is equivalent to the CTL* formula A CTL is a restricted fragment of CTL* with path formulas  ::= X | F | G |  U  and the same state formulas as CTL*, i.e.  ::= T | p |  |    | A | E PenC - Spring 2006 Slide 30

Expressivity CTL* CTL LTL 1 2 3 4 Slide 31

In CTL but not in LTL 1 = AG EF p in CTL From any state we can always get to a state in which p holds M’ M s s s’ p p p It cannot be expressed as LTL formula  because All executions starting from s in M’ are also executions starting from s in M In CTL M,s  1 but M’,s  1 Slide 32

In CTL and in LTL 2 = AG(p  AFq) in CTL and 2 = G(p  Fq) in LTL “Any p is eventually followed by a q” Slide 33

In LTL but not in CTL 3 = GFp  Fq in LTL “If p holds infinitely often along a path, then there is a state in which q holds” Note: FGp is different from AFAGp since the first is satisfied in whereas the latter is not (starting from s). s s’ p p s’’ Slide 34

Neither in CTL nor in LTL 4 = E(GFp) in CTL* “There is a path with infinitely many state in which p holds” Not expressible in LTL: Trivial Not expressible in CTL: very complex Slide 35

Boolean combination of path in CTL CTL = CTL* but Without boolean combination of path formulas Without nesting of path formulas The first restriction is not real … E[Fp  Fq]  EF[p  EFq]  EF[q  EFp] First p and then q or viceversa PenC - Spring 2006 Slide 36

More generally … E[(pUq)]  E[ qU(p  q)]  EG q E[(p1Uq1)  (p2Uq2)]  E[(p1p2)U(q1  E[p2Uq2])]  E[(p1p2)U(q2  E[p1Uq1])] E[Fp  Gq]  E[q U (p  EG q)] E[Xp]  EXp E[Xp  Xq]  EX(p  q) E[Fp  Xq]  EX(q  EFp) A[]   E[ ] PenC - Spring 2006 Slide 37

Past operators analogues of ------------------------------------------------- Previous P X neXt Since S U Until Once O F Future Historically H G Globally In LTL they do not add expressive power, but CTL they do! PenC - Spring 2006 Slide 38