Specification Formalisms Book: Chapter 5. Properties of formalisms Formal. Unique interpretation. Intuitive. Simple to understand (visual). Succinct.

Slides:



Advertisements
Similar presentations
Modeling Software Systems Lecture 2 Book: Chapter 4.
Advertisements

Model Checking and Testing combined
Automatic Verification Book: Chapter 6. How can we check the model? The model is a graph. The specification should refer the the graph representation.
Modeling issues Book: chapters 4.12, 5.4, 8.4, 10.1.
Language and Automata Theory
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Part 3: Safety and liveness
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.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Temporal Logic and the NuSMV Model Checker CS 680 Formal Methods Jeremy Johnson.
UPPAAL Introduction Chien-Liang Chen.
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.
Spin Tutorial (some verification options). Assertion is always executable and has no other effect on the state of the system than to change the local.
Introduction to Computability Theory
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture # 11.
Infinite Automata -automata is an automaton that accepts infinite strings A Buchi automaton is similar to a finite automaton: S is a finite set of states,
CSE 555 Protocol Engineering Dr. Mohammed H. Sqalli Computer Engineering Department King Fahd University of Petroleum & Minerals Credits: Dr. Abdul Waheed.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Specification Formalisms Book: Chapter 5. Properties of formalisms Formal. Unique interpretation. Intuitive. Simple to understand (visual). Succinct.
Modeling Software Systems Lecture 2 Book: Chapter 4.
Review of the automata-theoretic approach to model-checking.
Normal forms for Context-Free Grammars
ESE601: Hybrid Systems Introduction to verification Spring 2006.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
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 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
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.
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
Finite-State Machines with No Output
Basics of automata theory
Compiler Construction Lexical Analysis. The word lexical means textual or verbal or literal. The lexical analysis implemented in the “SCANNER” module.
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.
Language: Set of Strings
Recognizing safety and liveness Presented by Qian Huang.
LTL Model Checking 张文辉
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
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.
Model Checking Lecture 1. Model checking, narrowly interpreted: Decision procedures for checking if a given Kripke structure is a model for a given formula.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
From Natural Language to LTL: Difficulties Capturing Natural Language Specification in Formal Languages for Automatic Analysis Elsa L Gunter NJIT.
Presented by: Belgi Amir Seminar in Distributed Algorithms Designing correct concurrent algorithms Spring 2013.
About Alternating Automata Daniel Choi Provable Software Laboratory KAIST.
Overview of Previous Lesson(s) Over View  A token is a pair consisting of a token name and an optional attribute value.  A pattern is a description.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
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.
Formal methods: Lecture
Non Deterministic Automata
Semantically Equivalent Formulas
Automatic Verification
Program Synthesis is a Game
Finite Automata & Regular Languages
Chapter 2 FINITE AUTOMATA.
Alternating tree Automata and Parity games
CSE322 Definition and description of finite Automata
Non Deterministic Automata
Instructor: Aaron Roth
Translating Linear Temporal Logic into Büchi Automata
Presentation transcript:

Specification Formalisms Book: Chapter 5

Properties of formalisms Formal. Unique interpretation. Intuitive. Simple to understand (visual). Succinct. Spec. of reasonable size. Effective. Check that there are no contradictions. Check that the spec. is implementable. Check that the implementation satisfies spec. Expressive. May be used to generate initial code. Specifying the implementation or its properties?

A transition system A (finite) set of variables V. A set of states . A (finite) set of transitions T, each transition e  t has an enabling condition e and a transformation t. An initial condition I. Denote by R(s, s’) the fact that s’ is a successor of s.

The interleaving model An execution is a finite or infinite sequence of states s 0, s 1, s 2, … The initial state satisfies the initial condition, i.e., I(s 0 ). Moving from one state s i to s i+1 is by executing a transition e  t: e(s i ), i.e., s i satisfies e. s i+1 is obtained by applying t to s i.

LTL: Syntax  ::= (  ) | ¬  |  Æ   Ç  U   ¤  }  |O  | p ¤  Always  ( = “Henceforth  ”) }  Eventually  (= “  in the future”) O  “next-time  ”  U  “  until  ”  W  “  Waiting for  ”

Semantics ¤         }  O   U   W  U  Ç ¤ 

Combinations ¤} p “p will happen infinitely often” }¤ p “p will happen from some point forever”. ( ¤} p) --> ( ¤} q) “If p happens infinitely often, then q also happens infinitely often”.

A Spring Example s1s3s2 pull release extended malfunction r0 = s1 s2 s1 s2 s1 s2 s1 … r1 = s1 s2 s3 s3 s3 s3 s3 … r2 = s1 s2 s1 s2 s3 s3 s3 … …

LTL satisfaction by a single sequence malfunction s1s3s2 pull release extended r2 = s1 s2 s1 s2 s3 s3 s3 … r2 ² extended ?? r2 ² O extended ?? r2 ² O O extended ?? r2 ² } extended ?? r2 ² ¤ extended ?? r2 ² } ¤ extended ?? r2 ² } ¤ malfunction ?? r2 ² ¬ } ¤ extended ?? r2 ² (¬extended) U malfunction ?? r2 ² ¤ (¬extended ! O extended) ??

LTL satisfaction by a system malfunction s1s3s2 pull release extended A ² extended ?? A ² O extended ?? A ² O O extended ?? A ² } extended ?? A ² ¤ extended ?? A ² } ¤ extended ?? A ² } ¤ malfunction ?? A ² ¬ } ¤ extended ?? A ² (¬extended) U malfunction ?? A ² ¤ (¬extended->O extended) ?? A:

Automata over finite words A=  Alphabet (finite). S: States (finite).  : S x  x S ) S is the transition relation. I µ S are the Initial states. F µ S are the Final (accepting) states. A A B B S0 S1

Equivalently: A Kripke structure A convenient model for describing reactive systems There exists a 1-1 translation between a Kripke structure and an automaton A= S: States (finite).  µ S x S is the transition relation. I µ S are the Initial states. L: S ) 2 AP (where AP is a set of atomic propositions) S0 S1

The transition relation (S0, A, S0) (S0, B, S1) (S1, A, S0) (S1, B, S1) A A B B S0 S1

A run over a word A word over , e.g., ABAAB. A sequence of states, e.g. S0 S0 S1 S0 S0 S1. Starts with an initial state. Accepting if ends at accepting state. A A B B S0 S1

The language of an automaton The words that are accepted by the automaton. Includes AABBBA, ABBBBA. Does not include ABAB, ABBB. What is the language? A A B B S0 S1

Nondeterministic automaton Transitions: (S0,A,S0), (S0,B,S0), (S0,A,S1),(S1,A,S1). What is the language of this automaton? A,B A A S0 S1

Equivalent deterministic automaton A,B A A S0 S1 B A A S0 S1 B

Automata over infinite words Similar definition. Runs on infinite words over . Accepts when an accepting state occurs infinitely often in a run. A A B B S0 S1

Automata over infinite words Consider the word A B A B A B A B… There is a run S0 S0 S1 S0 S1 S0 S1 … This run is accepting, since S0 appears infinitely many times. A A B B S0 S1

Other runs For the word B B B B B… the run is S0 S1 S1 S1 S1… and is not accepting. For the word A A A B B B B B …, the run is S0 S0 S0 S0 S1 S1 S1 S1 … What is the run for A B A B B A B B B …? A A B B S0 S1

Nondeterministic automaton What is the language of this automaton? What is the LTL specification if B = (pc 0 =cr 0 ), A=¬B? A,B A A S0 S1

Specification using Automata Let each letter correspond to some propositional property. Example: A = P0 enters critical section B = P0 does not enter critical section. ¤ } pc 0 =cr 0 B A A B S0 S1

Mutual Exclusion ð ¬(pc 0 =cr 0 Æ pc 1 =cr 1 ) A: pc 0 =cr 0 Æ pc 1 =cr 1 B: ¬(pc 0 =cr 0 Æ pc 1 =cr 1 ) C: TRUE B A C S0 S1

L 0 :While True do nc 0 :wait (Turn=0); cr 0 :Turn=1 T0:pc 0 =L 0 ! pc 0: =nc 0 T1:pc 0 =nc 0 Æ Turn=0 ! pc 0 :=cr 0 T2:pc 0 =cr 0 ! (pc 0,Turn):=(L 0,1) T3:pc 1 =L 1 ! pc 1 =nc 1 T4:pc 1 =nc 1 Æ Turn=1 ! pc 1 :=cr 1 T5:pc 1 =cr 1 ! (pc 1,Turn):=(L 1,0) Initially: pc 0 =L 0 Æ pc 1 =L 1 L 1 :While True do nc 1 :wait (Turn=1); cr 1 :Turn=0 || Possible transitions:

The state space Turn=0 L 0,L 1 Turn=0 L 0,nc 1 Turn=0 nc 0,L 1 Turn=0 cr 0,nc 1 Turn=0 nc 0,nc 1 Turn=0 cr 0,L 1 Turn=1 L 0,cr 1 Turn=1 nc 0,cr 1 Turn=1 L 0,nc 1 Turn=1 nc 0,nc 1 Turn=1 nc 0,L 1 Turn=1 L 0,L 1

Turn=0 L 0,L 1 Turn=0 L 0,nc 1 Turn=0 nc 0,L 1 Turn=0 cr 0,nc 1 Turn=0 nc 0,nc 1 Turn=0 cr 0,L 1 Turn=1 L 0,cr 1 Turn=1 nc 0,cr 1 Turn=1 L 0,nc 1 Turn=1 nc 0,nc 1 Turn=1 nc 0,L 1 Turn=1 L 0,L 1 ð : (pc 0 =cr 0 Æ pc 1 =cr 1 )

Turn=0 L 0,L 1 Turn=0 L 0,nc 1 Turn=0 nc 0,L 1 Turn=0 cr 0,nc 1 Turn=0 nc 0,nc 1 Turn=0 cr 0,L 1 Turn=1 L 0,cr 1 Turn=1 nc 0,cr 1 Turn=1 L 0,nc 1 Turn=1 nc 0,nc 1 Turn=1 nc 0,L 1 Turn=1 L 0,L 1 ð (Turn=0 ! } Turn=1)

Correctness condition We want to find a correctness condition for a model to satisfy a specification. Language of a model: L(Model) Language of a specification: L(Spec). We need: L(Model)  L(Spec).

Correctness All sequences Sequences satisfying Spec Program executions

Incorrectness All sequences Sequences satisfying Spec Program executions Counter examples