Crash course Verification of Finite Automata Binary Decision Diagrams Exercise session 10 Xiaoxi He 1
Equivalence of representations E Sets A B A B Set algebra,, ψψ EE = 1 ψψ AA = ff ψψ BB = gg ψψ AA BB = ff gg Boolean functions/ Characteristic functions Boole algebra +,, 2
Equivalence of representations E Sets A B A B Set algebra,, ψψ EE = 1 ψψ AA = ff ψψ BB = gg ψψ AA BB = ff gg Boolean functions/ Characteristic functions Boole algebra +,, Binary encoding: σσ: XX Ψ Map a state to a binary expression Bijective mapping! 3
Equivalence of representations E Sets A B A B Set algebra,, Binary encoding: σσ: XX Ψ Map a state to a binary expression Bijective mapping! 4 ψψ EE = 1 ψψ AA = ff ψψ BB = gg ψψ AA BB = ff gg Boolean functions/ Characteristic functions Boole algebra +,, States Boolean functions
Equivalence of representations E Sets xx A A ss AA B A B σσ( ) Example: σσ ss = xx 1 xx 0 = (1,0) and ψψ AA = xx 1 + xx 0 ss ψψ AA? ψψ EE = 1 ψψ AA = ff ψψ BB = gg ψψ AA BB = ff gg Boolean functions/ Characteristic functions ψψ AA ψψ AA σσ ss = 1 σσ ss ψψ AA or just ss ψψ AA Reads ss satisfies ψψ AA 5
Binary Decision Diagrams Based on the Boole-Shannon decomposition: Boolean function of nn and (nn 1) variables For a given order of variable, the decomposition is unique! Hence the uniqueness of R(reduced)O(rdered)BDD. Reminder: In practice, simplicity of BDD depends strongly on the order. Good vs. Bad ordering 6
Binary Decision Diagrams: an example ff: xx 1 + xx 1 xx 2 + xx 2 xx 3 ff xx 1 0 1 0 1 7
Binary Decision Diagrams: an example ff: xx 1 + xx 1 xx 2 + xx 2 xx 3 Fall xx 1 = 0 ff xx1 =0: xx 2 + xx 2 xx 3 ff xx 1 ff xx1 =0 xx 2 0 1 0 1 8
Binary Decision Diagrams: an example ff: xx 1 + xx 1 xx 2 + xx 2 xx 3 Fall xx 1 = 0 ff xx 1 ff xx1 =0: xx 2 + xx 2 xx 3 Fall xx 2 = 0 ff xx1 =0, xx 2 =0: xx 3 ff xx1 =0 xx 2 ff xx1 =0, xx 2 =0 xx 3 0 1 0 1 9
Binary Decision Diagrams: an example ff: xx 1 + xx 1 xx 2 + xx 2 xx 3 Fall xx 1 = 0 ff xx 1 ff xx1 =0: xx 2 + xx 2 xx 3 Fall xx 2 = 0 ff xx1 =0, xx 2 =0: xx 3 ff xx1 =0 xx 2 ff xx1 =0, xx 2 =0 xx 3 0 1 0 1 10
Binary Decision Diagrams: an example ff: xx 1 + xx 1 xx 2 + xx 2 xx 3 Fall xx 1 = 0 ff xx 1 ff xx1 =0: xx 2 + xx 2 xx 3 Fall xx 2 = 0 ff xx1 =0, xx 2 =0: xx 3 Fall xx 2 = 1 ff xx1 =0, xx 2 =1: 1 ff xx1 =0 ff xx1 =0, xx 2 =0 xx 2 xx 3 0 1 0 1 11
Binary Decision Diagrams: an example ff: xx 1 + xx 1 xx 2 + xx 2 xx 3 Fall xx 1 = 0 ff xx 1 ff xx1 =0: xx 2 + xx 2 xx 3 Fall xx 2 = 0 ff xx1 =0 xx 2 ff xx1 =0, xx 2 =0: xx 3 Fall xx 2 = 1 ff xx1 =0, xx 2 =1: 1 ff xx1 =0, xx 2 =0 xx 3 Fall xx 1 = 1 ff xx1 =1: 1 0 1 0 1 12
Crash course Verification of Finite Automata Binary Decision Diagrams Slides online on my webpage: http://people.ee.ethz.ch/~jacobr/ Your turn! 13
Ex1: Sets Representation Each state is either a nominal or an error state or both". X N E 14
Ex1: Sets Representation If a state is in the overflow set, it is not a nominal state". O X N E But note it is not necessarily true!! Although you would like it to be 15
Ex1: Sets Representation Describe Q1, the set of error states which are not an overflow, in term of sets and characteristic functions. O X N E Q1 16
Ex1: Sets Representation Describe Q2, satisfying "O E", i.e., the set of state for which this property holds, in term of sets and characteristic functions. O Q2 X Is that correct? N E 17
Ex1: Sets Representation Describe Q2, satisfying "O E", i.e., the set of state for which this property holds, in term of sets and characteristic functions. N O E Q2 X Is that correct? No! What if a state is not in O? Property is always true! 18
Ex1: Sets Representation Describe Q2, satisfying "O E", i.e., the set of state for which this property holds, in term of sets and characteristic functions. N O E Q2 X Is that correct? No! What if a state is not in O? Property is always true! 19
Ex2.1 Verication using BDDs 20
Ex2.1 Verication using BDDs 21
Ex2.1 Verication using BDDs 22
Ex2.2 BDDs with respect to different orderings, 23
Ex2.2 BDDs with respect to different orderings, Better ordering: 6 vs. 9 nodes 24
About the lecture exercise feedback 26
Crash course Verification of Finite Automata Binary Decision Diagrams See you next week! 27