LTL – model checking Jonas Kongslund Peter Mechlenborg Christian Plesner Kristian Støvring Sørensen.

Slides:



Advertisements
Similar presentations
Model Checking Lecture 3. Specification Automata Syntax, given a set A of atomic observations: Sfinite set of states S 0 Sset of initial states S S transition.
Advertisements

Model Checking Lecture 2. Three important decisions when choosing system properties: 1automata vs. logic 2branching vs. linear time 3safety vs. liveness.
1 Reasoning with Promela Safety properties bad things do not happen can check by inspecting finite behaviours Liveness properties good things do eventually.
Translating from logic to automata Book: Chapter 6.
Model Checking and Testing combined
Black Box Checking Book: Chapter 9 Model Checking Finite state description of a system B. LTL formula. Translate into an automaton P. Check whether L(B)
Automatic Verification Book: Chapter 6. How can we check the model? The model is a graph. The specification should refer the the graph representation.
CS 267: Automated Verification Lecture 2: Linear vs. Branching time. Temporal Logics: CTL, CTL*. CTL model checking algorithm. Counter-example generation.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Partial Order Reduction: Main Idea
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
CS 290C: Formal Models for Web Software Lecture 3: Verification of Navigation Models with the Spin Model Checker Instructor: Tevfik Bultan.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
UPPAAL Introduction Chien-Liang Chen.
CS 267: Automated Verification Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking.
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.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Temporal Logic u Classical logic:  Good for describing static conditions u Temporal logic:  Adds temporal operators  Describe how static conditions.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture # 11.
CSE 555 Protocol Engineering Dr. Mohammed H. Sqalli Computer Engineering Department King Fahd University of Petroleum & Minerals Credits: Dr. Abdul Waheed.
Specification Formalisms Book: Chapter 5. Properties of formalisms Formal. Unique interpretation. Intuitive. Simple to understand (visual). Succinct.
1 Carnegie Mellon UniversitySPINFlavio Lerda SPIN An explicit state model checker.
On-the-fly Model Checking from Interval Logic Specifications Manuel I. Capel & Miguel J. Hornos Dept. Lenguajes y Sistemas Informáticos Universidad de.
1 Translating from LTL to automata Book: Chapter 6.
Witness and Counterexample Li Tan Oct. 15, 2002.
Specification Formalisms Book: Chapter 5. Properties of formalisms Formal. Unique interpretation. Intuitive. Simple to understand (visual). Succinct.
Review of the automata-theoretic approach to model-checking.
Witness and Counterexample Li Tan Oct. 15, 2002.
Automata and Formal Lanugages Büchi Automata and Model Checking Ralf Möller based on slides by Chang-Beom Choi Provable Software Lab, KAIST.
1 Translating from LTL to automata. 2 Why translating? Want to write the specification in some logic. Want to check that an automaton (or a Kripke structure)
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
The Model Checker SPIN Written by Gerard J. Holzmann Presented by Chris Jensen.
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.
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.
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
Lexical Analysis — Part II: Constructing a Scanner from Regular Expressions Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.
Basics of automata theory
Model Checking Lecture 3 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
Languages of nested trees Swarat Chaudhuri University of Pennsylvania (with Rajeev Alur and P. Madhusudan)
Lexical Analysis — Part II: Constructing a Scanner from Regular Expressions.
Lexical Analysis Constructing a Scanner from Regular Expressions.
CIS 842: Specification and Verification of Reactive Systems Lecture Specifications: LTL Model Checking Copyright , Matt Dwyer, John Hatcliff,
Copyright , Doron Peled and Cesare Tinelli. These notes are based on a set of lecture notes originally developed by Doron Peled at the University.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
Recognizing safety and liveness Presented by Qian Huang.
LTL Model Checking 张文辉
Verification & Validation By: Amir Masoud Gharehbaghi
Constraints Assisted Modeling and Validation Presented in CS294-5 (Spring 2007) Thomas Huining Feng Based on: [1]Constraints Assisted Modeling and Validation.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CS 203: Introduction to Formal Languages and Automata
Translating from logic to automata (Book: Chapter 6)
NPC.
Variants of LTL Query Checking Hana ChocklerArie Gurfinkel Ofer Strichman IBM Research SEI Technion Technion - Israel Institute of Technology.
From Natural Language to LTL: Difficulties Capturing Natural Language Specification in Formal Languages for Automatic Analysis Elsa L Gunter NJIT.
About Alternating Automata Daniel Choi Provable Software Laboratory KAIST.
Today’s Agenda  Quiz 4  Temporal Logic Formal Methods in Software Engineering1.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
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,
Automatic Verification
An explicit state model checker
Translating Linear Temporal Logic into Büchi Automata
Chapter 1 Regular Language
Presentation transcript:

LTL – model checking Jonas Kongslund Peter Mechlenborg Christian Plesner Kristian Støvring Sørensen

Overview System Model Büchi automaton (A sys ) Negation of property PLTL-formula (  ) Normal-form formula Graph Generalised Büchi automaton Büchi automaton (A  ) Product automaton (A sys  A  ) State space Checking emptiness Yes!No! Model checker

Büchi Automata Def.: Labelled Büchi Automaton

Büchi Automata 2 Def.: Run of a LBA

Büchi Automata 3 Example: Σ={a,b,c,d,e} {a,d}{b} {c} (a|d)(bc + ) ω

Büchi Automata 4 For each PLTL formula φ one can construct an LBA A φ s.t. L ω (A φ ) is the sequences of sets of atomic propositions that satisfy φ. Let Σ=2 AP where AP is the set of atomic propositions.

Büchi Automata 5 Def.: Generalised LBA

Getting Normal Eliminate F and G operators Make negations adjacent to atomic propositions Example: LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty?

Past operators do not add any expressive power to LTL Why are they useful? Past operators are not easy expressed with future operators Getting Normal 2 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty?

Past operators does not add any expressive power to LTL Why are they useful? Past operators are not easy to translate to normal form Possible exponential blowup Getting Normal 3 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty?

Normal Form → GLBA LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Overall idea: A node in the graph represents a state, an edge represent a step forward in time. Each node contains formulas that must be true at this time; view these formulas as proof obligations: Atomic propositions: check for contradictions Conjunctions: check both clauses Disjunctions: split into two nodes and allow a nondeterministic choice Next: Push proof obligation to the successors Until and its evil twin: unfold recursively on demand

Accept states 1 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Definition of strict p U q: Sooner or later, q must happen! {{q}, {p, q}}Ø {{p}, {p, q}} (Remember, every run is accepted, since the set of accept sets is empty)

Accept states 2 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Definition of strict p U q: Sooner or later, q must happen! {{q}, {p, q}}Ø {{p}, {p, q}} Problem: The automaton accepts p ω !

Accept states 3 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Definition of strict p U q: Sooner or later, q must happen! {{q}, {p, q}}Ø {{p}, {p, q}} Solution: Insert accept states to break the cycle (not needed for U).

Un-generalizing GLBAs 1 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? The generated automaton may have more than one set of accept states (one for each ‘until’ in the original formula):

Un-generalizing GLBAs 2 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Duplicate automaton. When leaving an accept state, jump to next automaton. Keep only one set of accept states.

Un-generalizing GLBAs 3 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Duplicate automaton. When leaving an accept state, jump to next automaton. Keep only one set of accept states.

Un-generalizing GLBAs 4 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Duplicate automaton. When leaving an accept state, jump to next automaton. Keep only one set of accept states.

Un-generalizing GLBAs 5 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Duplicate automaton. When leaving an accept state, jump to next automaton. Keep only one set of accept states.

Combining the two LBAs 1 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Wanted: an automaton accepting the intersection of the two languages: x

Combining the two LBAs 2 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? By the ordinary DFA product construction: Problem: Requires accept states to be visited at the same time.

Combining the two LBAs 3 LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? Solution: Use a GLBA with two accept sets, then reduce to an LBA.

The emptiness problem LTL → Normal Form → GLBA → LBA → LBA × LBA → Empty? How do we do it? Find an appropriate cycle in the LBA – if no such cycle exists, the language is empty. Why does this work? Theorem 17. Seriously, why? In order for the language to be non-empty, there must be an infinite run of the automaton that visits an accept state infinitely often. This means that there has to be a reachable cycle containing an accept state.

Overview System Model Büchi automaton (A sys ) Negation of property PLTL-formula (  ) Normal-form formula Graph Generalised Büchi automaton Büchi automaton (A  ) Product automaton (A sys  A  ) State space Checking emptiness Yes!No! Model checker

The state space Example int i; proctype P1(){ do ::true -> atomic(if::(i i=i+1 fi) od } proctype P2(){ do ::true -> atomic(if::(i!=2) -> i=2 ::else -> i=0 fi) od } init{i=0; run(P1); run(P2);}

The state space 2 A state –all global vars. –local vars. and program counter in all processes State space: all possible simulations from the initial state State space must be finite

The state space 3 i=0 i=1i=2 P1 and P2 enabled P2 enabled

Convert states to proposition tables –Get all propositions from the LTL expression –In each state Change the lable to the set of all satisfied propositions State space → LBA

Propositions: p:= (i <= 0) q:= (i == 1) r:= (i >= 2) State space → LBA 2 i=0 i=1i=2 p q r

State space → LBA 3 Make all paths infinite Make all states accepting –Product is now normal DFA product

The rest Is in chapter 5

References G. J. Holzmann: An improved protocol reachability analysis technique. O. Lichtenstein, A. Pnueli: The glory of the past. R. Gerth et al.: Simple on-the-fly automatic verification of linear temporal logic. K. Etessami, G. J. Holzmann: Optimizing Büchi automata. A. M. Mikkelsen: On-the-fly model checking in Design/CPN. G. J. Holzmann: The model checker SPIN.

Exercises Exercises 8, 9, 10 (s 3 should be s 2 ), 12 Derive the semantics of U from the semantics of U, and give an intuitive explanation.