SLIDE 1 Semantics & Verification
Lecture 13
Gerd Behrmann
SLIDE 2 Outline of remaining lectures
- Lecture 9: Modelling real time system
- Lecture 10: More on Uppaal + mini projects
- Lecture 11: Mini projects
- Lecture 12: Verification of timed automata
- Lecture 13: Binary Decision Diagrams
- Lecture 14: Using BDDs for the purpose of verification
- Lecture 15: Round-up of course
SLIDE 3 Reduced Ordered Binary Decision Diagrams
[Bryant’86]
- Compact represetation of boolean functions
allowing effective manipulation (satisfiability, validity,….)
- Compact representation of sets over finite
universe allowing effective manipulations.
SLIDE 4 Use of ROBDDs
- Comibatorial circuits
- Sequential circuits
- Automata
- Combinatorial problems
- Temporal logic model checking
- Program analysis
- …..
SLIDE 5
Boolean Functions
SLIDE 6
Truth Tables
2n entries in table!
SLIDE 7
Combinatorial Circuits
Are these two circuits equivalent?
SLIDE 8 Control Programs
A Train Simulator, visualSTATE (VVS)
1421 machines 11102 transitions 2981 inputs 2667 outputs 3204 local states Declared state sp.: 10^476
BUGS ?
“Ideal” presentation: 1 bit/state will clearly NOT work!
SLIDE 9 “Good” Representations of Boolean Functions
Normalforms
– Disjunctive NF – Conjunctive NF – If-then-else NF – …….
THEOREM (Cook’s theorem) Satisfiability of Boolean expressions is NP-complete
Compact representations are
- compact and
- efficient
- n real-life examples
Always perfect representations are hopeless
SLIDE 10 Binary Decision Trees
Variable is set to 0 Variable is set to 1 Each path determines a partial (set of) truth assignments. Result of the boolean expression under the given assigment found in value of terminal.
SLIDE 11 Binary Decision Diagrams
allow NODES to be shared
Equivalence ~ on nodes: n ~ m iff either both n and m are terminals and have the same value
- r both are non-terminals with var(n) = var(m) and
- 1. n’ ~ m’ when n -0-> n’ , m-0->m’ , and
- 2. n’ ~ m’ when n -1-> n’ , m-1->m’
Have you seen this somewhere before?
SLIDE 12
Orderedness & Reducedness TESTS
SLIDE 13
Orderedness & Reducedness
x y z x x x
x<y x<z
SLIDE 14 Reduced Ordered Binary Decision Diagrams
IBEN
Edges to 0 implicit
SLIDE 15
ROBDDs formally
SLIDE 16
Ordering does matter!
Variable ordering
SLIDE 17
Canonicity of ROBDDs
SLIDE 18
Canonicity of ROBDDs
SLIDE 19
Array implementation
b
SLIDE 20
Makenode and Hashing
SLIDE 21
BUILD
Run time?
SLIDE 22
Boolean operations on ROBDDs
SLIDE 23
Boolean operations on ROBDDs
SLIDE 24
APPLY example
SLIDE 25
APPLY operation
SLIDE 26
APPLY with dynamic programming
SLIDE 27
Other operations
SLIDE 28 Mia’s skema
geo bio 13-14 bio 14-15 gym gym fys fys fys gym 12-13 gym mat bio dan dan 11-12 tys dan tys dan eng 10-11 tys geo dan tys mat 9-10 eng tys dan eng mat 8-9
Sun Sat Fri Thu Wed Tue Mon
SLIDE 29 ROBDD encoding of transition system
00 10 01 11
Trans(x1,x2,y1,y2):= !x1 & !x2 & !y1 & y2 + !x1 & !x2 & y1 & y2 + x1 & !x2 & !y1 & y2 + x1 & !x2 & y1 & y2 + x1 & x2 & y1 & !y2;
Encoding of states using binary variables (here x1 and x2). Encoding of transition relation using source and target variables (here x1, x2, y1, and y2)
SLIDE 30 ROBDD representation (cont.)
Trans(x1,x2,y1,y2):= !x1 & !x2 & !y1 & y2 + !x1 & !x2 & y1 & y2 + x1 & !x2 & !y1 & y2 + x1 & !x2 & y1 & y2 + x1 & x2 & y1 & !y2;
00 10 01 11
SLIDE 31 Reachable States
Reach(x) := Init(x); REPEAT Old(x) := Reach(x); New(y) := Exists x.(Reach(x) & Trans(x,y)); Reach(x) := Old(x) + New(x) UNTIL Old(x) = Reach(x)
00 10 01 11 Reach0 Reach1 Reach2 Reach1 Relational Product: May be constructed without building intermediate (often large) &-BDD.