Professional Documents
Culture Documents
Chittaranjan Mandal
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 1 / 154
Contents
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 2 / 154
Microwave controller
Section outline
Formal specifications
Diagram of Moore FSM of
1 Microwave controller controller
Specification
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 3 / 154
Microwave controller Specification
Specification
We consider a simplified microwave oven that has a door, a motor to
operate the turntable (on which some food may be placed for
warming), a rotary timer and a microwave generating unit; working is
as follows:
The door should be closed for the motor to rotate the turntable
and the wave generating unit to operate.
The motor turns ON to rotate the turntable and the wave
generating unit stays ON only if the rotary timer is counting down.
The wave generating unit should not be ON continuosly for more
than T seconds.
After operating for T seconds, the wave generating unit should be
rested (to OFF) for T seconds.
An internal count-down timer is used to keep track of the time the
microwave generating unit stays on.
Opening the door will stop both the motor and the wave TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
generating unit.
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 4 / 154
Microwave controller Formal specifications
Formal specifications
Inputs
D 2 f0; 1g door is open (0) or closed (1)
T 2 f0; 1g rotary timer is stopped (0) or counting (1)
Internal states
C 2 f0; 1g internal timer value is zero (0) or non-zero (1)
S 2 f0; 1g mark (0) or space (1) state, flips
synchronously on F
Outputs
M 2 f0; 1g stop (0) or start (1) the turntable motor
W 2 f0; 1g stop (0) or start (1) the wave generator unit
F 2 f0; 1g flip (1) the state from mark to space and vice
versa or do not flip (0)
E 2 f0; 1g enable (1) the internal counter to count or
disable (0)
R 2 f0; 1g reset (1) the internal counter or operate
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
normally (0)
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 5 / 154
Microwave controller Diagram of Moore FSM of controller
D DTS DTS
DT
D
DT D DT
CDT D DT CDT
5 4 3
WMFRE WMFRE WMFRE
CDT CDT
DT
40
DTS DTS TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
WMFRE
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 6 / 154
Temporal logic
Section outline
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 7 / 154
Temporal logic Kripke Structure
Kripke Structure
Definition
A Kripke Structure M is a 5-tuple hS ; I ; AP ; !; Li where:
S is a set of states.
I is the set of initial states: I S
AP is a set of atomic propositions.
! is a total transition relation: ! S S (i.e. 8s 2 S; 9s0js ! s0).
L is a state labelling: L : S ! 2AP
FSM and its Kripke structure by absorbtion of inputs
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 8 / 154
Temporal logic Kripke Structure
Kripke Structure
Definition
A Kripke Structure M is a 5-tuple hS ; I ; AP ; !; Li where:
S is a set of states.
I is the set of initial states: I S
AP is a set of atomic propositions.
! is a total transition relation: ! S S (i.e. 8s 2 S; 9s0js ! s0).
L is a state labelling: L : S ! 2AP
FSM and its Kripke structure by absorbtion of inputs
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 8 / 154
Temporal logic Computation tree logics
Computation tree
a; b
a; b
b; c c
b; c c
a; b c c
Kripke model (derived from
state transition graph) Infinite computation tree derived by
unwinding the Kripke model
A path in M is an infinite sequence of states, = s0 ; s1 ; s2 ; : : : such
that for i 0, si ! si +1 and s0 may be the initial state of M or a
designated initial state of the path
We write i to denote the suffix of starting at si
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 9 / 154
Temporal logic Computation tree logics
Computation tree
a; b
a; b
b; c c
b; c c
a; b c c
Kripke model (derived from
state transition graph) Infinite computation tree derived by
unwinding the Kripke model
A path in M is an infinite sequence of states, = s0 ; s1 ; s2 ; : : : such
that for i 0, si ! si +1 and s0 may be the initial state of M or a
designated initial state of the path
We write i to denote the suffix of starting at si
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 9 / 154
Temporal logic Computation tree logics
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 10 / 154
Temporal logic Temporal operators
Temporal operators
X The next time operator is used to specify that some
property holds in the second state of a path
F The future time operator (F) is used to specify that some
property eventually holds at some state in a path
G The global operator (G) is used to specify that some
property holds for all states of a particular path.
U The until operator (U) is a binary operator, and is used to
specify that the first property holds in all states preceding
the one where the second property is satisfied
W The weak until operator is similar to the until operator,
except that the second property need not hold eventually
R The release operator (R) is also a binary operator used to
specify that the second property holds in all states along
a path up to and including the first state where the first TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
property holds; the first property need not hold eventually
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 11 / 154
Temporal logic Semantics of satisfying a formula along a path
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 12 / 154
Temporal logic Semantics of satisfying a formula along a path
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 13 / 154
Temporal logic LTL formulae
LTL formulae
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 14 / 154
Temporal logic LTL formulae
Example
Let = F (p ! X q ) in the future if AP p holds in a certain state
AP q holds in the next state
M could have one path where p is never followed by q in the next
state, so M 6j=
Now : = :F (p ! X q ) never in the future p is followed by q in
the next state
M could have another path where p is followed by q in the next
state, so M 6j= :
Thus, it is possible for M 6j= and M 6j= : to be simultaneously
true for some M and some LTL formula
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 15 / 154
Temporal logic CTL formulae
CTL formulae
CTL syntax
::= ?j>jpj:j1 ^ 2 j1 _ 2 j 1 ! 2 j AX j EX j AF j EF j
AG j EG j A [1 U 2 ] j E [1 U 2 ]
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 16 / 154
Temporal logic CTL formulae
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 17 / 154
Temporal logic CTL formulae
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 17 / 154
Temporal logic Illustration of CTL operators
p p p
p p p p p p
M; s0 j= AG p M; s0 j= AF p
p
p p
M; s0 j= EF p M; s0 j= EG p
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 18 / 154
Temporal logic Semantics of CTL
Semantics of CTL
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 19 / 154
Temporal logic Semantics of CTL
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 20 / 154
Temporal logic Adequate CTL operators
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 21 / 154
Temporal logic More CTL operators
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 22 / 154
Temporal logic More relationships between CTL operators
AF A [> U ]
EF E [> U ]
A [? U ] E [? U ]
AG ^ AX AG
EG ^ EX EG
AF _ AX AF
EF _ EX EF
A [ U ] _ ( ^ AX A [ U ])
E [ U ] _ ( ^ EX E [ U ])
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 23 / 154
Temporal logic Examples of CTL formulae
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 24 / 154
Temporal logic Examples of CTL formulae
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 25 / 154
Temporal logic Comparison of LTL and CTL
p p
:p
A B
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
LTL and CTL coincide if the model has only one path!
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 26 / 154
Temporal logic Comparison of LTL and CTL
p p
:p
A B
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
LTL and CTL coincide if the model has only one path!
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 26 / 154
Temporal logic Comparison of LTL and CTL
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 27 / 154
Temporal logic Safety and liveness
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 28 / 154
Verification of microwave controller
Section outline
3 Verification of microwave
controller
Properties
NuSMV model
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 29 / 154
Verification of microwave controller Properties
Properties
The door should be closed for the motor to turn ON to rotate the
turntable and the wave generating unit to be ON to operate; opening the
door will stop both the motor and the wave generating unit.
CTL AG [EX (M _ W ) ! D ]
LTL G [X (M _ W ) ! D ]
The motor turns ON to rotate the turntable and the wave generating unit
to be ON to operate only if the rotary timer is counting down.
CTL AG [EX (M _ W ) ! T ]
LTL G [X (M _ W ) ! T ]
Internal counter is enabled after the door is closed and the rotary timer is
ON, disabled otherwise.
CTL AG [(:D _ :T ) ! AX :E ]
LTL G [(:D _ :T ) ! X :E ]
The internal countdown timer is disabled when its count reaches zero.
CTL AG [:C ! AX :E ]
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
LTL G [:C ! X :E ]
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 30 / 154
Verification of microwave controller NuSMV model
Counter module
MODULE Counter(En, R)
VAR
timer : 0..10;
ASSIGN
init(timer) := 10;
next(timer) := case
R : 10;
En & timer > 0 : timer - 1;
TRUE : timer;
esac;
DEFINE
state := timer != 0; TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 31 / 154
Verification of microwave controller NuSMV model
MODULE MarkSpace(Fp)
VAR
MS : boolean;
ASSIGN
next(MS) := (Fp & !MS) | MS;
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 32 / 154
Verification of microwave controller NuSMV model
MWFSM module
MODULE MWFSM(D, TM, MS, C)
VAR
State : {1, 2, 3, 4, 41, 5};
DEFINE
W := (State = 5);
M := (State = 3 |State = 4 |State = 41 |State = 5);
FP := (State = 4);
R := (State = 4);
En := (State = 3 | State = 5);
ASSIGN
init(State) := 1;
next(State) :=
case
State = 1 & D: 2; TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 33 / 154
Verification of microwave controller NuSMV model
State = 4 & !D : 1;
State = 4 & D & !TM: 2; -- not optional!
State = 4 & D & TM: 41;
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 34 / 154
Verification of microwave controller NuSMV model
TRUE : State;
esac;
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 35 / 154
Verification of microwave controller NuSMV model
Main module
MODULE main
VAR
D : boolean;
TM : boolean;
mw : MWFSM(D, TM, ms.MS, ct.state);
ms : MarkSpace(mw.FP);
ct : Counter(mw.En, mw.R);
ASSIGN
init(D) := FALSE;
init(TM) := FALSE;
LTLSPEC G(X(mw.W | mw.M) -> D);
LTLSPEC G(X(mw.W | mw.M) -> TM);
LTLSPEC G((!D | !TM) -> X!mw.En);
SPEC AG(EX(mw.W | mw.M) -> D);
SPEC AG(EX(mw.W | mw.M) -> TM); TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 36 / 154
Verification of microwave controller NuSMV model
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 37 / 154
Verification of microwave controller NuSMV model
Note that the trace contains an unrealistic loop between states 1 and 2
Similar property where looping between states 1 and 2 is precluded
using LTL, but using knowledge of the implementation
-- specification
(!( F ( G (mw.State = 1 | mw.State = 2))) -> TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
G ((D & TM) -> F mw.En)) is true
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 38 / 154
Verification of microwave controller NuSMV model
GY
ITU
!EF EG(mw.State = 1 | mw.State = 2) holds
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 39 / 154
Verification of microwave controller NuSMV model
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 40 / 154
Verification of microwave controller NuSMV model
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 41 / 154
CTL model checking
Section outline
Handling AF 1
Handling EG 1 more
efficiently
4 CTL model checking CTL model checking with
CTL model checking fairness
Properties for Kripke Handling
structure of (0j1) 1+ FSM EC G 1 wrt f 1 ; : : :g
Base cases for labelling for Counterexample generation
CTL model checking Counterexample generation
Handling E [ 1 U 2 ] for ACTL
Handling EG 1
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 42 / 154
CTL model checking
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 43 / 154
CTL model checking CTL model checking
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 44 / 154
CTL model checking Properties for Kripke structure of (0j1) 1+ FSM
0 1 1 0 1 1
01 11
0 1 s1 s3
0 0
00 10
s0 s2
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 45 / 154
CTL model checking Properties for Kripke structure of (0j1) 1+ FSM
GY
ITU
IAN INST
KH
FAIRNESS In = 1 SPEC ! EF ! EF (State = 1) [ AG EF (State = 1)]
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 46 / 154
CTL model checking Properties for Kripke structure of (0j1) 1+ FSM
_ EG
2 5
0 1 1
3 4 4
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 47 / 154
CTL model checking Base cases for labelling for CTL model checking
! EX 1
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
1 1
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 48 / 154
CTL model checking Handling E[ 1 U 2]
Handling E[ 1U 2]
1 ! 1 ! E[ 1 U
1
2]
E[ 1 U 2] E[ 1 U 2]
2 TE
OF
TECHNO
LO
2 2
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 49 / 154
CTL model checking Handling E[ 1 U 2]
Time complexity
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 50 / 154
CTL model checking Handling EG 1
Handling EG 1
EG 1
EG
1
1 EG
1
1
! EG
1
1 EG
1
1
! EG
1
1
1
EG 1 EG 1 EG 1 EG 1 EG 1 EG 1
TECHNO
OF LO
TE
1 1 1 1 1 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 51 / 154
CTL model checking Handling AF 1
Handling AF 1
AF 1 AF 1
1
1 1
1 ! AF
1
1
! AF 1
AF
1
1
AF 1 AF 1
1 TE
OF
TECHNO
LO
GY
ITU
1 1
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 52 / 154
CTL model checking Handling EG 1 more efficiently
1 1
1 1
1
1 1 1 1
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
1
ARAGPUR
1
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 53 / 154
CTL model checking Handling EG 1 more efficiently
Checking AF AG p on a model
Example (Checking AF AG p by labelling with subformulae)
B ;p B ;p
A; p M A; p M ;
! !
p p
:p
A B
A; :p
:
A; p
Let = AG p
Let = AF
First, label nodes with subformula = AG p
Next, label nodes with subformula = AF
Thus, M 6j= AF AG p, as all initial states are not labelled with
= AF AG p
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 54 / 154
CTL model checking Handling EG 1 more efficiently
01 11
s1 s3
EU
_
M 2
EG
1
00 10
s0 s2
0 1 1
3 4 4
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 55 / 154
CTL model checking Handling EG 1 more efficiently
01 11
s1 4 s3 4
EU
_
M 2
EG
1
00 10
s0 3 s2 3
0 1 1
3 4 4
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 55 / 154
CTL model checking Handling EG 1 more efficiently
01 1 11 1
s1 4 ;2 s3 4 ;2
EU
_
M 2
EG
1
00 10
s0 3 ;2 s2 3 ;2
0 1 1
3 4 4
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 55 / 154
CTL model checking Handling EG 1 more efficiently
01 1 ; 11 1 ;
s1 4 ;2 s3 4 ;2
EU
_
M 2
EG
1
00 10
s0 3 ;2 s2 3 ;2
0 1 1
3 4 4
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 55 / 154
CTL model checking Handling EG 1 more efficiently
01 1 ; 11 1 ;
s1 4 ;2 s3 4 ;2
EU
M j= _ EG
2 1
00 10
s0 3 ;2 s2 3 ;2
0 1 1
3 4 4
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 55 / 154
CTL model checking CTL model checking with fairness
GY
ITU
IAN INST
KH
of it is fair, enforced via EC G >
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 56 / 154
CTL model checking CTL model checking with fairness
GY
ITU
IAN INST
KH
of it is fair, enforced via EC G >
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 56 / 154
CTL model checking Handling EC G 1 wrt f 1 ; : : :g
Handling EC G 1 wrt f 1 ; : : :g
Similar to EG 1 , but only use the SCCs that have, for each
i , a state si such that M; si j= i each si need not be distinct
Each i should be satisfied only within its own SCC
The i properties, in turn, should not rely on fairness constraints
This ensures fairness because it is now possible to find a path
through the nodes in a fair SCC where each fairness constraint i
is satisfied infinitely often
j= ECG 1 1 1
1
1 1
1 fair 1 SCC
1 SCC wrt without
1 SCC f 1 ; 2 g connection
sans ALL 1 1 1 1
of f 1 ; 2 g 1 1
1 1 1 X 2
1
1 1 1
1
2
2 X
1 1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 57 / 154
CTL model checking Handling EC G 1 wrt f 1 ; : : :g
M > State=1
4
00 10
s0 s2
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 58 / 154
CTL model checking Handling EC G 1 wrt f 1 ; : : :g
M > State=1
4
00 10
s0 s2 ;4
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 58 / 154
CTL model checking Handling EC G 1 wrt f 1 ; : : :g
M > State=1
4
00 10 3
s0 ;3 s2 ;4
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 58 / 154
CTL model checking Handling EC G 1 wrt f 1 ; : : :g
M j= > State=1
4
00 10 3 ;
s0 ;3 s2 ;4
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 58 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Let p and q be atomic propositions
Counterexample for = AG p? model for : = :AG p = EF :p a path
Counterexample for = AF p? model for : = :AF p = EG :p a path
Counterexample for = AF p _ AF q?
model for : = :AF p ^ :AF q = EG :p ^ EG :q two paths
Counterexample for = EF p? model for : = :EF p = AG :p a tree
Counterexample for = AF AX p? model for :AF AX p = EG EX :p
Linear counterexamples (having the form of a path rather than a tree)
are easier to understand
A CTL formula in which the temporal operators do not appear within the
scope of a negation is said to be in negation normal form (NNF)
ACTL formulae that do not use the EX , EG or EU are better for linear
counter examples
Negation of ACTL formula and then transforming to NNF yields an ECTL TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
formula and vice versa
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 59 / 154
CTL model checking Counterexample generation
Counterexamples
Verification v/s refutation of property in K = hS ; S0 ; R ; Li
Verification Show that S0 fsj K; s j= g
Refutation Find a state s 2 S0 st K; s 6j= K; s j= :
Generate a counter-example starting from that state
structure
LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 60 / 154
CTL model checking Counterexample generation
Traces
Definition (Trace)
A trace is either a finite path or a path leading to a loop, i.e., only the last state
of a trace may be a repetition of a state already present in the trace
Example (Counterexample for AF :x)
K 6j= AF :x C j= :AF :x C j= EG x
x x
x x
:x
x x x x
x x
x x
:x
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 61 / 154
CTL model checking Counterexample generation
Traces
Definition (Trace)
A trace is either a finite path or a path leading to a loop, i.e., only the last state
of a trace may be a repetition of a state already present in the trace
Example (Counterexample for AF :x)
K 6j= AF :x C j= :AF :x C j= EG x
x x
x x
:x
x x x x
x x
x x
:x
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 61 / 154
CTL model checking Counterexample generation for ACTL
:p :p
:p
:
:p :p
:p
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 62 / 154
CTL model checking Counterexample generation for ACTL
:p :p
:p
:
:p :p
:p
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 62 / 154
CTL model checking Counterexample generation for ACTL
Generating counterexamples
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 63 / 154
LTL model checking
Section outline
construction
LTL model checking
example
5 LTL model checking Gerths algorithm for LTL to
Approach for LTL model Buchi
automata
checking Motivating example of
Buchi
automata Gerths algorithm
Buchi
automata for some Pseudocode for Gerths
LTL formulae algorithm
Adequate LTL connectives Another illustration of
Model theoretic proofs of Gerths algorithm
some equivalences Double DFS for LTL MC
Product of Buchi
automata Nested DFS for LTL MC
GNBA to NBA Illustration of LTL MC via
transformation Gerths algorithm TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
Buchi
automata
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 64 / 154
LTL model checking Approach for LTL model checking
GY
ITU
IAN INST
KH
ARAGPUR
that demonstrates the bug
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 65 / 154
LTL model checking Buchi
automata
Buchi
automata
At the heart of LTL model checking are Buchi
automata
They work on infinite strings representing the infinite input given to
the m/c to be verified
A Buchi
automata accepts a string when the resulting run causes
a non-empty subset of the accepting states to be visited infinitely
often
note that there is not termination as the string does not end
An LTL property can be translated to a Buchi
automaton so that
precisely the strings conforming to the property get accepted
Definition (Buchi
automaton)
A = hQ ; ; !; Q0; F i is a Buchi
automaton accepting the
languagen o
L(A) = = a1 a2 : : : j 9 = q0 ! q1 ! q2 j inf() \ F 6= ? ,
a1 a2
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 66 / 154
LTL model checking Buchi
automata
Buchi
automata
At the heart of LTL model checking are Buchi
automata
They work on infinite strings representing the infinite input given to
the m/c to be verified
A Buchi
automata accepts a string when the resulting run causes
a non-empty subset of the accepting states to be visited infinitely
often
note that there is not termination as the string does not end
An LTL property can be translated to a Buchi
automaton so that
precisely the strings conforming to the property get accepted
Definition (Buchi
automaton)
A = hQ ; ; !; Q0; F i is a Buchi
automaton accepting the
languagen o
L(A) = = a1 a2 : : : j 9 = q0 ! q1 ! q2 j inf() \ F 6= ? ,
a1 a2
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 66 / 154
LTL model checking Buchi
automata
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 67 / 154
LTL model checking Buchi
automata for some LTL formulae
Buchi
automata for some LTL formulae
Example (Buchi
automata for some LTL formulae)
q2
p
p
:p q0 :p ^ :q q1
q0 q1
Gp pWq q
q2
:p q ^ :p
q0
p
q1 :q
p^q
q0 q1
Fp pRq
q2
q1
p
:p ^ :q p :p
q0 q1 p
pUq q q0 q2
FGp
:p p p ^ :q
p :p _ q :q
q0 q1
:p G (p ) F q)
q0 q1
TECHNO
OF LO
TE
GY
GFp
ITU
IAN INST
KH
ARAGPUR
IND
q
19 5 1
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 68 / 154
LTL model checking Buchi
automata for some LTL formulae
Buchi
automata for some LTL formulae
Example (Buchi
automata for some LTL formulae)
q2
p
p
:p q0 :p ^ :q q1
q0 q1
Gp pWq q
q2
:p q ^ :p
q0
p
q1 :q
p^q
q0 q1
Fp pRq
q2
q1
p
:p ^ :q p :p
q0 q1 p
pUq q q0 q2
FGp
:p p p ^ :q
p :p _ q :q
q0 q1
:p G (p ) F q)
q0 q1
TECHNO
OF LO
TE
GY
GFp
ITU
IAN INST
KH
ARAGPUR
IND
q
19 5 1
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 68 / 154
LTL model checking Buchi
automata for some LTL formulae
Buchi
automata for some LTL formulae
Example (Buchi
automata for some LTL formulae)
q2
p
p
:p q0 :p ^ :q q1
q0 q1
Gp pWq q
q2
:p q ^ :p
q0
p
q1 :q
p^q
q0 q1
Fp pRq
q2
q1
p
:p ^ :q p :p
q0 q1 p
pUq q q0 q2
FGp
:p p p ^ :q
p :p _ q :q
q0 q1
:p G (p ) F q)
q0 q1
TECHNO
OF LO
TE
GY
GFp
ITU
IAN INST
KH
ARAGPUR
IND
q
19 5 1
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 68 / 154
LTL model checking Buchi
automata for some LTL formulae
Buchi
automata for some LTL formulae
Example (Buchi
automata for some LTL formulae)
q2
p
p
:p q0 :p ^ :q q1
q0 q1
Gp pWq q
q2
:p q ^ :p
q0
p
q1 :q
p^q
q0 q1
Fp pRq
q2
q1
p
:p ^ :q p :p
q0 q1 p
pUq q q0 q2
FGp
:p p p ^ :q
p :p _ q :q
q0 q1
:p G (p ) F q)
q0 q1
TECHNO
OF LO
TE
GY
GFp
ITU
IAN INST
KH
ARAGPUR
IND
q
19 5 1
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 68 / 154
LTL model checking Buchi
automata for some LTL formulae
Buchi
automata for some LTL formulae
Example (Buchi
automata for some LTL formulae)
q2
p
p
:p q0 :p ^ :q q1
q0 q1
Gp pWq q
q2
:p q ^ :p
q0
p
q1 :q
p^q
q0 q1
Fp pRq
q2
q1
p
:p ^ :q p :p
q0 q1 p
pUq q q0 q2
FGp
:p p p ^ :q
p :p _ q :q
q0 q1
:p G (p ) F q)
q0 q1
TECHNO
OF LO
TE
GY
GFp
ITU
IAN INST
KH
ARAGPUR
IND
q
19 5 1
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 68 / 154
LTL model checking Buchi
automata for some LTL formulae
Buchi
automata for some LTL formulae
Example (Buchi
automata for some LTL formulae)
q2
p
p
:p q0 :p ^ :q q1
q0 q1
Gp pWq q
q2
:p q ^ :p
q0
p
q1 :q
p^q
q0 q1
Fp pRq
q2
q1
p
:p ^ :q p :p
q0 q1 p
pUq q q0 q2
FGp
:p p p ^ :q
p :p _ q :q
q0 q1
:p G (p ) F q)
q0 q1
TECHNO
OF LO
TE
GY
GFp
ITU
IAN INST
KH
ARAGPUR
IND
q
19 5 1
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 68 / 154
LTL model checking Buchi
automata for some LTL formulae
Buchi
automata for some LTL formulae
Example (Buchi
automata for some LTL formulae)
q2
p
p
:p q0 :p ^ :q q1
q0 q1
Gp pWq q
q2
:p q ^ :p
q0
p
q1 :q
p^q
q0 q1
Fp pRq
q2
q1
p
:p ^ :q p :p
q0 q1 p
pUq q q0 q2
FGp
:p p p ^ :q
p :p _ q :q
q0 q1
:p G (p ) F q)
q0 q1
TECHNO
OF LO
TE
GY
GFp
ITU
IAN INST
KH
ARAGPUR
IND
q
19 5 1
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 68 / 154
LTL model checking Buchi
automata for some LTL formulae
Buchi
automata for some LTL formulae
Example (Buchi
automata for some LTL formulae)
q2
p
p
:p q0 :p ^ :q q1
q0 q1
Gp pWq q
q2
:p q ^ :p
q0
p
q1 :q
p^q
q0 q1
Fp pRq
q2
q1
p
:p ^ :q p :p
q0 q1 p
pUq q q0 q2
FGp
:p p p ^ :q
p :p _ q :q
q0 q1
:p G (p ) F q)
q0 q1
TECHNO
OF LO
TE
GY
GFp
ITU
IAN INST
KH
ARAGPUR
IND
q
19 5 1
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 68 / 154
LTL model checking Adequate LTL connectives
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 69 / 154
LTL model checking Adequate LTL connectives
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 69 / 154
LTL model checking Model theoretic proofs of some equivalences
F
2
F : :
F F
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 70 / 154
LTL model checking Model theoretic proofs of some equivalences
F
2
F : :
F F
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 70 / 154
LTL model checking Model theoretic proofs of some equivalences
Examples of translations
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 71 / 154
LTL model checking Product of Buchi
automata
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 72 / 154
LTL model checking Product of Buchi
automata
Product of Buchi
automata
Definition (Product of two Buchi
automata)
Given two Buchi
automata B1 = hQ1 ; ; 1 ; I1 ; F1 i and B2 = hQ2 ; ; 2 ; I2 ; F2 i
with the same alphabet , the product is a generalised Buchi automaton
(GNBA) B = B1 B2 = hQ ; ; ; I ; F i may be defined so that
Q = Q1 Q2 ,
hq1 ; q2 i a hq10 ; q20 i iff 1 q1 a q10 and 2 q2 a q20 ,
I = I1 I2 and
F = fF1 Q2 ; Q1 F2 g
A run resulting from an input is an accepting run if for each Fi 2 F ,
inf() \ Fi 6= ?, so that accepting states of the constituent automata are
visited infinitely often
Note the proliferation of sets of final states in the GNBA to ensure that
constitutent final states of each consitituent automaton is visited infinitely
often
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
C1 C1
GY
ITU
IAN INST
KH
LTL: = (G F C1 ) ^ (G F C2 )
ARAGPUR
IND
19 5 1
yog, km s kOflm^
C1
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 74 / 154
LTL model checking GNBA to NBA transformation
C1 C1
GY
ITU
IAN INST
KH
LTL: = (G F C1 ) ^ (G F C2 )
ARAGPUR
IND
19 5 1
yog, km s kOflm^
C1
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 74 / 154
LTL model checking Buchi
automata construction
Buchi
automata construction
Constructing Buchi
automaton for K = hS ; S0 ; AP ; !; Li
Buchi automaton A = h; Q ; ; I ; F i corresponding to K is defined as:
= P (AP ), s a s0 iff either
Q = S [ f s A g, s ! s0 and p 2 a iff L s0 p or
I = fsA g, s = sA and s0 2 S0 and p 2 a iff L s0 p
F =Q
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 75 / 154
LTL model checking LTL model checking example
p; q q p
M
fp ; q g fpg
q0
fp ; q g q1
fq g q2 q3
BM fq g
fq g ; ?; fpg ;
fp ; q g fq g ; fp; q g
: = F :q q
q0
:q q1 q0
?; fpg q1
B: or
fp ; q g fq g
q0;0
fp ; q g q1;0
fq g q2;0
fpg q3;1 q2;1
BM B:
fpg
!
fp;qg fq g fpg fqg fpg
M 6j= ; C q0;0 ! q0;1 ! q2;0 ! q3;1 ! q2;1 ! q3;1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 76 / 154
LTL model checking LTL model checking example
p; q q p
M
fp ; q g fpg
q0
fp ; q g q1
fq g q2 q3
BM fq g
fq g ; ?; fpg ;
fp ; q g fq g ; fp; q g
: = F :q q
q0
:q q1 q0
?; fpg q1
B: or
fp ; q g fq g
q0;0
fp ; q g q1;0
fq g q2;0
fpg q3;1 q2;1
BM B:
fpg
!
fp;qg fq g fpg fqg fpg
M 6j= ; C q0;0 ! q0;1 ! q2;0 ! q3;1 ! q2;1 ! q3;1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 76 / 154
LTL model checking LTL model checking example
p; q q p
M
fp ; q g fpg
q0
fp ; q g q1
fq g q2 q3
BM fq g
fq g ; ?; fpg ;
fp ; q g fq g ; fp ; q g
: = F :q q
q0
:q q1 q0
?; fpg q1
B: or
fp ; q g fq g
q0;0
fp ; q g q1;0
fq g q2;0
fpg q3;1 q2;1
BM B:
fpg
!
fp;qg fq g fpg fqg fpg
M 6j= ; C q0;0 ! q0;1 ! q2;0 ! q3;1 ! q2;1 ! q3;1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 76 / 154
LTL model checking LTL model checking example
p; q q p
M
fp ; q g fpg
q0
fp ; q g q1
fq g q2 q3
BM fq g
fq g ; ?; fpg ;
fp ; q g fq g ; fp ; q g
: = F :q q
q0
:q q1 q0
?; fpg q1
B: or
fp ; q g fq g
q0;0
fp ; q g q1;0
fq g q2;0
fpg q3;1 q2;1
BM B:
fpg
!
fp;qg fq g fpg fqg fpg
M 6j= ; C q0;0 ! q0;1 ! q2;0 ! q3;1 ! q2;1 ! q3;1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 76 / 154
LTL model checking LTL model checking example
p; q q p
M
fp ; q g fpg
q0
fp ; q g q1
fq g q2 q3
BM fq g
fq g ; ?; fpg ;
fp ; q g fq g ; fp ; q g
: = F :q q
q0
:q q1 q0
?; fpg q1
B: or
fp ; q g fq g
q0;0
fp ; q g q1;0
fq g q2;0
fpg q3;1 q2;1
BM B:
fpg
!
fp;qg fq g fpg fqg fpg
M 6j= ; C q0;0 ! q0;1 ! q2;0 ! q3;1 ! q2;1 ! q3;1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 76 / 154
LTL model checking Gerths algorithm for LTL to Buchi
automata
GY
ITU
IAN INST
KH
ARAGPUR
duplicate and non-terminating node expansions
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 77 / 154
LTL model checking Gerths algorithm for LTL to Buchi
automata
GY
ITU
IAN INST
KH
ARAGPUR
duplicate and non-terminating node expansions
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 77 / 154
LTL model checking Gerths algorithm for LTL to Buchi
automata
GY
ITU
IAN INST
KH
ARAGPUR
duplicate and non-terminating node expansions
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 77 / 154
LTL model checking Gerths algorithm for LTL to Buchi
automata
GY
ITU
IAN INST
KH
ARAGPUR
duplicate and non-terminating node expansions
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 77 / 154
LTL model checking Gerths algorithm for LTL to Buchi
automata
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 78 / 154
LTL model checking Motivating example of Gerths algorithm
N fp U q g I I expand(n1 ,?)
n1
O ? X ?
N p I I N q I I
O fp U q g X fp U q g fp U q g ?
n2 n3
O X
expand(n3 ,expand(n2 ; ?))
N ? I I expand(n4 ,?)
O fp ; p U q g X fp U q g
n4
N fp U q g I n4
expand(n5 ,fn4 g)
n5
O ? X ?
N p I n4 N q I n4
O fp U q g X fp U q g fp U q g ?
n6 n7
O X
expand(n7 ,expand(n6 ; fn4 g))
N ? I n4
expand(n8 ,fn4 g)
n8
O fp ; p U q g X fp U q g TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 79 / 154
LTL model checking Motivating example of Gerths algorithm
N ? I I ; n4 expand(n7 ,fn4 g)
n4
O fp ; p U q g X fp U q g
N ? I n4
expand(n9 ,fn4 g)
n9
O fq ; p U q g X ?
N ? I n9 expand(n10 ,fn4 ; n9 g)
n10
O ? X ?
N ? I n10 expand(n11 ,fn4 ; n9 ; n10 g)
n11
O ? X ?
N ? I n9 ; n10 expand(n3 ,fn4 ; n9 ; n10 g)
n10
O ? X ?
N ? I I expand(n12 ,fn4 ; n9 ; n10 g)
n12
O fq ; p U q g X ?
N ? I n4 ; I
fn4 ; n9 ; n10 g
fq ; p U q g X ?
TECHNO
n9
OF LO
TE
GY
ITU
IAN INST
KH
O
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 80 / 154
LTL model checking Motivating example of Gerths algorithm
ffq g ; fp; q gg N ? I n4 ; I
I n9
O fq ; p U q g X ?
N ? I I ; n4 N ? I n9 ; n10
n4
O fp; p U q g X fp U q g n10
O ? X ?
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 81 / 154
LTL model checking Pseudocode for Gerths algorithm
GY
ITU
IAN INST
KH
ARAGPUR
return expand(q, Nodelist);
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 82 / 154
LTL model checking Pseudocode for Gerths algorithm
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 83 / 154
LTL model checking Pseudocode for Gerths algorithm
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 84 / 154
LTL model checking Pseudocode for Gerths algorithm
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 85 / 154
LTL model checking Another illustration of Gerths algorithm
N fp R q g I I expand(n1 ,?)
n1
O ? X ?
N q I I N p^q I I
O fp R q g X fp R q g fp R q g ?
n2 n3
O X
expand(n3 ,expand(n2 ; ?))
N ? I I expand(n4 ,?)
O fq ; p R q g X fp R q g
n4
N fp R q g I n4
expand(n5 ,fn4 g)
n5
O ? X ?
N q I n4 N p^q I n4
O fp R q g X fp R q g fp R q g ?
n6 n7
O X
expand(n7 ,expand(n6 ; fn4 g))
N ? I n4
expand(n8 ,fn4 g)
n8
O fq ; p R q g X fp R q g TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 86 / 154
LTL model checking Another illustration of Gerths algorithm
N ? I I ; n4 expand(n7 ,fn4 g)
n4
O fq ; p R q g X fp R q g
N fp; q g I n4
expand(n9 ,fn4 g)
n9
O fp ^ q ; p R q g X ?
N fq g I n4
expand(n10 ,fn4 g)
n10
O fp; p ^ q ; p R q g X ?
N ? I n4
expand(n11 ,fn4 g)
n11
O fp; q ; p ^ q ; p R q g X ?
N ? I n11 expand(n12 ,fn4 ; n11 g)
n12
O ? X ?
N ? I n12 expand(n13 ,fn4 ; n11 ; n12 g)
n13
O ? X ?
N ? I n11 ; n12 expand(n3 ,fn4 ; n11 ; n12 g)
? X ?
TECHNO
n12
OF LO
TE
GY
ITU
IAN INST
KH
O
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 87 / 154
LTL model checking Another illustration of Gerths algorithm
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 88 / 154
LTL model checking Another illustration of Gerths algorithm
ffp; q gg N ? I n4 ; I
I n11
O fp; q ; p ^ q ; p R q g X ?
N ? I I ; n4 N ? I n11 ; n12
n4
O fq ; p R q g X fp R q g n12
O ? X ?
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 89 / 154
LTL model checking Double DFS for LTL MC
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 90 / 154
LTL model checking Nested DFS for LTL MC
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 91 / 154
LTL model checking Illustration of LTL MC via Gerths algorithm
N ? I q0 ; q1 N ? I q2 ; q3
q1
O f>; > U q g X f> U q g q3
O ? X ?
fp; q g fpg
fp; q g fq g
BM : q0 q1 q2 q3
fq g
fp; q g
fp; q g fp; q g
Part of BM B> U q : q0;0 q1;2 q1;3
TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 92 / 154
LTL model checking Illustration of LTL MC via Gerths algorithm
fp; q g fpg
fp; q g fq g
BM : q0 q1 q2 q3
fq g
BM B? R :q : q0;0
L BM B? R :q = ?, hence, M j= F q
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 93 / 154
LTL model checking Illustration of LTL MC via Gerths algorithm
f> U (? R :q )g
GY
ITU
IAN INST
KH
n7
ARAGPUR
IND
O X
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 94 / 154
LTL model checking Illustration of LTL MC via Gerths algorithm
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 95 / 154
LTL model checking Illustration of LTL MC via Gerths algorithm
GY
ITU
O
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 96 / 154
LTL model checking Illustration of LTL MC via Gerths algorithm
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 97 / 154
LTL model checking Illustration of LTL MC via Gerths algorithm
f?; fpgg N I I ; n4
I n11
O f:q ; > U (? R :q ); ? R :q g X ? R :q
N I I ; n4 N I fn11 ; n15 g
n4
O f>; > U (? R :q )g X > U ( ? R :q ) n15
O f:q ; ? R :q g X ? R :q
fp ; q g fp g
fp ; q g fq g
BM : q0 q1 q2 q3
fp; q g fq g
BM B:G F q : q0;0
fp; q g q1;2
L(BM B:G F q ) = ?, so M j= G F q TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
NB: (Non-trivial) Final states for U -subformula only shown, jF j = 2
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 98 / 154
BDDs
Section outline
BDD extensions
Compose using ITE
Tautology checking using
6 BDDs ITE
BDD reduction Resolving ambiguities
BDD operations More general representation
Implementation aspects BDDs for sets and relations
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 99 / 154
BDDs
Truth tables
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 100 / 154
BDDs
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 101 / 154
BDDs BDD reduction
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 102 / 154
BDDs BDD reduction
x1
1
0
x2 x2
0 1 0 1
x3 x3 x3 x3
0 1 0 1 0 1 0 1
0 0 0 1 0 1 0 1
Original OBDD
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 103 / 154
BDDs BDD reduction
x1
1
0
x2 x2
0 1 0 1
x3 x3 x3 x3
0 1 0 1 0 10 1
0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 104 / 154
BDDs BDD reduction
x1
1
0
x2 x2
1 01
0
x3 x3
0 1
0 1
0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 105 / 154
BDDs BDD reduction
x1
0
x2 1
1
0 x3
0 1
0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 106 / 154
BDDs BDD reduction
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 107 / 154
BDDs BDD reduction
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 108 / 154
BDDs BDD operations
Complementation of f
x1
0
x2 1
1
0 x3
0 1
0 1
f is to be complemented
Result of complementation only the terminal values of 0 and 1
TECHNO
OF LO
need to be interchanged
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 109 / 154
BDDs BDD operations
Complementation of f
x1
0
x2 1
1
0 x3
0 1
1 0
f is to be complemented
Result of complementation only the terminal values of 0 and 1
TECHNO
OF LO
need to be interchanged
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 109 / 154
BDDs BDD operations
Restriction of f
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 110 / 154
BDDs BDD operations
Restriction of f
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 110 / 154
BDDs BDD operations
0
x2 1
1
0 x3
0 1
0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 111 / 154
BDDs BDD operations
x2 1
1
0 x3
0 1
0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 111 / 154
BDDs BDD operations
x3
0 1
0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 111 / 154
BDDs BDD operations
0
x2 1
1
0 x3
0 1
0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 112 / 154
BDDs BDD operations
0
x2 1
0 x3
0 1
0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 112 / 154
BDDs BDD operations
x3
0 1
0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 112 / 154
BDDs BDD operations
Shannon expansion:
f = x f jx 0 + x f jx 1
Existential quantification:
9x f = f jx 0 + f jx 1
Universal quantification:
8x f = f jx 0 f jx 1
f jx g = g f jx 0 + g f jx 1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 113 / 154
BDDs BDD operations
Shannon expansion:
f = x f jx 0 + x f jx 1
Existential quantification:
9x f = f jx 0 + f jx 1
Universal quantification:
8x f = f jx 0 f jx 1
f jx g = g f jx 0 + g f jx 1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 113 / 154
BDDs BDD operations
Shannon expansion:
f = x f jx 0 + x f jx 1
Existential quantification:
9x f = f jx 0 + f jx 1
Universal quantification:
8x f = f jx 0 f jx 1
f jx g = g f jx 0 + g f jx 1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 113 / 154
BDDs BDD operations
Shannon expansion:
f = x f jx 0 + x f jx 1
Existential quantification:
9x f = f jx 0 + f jx 1
Universal quantification:
8x f = f jx 0 f jx 1
f jx g = g f jx 0 + g f jx 1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 113 / 154
BDDs BDD operations
Composition
Theorem
f jx g = g f jx 0 + g f jx 1
Proof.
Here g is to be substituted for x in f
Let the support of g be xj1 ; xj2 ; : : :
When g is 1 for some truth assignment of xj1 ; xj2 ; : : :, f should be
restricted to x 1, hence we get the clause g f jx 1
Essentially means restrict f such that x 1 when g is 1
Similarly, when g is 0 for some truth assignment of xj1 ; xj2 ; : : :, f
should be restricted such that x 0, hence we get the clause
f jx 0 , restricting f to 0 when g is 0
g
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 114 / 154
BDDs BDD operations
Composition
Theorem
f jx g = g f jx 0 + g f jx 1
Proof.
Here g is to be substituted for x in f
Let the support of g be xj1 ; xj2 ; : : :
When g is 1 for some truth assignment of xj1 ; xj2 ; : : :, f should be
restricted to x 1, hence we get the clause g f jx 1
Essentially means restrict f such that x 1 when g is 1
Similarly, when g is 0 for some truth assignment of xj1 ; xj2 ; : : :, f
should be restricted such that x 0, hence we get the clause
f jx 0 , restricting f to 0 when g is 0
g
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 114 / 154
BDDs BDD operations
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 115 / 154
BDDs BDD operations
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 115 / 154
BDDs BDD operations
Shared BDDs
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 116 / 154
BDDs Implementation aspects
GY
ITU
IAN INST
KH
ARAGPUR
IND
its pointer returned
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 117 / 154
BDDs Implementation aspects
GY
ITU
IAN INST
KH
Fv
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 118 / 154
BDDs Implementation aspects
R2 = ITE(RF ; RG ; RH )
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
v v v
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 119 / 154
BDDs Implementation aspects
ITE algorithm
ITE(RF ; RG ; RH ) f
if (called as (RF ; RG ; RG ) or (0; RF ; RG ) or (1; RG ; RF ) or (RG ; 1; 0)) f
return RG ;
g else if (computed table has entry hhRF ; RG ; RH i ; R i) f
return R;
g else f
let v be the top variable of fRF ; RG ; RH g;
R1 ITE (RFv , RGv , RHv );
R2 ITE (RFv , RGv , RHv );
if R1 equals R2 return R1 ;
R find or add unique table(hhv ; R1 ; R2 ii);
insert computed table(hhRF ; RG ; RH i ; R i);
return R;
g
g
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 120 / 154
BDDs Implementation aspects
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 121 / 154
BDDs BDD extensions
Complement Edges
G
G
0 1 0 1
available redundant
ROBDD for both G and G
Share with complement edge
Share leaf also with complement edge
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 122 / 154
BDDs BDD extensions
Complement Edges
G
G
G G
0 1 0 1 0 1
available redundant
ROBDD for both G and G
Share with complement edge
Share leaf also with complement edge
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 122 / 154
BDDs BDD extensions
Complement Edges
G
G
G G
0 1 0 1 1
available redundant
ROBDD for both G and G
Share with complement edge
Share leaf also with complement edge
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 122 / 154
BDDs BDD extensions
v v
vf + v g = vf + v g = vf v g
= (v + f ) (v g ) = v g + v f + f g
= v g + v f + (v + v )f g = v (g + f g ) + v (f + f g )
= v (g (1 + f )) + v (f (1 + g )) = v g + v f = v f + v g
Preference is given to the left equivalent form so that the then leg has TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
no complement edge
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 123 / 154
BDDs BDD extensions
v v
vf + v g = v f + v g =) vf + v g = v f + v g
Preference is given to the left equivalent form so that the then leg has
no complement edge TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 124 / 154
BDDs BDD extensions
v v
vf + v g = v f + v g =) vf + v g = v f + v g
Preference is given to the left equivalent form so that the then leg has
no complement edge TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 125 / 154
BDDs BDD extensions
v v
vf + v g = v f + v g =) vf + v g = v f + v g
Preference is given to the left equivalent form so that the then leg has
no complement edge TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 126 / 154
BDDs Compose using ITE
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 127 / 154
BDDs Tautology checking using ITE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 128 / 154
BDDs Resolving ambiguities
Resolving ambiguities
Standard triples Resolving equivalences (contd.)
ITE(F ; F ; G) ! ITE(F ; 1; G) 1 First argument is chosen with
ITE(F ; G; F ) ! ITE(F ; G; 0) smallest top variable
ITE(F ; G; F ) ! ITE(F ; G; 1)
2 Break ties with smallest address
pointer
ITE(F ; F ; G) ! ITE(F ; 0; G)
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 129 / 154
BDDs More general representation
Example
t 0 1 X +t 0 1 X
0 0 0 0 0 0 1 X
1 0 1 X 1 1 1 1
X 0 X X X X 1 X
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 130 / 154
BDDs More general representation
Example
t 0 1 X +t 0 1 X
0 0 0 0 0 0 1 X
1 0 1 X 1 1 1 1
X 0 X X X X 1 X
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 130 / 154
BDDs More general representation
Example (contd.)
For the encoding
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 131 / 154
BDDs More general representation
fi ( (a)) = i (f (a))
The COSMOS symbolic simulator [Cho and Bryant 1989] uses ROBDDs
to compute the behavior of a transistor circuit symbolically
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 132 / 154
BDDs More general representation
fi ( (a)) = i (f (a))
The COSMOS symbolic simulator [Cho and Bryant 1989] uses ROBDDs
to compute the behavior of a transistor circuit symbolically
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 132 / 154
BDDs More general representation
fi ( (a)) = i (f (a))
The COSMOS symbolic simulator [Cho and Bryant 1989] uses ROBDDs
to compute the behavior of a transistor circuit symbolically
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 132 / 154
BDDs BDDs for sets and relations
Representation of Sets
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 133 / 154
BDDs BDDs for sets and relations
Representation of Sets
Example (A characteristic function and its ROBDD)
The set S has eight elements e1 ; : : : ; e8
encoded using three bits.
The table below shows the encoding and
also the charactersistic function XS (~x ) de- x1
fined on the encoding.
element x1 x2 x3 XS (~x ) 0
e1 0 0 0 0 x2 1
e2 0 0 1 0 1
e3 0 1 0 0
e4 0 1 1 1 0 x3
e5 1 0 0 0
e6 1 0 1 1 0 1
e7 1 1 0 0
0 1 TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
e8 1 1 1 1
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 134 / 154
BDDs BDDs for sets and relations
Operations on Sets
Empty Set X = 0
Set Union X(S [T ) = XS + XT
Set Intersection X(S \T ) = XS XT
Set Difference X(S T ) = XS XT
The right hand side represents usual operations that can be performed
on ROBDDs
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 135 / 154
BDDs BDDs for sets and relations
Representation of Relations
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 136 / 154
BDDs BDDs for sets and relations
Representation of Relations
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 136 / 154
BDDs BDDs for sets and relations
Representation of Relations
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 136 / 154
BDDs BDDs for sets and relations
= :::
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 137 / 154
BDDs BDDs for sets and relations
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 138 / 154
BDDs BDDs for sets and relations
1
s1 01 1 1 1 1
(p) (q ) =
0 s2 10 0 1 1 0
s3 11 1 1 1 0
0 0 0 0
0 0 0 1
XR
jS j = 4 1 0 0 0
dlg jSje = 2 1 0 0 1
Moore m/c representing recogniser, not a pure relation
Result of input non-determinism on left state
Result of input non-determinism on right state
Transitions between input capturing states a pure relation
Tabular transition relation shown for state encoding : S ! f0; 1g2
Table only has tuples for which XR (p) (q ) = 1; p; q 2 S
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 139 / 154
BDDs BDDs for sets and relations
1
s1 s1 01 1 1 1 1
(p) (q ) =
0 s2 10 0 1 1 0
s3 11 1 1 1 0
0 0 0 0
00 0 0 0 1
XR
s0
jS j = 4 1 0 0 0
dlg jSje = 2 1 0 0 1
Moore m/c representing recogniser, not a pure relation
Result of input non-determinism on left state
Result of input non-determinism on right state
Transitions between input capturing states a pure relation
Tabular transition relation shown for state encoding : S ! f0; 1g2
Table only has tuples for which XR (p) (q ) = 1; p; q 2 S
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 139 / 154
BDDs BDDs for sets and relations
1
s1 s3 s1 01 1 1 1 1
(p) (q ) =
0 s2 10 0 1 1 0
s3 11 1 1 1 0
0 0 0 0
00 10 0 0 0 1
XR
s0 s2
jS j = 4 1 0 0 0
dlg jSje = 2 1 0 0 1
Moore m/c representing recogniser, not a pure relation
Result of input non-determinism on left state
Result of input non-determinism on right state
Transitions between input capturing states a pure relation
Tabular transition relation shown for state encoding : S ! f0; 1g2
Table only has tuples for which XR (p) (q ) = 1; p; q 2 S
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 139 / 154
BDDs BDDs for sets and relations
1
s1 s3 s1 01 1 1 1 1
(p) (q ) =
0 s2 10 0 1 1 0
s3 11 1 1 1 0
0 0 0 0
00 10 0 0 0 1
XR
s0 s2
jS j = 4 1 0 0 0
dlg jSje = 2 1 0 0 1
Moore m/c representing recogniser, not a pure relation
Result of input non-determinism on left state
Result of input non-determinism on right state
Transitions between input capturing states a pure relation
Tabular transition relation shown for state encoding : S ! f0; 1g2
Table only has tuples for which XR (p) (q ) = 1; p; q 2 S
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 139 / 154
BDDs BDDs for sets and relations
jS j = 4 1 0 0 0
dlg jSje = 2 1 0 0 1
Since dlg jS je = 2, (p); p; q 2 S are encoded in 2 0 (p) 0 (p)
bits, as h1 (p); 0 (p)i and h1 (q ); 0 (q )i
XR : f0; 1g2 ! f0; 1g2 ! f0; 1g characterises the
tuples of the relation as the Boolean function 0 1
0 (p)1 (q )0 (q ) + 0 (p)1 (q )0 (q ) + 0 (p) 1 (q ),
hp; q i 2 R, on 1 (p), 0 (p), 1 (q ), 0 (q )
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 140 / 154
BDDs BDDs for sets and relations
1 (q ) XR h0;!
1i 1 (q ) !
reduce 1 (q )
0 1 0 1 0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 141 / 154
BDDs BDDs for sets and relations
1 (q ) XR h0;!
1i 1 (q ) !
reduce 1 (q )
0 1 0 1 0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 141 / 154
BDDs BDDs for sets and relations
1 (q ) XR h0;!
1i 1 (q ) !
reduce 1 (q )
0 1 0 1 0 1
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 141 / 154
CTL Symbolic Model Checking
Section outline
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 142 / 154
CTL Symbolic Model Checking CTL MC using BDDs
GY
ITU
IAN INST
KH
ARAGPUR
Both pre-image computations are forms of backward BFS in R
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 143 / 154
CTL Symbolic Model Checking CTL MC using BDDs
GY
ITU
IAN INST
KH
ARAGPUR
Both pre-image computations are forms of backward BFS in R
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 143 / 154
CTL Symbolic Model Checking CTL MC using BDDs
GY
ITU
IAN INST
KH
ARAGPUR
Both pre-image computations are forms of backward BFS in R
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 143 / 154
CTL Symbolic Model Checking CTL MC using BDDs
GY
ITU
IAN INST
KH
ARAGPUR
Both pre-image computations are forms of backward BFS in R
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 143 / 154
CTL Symbolic Model Checking CTL MC using BDDs
1 (q )
01 11
s1 s3
0 (p)
XR 0 (p)
M
00 10
s0 s2
0 1
XR hp1 ; p0 i hq1 ; q0 i = p0 q1 + p0 q1
Let JK represent the set of states satisfying
Y = J1K = fs1 ; s3 g; XY hq1 ; q0 i = q0
q y
JEX 1K = Xpre9 (Y )
GY
ITU
= 1
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 144 / 154
CTL Symbolic Model Checking CTL MC using BDDs
Xpre8 (Y ) =
8hq1 qh0 i [XR hp1 p0 i hq1 q0 i ) XY hq1 q0 i] i =
8hq1 i h ((p0 q1 + p0 q1 ) ) q0 )jq =0 ^ ((p0 q1 + p0 q1 ) ) q0 )jq =i1
0 0
=
8hq1 i ((p0 q1 + p0 q1 ) _ q0 )jq =0 ^ ((p0 q1 + p0 q1 ) _ q0 )jq =1 =
8hq1 i (p0 q1 + p0 q1 )
0 0
=
p0 ^ p0 =
0
So, M 6j= AX 1
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 145 / 154
CTL Symbolic Model Checking Model Checking using Sets of States
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 146 / 154
CTL Symbolic Model Checking Monotone functions
Monotone functions
Definition
Let S be a set of states and F : P (S ) ! P (S )
1 F is monotone if for X Y S ) F (X ) F (Y )
2 X S is a fixed point of F if F (X ) = X
Example Example
Let S = fs0 ; s1 g Let S = fs0 ; s1 g
F (Y ) = Y [ fs0 g F (Y ) = if Y = fs0 g ; fs1 g else fs0 g
F is a monotone function fs0 g fs0 ; s1 g but
fs0 g is the least fixed G (fs0 g) = fs1 g 6 G (fs0 ; s1 g) =
point fs0 g
fs0 ; s1 g is the greatest G is a non-monotone function
fixed point G does not have fixed points
GY
ITU
IAN INST
KH
ARAGPUR
IND
2
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 147 / 154
CTL Symbolic Model Checking Monotone functions
Monotone functions
Definition
Let S be a set of states and F : P (S ) ! P (S )
1 F is monotone if for X Y S ) F (X ) F (Y )
2 X S is a fixed point of F if F (X ) = X
Example Example
Let S = fs0 ; s1 g Let S = fs0 ; s1 g
F (Y ) = Y [ fs0 g F (Y ) = if Y = fs0 g ; fs1 g else fs0 g
F is a monotone function fs0 g fs0 ; s1 g but
fs0 g is the least fixed G (fs0 g) = fs1 g 6 G (fs0 ; s1 g) =
point fs0 g
fs0 ; s1 g is the greatest G is a non-monotone function
fixed point G does not have fixed points
GY
ITU
IAN INST
KH
ARAGPUR
IND
2
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 147 / 154
CTL Symbolic Model Checking Monotone functions
Monotone functions
Definition
Let S be a set of states and F : P (S ) ! P (S )
1 F is monotone if for X Y S ) F (X ) F (Y )
2 X S is a fixed point of F if F (X ) = X
Example Example
Let S = fs0 ; s1 g Let S = fs0 ; s1 g
F (Y ) = Y [ fs0 g F (Y ) = if Y = fs0 g ; fs1 g else fs0 g
F is a monotone function fs0 g fs0 ; s1 g but
fs0 g is the least fixed G (fs0 g) = fs1 g 6 G (fs0 ; s1 g) =
point fs0 g
fs0 ; s1 g is the greatest G is a non-monotone function
fixed point G does not have fixed points
GY
ITU
IAN INST
KH
ARAGPUR
IND
2
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 147 / 154
CTL Symbolic Model Checking Monotone functions
Monotone functions
Definition
Let S be a set of states and F : P (S ) ! P (S )
1 F is monotone if for X Y S ) F (X ) F (Y )
2 X S is a fixed point of F if F (X ) = X
Example Example
Let S = fs0 ; s1 g Let S = fs0 ; s1 g
F (Y ) = Y [ fs0 g F (Y ) = if Y = fs0 g ; fs1 g else fs0 g
F is a monotone function fs0 g fs0 ; s1 g but
fs0 g is the least fixed G (fs0 g) = fs1 g 6 G (fs0 ; s1 g) =
point fs0 g
fs0 ; s1 g is the greatest G is a non-monotone function
fixed point G does not have fixed points
GY
ITU
IAN INST
KH
ARAGPUR
IND
2
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 147 / 154
CTL Symbolic Model Checking Handling SATEX and SATEU
SATEU (; ) f
V J K; W JK; Y J?K;
repeat
X Y;
Y V [ (W \ pre9 (Y ));
until X = Y
return Y ; TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 148 / 154
CTL Symbolic Model Checking Handling SATEX and SATEU
SATEU (; ) f
V J K; W JK; Y J?K;
repeat
X Y;
Y V [ (W \ pre9 (Y ));
until X = Y
return Y ; TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 148 / 154
CTL Symbolic Model Checking Handling SATEX and SATEU
SATEU (; ) f
V J K; W JK; Y J?K;
repeat
X Y;
Y V [ (W \ pre9 (Y ));
until X = Y
return Y ; TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 148 / 154
CTL Symbolic Model Checking Handling SATEX and SATEU
SATEU (; ) f
V J K; W JK; Y J?K;
repeat
X Y;
Y V [ (W \ pre9 (Y ));
until X = Y
return Y ; TE
OF
TECHNO
LO
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 148 / 154
CTL Symbolic Model Checking Handling SATEG
Handling SATEG
EG = ^ (EX (EG )) X Y ) G(X ) G(Y )
JEG K = JK \ J(EX (EG ))K G is monotone, G(S ) = JK
Let G(X ) = JK \ pre9 (X ) SATEG () computes the GFP of G
SATEG () f
W JK ; Y J>K ;
repeat
X Y;
// Remove label EG from any state not
// having a successor labelled with EG
Y W \ pre9 (Y );
until X = Y
return Y ;
g TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 149 / 154
CTL Symbolic Model Checking Handling SATEG
Handling SATEG
EG = ^ (EX (EG )) X Y ) G(X ) G(Y )
JEG K = JK \ J(EX (EG ))K G is monotone, G(S ) = JK
Let G(X ) = JK \ pre9 (X ) SATEG () computes the GFP of G
SATEG () f
W JK ; Y J>K ;
repeat
X Y;
// Remove label EG from any state not
// having a successor labelled with EG
Y W \ pre9 (Y );
until X = Y
return Y ;
g TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 149 / 154
CTL Symbolic Model Checking Handling SATEG
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 150 / 154
CTL Symbolic Model Checking Handling SATE G
C
Handling SATEC G
Let H = f 1 ; : : : ; k g be the fairness constraints
For an infinite computation path to satisfy SATEC G wrt H,
must hold at each state of
is fair wrt H, so that each i 2 H holds infinitely often along
Let Y be the largest set of states with the following two properties
1 all states in Y satisfy
2 for all i 2 H and s 2 Y ,
i there is a non-zero length path from s to a state in Y satisfying i
ii all states in the path satisfy
Consider G(X ) = JK \ pre9 (JE [ U XX ^ ] ) \:::\
1 K
pre9 (JE [ U XX ^ k ]K)
G is monotone, G(S ) is the satisfying pre-image of states where
each leads to all i s, 1 i k proof?
q y
SATEC G () needs to compute the GFP of G G( SATEC G () ) = JK \
pre9 (JE [ U EC G () ^ 1 ]K) \ : : : \ pre9 (JE [ U EC G () ^ k ]K) ?
TECHNO
OF LO
TE
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 151 / 154
CTL Symbolic Model Checking Handling SATE G
C
GY
ITU
IAN INST
KH
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 152 / 154
CTL Symbolic Model Checking Handling SATE G
C
GY
ITU
IAN INST
KH
= Z \ Y = fS1 ; S3 g \ fS1 ; S2 ; S3 g = fS1 ; S3 g;
ARAGPUR
IND
19 5 1
Z
yog, km
s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 153 / 154
CTL Symbolic Model Checking Handling SATE G
C
GY
ITU
IAN INST
KH
return fS1 ; S3 g;
ARAGPUR
IND
19 5 1
yog, km s kOflm^
Chittaranjan Mandal (IIT Kharagpur) Testing and verification December 27, 2016 154 / 154