Algorithmic Software Verification



Similar documents
Introduction to Software Verification

logic language, static/dynamic models SAT solvers Verified Software Systems 1 How can we model check of a program or system?

Automata-based Verification - I

Software Modeling and Verification

Model Checking: An Introduction

Formal Verification and Linear-time Model Checking

Today s Agenda. Automata and Logic. Quiz 4 Temporal Logic. Introduction Buchi Automata Linear Time Logic Summary

On the Modeling and Verification of Security-Aware and Process-Aware Information Systems

Formal Verification of Software

Testing LTL Formula Translation into Büchi Automata

Software Model Checking: Theory and Practice

Runtime Verification - Monitor-oriented Programming - Monitor-based Runtime Reflection

Journal of Mathematics Volume 1, Number 1, Summer 2006 pp

T Reactive Systems: Introduction and Finite State Automata

Static Program Transformations for Efficient Software Model Checking

Model Checking II Temporal Logic Model Checking

tutorial: hardware and software model checking

The Model Checker SPIN

Fundamentals of Software Engineering

Model checking test models. Author: Kevin de Berk Supervisors: Prof. dr. Wan Fokkink, dr. ir. Machiel van der Bijl

LTL Model Checking with Logic Based Petri Nets

Formal Verification by Model Checking

Development of dynamically evolving and self-adaptive software. 1. Background

Temporal Logics. Computation Tree Logic

Software Engineering using Formal Methods

CHAPTER 7 GENERAL PROOF SYSTEMS

The Halting Problem is Undecidable

Automata-Based Verification of Temporal Properties on Running Programs Dimitra Giannakopoulou Klaus Havelund

Program Synthesis is a Game

Model Checking LTL Properties over C Programs with Bounded Traces

Fabio Patrizi DIS Sapienza - University of Rome

Software Verification and Testing. Lecture Notes: Temporal Logics

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:

Software Reliability: Runtime Verification

Introduction to Logic in Computer Science: Autumn 2006

The Classes P and NP

Model Checking of Software

Software Model Checking: Theory and Practice

Analysis of Boolean Programs

Runtime Verification for Real-Time Automotive Embedded Software

Verification of hybrid dynamical systems

Validated Templates for Specification of Complex LTL Formulas

Monitoring Metric First-order Temporal Properties

How To Compare A Markov Algorithm To A Turing Machine

Constructing Automata from Temporal Logic Formulas : A Tutorial

Verifying Real-Time Embedded Software by Means of Automated State-based Online Testing and the SPIN Model Checker Application to RTEdge Models

Feature Specification and Automated Conflict Detection

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

A Classification of Model Checking-based Verification Approaches for Software Models

Specification and Analysis of Contracts Lecture 1 Introduction

Path Querying on Graph Databases

Informatique Fondamentale IMA S8

An Overview of the Runtime Verification Tool Java PathExplorer

Fixed-Point Logics and Computation

The Ultimate Undecidability Result for the Halpern Shoham Logic

A Continuous Truth Domain for Runtime Verification

CS510 Software Engineering

Formal Verification of Computer Systems - (INFO-F-412)

A Propositional Dynamic Logic for CCS Programs

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

2. The Language of First-order Logic

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 4 Nancy Lynch

Institut für Parallele und Verteilte Systeme. Abteilung Anwendersoftware. Universität Stuttgart Universitätsstraße 38 D Stuttgart

From Workflow Design Patterns to Logical Specifications

CISC422/853: Formal Methods

Foundational Proof Certificates

Rigorous Software Development CSCI-GA

Logic in general. Inference rules and theorem proving

EQUATIONAL LOGIC AND ABSTRACT ALGEBRA * ABSTRACT

Theoretical Computer Science (Bridging Course) Complexity

6.080/6.089 GITCS Feb 12, Lecture 3

Formal Verification Problems in a Bigdata World: Towards a Mighty Synergy

Lecture 2: Universality

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Reachability in Succinct and Parametric One-Counter Automata

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)

A first step towards modeling semistructured data in hybrid multimodal logic

CS Master Level Courses and Areas COURSE DESCRIPTIONS. CSCI 521 Real-Time Systems. CSCI 522 High Performance Computing

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

Lecture 9 verifying temporal logic

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

Transcription:

Algorithmic Software Verification (LTL Model Checking) Azadeh Farzan

What is Verification Anyway? Proving (in a formal way) that program satisfies a specification written in a logical language. Formal models for programs. Logics for specifications. Algorithms for checking the model against the specification.

First Step: We need a formal model!

Finite State Machines F SM =(Σ, X, {D x } x X, Q, Q 0, λ, δ) Σ X D x Q Q 0 Q λ δ Q Σ Q finite set of actions. finite set of variables. domain of x for all x X. finite set of states. set of initial states. q (x D x ) transition relation.

Extended Finite State Machines EF SM =(Σ, X, {D x } x X, L, L 0, G, δ) Σ X D x L L 0 L G δ finite set of actions. finite set of variables. domain of x for all x X. finite set of control locations. set of initial locations. predicates (guards) over variables. transition relation.

Kripke Structures An FSM where: D x = {true, false}

Kripke Structures An FSM where: D x = {true, false} In short: M =(Q, Q 0, AP, L : Q 2 AP, δ)

Reachability in FSMs Problem: given an FSM, and a target set T, is T reachable from Q 0. Solution?

Reachability in FSMs Problem: given an FSM, and a target set T, is T reachable from Q 0. Solution? Depth First Search, in O(n) time.

Reachability in FSMs Problem: given an FSM, and a target set T, is T reachable from Q 0. Solution? Depth First Search, in O(n) time. DFS(q) Add q to visited_states; for each q such that q -a-> q if q in T print "YES!"; halt; else if q not in visited_states DFS(q )

Model Checking FSMs Given an FSM M for the model and an FSM S for the specification: Question: Is every behavior of M a behavior of S? L(M) L(S) Solvable in PSpace: linear in M and exponential in S.

Exercise I 3 cannibals and 3 missionaries are on the left side of a river. There is 1 boat that can carry two people. (The boat of course needs to be ferried by at least one person). If at any point, there are more cannibals than missionaries on one bank, the cannibals eat the missionaries. Model all the possibilities of movement between the banks using an EFSM. The EFSM should have at least two locations, one for the configurations where the boat is on the left bank, and one for configurations where it is on the right. Also, model it such that checking whether all of them can get safely across to the right side reduces to reachability in the model.

Temporal Logic (A language for writing specifications) Language for describing properties of infinite sequences. Extension of propositional logic (or firstorder logic). Uses temporal operators to describe sequencing properties.

Temporal Logic Interpreted on sequences of states. Each state in the sequence gives a truth value to atomic propositions. Temporal operators indicate in which states the formula should be interpreted.

Temporal Operators (Next) formula is true in the next state. : (eventually) formula is true in some future state. : (Always) formula is true in all future states. U: (Until) binary operator. R: (Release) binary operator.

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Examples p,q p, q p,q p,q p,q p q (p q) (p q) p ( p q)

Temporal Logic (Syntax) true, false,p, or p where p P is an atomic proposition. φ 1 φ 2 or φ 1 φ 2, where φ 1 and φ 2 are LTL formulas. φ 1, φ 1 U φ 2, or φ 1 R φ 2, where φ 1 and φ 2 are LTL formulas.

Temporal Logic (Syntax) true, false,p, or p where p P is an atomic proposition. φ 1 φ 2 or φ 1 φ 2, where φ 1 and φ 2 are LTL formulas. φ 1, φ 1 U φ 2, or φ 1 R φ 2, where φ 1 and φ 2 are LTL formulas. Two useful abbreviations:

Temporal Logic (Syntax) true, false,p, or p where p P is an atomic proposition. φ 1 φ 2 or φ 1 φ 2, where φ 1 and φ 2 are LTL formulas. φ 1, φ 1 U φ 2, or φ 1 R φ 2, where φ 1 and φ 2 are LTL formulas. Two useful abbreviations: φ = true U φ φ = false R φ

Temporal Logic (Semantics) The semantics of LTL is defined with respect to paths. For a path π : N 2 P, let π i represent the suffix of π when the first i states are removed.

Temporal Logic (Semantics) The semantics of LTL is defined with respect to paths. For a path π : N 2 P, let π i represent the suffix of π when the first i states are removed. For all π, we have π = true and π = false.

Temporal Logic (Semantics) The semantics of LTL is defined with respect to paths. For a path π : N 2 P, let π i represent the suffix of π when the first i states are removed. For all π, we have π = true and π = false. π = p iff p π(0).

Temporal Logic (Semantics) The semantics of LTL is defined with respect to paths. For a path π : N 2 P, let π i represent the suffix of π when the first i states are removed. For all π, we have π = true and π = false. π = p iff p π(0). π = p iff p π(0).

Temporal Logic (Semantics) The semantics of LTL is defined with respect to paths. For a path π : N 2 P, let π i represent the suffix of π when the first i states are removed. For all π, we have π = true and π = false. π = p iff p π(0). π = p iff p π(0). π = φ 1 φ 2 iff π = φ 1 and π = φ 2.

Temporal Logic (Semantics)

Temporal Logic (Semantics) π = φ 1 φ 2 iff π = φ 1 or π = φ 2.

Temporal Logic (Semantics) π = φ 1 φ 2 iff π = φ 1 or π = φ 2. π = φ iff π 1 = φ.

Temporal Logic (Semantics) π = φ 1 φ 2 iff π = φ 1 or π = φ 2. π = φ iff π 1 = φ. π = φ 1 U φ 2 iff i 0 such that π i = φ 2 and 0 j < i, we have π j = φ 1.

Temporal Logic (Semantics) π = φ 1 φ 2 iff π = φ 1 or π = φ 2. π = φ iff π 1 = φ. π = φ 1 U φ 2 iff i 0 such that π i = φ 2 and 0 j < i, we have π j = φ 1. π = φ 1 R φ 2 iff i 0 such that π i = φ 2, 0 j < i such that π j = φ 1.

Negation?

Negation? π = φ iff π = ( φ 1 )

Negation? π = φ iff π = ( φ 1 ) π = φ 1 U φ 2 iff π = ( φ 1 ) R( φ 2 )

Negation? π = φ iff π = ( φ 1 ) π = φ 1 U φ 2 iff π = ( φ 1 ) R( φ 2 ) π = φ 1 R φ 2 iff π = ( φ 1 ) U( φ 2 )

But, how do I get an FSM from a formula???

From LTL to Automata Given a LTL formula φ built from a set of atomic propositions construct an automaton on infinite words over the alphabet that accepts exactly the infinite sequences satisfying. φ 2 P P

From LTL to Automata Given a LTL formula φ built from a set of atomic propositions construct an automaton on infinite words over the alphabet that accepts exactly the infinite sequences satisfying. φ 2 P P Example: p

From LTL to Automata Given a LTL formula φ built from a set of atomic propositions construct an automaton on infinite words over the alphabet that accepts exactly the infinite sequences satisfying. φ 2 P P Example: p, {p} {p}

Tutorial on Büchi Automata