Formal Methods in software development a.y.2016/2017 Prof. Anna Labella 7/14/2017 1 OBDD [H-R cap.6] Representing boolean functions A formula can be represented by a boolean function, where its variables are boolean variables, as in circuits. 7/14/2017 2 OBDD 7/14/2017 [H-R cap.6] 3 Exercises 7/14/2017 4 Binary decision trees 7/14/2017 5 Exercises 7/14/2017 6 Exercises 7/14/2017 7 BDD Removal of duplicated terminals Removal of redundant tests 7/14/2017 (they are nomore trees) 8 BDD Removal of duplicated non terminals 7/14/2017 9 BDD Eliminate duplicated terminals Eliminate redundant tests Eliminate duplicated non terminals 7/14/2017 10 BDD: how do we introduce operations? Composing BDD constants variables 1 ☐ 7/14/2017 11 BDD: sums and products We can substitute terminals by non terminals and compose functions e.g. In the conjunction we substitute 1 by the BDD of the other function In the disjunction we substitute 0 by the BDD of the other function In the negation we swap 1 and 0 7/14/2017 12 Exercises Let f be represented by describe 7/14/2017 13 BDD Satisfiability: to reach 1 via a coherent path Validity: it is not possible to reach 0 via a coherent path 7/14/2017 14 OBDD: ordered binary decision diagrams Equivalence? 7/14/2017 15 OBDD Normal form: order and then reduce Theorem. We have a unique result Hence there is a canonical form 7/14/2017 16 OBDD An example: the parity function on 4 variables 7/14/2017 Repeated variables 17 OBDD 7/14/2017 order without repetitions 18 OBDD 7/14/2017 19 OBDD • • • • • • Composition is nomore directly allowed Absence of redundant variables Test for semanic equivalence with a compatible ordering Test for validity (reducibility to B1) Test for implication (reducibility of f. g to B0) Test for satisfiability (non reducibility to B0) 7/14/2017 20 Exercises 7/14/2017 21 OBDD: the algorithm reduce It identifies equal nodes going bottom up 7/14/2017 22 OBDD: the algorithm apply It exploits operations 7/14/2017 23 OBDD: the algorithm apply Shannon expansion theorem ƒ = x ƒ[0/x] + x ƒ[1/x] In general form ƒ op g = xi ( ƒ[0/xi] op g[0/xi] + xi ( ƒ[1/xi] op g[1/xi]) 7/14/2017 24 OBDD: the algorithm apply 7/14/2017 25 OBDD: the control structure for the algorithm apply 7/14/2017 26 OBDD: the algorithm apply 7/14/2017 27 OBDD: the algorithm restrict restrictig f to f[0/x] and to f[1/x] restrict(0, x, Bf) works as follows: For each node n labeled 7/14/2017 28 OBDD: restrict exercise 7/14/2017 29 OBDD: the algorithm exists f = f[0/x] + f[1/x] f = f[0/x] . f[1/x] 7/14/2017 30 OBDD: the algorithm exists exercise 7/14/2017 31 OBDD: the algorithm exists exercise 7/14/2017 32 7/14/2017 33 Complexity 7/14/2017 34
© Copyright 2026 Paperzz