*This preview shows
pages
1–8. Sign up to
view the full content.*

This ** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*This ** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*This ** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*This ** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
**Unformatted text preview: **CS256/Winter 2007 — Lecture #14 Zohar Manna 14-1 Satisfiability over a finite-state program P-validity problem (of ϕ ) Given a finite-state program P and formula ϕ , is ϕ P-valid? i.e. do all P-computations satisfy ϕ ? P-satisfiability problem (of ϕ ) Given a finite-state program P and formula ϕ is ϕ P-satisfiable? i.e., does there exist a P-computation which satisfies ϕ ? To determine whether ϕ is P-valid, it suffices to apply an algorithm for deciding if there is a P-computation that satisfies ¬ ϕ . 14-2 The Idea To check P-satisfiability of ϕ , we combine the tableau T ϕ and the transition graph G P into one product graph, called the behavior graph B ( P,ϕ ) , and search for paths ( s , A ) , ( s 1 , A 1 ) , ( s 2 , A 2 ) , . . . that satisfy the two requirements: • σ q ϕ : there exists a fulfilling path π : A , A 1 , . . . in the tableau T ϕ such that ϕ ∈ A . • σ is a P-computation: there exists a fair path σ : s , s 1 , . . . in the transition graph G P . 14-3 State transition graph G P : Construction • Place as nodes in G P all initial states s ( s q Θ ) • Repeat for some s ∈ G P , τ ∈ T , add all its τ-successors s to G P if not already there, and add edges between s and s . Until no new states or edges can be added. If this procedure terminates, the system is finite-state. 14-4 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 14-5 Abstract state-transition graph for mux-pet1 m 2 m 3 m 5 ‘ 5 ‘ 2 ‘ 3 s = 1 9 s = 1 2 6 1 s = 2 3 s = 2 1 2 s = 2 s = 2 s = 2 9 s = 1 s = 1 3 at- m .. 2 at- m 3 at- m 4 , 5 at- ‘ .. 2 at- ‘ 3 at- ‘ 4 , 5 s = 1 6 We use y 1 ⇔ at- ‘ 3 .. 5 y 2 ⇔ at- m 3 .. 5 14-6 Some states have been lumped together: a super-state labeled by...

View Full
Document