model checking demonstration of spin by mitra purandare
TRANSCRIPT
![Page 1: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/1.jpg)
Model Checking
Demonstration Of
SPIN
By
Mitra Purandare
![Page 2: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/2.jpg)
Motivation
More and more complex systems Increased dependability : everything important
depends on computers Increased functionality : security, mobility Testing is becoming humanly un-manageable!
![Page 3: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/3.jpg)
Testing
Dynamic Execution/Simulation of System Generating test-cases : Limited by tester's ability
to devise test-cases To Prove : Absence of a certain bug? To Prove : Presence of a certain property? Is CSARDAS 100% correct? Testing : Not formal/Mathematical!
![Page 4: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/4.jpg)
Implications
More efficient methods for test and verification
needed. Formal Verification is the most promising
approach. Experts in these new methods lacking!! Job : A great motivation to study formal methods!
![Page 5: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/5.jpg)
Formal Verification
Problem : Does an implementation satisfy a
property? Two Basic categories
Theorem provers : infinite state systems, time-
consuming, not really automated Model Checkers : exhaustive state space exploration,
finite state systems, automated
![Page 6: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/6.jpg)
Model Checking
Introduced by Clarke and Emerson, Quielle and
Sifakis in 1981 Given a property (P) and a system (M),
does M ⊨ P? Yes, P holds in M No, generate a trace which shows the property
violation
![Page 7: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/7.jpg)
Example : Model and Property
Model : Kripke
Structure, Finite State
Machine, Automaton Property : CTL/ LTL Safety Property Liveness Property
a b
c
q
p
G !pLTL
! G !p
F q
q U p
Result
a b a a....b
a b c
![Page 8: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/8.jpg)
Model Checking
Explicit State Model Checking : explicit state
representation, Kripke structure( graph) Symbolic : Uses BDDs to represent sets of states Now a days SAT solvers!
![Page 9: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/9.jpg)
Tools
SPIN (Bell Labs) SMV, NuSMV (CMU) Mocha (Penn) JPF (Java Path Finder, NASA) Bandera (KSU) BLAST (Berkeley) MAGIC (CMU) FormalCheck (Cadence) RuleBase (IBM, Haifa) SLAM, Zing (Microsoft Research) FormalPro (Mentor Graphics)
![Page 10: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/10.jpg)
SPIN(Simple Promela INterpreter)
Developed by G.Z. Holzman@Bell Labs Promela (PROtocal MEta LAnguage) Publicly available since 1991 Prestigious ACM System Software Award for
2001 Most efficient and scalable still active research -> good support
![Page 11: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/11.jpg)
SPIN
Explicit state LTL model checker On-the-fly reachability Partial order reduction to reduce state space Targets software verification Scales well for large problem sizes
![Page 12: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/12.jpg)
The Cabbage-Goat-Wolf problem!
Ferryman with C, G, W and a boat on one side of a
river Only ferryman can row the boat Ferryman can take only one item at a time Not goat and wolf together without ferryman Not goat and cabbage together without ferryman GOAL : Ferryman wants to take all 3 items to the
other side!
![Page 13: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/13.jpg)
Property
Goal : wolf_location = destination & goat_location
= destination & cabbage_location = destination &
ferryman_location = destination Restriction 1 : wolf_location = goat_location &
ferryman_location != wolf_location Restriction 2 : goat_location = cabbage_location &
ferryman_location != cabbage_location !(Restriction 1 | Restriction 2) U Goal
![Page 14: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/14.jpg)
State Transition Diagram
4 variables, ferryman, cabbage, goat, wolf
respectively 1 : on this bank , 0 : other bank i.e. destination
1111 0101
0011
0110
1011
1101
1110
0010
0001
0100
1010
1001
1100
0000
0111 1000
![Page 15: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/15.jpg)
SPIN References
http://spinroot.com/spin/whatispin.html THE SPIN MODEL CHECKER Primer and
Reference Manual : Holzman Model Checking : Clarke, Grumberg and Peled Symbolic Model Checking : Kenneth L. McMillan OR Come To the H-Floor! :)
![Page 16: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/16.jpg)
Challenges
Coverage Reliability Repair Scalability Infinite State System Specification InterOperability
![Page 17: Model Checking Demonstration Of SPIN By Mitra Purandare](https://reader036.vdocuments.us/reader036/viewer/2022082709/56649d055503460f949d9091/html5/thumbnails/17.jpg)
Future
Bounded Model Checking SAT Solvers Abstraction and refinement Hybrid Systems