Decson Dagrams Dervatves Logc Crcuts Desgn Semnars WS2010/2011, Lecture 3 Ing. Petr Fšer, Ph.D. Department of Dgtal Desgn Faculty of Informaton Technology Czech Techncal Unversty n Prague Evropský socální fond Praha & EU: Investujeme do vaší budoucnost
Multple-Output Functons Mult-rooted BDDs (Shared BDDs, SDDs) MTBDDs (Mult-Termnal BDDs) BDDs for characterstc functons PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 2
Mult-Rooted (Shared) BDDs Each root represents a dstnct functon Subgraphs of dfferent functons are shared Nodes n Unque table are shared BDD reducton rules retaned Canoncty retaned Evaluaton tme: O(n.m) PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 3
Mult-Termnal BDDs (MTBDDs) Termnals represent output vectors O(2 m ) termnals a, b a+b a.b 00 0 0 01 1 0 10 1 0 11 1 1 PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 4
Mult-Termnal BDDs (MTBDDs) Reducton rules and canoncty retaned O(2 m ) termnals Evaluaton tme: O(n+m) PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 5
BDDs for Characterstc Functon Let f( 1,, n ) (y 1,, y m ) f ( 1,, n, y 1,, y m ) = 1 f( 1,, n ) = (y 1,, y m ) a b f 1 = a+b f 2 = a.b 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 a b f 1 f 2 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 a b f 1 f 2 1 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 1 1 1 PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 6
BDDs for Characterstc Functon a b f 1 f 2 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 a b f 1 f 2 1 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 1 1 1 = a.b.f 1. f 2 + a.b.f 1.f 2 + a.b.f 1.f 2 + a.b.f 1.f 2 PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 7
BDDs for Characterstc Functon BDD reducton rules retaned Canoncty retaned Evaluaton tme: O(n+m) PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 8
BDDs for Multple-Output Functons References P. Ashar, S. Malk, "Fast functonal smulaton usng branchng programs, In Proceedngs of the 1995 IEEE/ACM nternatonal conference on Computer-aded desgn, San Jose, Calforna, Unted States, 1995, pp. 408-412. R. Drechsler, C. Scholl, B. Becker, "Functonal smulaton usng bnary decson dagrams, In Proceedngs of the 1997 IEEE/ACM nternatonal conference on Computer-aded desgn, San Jose, Calforna, Unted States, 1997, pp. 8-12. M. Fujta, P. C. McGeer, J. C. Yang, "Mult-Termnal Bnary Decson Dagrams: An Effcent DataStructure for Matr Representaton", Formal Methods n System Desgn Journal, vol. 10, no. 2-3, pp. 149-169, aprl, 1997. T. Sasao, Y. Iguch, M. Matsuura, "Comparson of decson dagrams for multple-output logc functons, In Internatonal Workshop on Logc and Synthess, Unversty of Mchgan, 2002, pp. 4-7. PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 9
Incompletely Specfed Functons Two BDDs Modfed Bnary Dagrams (MBDs) BDD for characterstc functon PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 10
Incompletely Specfed Functons Two BDDs On-set & DC-set (or on- and off-set) are mplemented by separate BDDs or by mult-rooted BDD Propertes: Two separate functons, no relaton between onand dc-set on-set and dc-set (or on-set and off-set) may ntersect PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 11
Modfed Bnary Dagrams (MBDs) Lke MTBDDs Three termnals Eample: f 1 = a.b.c + a.b.c f dc = a.b.c PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 12
Modfed Bnary Dagrams (MBDs) BDD reducton rules & canoncty retaned Operatons slghtly modfed, applcaton prncples are the same AND 0 1 X 0 0 0 0 1 0 1 X X 0 X X OR 0 1 X 0 0 1 X 1 1 1 1 X X 1 X NOT 0 1 1 0 X X PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 13
Modfed Bnary Dagrams (MBDs) Propertes Two separate functons, no relaton between on- and dc-set But on-, off- and dc-set cannot ntersect PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 14
PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 15 BDD for Characterstc Functon One more defnton of the characterstc functon of a completely specfed multple-output functon: m n m n n y f y y m f 1 1 1 1 1 ),..., ( ),...,,,..., ( 1,... {0,1}, ),..., ( m n OFF n ON m n n n OFF n n ON f y f y y y f f f f 1 1 1 1 1 1 1 1 1 ),..., ( ),..., ( ),...,,,..., ( ),..., ( ),..., ( ),,..., ( ),..., ( Let
BDD for Characterstc Functon For ncompletely specfed multple-output functon: ( 1,..., n, y1,..., ym) m 1 y f ON y f OFF f DC PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 16
BDD for Characterstc Functon Propertes Real nterpretaton of dc-set s recognzed DC may be ether 0, or 1 PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 17
Incompletely Specfed Functons References R. P. Jacob, "A Study of the Applcaton of Bnary Decson Dagrams n Multlevel Logc Synthess", Ph.D. Thess, 1993. T. Sasao, M. Matsuura, "BDD representaton for ncompletely specfed multple-output logc functons and ts applcatons to functonal decomposton, In 42nd Conference on Desgn Automaton, San Dego Calforna USA, 2005, pp. 373-378. PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 18
Algebrac Decson Dagrams (ADDs) More termnals, not only {0, 1} ADD represents a set of functons f : {0, 1} n S MTBDDs, actually Arthmetc operatons support (addton, multplcaton, dvson, mnmum, mamum) Complemented edges of lmted use Reducton rules and canoncty retaned Applcatons: Representaton of mult-output functons Matr multplcaton Shortest path search FSM traversal PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 19
ADDs References F. Somenz et al. "Algebrac decson dagrams and ther applcatons, In Proceedngs of the 1993 IEEE/ACM nternatonal conference on Computer-aded desgn, Santa Clara, Calforna, Unted States, 1993, pp. 188-191. M. Fujta, P. C. McGeer, J. C. Yang, "Mult-Termnal Bnary Decson Dagrams: An Effcent DataStructure for Matr Representaton", Formal Methods n System Desgn Journal, vol. 10, no. 2-3, pp. 149-169, aprl, 1997. PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 20
Zero-Suppressed Decson Dagrams (ZDDs) To represent combnaton sets (or sets of subsets), not functons (!) Sets of combnatons of n objects Each combnaton descrbed by a vector X = ( 1, 2,, n ), X {0, 1} Good for representng sparse combnatons = combnatons havng only few 1 s Bascally BDDs, wth modfed reducton rules all combnatons stored n ZDD are recovered by traversng all paths from the root to the 1-termnal PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 21
Zero-Suppressed Decson Dagrams (ZDDs) BDD Reducton rules: 1. Elmnate duplcate termnals 2 termnals only 2. Elmnate duplcate non-termnals share equvalent subgraphs 3. Elmnate redundant nodes elmnate nodes where both edges pont to the same node [ lo(u) = h(u) ] PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 22
Zero-Suppressed Decson Dagrams (ZDDs) ZDD Reducton rules: 1. Elmnate duplcate termnals 2 termnals only 2. Elmnate duplcate non-termnals share equvalent subgraphs 3. Elmnate nodes whose 1-edge ponts to the 0-termnal node elmnate non-branchng nodes representng non-present objects PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 23
Zero-Suppressed Decson Dagrams (ZDDs) Eample: X = (a, b, c) S = { (100), (010), (001) } = { (a), (b), (c) } Elmnate nodes whose 1-edge ponts to the 0-termnal node PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 24
Zero-Suppressed Decson Dagrams Eamples of operatons: Subset_1(P, var) returns the subset of P where var = 1 Subset_0(P, var) returns the subset of P where var = 0 Unon(P, Q) returns P Q Intsecton(P, Q) returns P Q Dfference(P, Q) returns P- Q Product(P, Q) returns all possble concatenatons Dvson(P, Q) returns quotent and remander, P = Q*(P/Q) + (P%Q) PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 25
Zero-Suppressed Decson Dagrams Algorthms: Performed recursvely Lke APPLY n BDDs Complety of bnary operatons: O(P.Q) PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 26
ZDD Propertes Canoncal under gven varable orderng and support set Good for sparse combnatons No problems wth many varables (n contrast wth BDDs) Worst-case ZDD sze s O( X. S ) PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 27
Applcatons of ZDDs Cube (SOP) set representaton a a Each lteral represented by one ZDD varable 2n ZDD varables for n-nput functon a' b b' b Eample { ab, abc, c } = { (101000), (101001), (000010) } where X = ( a, a, b, b, c, c ) c c' c c' 0 1 PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 28
Applcatons of ZDDs Network paths representaton (e.g. for tmng analyss) Representaton of fault sets Combnatoral problems Unate coverng problem SAT solvng Graph problems Data mnng PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 29
ZDDs References S. Mnato, "Zero-suppressed BDDs for set manpulaton n combnatoral problems, In 30th Internatonal Conference on Desgn Automaton, USA, 1993. A. Mshchenko, An ntroducton to zero-suppressed bnary decson dagrams, In Proceedngs of the 12th Symposum on the Integraton of Symbolc Computaton and Mechanzed Reasonng, 2001. S. Mnato, "Zero-suppressed BDDs and ther applcatons", Internatonal Journal on Software Tools for Technology Transfer (STTT), vol. 3, no. 2, pp. 156-170, 2001 S. Mnato, Recent Topcs on Decson Dagrams and Dscrete Structure Manpulaton, Proc. 9th Int. Workshop on Boolean Problems (IWSBP'10), Freberg, Germany, 16.-17.9.2010, pp. 103-112 PI-SCN-3, ČVUT FIT, Petr Fšer, 2010 30