Top Banner
Review of the automata- theoretic approach to model-checking
25

Review of the automata-theoretic approach to model-checking.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Review of the automata-theoretic approach to model-checking.

Review of the automata-theoretic approach to model-checking

Page 2: Review of the automata-theoretic approach to model-checking.

Overview*

• Kripke structures

• Temporal logics: LTL, CTL, CTL*

• From LTL to Buchi automata

• Model checking

*Thanks for borrowed slides: Orna Grumberg, Ken McMillan

Page 3: Review of the automata-theoretic approach to model-checking.

Program verification Given a program and a specification,

does the program satisfy the specification?

Not decidable!

We restrict the problem to a decidable one:• Finite-state abstractions• Propositional temporal logics

Page 4: Review of the automata-theoretic approach to model-checking.

Model Checking

MC

G(p -> F q)yes

nop

q

p

q

temporal formula

finite-state model

algorithm

counterexample

Model must now represent all behaviors

Page 5: Review of the automata-theoretic approach to model-checking.

Finite state systems

• Hardware designs• Communication protocols• High level description of non finite state systems• Web service abstractions

Page 6: Review of the automata-theoretic approach to model-checking.

Properties in temporal logic

• mutual exclusion: always ( cs1 cs2)

• non starvation: always (request eventually grant)

• communication protocols: ( get-message) until send-message

Page 7: Review of the automata-theoretic approach to model-checking.

Kripke structures

• A Kripke structure (S,AP,R,L) consists of– set of states S, atomic propositions AP– set of transitions R SS– labeling L SAP

• Example: Kripke model of a program

p prepeat p := true; p := false;end

Page 8: Review of the automata-theoretic approach to model-checking.

Kripke structure / transition system

a,b a

ab,c

c

a,c a,bb

Page 9: Review of the automata-theoretic approach to model-checking.

=s0s1s2... is a run in M from s iff

s = s0 and for every i0: (si,si+1)R

How to specify properties of runs:

temporal logics!

Page 10: Review of the automata-theoretic approach to model-checking.

Linear temporal logic: LTL

AP – a set of atomic propositions

LTL: propositional logic + temporal operators

Gp

Fp

Xp

pUq

Page 11: Review of the automata-theoretic approach to model-checking.

Examples of LTL properties

• x=a y=b XXXX z=a+b• pay B deliver B: “before”• liveness: “if input, then eventually output”

G (input F output)• strong fairness: “infinitely sent implies infinitely

received”

GF send GF receive

Page 12: Review of the automata-theoretic approach to model-checking.

Branching time logics: CTL, CTL*

• Model of time is a tree, not a sequence• Path quantifiers A: “for every path” E: “there exists a path”

AF p

p

p

p

Page 13: Review of the automata-theoretic approach to model-checking.

Computation Tree Logic: CTL

• Every operator F, G, X, U preceded by A or E• Universal modalities:

p p

p

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

AG p

p p p p

p

p p

AF p

Page 14: Review of the automata-theoretic approach to model-checking.

CTL, cont...

• Existential modalities:

p

p

. . .

. . .

. . .

. . . . . .

. . .

. . .

. . .

EG p

p p

EF p

Page 15: Review of the automata-theoretic approach to model-checking.

CTL, cont

• Other modalitiesAX p, EX p, A(p U q), E(p U q)

• Examples: mutual exclusion specs...

AG (C1 C2) mutual exclusion

AG (request AF grant) non-starvation

AG (N1 EX T1) non-blocking

Page 16: Review of the automata-theoretic approach to model-checking.

CTL*• Contains both CTL and LTL

– path formulas p U q, G p, Fp, Xp, p, p q– state formulas A p, E p

• Note: p in LTL A p in CTL*

• CTL* is more powerful than CTL Example: Fairness assumptions

A (GF p GF q)

Page 17: Review of the automata-theoretic approach to model-checking.

Model checking complexities

CTL

LTLO(2f (V+E))

CTLO(f (V+E))

*

=

Note: all are linear in model size

PSPACE COMPLETE

Page 18: Review of the automata-theoretic approach to model-checking.

LTL vs. Buchi automata

• Buchi automaton: finite-state automaton

accepting infinite words by going forever through some accepting state

a1 a2 a3 ………………………………

s0 s1 s2 s3 ……….f ….. f ….. f ….. f…..

• Languages accepted by Buchi automata:

ω-regular

Page 19: Review of the automata-theoretic approach to model-checking.

Let φ be an LTL formula with propositions AP.There exists a Buchi automaton B(φ) over alphabet 2AP accepting exactly the infinite words satisfying φ.

Naïve construction: simple recursion on the structure of φ

Examples:• if φ = X p then B(φ) is

• if φ = p U q then B(φ) is

• but: each negation leads to exponential blowup!

pq

accept

paccept

Page 20: Review of the automata-theoretic approach to model-checking.

Smarter way: one-step construction

• exponential number of states

• given a state of B(φ) and an input, a next state of B(φ) can be computed in PSPACE with respect to φ

Page 21: Review of the automata-theoretic approach to model-checking.

Example: p U q

• States: consistent sets of subformulas (or their negations)

() subformulas p U q, (p U q), p, p, q, q

p, q p U q

p, q, p U q

p, q, (p U q)

p, q, p U q

p q, (p U q)

States (consistent sets):

Intuition: a state contains the formulas satisfied by all accepted infinite runs starting in that state

Page 22: Review of the automata-theoretic approach to model-checking.

p, q, p U q

p, q, p U q

p, q, (p U q)

p, q, p U q

p, q, (p U q)

all all

all

• Initial states: all containing p U q • Transitions: on assignment in source state

Page 23: Review of the automata-theoretic approach to model-checking.

Model checking Input: Kripke structure K LTL formula φ

1. Construct B( φ)

2. Search for runs of K accepted by B( φ)

3. If none found, output “yes”

otherwise, output counter-example run

Page 24: Review of the automata-theoretic approach to model-checking.

Can be done in NPSPACE, so in PSPACE:

• Non-deterministically generate runs of K B(φ)

• Accept when looping in <S, f >

where S is a state in K and f is an accepting state of B(φ)

Run of K

States of B(φ)

s0 s1 s2 … f …. f

Deterministic algorithm: depth-first search + some efficient bookkeeping

O(2|φ| |K|)

S S

Page 25: Review of the automata-theoretic approach to model-checking.

Some other complexities

• Model checking for CTL: O( |φ| |K|)

• Satisfiability for CTL: EXPTIME-complete

• Model checking for CTL*: PSPACE-complete • Satisfiability for CTL*: 2-EXPTIME-complete