Binary Recursion Tree.ppt
《Binary Recursion Tree.ppt》由会员分享,可在线阅读,更多相关《Binary Recursion Tree.ppt(54页珍藏版)》请在麦多课文档分享上搜索。
1、1,Binary Recursion Tree,The recursive Shannon expansion corresponds to a binary recursion treeExample:Path (v) to node v corresponds to cube c(v) Example: c(v) = x1 x2 x3,1,0,1,1,0,0,x1,x3,x2,1,1,1,0,0,0,x,y,y,v,(v),2,Binary Recursion Tree,The root represents the original function f. Each node v cor
2、responds to fc(v). If ever fc(v) = 1 or 0 we can terminate the tree and replace v by 1 or 0. Such a node v is a leaf.,3,Example,1,1,1,0,0,0,1,a,b,b,0,1,0,1,0,c,c,Splitting variable,4,Implicit Enumeration - Branch and Bound,Checking for tautology and many other theoretically intractable problems (co-
3、NP complete) can be effectively solved using implicit enumeration: use recursive Shannon expansion to explore Bn. In (hopefully) large subspaces of Bn, prune the binary recursion tree by exploiting properties of the node function fc(v) exploiting heuristic bounding techniques even though in the wors
4、t case the recursion tree may have 2n nodes, in practice (in many cases), we typically encounter a linear number of nodes,5,Implicit Enumeration - Branch and Bound,Thus we say that the 2n min-terms of f have been implicitly enumerated BDDs (Binary Decision Diagrams) are alternate representations in
5、which implicit enumeration is performed statically, and nodes with identical path cofactors are identified(very important - will discuss later!),6,Example,Not a tautology. In testing for tautology, we look for a cube subspace c such that fc=0. If we can find it then f is not the tautology.,1,1,1,0,0
6、,0,1,a,b,b,0,1,0,1,0,c,c,fab,7,Can rule out complete cube subspace c if fc=1Tautology can be proved by finding ci such that ci = 1 and fci 1 for all ci. We dont need that ci cj =.,C ,Means that f, in the subspace c = ac, is identically 1,8,Definition 1 A function f : Bn B is positive unate in variab
7、le xi iffThis is equivalent to monotone increasing in xi:for all min-term pairs (m-, m+) whereFor example, m-3=1001, m+3=1011(where i=3),9,Similarly for negative unate monotone decreasing:A function is unate in xi if it is either positive unate or negative unate in xi.Definition 2 A function is unat
8、e if it is unate in each variable. Definition 3 A cover f is positive unate in xi iff xi cj for all cubes cjF,10,Example 1,c,b,a,c,b,a,m+,m-,f(m-)=1 f(m+)=0,positive unate in a,b negative unate in c,11,The Unate Recursive Paradigm,In the EXPRESSO program, the key pruning technique is based on exploi
9、ting the properties of unate functions. In particular, the splitting variable is chosen so that the functions at lower nodes of the recursion tree become unate.,12,Unate covers F have many extraordinary properties: If a cover F is minimal with respect to single-cube containment, all of its cubes are
10、 essential primes.In this case F is the unique minimum cube representation of its logic function.A unate cover represents the tautology iff it contains a cube with no literals, i.e. a single tautologous cube.This type of implicit enumeration applies to many sub-problems (prime generation, reduction,
11、 complementation, etc.). Hence, we refer to it as the Unate Recursive Paradigm.,13,The Binate Select Heuristic,Tautology and other programs based on the unate recursive paradigm use a heuristic called BINATE_SELECT to choose the splitting variable in recursive Shannon expansion. The idea is for a gi
12、ven cover F, choose the variable which occurs, both positively and negatively, most often in the cubes of F.,14,The Binate Select Heuristic,Example 2 Unate and non-unate covers:a b c dG = ac+cd 1 2 1 22 2 1 0a b c dF = ac+cd+bcd 1 2 1 22 2 0 12 1 1 0 Choose c for splitting. The binate variables of a
13、 cover are those with both 1s and 0s in the corresponding column. In the unate recursive paradigm, the BINATE_SELECT heuristic chooses a (most) binate variable for splitting, which is thus eliminated from the sub-covers.,is unate,is not unate,15,Examples,1,1,1,0,0,2221 unate,22212 unate,21202 unate,
14、1222 2120 unate,12222 unate,12220 21201,1 2 1 2 0 F= 2 2 0 1 22 1 1 0 1,1 2 1 2 F=2 2 0 12 1 1 0,e,c,c,FC,FC,16,Tautology,Is F = 1? NOT EASY!1211211101200200F= 2201 = 1?12021220201000210012,17,Two Useful Theorems,Theorem 1Theorem 2 Let A be a unate cover matrix. Then A1 if and only if A has a row of
15、 all 2s. Proof: If. A row of all 2s is the tautology cube. Only if. Assume no row of all 2s. Without loss of generality, suppose function is positive unate. Then each row has at least one “1” in it. Consider the point (0,0,0). This is not contained in any row of A. Hence A1.,18,Unate Reduction of Ta
16、utology Checking,Let F(x) be a cover. Let (a,x) be a partition of the variables x, and letwhere the columns of A correspond to variables a of x T is a matrix of all 2s.Theorem 3 Assume A 1. Then F1 F1,19,Example 3=,20,A1,C2,D1,B2,C1,B1,A2,Unate Reduction,Result: Only have to look at D1 to test if th
17、is is a tautology. Note: A1, A2 has no row of all 2s. Hence is a unate cover. Hence (A1, A2)1,21,End of Lecture 2,22,Proof,Theorem 1 Assume A 1. Then F1F1 Proof: if: Assume F1. Then we can replace F by all 2s. Then last row of F becomes a row of all 2s, so tautology.,A1 T=2s,23,Proof (contd),Only if
18、: Assume F 1. Then there is a minterm m2 such that F(m2)=0, i.e. m2cube of F. Similarly, m1 exists where A(m1)=0, i.e. m1cube of A. Now the minterm (m1,m2) in the full space satisfies F(m1,m2)=0 since m1m2 AX and m1m2TF. (a, x) is any row of first parta(m1) x(m2)=0 x(m2)=0 (t,f) is any row of the la
19、st part t(m1) f(m2)=t(m1) 0 = 0 So m1m2 is not in any cube of F.,24,Unate Reduction for Tautology,Procedure TAUTOLOGY(F, C) / C is a cube returned if F 1. Then C / contains a minterm m where F(m)=0T SPECIAL_CASES(F)if (T -1) return TF UNATE_REDUCTION(F)if (F=) print C; return 0;j BINATE_SELECT(F)T T
20、AUTOLOGY(Fxj , C xj if(T=0) print (C xj ), return 0T TAUTOLOGY(Fxj , C xj if(T=0) print (C xj ), return 0return 1end,25,Unate Reduction for Tautology,Notes. T=1(0) if F is a tautology (is empty), else T=-1SPECIAL_CASES: (T=-1 unless) T=1 : F contains a cube with no literals (all 2s) T=0 : F contains
21、 same literal in every cube T=0 if number of minterms in onset is 2n,26,x1,x1,x2,x2,x3,x4,x4,x3,Unate reduction,No tautology(case 2),No tautology(case 2),No tautology(case 2),tautology(case 1),tautology(case 1),tautology(case 1),27,Unate Recursive Paradigm,Create cofactoring tree stopping at unate c
22、overs choose, at each node, the “most binate” variable for splitting recurse till no binate variable left (unate leaf) “Operate” on the unate cover at each leaf to obtain the result for that leaf. Return the result At each non-leaf node, merge (appropriately) the results of the two children.Main Ide
23、a “Operation” on unate leaf is easy Operations: complement, simplify,tautology,generate-primes,.,merge,28,Operations on a Unate Cover: Complement,Map cube matrix M into Boolean matrix Ba b c d e= BThus non-2 12 0,29,Complement of a Unate Cover,Find all minimal column covers of B. (A column cover is
24、a set of columns J such that for each row i, jJ such that Bij = 1)Example 4 1,4 is a minimal column cover forAll rows “covered” by at least one 1.,30,Complement of a Unate Cover,For each minimal column cover create a cube with opposite column literal from M.Example 5 1,4 ad is a cube of f,31,Complem
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- BINARYRECURSIONTREEPPT
