Finite field arithmetic: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Liamsteele
 
Line 1: Line 1:
In the field of [[computer science]], a '''binary decision diagram''' ('''BDD''') or '''branching program''', like a [[negation normal form]] (NNF) or a [[propositional directed acyclic graph]] (PDAG), is a [[data structure]] that is used to represent a [[Boolean function]]. On a more abstract level, BDDs can be considered as a [[data compression|compressed]] representation of [[set (mathematics)|sets]] or relations. Unlike other compressed representations, operations are performed directly on the compressed representation, i.e. without decompression.
Hi, everybody! <br>I'm Arabic male :D. <br>I really love The Vampire Diaries!<br><br>Also visit my blog ... fifa 14 coin generator ios ([https://www.youtube.com/watch?v=JcP2k3KKkuU additional reading])
 
== Definition ==
 
A Boolean function can be represented as a rooted, directed, acyclic [[graph theory|graph]], which consists of several decision nodes and terminal nodes. There are two types of terminal nodes called 0-terminal and 1-terminal. Each decision node <math>N</math> is labeled by  Boolean variable <math>V_N</math> and has two [[child node]]s called low child and high child. The edge from node <math>V_N</math> to a low (or high) child represents an assignment of <math>V_N</math> to 0 (resp. 1).
Such a '''BDD''' is called 'ordered' if different variables appear in the same order on all paths from the root. A BDD is said to be 'reduced' if the following two rules have been applied to its graph:
* Merge any [[Graph isomorphism|isomorphic]] subgraphs.
* Eliminate any node whose two children are [[Graph isomorphism|isomorphic]].
 
In popular usage, the term '''BDD''' almost always refers to '''Reduced Ordered Binary Decision Diagram''' ('''ROBDD''' in the literature, used when the ordering and reduction aspects need to be emphasized). The advantage of an ROBDD is that it is canonical (unique) for a particular function and variable order.<ref>Graph-Based Algorithms
for Boolean Function Manipulation, Randal E. Bryant, 1986</ref> This property makes it useful in [[functional equivalence]] checking and other operations like functional technology mapping.
 
A path from the root node to the 1-terminal represents a (possibly partial) variable assignment for which the represented Boolean function is true. As the path descends to a low (or high) child from a node, then that node's variable is assigned to 0 (resp. 1).
 
=== Example ===
The left figure below shows a binary [[decision tree|decision ''tree'']] (the reduction rules are not applied), and a [[truth table]], each representing the function f (x1, x2, x3).  In the tree on the left, the value of the function can be determined for a given variable assignment by following a path down the graph to a terminal. In the figures below, dotted lines represent edges to a low child, while solid lines represent edges to a high child. Therefore, to find (x1=0, x2=1, x3=1), begin at x1, traverse down the dotted line to x2 (since x1 has an assignment to 0), then down two solid lines (since x2 and x3 each have an assignment to one).  This leads to the terminal 1, which is the value of f (x1=0, x2=1, x3=1).
 
The binary decision ''tree'' of the left figure can be transformed into a binary decision ''diagram'' by maximally reducing it according to the two reduction rules. The resulting '''BDD''' is shown in the right figure.
 
{| align="center"
|-
| [[File:BDD.png|thumb|546px|Binary decision tree and truth table for the function <math>f(x_1, x_2, x_3)=\bar{x_1} \bar{x_2} \bar{x_3} + x_1 x_2 + x_2 x_3</math>]]
| [[File:BDD simple.svg|thumb|189px|BDD for the function f]]
|}
 
== History ==
The basic idea from which the data structure was created is the [[Shannon expansion]]. A [[switching function]] is split into two sub-functions (cofactors) by assigning one variable (cf. ''if-then-else normal form'').  If such a sub-function is considered as a sub-tree, it can be represented by a ''binary decision tree''. Binary decision diagrams (BDD) were introduced by Lee,<ref name="Lee">C. Y. Lee. "Representation of Switching Circuits by Binary-Decision Programs". Bell Systems Technical Journal, 38:985–999, 1959.</ref> and further studied and made known by Akers<ref name="Akers">Sheldon B. Akers. Binary Decision Diagrams, IEEE Transactions on Computers, C-27(6):509–516, June 1978.</ref> and Boute.<ref>Raymond T. Boute, "The Binary Decision Machine as a programmable controller". [[EUROMICRO]] Newsletter, Vol. 1(2):16–22, January 1976.</ref>
 
The full potential for efficient algorithms based on the data structure was investigated by [[Randal Bryant]] at [[Carnegie Mellon University]]: his key extensions were to use a fixed variable ordering (for canonical representation) and shared sub-graphs (for compression).  Applying these two concepts results in an efficient data structure and algorithms for the representation of sets and relations.<ref name="Bryant-1986">Randal E. Bryant. "[http://www.cs.cmu.edu/~bryant/pubdir/ieeetc86.ps Graph-Based Algorithms for Boolean Function Manipulation]". IEEE Transactions on Computers, C-35(8):677–691, 1986.</ref><ref name="Bryant-1992">R. E. Bryant, "[http://www.cs.cmu.edu/~bryant/pubdir/acmcs92.ps Symbolic Boolean Manipulation with Ordered Binary Decision Diagrams"], ACM Computing Surveys, Vol. 24, No. 3 (September, 1992), pp. 293–318.
</ref>  By extending the sharing to several BDDs, i.e. one sub-graph is used by several BDDs, the data structure ''Shared Reduced Ordered Binary Decision Diagram'' is defined.<ref name="Brace">Karl S. Brace, Richard L. Rudell and Randal E. Bryant. "[http://portal.acm.org/citation.cfm?id=123222&coll=portal&dl=ACM Efficient Implementation of a BDD Package"]. In Proceedings of the 27th ACM/IEEE Design Automation Conference (DAC 1990), pages 40–45. IEEE Computer Society Press, 1990.</ref>  The notion of a BDD is now generally used to refer to that particular data structure.
 
In his video lecture ''Fun With Binary Decision Diagrams (BDDs)'',<ref>http://scpd.stanford.edu/knuth/index.jsp</ref> [[Donald Knuth]] calls BDDs "one of the only really fundamental data structures that came out in the last twenty-five years" and mentions that Bryant's 1986 paper was for some time one of the most-cited papers in computer science.
 
== Applications ==
 
BDDs are extensively used in [[Computer Aided Design|CAD]] software to synthesize circuits ([[logic synthesis]]) and in [[formal verification]]. There are several lesser known applications of BDD, including [[Fault tree]] analysis, [[Bayesian probability|Bayesian]] Reasoning, Product Configuration, and [[Private information retrieval]] <ref name="Jensen">R.M. Jensen. [http://www.cs.cmu.edu/~runej/data/papers/JSW04.pdf "CLab: A C+ + library for fast backtrack-free interactive product configuration"]. Proceedings of the Tenth International Conference on Principles and Practice of Constraint Programming, 2004.</ref>
<ref name="Lipmaa">H.L. Lipmaa. [http://eprint.iacr.org/2009/395.pdf "First CPIR Protocol with Data-Dependent Computation"]. ICISC 2009.</ref>{{Citation needed|reason=Please provide examples of these applications in the literature.|date=June 2010}}.
 
Every arbitrary BDD (even if it is not reduced or ordered) can be directly implemented by replacing each node with a 2 to 1 [[Multiplexer#Digital multiplexers|multiplexer]]; each multiplexer can be directly implemented by a 4-LUT in a [[FPGA]]. It is not so simple to convert from an arbitrary network of logic gates to a BDD{{Citation needed|date=March 2008}} (unlike the [[and-inverter graph]]).
 
== Variable ordering ==
The size of the BDD is determined both by the function being represented and the chosen ordering of the variables. There exist Boolean functions <math>f(x_1,\ldots, x_{n})</math> for which depending upon the ordering of the variables we would end up getting a graph whose number of nodes would be linear (in&nbsp;''n'') at the best and exponential at the worst case (e.g., a ripple carry adder).  Let us consider the Boolean function <math>f(x_1,\ldots, x_{2n}) = x_1x_2 + x_3x_4 + \cdots + x_{2n-1}x_{2n}.</math>
Using the variable ordering <math>x_1 < x_3 < \cdots < x_{2n-1} < x_2 < x_4 < \cdots < x_{2n}</math>, the BDD needs 2<sup>''n''+1</sup> nodes to represent the function.  Using the ordering <math>x_1 < x_2 < x_3 < x_4 < \cdots < x_{2n-1} < x_{2n}</math>, the BDD consists of 2''n''+2 nodes.
 
{| align="center"
|-
| [[File:BDD Variable Ordering Bad.svg|thumb|638px|BDD for the function ''&fnof;''(''x''<sub>1</sub>, ..., ''x''<sub>8</sub>) = ''x''<sub>1</sub>''x''<sub>2</sub> + ''x''<sub>3</sub>''x''<sub>4</sub> + ''x''<sub>5</sub>''x''<sub>6</sub> + ''x''<sub>7</sub>''x''<sub>8</sub> using bad variable ordering]]
| [[File:BDD Variable Ordering Good.svg|thumb|156px|Good variable ordering]]
|}
 
It is of crucial importance to care about variable ordering when applying this data structure in practice.
The problem of finding the best variable ordering is [[NP-hard]].<ref name="Bollig">Beate Bollig, Ingo Wegener. {{doi-inline|10.1109/12.537122|Improving the Variable Ordering of OBDDs Is NP-Complete}}, IEEE Transactions on Computers, 45(9):993–1002, September 1996.
</ref> For any constant ''c''&nbsp;>&nbsp;1 it is even NP-hard to compute a variable ordering resulting in an OBDD with a size that is at most c times larger than an optimal one.<ref name="Sieling">Detlef Sieling. "The nonapproximability of OBDD minimization." Information and Computation 172, 103–138. 2002.
</ref> However there exist efficient heuristics to tackle the problem.<ref>{{cite web|last=Rice|first=Michael|title=A Survey of Static Variable Ordering Heuristics for Efficient BDD/MDD Construction|url=http://alumni.cs.ucr.edu/~skulhari/StaticHeuristics.pdf}}</ref>
 
There are functions for which the graph size is always exponential — independent of variable ordering. This holds e. g. for the multiplication function (an indication{{Citation needed|date=March 2007}} as to the apparent complexity of [[factorization]] ).
 
Researchers have of late suggested refinements on the BDD data structure giving way to a number of related graphs, such as BMD ([[Binary Moment Diagrams]]), ZDD ([[Zero Suppressed Decision Diagram]]), FDD ([[Free Binary Decision Diagrams]]), PDD ([[Parity decision Diagrams]]), and MTBDDs (Multiple terminal BDDs).
 
== Logical operations on BDDs ==
Many logical operations on BDDs can be implemented by
polynomial-time graph manipulation algorithms.
* [[logical conjunction|conjunction]]
* [[logical disjunction|disjunction]]
* [[negation]]
* existential abstraction
* universal abstraction
However, repeating these operations several times, for example forming the conjunction or disjunction of a set of BDDs, may in the worst case result in an exponentially big BDD. This is because any of the preceding operations for two BDDs may result in a BDD with a size proportional to the product of the BDDs' sizes, and consequently for several BDDs the size may be exponential.
 
== See also ==
* [[Boolean satisfiability problem]]
* [[L/poly]], a [[complexity class]] that captures the complexity of problems with polynomially sized BDDs
* [[Model checking]]
* [[Radix tree]]
* [[Binary key]] – a method of species identification in biology using binary trees
* [[NC (complexity)#Barrington's theorem|Barrington's theorem]]
 
== References ==
<references/>
* R. Ubar, "Test Generation for Digital Circuits Using Alternative Graphs (in Russian)", in Proc. Tallinn Technical University, 1976, No.409, Tallinn Technical University, Tallinn, Estonia, pp.&nbsp;75–81.
 
== Further reading ==
* D. E. Knuth, "The Art of Computer Programming Volume 4, Fascicle 1: Bitwise tricks & techniques;  Binary Decision Diagrams" (Addison–Wesley Professional, March 27, 2009) viii+260pp, ISBN 0-321-58050-8. [http://www-cs-faculty.stanford.edu/~knuth/fasc1b.ps.gz Draft of Fascicle 1b] available for download.
* H. R. Andersen "[http://configit.com/configit_wordpress/wp-content/uploads/2013/07/bdd-eap.pdf An Introduction to Binary Decision Diagrams,]" Lecture Notes, 1999, IT University of Copenhagen.
* Ch. Meinel, T. Theobald, "[http://www.hpi.uni-potsdam.de/fileadmin/hpi/FG_ITS/books/OBDD-Book.pdf Algorithms and Data Structures in VLSI-Design: OBDD – Foundations and Applications"], Springer-Verlag, Berlin, Heidelberg, New York, 1998. Complete textbook available for download.
* {{cite book|author1=Rüdiger Ebendt|author2=Görschwin Fey|author3=Rolf Drechsler|title=Advanced BDD optimization|year=2005|publisher=Springer|isbn=978-0-387-25453-1}}
* {{cite book|author1=Bernd Becker|author2=Rolf Drechsler|title=Binary Decision Diagrams: Theory and Implementation|year=1998|publisher=Springer|isbn=978-1-4419-5047-5}}
 
== External links ==
{{Commons category|Binary decision diagrams}}
'''Available OBDD Packages'''
* [http://fmv.jku.at/abcd/ ABCD]: The ABCD package by Armin Biere, Johannes Kepler Universität, Linz.
* [http://www-2.cs.cmu.edu/~modelcheck/bdd.html CMU BDD], BDD package, Carnegie Mellon University, Pittsburgh
* [http://buddy.sourceforge.net/manual/ BuDDy]: A BDD package by Jørn Lind-Nielsen
* [http://biddy.meolic.com/ Biddy]: Academic multiplatform BDD package, University of Maribor
* [http://vlsi.colorado.edu/~fabio/CUDD/ CUDD]: BDD package, University of Colorado, Boulder
* [http://javabdd.sourceforge.net JavaBDD], a Java port of BuDDy that also interfaces to CUDD, CAL, and JDD
* [http://javaddlib.sourceforge.net/jdd/ JDD] is a pure java implementation of BDD and ZBDD. [http://javaddlib.sourceforge.net/jbdd/ JBDD] by the same author has a similar API but is a Java interface to BuDDy and CUDD
* The Berkeley [http://embedded.eecs.berkeley.edu/Research/cal_bdd/ CAL] package which does breadth-first manipulation
* [http://ddd.lip6.fr DDD]: A C++ library with support for integer valued and hierarchical decision diagrams.
* [http://www.jossowski.de/projects/jinc/jinc.html JINC]: A C++ library developed at University of Bonn, Germany, supporting several BDD variants and multi-threading.
* [http://myvideos.stanford.edu/player/slplayer.aspx?coll=ea60314a-53b3-4be2-8552-dcf190ca0c0b&co=18bcd3a8-965a-4a63-a516-a1ad74af1119&o=true Fun With Binary Decision Diagrams (BDDs)], lecture by [[Donald Knuth]]
 
{{Data structures}}
 
{{DEFAULTSORT:Binary Decision Diagram}}
[[Category:Diagrams]]
[[Category:Graph data structures]]
[[Category:Model checking]]
[[Category:Articles with example code]]
[[Category:Boolean algebra]]

Latest revision as of 13:42, 29 June 2014

Hi, everybody!
I'm Arabic male :D.
I really love The Vampire Diaries!

Also visit my blog ... fifa 14 coin generator ios (additional reading)