BDD graph for the Boolean formula x1 * x2 + x3 * x4 + x5 * x6 + x7 * x8 using a bad variable ordering
Visualization of the BDD for the Boolean formula x1 * x2 + x3 * x4 + ... + x19 * x20 using a bad variable ordering
The following is the RML (Relational Manipulation Language) code that I fed to CrocoPat
to produce the GraphViz dot files:
// RML program to generate BDD graphs for the formula
// x1 & x2 | x3 & x4 | x5 & x6 | x7 & x8,
// using two different variable orderings.
// "crocopat -e BDD_Variable_Ordering.rml" generates two files in dot format.
// "dot -Tsvg BDD_Variable_Ordering_Bad.dot -o BDD_Variable_Ordering_Bad.svg"
// generates a file in SVG format from the file in dot format.
// There are two ('Boolean') values for the variables x1, ..., x8.
DOM("0");
DOM("1");
// F is the name of the Boolean formula.
F(x1,x2,x3,x4,x5,x6,x7,x8) := (x1="1" & x2="1")
| (x3="1" & x4="1")
| (x5="1" & x6="1")
| (x7="1" & x8="1");
// Prints the BDD as graph in GraphViz dot format,
// using a good variable ordering resulting in linear size of the graph.
PRINT GRAPH( F(x1,x2,x3,x4,x5,x6,x7,x8) )
TO "BDD_Variable_Ordering_Good.dot";
// Prints the BDD as graph in GraphViz dot format,
// using a bad variable ordering resulting in exponential size of the graph.
// The first term of the conjunction sets the variable ordering.
PRINT GRAPH( TRUE(x1,x3,x5,x7,x2,x4,x6,x8) &
F(x1,x2,x3,x4,x5,x6,x7,x8) )
TO "BDD_Variable_Ordering_Bad.dot";;
Conditions d’utilisation
Moi, en tant que détenteur des droits d’auteur sur cette œuvre, je la publie sous les licences suivantes :
Vous avez la permission de copier, distribuer et modifier ce document selon les termes de la GNU Free Documentation License version 1.2 ou toute version ultérieure publiée par la Free Software Foundation, sans sections inaltérables, sans texte de première page de couverture et sans texte de dernière page de couverture. Un exemplaire de la licence est inclus dans la section intitulée GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue
de partager – de copier, distribuer et transmettre cette œuvre
d’adapter – de modifier cette œuvre
Sous les conditions suivantes :
paternité – Vous devez donner les informations appropriées concernant l'auteur, fournir un lien vers la licence et indiquer si des modifications ont été faites. Vous pouvez faire cela par tout moyen raisonnable, mais en aucune façon suggérant que l’auteur vous soutient ou approuve l’utilisation que vous en faites.
partage à l’identique – Si vous modifiez, transformez, ou vous basez sur cette œuvre, vous devez distribuer votre contribution sous la même licence ou une licence compatible avec celle de l’original.
Ce bandeau de licence a été ajouté à ce fichier dans le cadre de la procédure de mise à jour des licences des images sous GFDL.http://creativecommons.org/licenses/by-sa/3.0/CC BY-SA 3.0Creative Commons Attribution-Share Alike 3.0truetrue
de partager – de copier, distribuer et transmettre cette œuvre
d’adapter – de modifier cette œuvre
Sous les conditions suivantes :
paternité – Vous devez donner les informations appropriées concernant l'auteur, fournir un lien vers la licence et indiquer si des modifications ont été faites. Vous pouvez faire cela par tout moyen raisonnable, mais en aucune façon suggérant que l’auteur vous soutient ou approuve l’utilisation que vous en faites.
partage à l’identique – Si vous modifiez, transformez, ou vous basez sur cette œuvre, vous devez distribuer votre contribution sous la même licence ou une licence compatible avec celle de l’original.
== Summary == {{Information| |Description = BDD graph for the Boolean formula x1 * x2 + x3 * x4 + x5 * x6 + x7 * x8 using a good variable ordering |Source = self-made using CrocoPat, a tool for relational programming, and GraphViz dot, a tool for graph la