Witness and Counterexample Li Tan Oct. 15, 2002.

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.
Tutorial I – An Introduction to Model Checking Peng WU INRIA Futurs LIX, École Polytechnique.
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.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.
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.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar.
CS6133 Software Specification and Verification
Determinization of Büchi Automata
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.
 Dr. Vered Gafni 1 LTL Decidability Enables consistency check, but also base for verification.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: Property checking Property checking.
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.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture # 11.
© 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.
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.
ESE601: Hybrid Systems Introduction to verification Spring 2006.
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.
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.
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)
LTL – model checking Jonas Kongslund Peter Mechlenborg Christian Plesner Kristian Støvring Sørensen.
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.
1 Introduction to SMV and Model Checking Mostly by: Ken McMillan Cadence Berkeley Labs Small parts by: Brandon Eames ISIS/Vanderbilt.
Model Checking Lecture 4 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
Model Checking Lecture 3 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
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.
Automatic Verification of Finite-State Concurrent Systems Using Temporal Logic Specifications 1.
CIS 842: Specification and Verification of Reactive Systems Lecture Specifications: LTL Model Checking Copyright , Matt Dwyer, John Hatcliff,
1 Bisimulations as a Technique for State Space Reductions.
Four Lectures on Model Checking Tom Henzinger University of California, Berkeley.
卜磊 Transition System. Definitions and notations Reactive System The intuition is that a transition system consists of a set of possible.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Validation - Formal verification -
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.
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.
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.
Complexity of Compositional Model Checking of Computation Tree Logic on Simple Structures Krishnendu Chatterjee Pallab Dasgupta P.P. Chakrabarti IWDC 2004,
15-820A 1 LTL Model Checking A Flavio Lerda.
CIS 842: Specification and Verification of Reactive Systems
CSEP590 – Model Checking and Automated Verification
Automatic Verification of Industrial Designs
Formal Methods in software development
CSCI1600: Embedded and Real Time Software
Translating Linear Temporal Logic into Büchi Automata
Introduction to verification
Formal Methods in software development
Formal Methods in software development
Program correctness Branching-time temporal logics
Model Checking CS 680 Formal Methods Jeremy Johnson.
Presentation transcript:

Witness and Counterexample Li Tan Oct. 15, 2002

Witness and Counterexample Informal Definition Recall the model checking problem M ² , 1. A witness W should be a subsystem of M s.t. W ² . $W$ should be small. M is a witness of , but it is useless. 2. Witness should show the evidence why M ² . Any system of which $W$ is a subsystem should satisfy . To show $M ²  $, it is enough to show The relation between M and W. 3. Viability. 1. Completeness. 1. Each formula in the targeting logic should have a well-defined witness if it is satisfied by the model. 2. Simple and Efficient. 1. Witness should be verified and analyzed efficiently. 3. Effectiveness. 1. There exists an effective algorithm for generating the witness.

Witness and Counterexample Informal Definition 1. Counterexample is just the dual of witness. 1. C is an counterexample for M ²  iff C is a witness of M ² : . 2. An counterexample always exists if 1. The logic is complete under negation, i.e.,  2 L ) :  2 L 1. The definition of witness is complete in L. 3. The mechanism for generating witness/counterexample are same. 1. For history reason, many model checker like SMV and SPIN only use the notion of counterexample. 2. Our reference to witness/counterexample will be chose depending on the context.

Witness and Counterexample Why we need them? 1. Counterexample can be used for, 1. Debugging the design. 2. Counterexample-based abstract refinement. 1. The abstraction is conservative 1. It may cause the false alarm. 2. A counterexample is generated after checking the abstract system, if it is, 1. A real trace, then model checker terminates with “no”. 2. Not a real trace, then refine the abstract ( add more predicators etc), and re-do the model checking. 2. Witness can be used for, 1. Enable efficiently checking the correctness. 1. Verifying result=Verifying the property on witness+prove that a witness is a subsystem of model. 2. Generating tests. 1. Any system contains the witness should possess the property.

Witness and Counterexample Formal Definition Informal definition is ambiguous, What is a context of definition? => Fix a logic What is a “subsystem”? => Define a preordering Á on Transition system. Definition [Natural Preorder of Logic] Let L be a temporal logic, a preordering Á L on Kripke structures are a nature such that for every f 2 L, if T ² f and T Á L T’, then T’ ² f. Definition [Witness and Counterexample] Let Á be a natural preordering for the logic L ( : L ), C is a witness(or, counterexample) for M ² f s.t. in L if C ²  (C ² :  ) C Á M. Our mission: fix L, then find Á.

Witness and Counterexample Kripke Structure and CTL* Definition [Kripke Structure] Transition System will be modeled as Kripke structure K = where, S is the set of states. s 0 2 S is a starting state. ! µ S £ S is transition relation. A is the set of atomic proposition. V : A ! 2 S is the evulation for atomic proposition.

Witness and Counterexample CTL*: Syntax Formulae in Computational Tree Logic (CTL*) are syntactically constructed by, S ::= a | : a| S Æ S | S Ç S | A P | E P P ::= S | P Æ P | P Ç P | X P | P U P | P R P S is a state formula, and P is a path formula. A (for all the paths), and E (exists a path) are the path quantifier. U and R are the “until” and “release” operators. X is the “next time” operator. CTL* formula is a state formula. Sometimes, we write G P (always hold) for false R P, and F P ( Eventually hold) for true U P

Witness and Counterexample Semantics of path formulae

Witness and Counterexample Semantics of state formulae 1. s ² T a if s 2 V (s) 2. s ² T : a if s  V (s) 3. s ² A P if  ² P for every path  from s. 4. s ² E P if there exists a  from s such that  ² P

Witness and Counterexample LTL, CTL, and ACTL 1. Linear Temporal Logic (LTL) is sublogic of CTL* which contains no path quantifier. 1. Semantically LTL formula f = CTL* formula Af. 2. Intuitively LTL check all the possible paths simultaneously. 2. CTL is sublogic of CTL* such that each temporal operator (X, U, R) must be immediately preceded by a path quantifier. 3. ACTL is a sublogic of CTL in which only path quantifier permitted is A.

Witness and Counterexample An example 1. Does T satisfy LTL F(G : y)? 2. Does T satisfy ACTL AF( : y Æ AX : X)? x, y y s0s0 s2s2 s1s1

Witness and Counterexample Counterexample in LTL Customizing the definition of counterexample, 1. Fix the logic: LTL 2. Fix the preordering relation Á : language inclusion 2 Definition Let f be a LTL formula, a path  is a linear counterexample for model-checking problem M ² f if  ² : f and  2 L(M). Is the definition viable?  2 L(T) => T ² : f, why? Is the definition complete? If M ² f, then we can always find a  2 L(M) as a counterexample, why?

Witness and Counterexample LTL model checking via Büchi automaton A generalized Büchi automaton is a tuple where, 1. Q is the set of states with q 0 as the starting state. 2. ! µ Q £ Q is the transition relation. 3. l: Q ! {a, : a, Æ, Ç, <>, []} 4. F µ 2 Q is Büchi acceptance condition.

Witness and Counterexample Büchi automaton as the temporal specification 1. G T, B ={ S, !, L} is the product graph for B and T if, 1. S = S £ Q U {true, false} 2. If q ! q’ and 1. l(q) 2 { Ç, Æ }, !. 2. l(q) = <> ([]), ! for some (all) s ! s’. 3. l(q) = a ( : a), ! (s 2 a ?)( : (s 2 a ?)) 3. L( )= Ç for l(q) 2 { Ç, <>} and L( )= Æ otherwise.

Witness and Counterexample Büchi automaton-based model checking 1. B accepts T if there is a successful run in G T, B, 1. A run of G T, B is a subgraph such that keeps one (all) child(ren) if L(q)= Ç (L(q)= Æ ). 2. A run is successful if, 1. All the leaf are true, and 2. Any infinite path in a run visits some nodes in F infinitely often, for every F 2 F. 2. Searching for a (un)successful run, 1. Mark all the leaves with true/false depending on the labeling, then propagate the values. 2. For the nodes in a strong connected component, marking the nodes as true/false depending on the coverage of SCC on F, then propagate the values. 3. Eventually, all the nodes will be marked as true/false.

Witness and Counterexample An example <> Æ Ç y q0q0 q 1 q2q2 q3q3 q4q4 q5q5 Æ F ={{q 1, q 2, q 4 }} x, y y s0s0 s2s2 s1s1

Witness and Counterexample s 0, q 2 \or true s 1, q 0 Æ s 0,q 0 Æ s 0, q 1 Ç s 0, q 3 Ç s 0, q 4 Æ s 1, q 1 Ç s 1, q 3 Æ s 1, q 4 Ç s 1, q 2 Ç s 2,q 0 Æ s 2, q 1 Ç s 2, q 3 Æ s 2, q 4 Ç false s 2, q 2 Ç

Witness and Counterexample s 0, q 2 \or true s 1, q 0 Æ s 0,q 0 Æ s 0, q 1 Ç s 0, q 3 Ç s 0, q 4 Æ s 1, q 1 Ç s 1, q 3 Æ s 1, q 4 Ç s 1, q 2 Ç s 2,q 0 Æ s 2, q 1 Ç s 2, q 3 Æ s 2, q 4 Ç false s 2, q 2 Ç

Witness and Counterexample Translate a LTL to a “never claim” BTA Construct BTA for : f by,

Witness and Counterexample Translate a LTL (cont.) 2. For each  = P 1 U P 2, there is a F 2 F such that F={q| (   q Æ X   q) or P 2 2 q} Basically F won’t contain any nodes of a loop on which P 1 U P 2 will produce itself. ) \cP_2 will eventually be satisfied.

Witness and Counterexample Translate F( G : y) : A (F (G : y))=E(G(F y)) <> Æ Ç y q0q0 q 1 q2q2 q3q3 q4q4 q5q5 Æ F ={{q 1, q 2, q 4 }} E(G(F y)) = E(G(F y)) E(XG(F y), F y ) E(XG(F y), y) E(XG(F y), XF y ) E(XG(F y))

Witness and Counterexample Step 1: find a successful run true s 0,q 0 Æ s 0, q 1 Ç s 0, q 4 Æ s 1, q 1 Ç s 1, q 3 Æ s 1, q 2 Ç s 2,q 0 Æ s 2, q 1 Ç s 2, q 4 Ç

Witness and Counterexample Step 2: Get the skeleton Remove branches like (s, q) ! (s’, q’) such that (s, q) is a leaf and l(q’)  {<>, []} s 0,q 0 Æ s 0, q 1 Ç s 0, q 4 Æ s 1, q 1 Ç s 1, q 3 Æ s 1, q 2 Ç s 2,q 0 Æ s 2, q 1 Ç s 2, q 4 Ç

Witness and Counterexample Step 3: Unroll the skeleton and get a path. (s 0, q 0 ) (s 0, q 1 ) (s 0, q 4 ) {(s 1,q 1 )(s 1, q 3 )(s 1, q 2 )(s 2, q 0 )(s 2, q 1 )(s 2, q 4 )}  S 0 S 0 S 0 S 1 S 1 S 1 S 2 S 2 S 2

Witness and Counterexample Step 4: Eliminate the redundancy Remove (s’, q’) from ……(s, q)(s’, q’) …… if l(q)  {<>, []} or (s, q) is the head of the path. (s 0, q 0 ) (s 0, q 1 ) (s 0, q 4 ) {(s 1,q 1 )(s 1, q 3 )(s 1, q 2 )(s 2, q 0 )(s 2, q 1 )(s 2, q 4 )}  (s 0, q 0 ) {(s 1,q 1 ) (s 2, q 0 ) }   S 0 { S 1 S 2 } 

Witness and Counterexample Is there a witness /counterexamples for CTL* Any Kripke structure which are not bi- similar are distinguishable by a CTL* formula [Mil71]. => Let Á be a nature order for CTL, then T 1 Á T 2 iff T 1 bisimulates T 2. => The witness(counterexample) for any $T ² f$ must bisimulate T. Since bisimularity on KS is similar to is isomorphism in graphics. => The witness and counterexample is trivial in CTL*

Witness and Counterexample Is there a witness /counterexamples for CTL*? Any Kripke structure which are not bi- similar are distinguishable by a CTL* formula [Mil71]. => Let Á be a nature order for CTL, then T 1 Á T 2 iff T 1 bisimulates T 2. => The witness(counterexample) for any T ² f must also bisimulate T. Since bisimularity on KS is basically the isomorphism in graphics. => The witness and counterexample is trivial in CTL*

Witness and Counterexample Counterexample for ACTL* Simulation preordering is a nature preordering for ECTL* => Counterexample for ACTL* is a well-defined. Most of desirable safeness and fairness properties can be expressed in ACTL* Definition [Simulation Preordering Á sim ] Á sim is a simulation preordering on T iff for every s Á sim s 1 and s ! s’, there exists a s 1 ! s’ 1 such that s’ Á sim s’ 1 T 1 Á sim T 2 if s 1 0 Á sim s 2 0, where s 1 0 and s 2 0 are the starting states of T 1 and T 2

Witness and Counterexample Tree-like Counterexample for ACTL* Let f be a ACTL* formula and M ² : f, then there exists a tree-like Kripke structure C Á sim M such that C ² : f [CJLV02]. C is a tree-like Kripke structure if, Its (strongly-connected) component graph is a tree Only strongly-connected components permitted in C are circles.

Witness and Counterexample An example ² : AF( : y Æ AX : X)? x, y y s0s0 s2s2 s1s1 y y s’ 0 s’ 2 s’ 1 x s’ 3 ² : AF( : y Æ AX : X)? Á sim

Witness and Counterexample Generating Tree-like Counterxample for M ² f …Similar to generate a linear counterexample for LTL! 1. Constructing a BTA B for : f. 2. Find a successful run in G M, B. 3. Get the skeleton of the run by cutting out any node (s’, q’) s.t. (s’, q’) is the only child of its father (s, q) and l(q)  { Æ, Ç }. 4. Eliminate the redundancy and project the skeleton to states.

Witness and Counterexample If we’ve know, ² AF( : y Æ AX : X)? x, y y s0s0 s2s2 s1s1 y y s’ 0 s’ 2 s’ 1 x s’ 3 is a tree-like counterexample for

Witness and Counterexample … and want to prove, ² : AF( : y Æ AX : X) x, y y s0s0 s2s2 s1s1 y

Witness and Counterexample We only need to show, x, y y s0s0 s2s2 s1s1 y y y s’ 0 s’ 2 s’ 1 x s’ 3 Á sim