Presentation is loading. Please wait.

Presentation is loading. Please wait.

Formal Methods in software development

Similar presentations


Presentation on theme: "Formal Methods in software development"— Presentation transcript:

1 Formal Methods in software development
a.y.2017/2018 Prof. Anna Labella 1/13/2019

2 OBDD [H-R chap.6] Representing boolean functions
A formula can be represented by a boolean function, where its variables are boolean variables, as in circuits. 1/13/2019

3 OBDD [H-R cap.6] 1/13/2019

4 Exercises 1/13/2019

5 Binary decision trees 1/13/2019

6 Exercises 1/13/2019

7 Exercises 1/13/2019

8 BDD Removal of duplicated terminals Removal of redundant tests
(they are nomore trees) 1/13/2019

9 BDD Removal of duplicated non terminals 1/13/2019

10 BDD Eliminate duplicated terminals Eliminate redundant tests
Eliminate duplicated non terminals 1/13/2019

11 BDD: how do we introduce operations? Composing BDD
constants variables 1 1/13/2019

12 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 1/13/2019

13 Exercises Let f be represented by describe 1/13/2019

14 BDD Satisfiability: to reach 1 via a coherent path
Validity: it is not possible to reach 0 via a coherent path 1/13/2019

15 OBDD: ordered binary decision diagrams
Equivalence? 1/13/2019

16 OBDD Normal form: order and then reduce
Theorem. We have a unique result Hence there is a canonical form 1/13/2019

17 OBDD An example: the parity function on 4 variables Repeated variables
1/13/2019 Repeated variables

18 OBDD 1/13/2019 order without repetitions

19 OBDD 1/13/2019

20 OBDD Composition is nomore directly allowed But we have:
Absence of redundant variables Test for semantic equivalence with a compatible ordering Test for validity (reducibility to B1) Test for satisfiability (non reducibility to B0) Test for implication (reducibility of f. g to B0) 1/13/2019

21 Exercises 1/13/2019

22 OBDD: the algorithm reduce
It identifies equal nodes going bottom up 1/13/2019

23 OBDD: the algorithm reduce
1/13/2019

24 OBDD: the algorithm apply
It exploits operations acting on (op, Bf, Bg) 1/13/2019

25 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]) This provides a recursive call structure 1/13/2019

26 OBDD: the algorithm apply
1/13/2019

27 OBDD: the algorithm apply
1/13/2019

28 OBDD: the control structure for the algorithm apply
1/13/2019

29 OBDD: the algorithm apply
1/13/2019

30 OBDD: the algorithm restrict
Given f, restrict(0, x, Bf) computes the reduced OBDD corresponding to f[0/x] Analogously, restrict(0, x, Bf) computes the reduced OBDD corresponding to to f[1/x] restrict(0, x, Bf) works as follows: For each node n labeled 1/13/2019

31 OBDD: restrict exercise
1/13/2019

32 OBDD: the algorithm exists
 f = f[0/x] + f[1/x]  f = f[0/x] . f[1/x] 1/13/2019

33 OBDD: the algorithm exists exercise
1/13/2019

34 OBDD: the algorithm exists exercise
1/13/2019

35 1/13/2019

36 Complexity 1/13/2019

37 Exercises 1/13/2019

38 1/13/2019


Download ppt "Formal Methods in software development"

Similar presentations


Ads by Google