Professional Documents
Culture Documents
T HEORETISCHE I NFORMATIK
KIT I NSTITUT F UR
Previous lecture
S PIN appeared as a P ROMELA simulator
This lecture
Intro to S PIN as a model checker
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
2/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
3/34
implicit, global:
scheduling of concurrent processes
(see next lecture)
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
4/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
5/34
model
name.pml
correctness
properties
-a
verifier
pan.c
executable
verifier
pan
C
compiler
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
ei
-t
or
-i
th
e
SPIN
failing
run
name.pml.trail
errors: 0
SS 2010
6/34
model
name.pml
correctness
properties
SPIN
verifier
pan.c
C
compiler
executable
verifier
pan
-i
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
failing
run
name.pml.trail
errors: 0
SS 2010
7/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
8/34
model
name.pml
correctness
properties
-a
verifier
pan.c
executable
verifier
pan
C
compiler
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
failing
run
name.pml.trail
or
ei
th
e
SPIN
errors: 0
SS 2010
9/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
10/34
correctness
properties
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
11/34
Assertion Statements
Definition (Assertion Statements)
Assertion statements in P ROMELA are statements of the form
assert(expr )
were expr is any P ROMELA expression.
Typically, expr is of type bool.
Assertion statements can appear anywhere where a P ROMELA
statement is expected.
...
stmt1;
assert(max == a);
stmt2;
...
...
if
:: b1 -> stmt3;
assert(x < y)
:: b2 -> stmt4
...
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
12/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
13/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
14/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
15/34
Generate Verifier in C
model
max.pml
correctness
properties
SPIN
-a
verifier
pan.c
SS 2010
16/34
verifier
pan.c
C
compiler
executable
verifier
pan
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
17/34
either
errors: 0
failing
run
max.pml.trail
SS 2010
18/34
Guided Simulation
To examine failing run: employ simulation mode, guided by trail file.
SPIN
-t
guided
simulation
failing
run
max.pml.trail
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
19/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
20/34
verifier
pan.c
-t
executable
verifier
pan
C
compiler
failing
run
name.pml.trail
or
-i
-a
th
er
SPIN
ei
model
name.pml
errors: 0
SS 2010
21/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
22/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
23/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
24/34
P ROMELA
datatypes
operators
statements
guarded commands
processes
channels
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
25/34
Why S PIN?
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
26/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
27/34
What is J S PIN?
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
28/34
J S PIN
Demo
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
29/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
30/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
31/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
32/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
33/34
Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov Applications of Formal Verification
SS 2010
34/34