This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS256/Winter 2007 — Lecture #12 Zohar Manna Chapter 5 Algorithmic Verification (of General Formulas) 12-1 Algorithmic Verification of Finite-state Systems Given finite-state program P , i.e., each x ∈ V assumes only finitely many values in all P-computations. Example: mux-pet1 (Fig. 3.4) is finite-state s = 1 , 2 y 1 = t , f y 2 = t , f π can assume at most 36 different values. We present an algorithm (decision procedure) for establishing properties specified by an arbitrary (quantifier-free) temporal formula. 12-2 Example: Program mux-pet1 (Fig. 3.4) (Peterson’s Algorithm for mutual exclusion) local y 1 , y 2 : boolean where y 1 = f , y 2 = f s : integer where s = 1 P 1 :: ‘ : loop forever do ‘ 1 : noncritical ‘ 2 : ( y 1 , s ) := ( t , 1) ‘ 3 : await ( ¬ y 2 ) ∨ ( s 6 = 1) ‘ 4 : critical ‘ 5 : y 1 := f P 2 :: m : loop forever do m 1 : noncritical m 2 : ( y 2 , s ) := ( t , 2) m 3 : await ( ¬ y 1 ) ∨ ( s 6 = 2) m 4 : critical m 5 : y 2 := f 12-3 Overview Given a temporal formula ϕ 1) Is ϕ satisfiable? i.e., is there a model σ such that σ q ϕ ? Apply algorithm for ϕ : YES: ϕ satisfiable produce a model σ satisfying ϕ NO: ϕ unsatisfiable there exists no model σ satisfying ϕ 2) Is ϕ valid? [Is ¬ ϕ unsatisfiable?] Apply algorithm for ¬ ϕ : YES: ¬ ϕ satisfiable = ϕ not valid produce a model σ satisfying ¬ ϕ (counterexample) NO: ¬ ϕ unsatisfiable = ϕ is valid 12-4 Overview (Cont’d) Given a temporal formula ϕ and a finite-state program P 3) Is ϕ P-satisfiable? i.e., is there a P-computation σ such that σ q ϕ ? Apply algorithm for ϕ and P : YES: ϕ P-satisfiable produce a P-computation σ satisfying ϕ NO: ϕ P-unsatisfiable there exists no such computation 12-5 Overview (Cont’d) Given a temporal formula ϕ and a finite-state program P 4) Is ϕ P-valid? [Is ¬ ϕ P-unsatisfiable?] Apply algorithm for ¬ ϕ and P : YES: ¬ ϕ P-satisfiable = ϕ not P-valid (Computation produced is a counterexample) NO: ¬ ϕ P-unsatisfiable = ϕ is P-valid 12-6 Idea of algorithm Construct a directed graph (“tableau”) T ϕ that exactly embeds all models of ϕ , i.e., σ is embedded in T ϕ iff σ q ϕ . Embedding in a graph In the simplest version , the nodes of the graph are la- belled by assertions . A model σ : s , s 1 , . . . s i , . . . is embedded in the graph if there exists a path π : n , n 1 , . . . n i , . . . (where n is an initial node) such that for all i ≥ , s i satisfies the assertion A i labeling node n i , i.e., s i q A i ....
View Full Document