File biddyMain.c contains main functions for representation and manipulation of boolean functions with various types of Binary Decision Diagrams. More...

`#include "biddyInt.h"`

Include dependency graph for biddyMain.c:

Go to the source code of this file.

## Functions | |

void | Biddy_InitMNG (Biddy_Manager *mng, int bddtype) |

Function Biddy_InitMNG initialize a manager. More... | |

void | Biddy_ExitMNG (Biddy_Manager *mng) |

Function Biddy_ExitMNG deletes a manager. More... | |

Biddy_String | Biddy_About () |

Function Biddy_About reports version of Biddy package. More... | |

Biddy_Edge | Biddy_GetThen (Biddy_Edge fun) |

Function Biddy_GetThen returns THEN successor. More... | |

Biddy_Edge | Biddy_GetElse (Biddy_Edge fun) |

Function Biddy_GetElse returns ELSE successor. More... | |

Biddy_Variable | Biddy_GetTopVariable (Biddy_Edge fun) |

Function Biddy_GetTopVariable returns the top variable. More... | |

Biddy_Edge | Biddy_Managed_GetTerminal (Biddy_Manager MNG) |

Function Biddy_Managed_GetTerminal returns unmarked and untagged edge pointing to terminal node 1. More... | |

Biddy_Edge | Biddy_Managed_GetConstantZero (Biddy_Manager MNG) |

Function Biddy_Managed_GetConstantZero returns constant 0. More... | |

Biddy_Edge | Biddy_Managed_GetConstantOne (Biddy_Manager MNG) |

Function Biddy_Managed_GetConstantOne returns constant 1. More... | |

Biddy_Boolean | Biddy_Managed_IsSmaller (Biddy_Manager MNG, Biddy_Variable fv, Biddy_Variable gv) |

Function Biddy_Managed_IsSmaller returns TRUE if the first variable is smaller (= lower = previous = above = topmore). More... | |

Biddy_Boolean | Biddy_Managed_IsLowest (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_IsLowest returns TRUE if the variable is the lowest one (lowest == topmost). More... | |

Biddy_Boolean | Biddy_Managed_IsHighest (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_IsHighest returns TRUE if the variable is the highest one if terminal node is ignored (highest == bottommost). More... | |

void | Biddy_Managed_Refresh (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_Refresh refreshes top node in a given function. More... | |

Biddy_Boolean | Biddy_Managed_IsOK (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_IsOK returns TRUE iff given node is not obsolete. More... | |

int | Biddy_Managed_GetManagerType (Biddy_Manager MNG) |

Function Biddy_Managed_GetManagerType reports BDD type used in the manager. More... | |

Biddy_String | Biddy_Managed_GetManagerName (Biddy_Manager MNG) |

Function Biddy_Managed_GetManagerName reports the name of the BDD type used in the manager. More... | |

void | Biddy_Managed_SetManagerParameters (Biddy_Manager MNG, float gcr, float gcrF, float gcrX, float rr, float rrF, float rrX, float st, float cst) |

Function Biddy_Managed_SetManagerParameters set modifiable parameters. More... | |

Biddy_Edge | Biddy_Managed_GetBaseSet (Biddy_Manager MNG) |

Function Biddy_Managed_GetBaseSet returns set containing only a null combination, i.e. it returns {{}}. More... | |

Biddy_Edge | Biddy_Managed_TransferMark (Biddy_Manager MNG, Biddy_Edge f, Biddy_Boolean mark, Biddy_Boolean leftright) |

Function Biddy_Managed_TransferMark returns edge with inverted complement bit iff the second parameter is TRUE and normalization rules require this. More... | |

Biddy_Boolean | Biddy_Managed_IsEqv (Biddy_Manager MNG1, Biddy_Edge f1, Biddy_Manager MNG2, Biddy_Edge f2) |

Function Biddy_Managed_IsEqv returns TRUE iff two BDDs are equal. More... | |

void | Biddy_Managed_SelectNode (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_SelectNode selects the top node of the given function. More... | |

void | Biddy_Managed_DeselectNode (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_DeselectNode deselects the top node of the given function. More... | |

Biddy_Boolean | Biddy_Managed_IsSelected (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_IsSelected returns TRUE iff the top node of the given function is selected. More... | |

void | Biddy_Managed_SelectFunction (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_SelectFunction recursively selects all nodes of a given function. More... | |

void | Biddy_Managed_DeselectAll (Biddy_Manager MNG) |

Function Biddy_Managed_DeselectAll deselects all nodes. More... | |

Biddy_Variable | Biddy_Managed_GetVariable (Biddy_Manager MNG, Biddy_String x) |

Function Biddy_Managed_GetVariable returns variable with the given name. More... | |

Biddy_Variable | Biddy_Managed_GetLowestVariable (Biddy_Manager MNG) |

Function Biddy_Managed_GetLowestVariable returns the lowest variable in the current ordering. More... | |

Biddy_Variable | Biddy_Managed_GetIthVariable (Biddy_Manager MNG, Biddy_Variable i) |

Function Biddy_Managed_GetIthVariable returns ith variable in the current global ordering. More... | |

Biddy_Variable | Biddy_Managed_GetPrevVariable (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_GetPrevVariable returns previous variable in the global ordering (lower, topmore). More... | |

Biddy_Variable | Biddy_Managed_GetNextVariable (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_GetNextVariable returns next variable in the global ordering (higher, bottommore). More... | |

Biddy_Edge | Biddy_Managed_GetVariableEdge (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_GetVariableEdge returns variable's edge. More... | |

Biddy_Edge | Biddy_Managed_GetElementEdge (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_GetElementEdge returns element's edge. More... | |

Biddy_String | Biddy_Managed_GetVariableName (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_GetVariableName returns the name of a variable. More... | |

Biddy_Edge | Biddy_Managed_GetTopVariableEdge (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_GetTopVariableEdge returns variable's edge of top variable. More... | |

Biddy_String | Biddy_Managed_GetTopVariableName (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_GetTopVariableName returns the name of top variable. More... | |

char | Biddy_Managed_GetTopVariableChar (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_GetTopVariableChar returns the first character in the name of top variable. More... | |

void | Biddy_Managed_ResetVariablesValue (Biddy_Manager MNG) |

Function Biddy_Managed_ResetVariablesValue sets all variable's value to biddyZero. More... | |

void | Biddy_Managed_SetVariableValue (Biddy_Manager MNG, Biddy_Variable v, Biddy_Edge f) |

Function Biddy_Managed_SetVariableValue sets variable's value. More... | |

Biddy_Edge | Biddy_Managed_GetVariableValue (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_GetVariableValue gets variable's value. More... | |

void | Biddy_Managed_ClearVariablesData (Biddy_Manager MNG) |

Function Biddy_Managed_ClearVariablesData free memory used for all variable's data. More... | |

void | Biddy_Managed_SetVariableData (Biddy_Manager MNG, Biddy_Variable v, void *x) |

Function Biddy_Managed_SetVariableData sets variable's data. More... | |

void * | Biddy_Managed_GetVariableData (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_GetVariableData gets variable's data. More... | |

Biddy_Boolean | Biddy_Managed_Eval (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_Eval returns the value of a Boolean function for a given variable assignment. More... | |

double | Biddy_Managed_EvalProbability (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_EvalProbability evaluates BDD. More... | |

Biddy_Variable | Biddy_Managed_FoaVariable (Biddy_Manager MNG, Biddy_String x, Biddy_Boolean varelem) |

Function Biddy_Managed_FoaVariable finds variable/element or adds new variable (i.e. Boolean function f = x) and new element (i.e. it creates set {{x}}). More... | |

void | Biddy_Managed_ChangeVariableName (Biddy_Manager MNG, Biddy_Variable v, Biddy_String x) |

Function Biddy_Managed_ChangeVariableName set new name to the given variable/element. More... | |

Biddy_Variable | Biddy_Managed_AddVariableByName (Biddy_Manager MNG, Biddy_String x) |

Function Biddy_Managed_AddVariableByName adds variable. More... | |

Biddy_Variable | Biddy_Managed_AddElementByName (Biddy_Manager MNG, Biddy_String x) |

Function Biddy_Managed_AddElementByName adds element. More... | |

Biddy_Edge | Biddy_Managed_AddVariableBelow (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_AddVariableBelow adds variable. More... | |

Biddy_Edge | Biddy_Managed_AddVariableAbove (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_AddVariableAbove adds variable. More... | |

Biddy_Edge | Biddy_Managed_IncTag (Biddy_Manager MNG, Biddy_Edge f) |

Function Biddy_Managed_IncTag returns edge with an incremented tag. More... | |

Biddy_Edge | Biddy_Managed_TaggedFoaNode (Biddy_Manager MNG, Biddy_Variable v, Biddy_Edge pf, Biddy_Edge pt, Biddy_Variable ptag, Biddy_Boolean garbageAllowed) |

Function Biddy_Managed_TaggedFoaNode finds or adds new node with the given variable and successors. More... | |

void | Biddy_Managed_GC (Biddy_Manager MNG, Biddy_Variable targetLT, Biddy_Variable targetGEQ, Biddy_Boolean purge, Biddy_Boolean total) |

Function Biddy_Managed_GC performs garbage collection. More... | |

void | Biddy_Managed_Clean (Biddy_Manager MNG) |

Function Biddy_Managed_Clean performs cleaning. More... | |

void | Biddy_Managed_Purge (Biddy_Manager MNG) |

Function Biddy_Managed_Purge immediately removes all nodes which were not preserved or which are not preserved anymore. More... | |

void | Biddy_Managed_PurgeAndReorder (Biddy_Manager MNG, Biddy_Edge f, Biddy_Boolean converge) |

Function Biddy_Managed_PurgeAndReorder immediately removes non-preserved nodes and triggers reordering on function. More... | |

void | Biddy_Managed_AddCache (Biddy_Manager MNG, Biddy_GCFunction gc) |

Function Biddy_Managed_AddCache adds cache to the end of Cache list. More... | |

unsigned int | Biddy_Managed_AddFormula (Biddy_Manager MNG, Biddy_String x, Biddy_Edge f, int c) |

Function Biddy_Managed_AddFormula adds formula to Formula table. More... | |

Biddy_Boolean | Biddy_Managed_FindFormula (Biddy_Manager MNG, Biddy_String x, unsigned int *idx, Biddy_Edge *f) |

Function Biddy_Managed_FindFormula find formula in Formula table. More... | |

Biddy_Boolean | Biddy_Managed_DeleteFormula (Biddy_Manager MNG, Biddy_String x) |

Function Biddy_Managed_DeleteFormula delete formula from Formula table. More... | |

Biddy_Boolean | Biddy_Managed_DeleteIthFormula (Biddy_Manager MNG, unsigned int i) |

Function Biddy_Managed_DeleteIthFormula deletes formula from the table. More... | |

Biddy_Edge | Biddy_Managed_GetIthFormula (Biddy_Manager MNG, unsigned int i) |

Function Biddy_Managed_GetIthFormula returns ith formula in a Formula table. More... | |

Biddy_String | Biddy_Managed_GetIthFormulaName (Biddy_Manager MNG, unsigned int i) |

Function Biddy_Managed_GetIthFormulaName returns name of the ith formula in a Formula table. More... | |

Biddy_String | Biddy_Managed_GetOrdering (Biddy_Manager MNG) |

void | Biddy_Managed_SetOrdering (Biddy_Manager MNG, Biddy_String ordering) |

Function Biddy_Managed_SetOrdering use variable swapping to create the ordering given by string. More... | |

void | Biddy_Managed_SetAlphabeticOrdering (Biddy_Manager MNG) |

Function Biddy_Managed_SetAlphabeticOrdering use variable swapping to create the alphabetic ordering. More... | |

Biddy_Variable | Biddy_Managed_SwapWithHigher (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_SwapWithHigher swaps two adjacent variables. More... | |

Biddy_Variable | Biddy_Managed_SwapWithLower (Biddy_Manager MNG, Biddy_Variable v) |

Function Biddy_Managed_SwapWithLower swaps two adjacent variables. More... | |

Biddy_Boolean | Biddy_Managed_Sifting (Biddy_Manager MNG, Biddy_Edge f, Biddy_Boolean converge) |

Function Biddy_Managed_Sifting reorders variables to minimize node number using Rudell's sifting algorithm for the whole system (if f = NULL) or for the given function (if f != NULL) . More... | |

void | Biddy_Managed_MinimizeBDD (Biddy_Manager MNG, Biddy_String name) |

Function Biddy_Managed_MinimizeBDD reorders variables to minimize the node number of the given formula using an exhaustive search over all possible orderings. More... | |

void | Biddy_Managed_MaximizeBDD (Biddy_Manager MNG, Biddy_String name) |

Function Biddy_Managed_MaximizeBDD reorders variables to maximize the node number of the given function using an exhaustive search over all possible orderings. More... | |

Biddy_Edge | Biddy_Managed_Copy (Biddy_Manager MNG1, Biddy_Manager MNG2, Biddy_Edge f) |

Function Biddy_Managed_Copy copies a graph from one manager to another manager which can use the same or different BDD type. More... | |

void | Biddy_Managed_CopyFormula (Biddy_Manager MNG1, Biddy_Manager MNG2, Biddy_String x) |

Function Biddy_Managed_CopyFormula uses Biddy_Managed_Copy to copy a graph from one manager to another manager which can use the same or different BDD type. More... | |

Biddy_Edge | Biddy_Managed_ConstructBDD (Biddy_Manager MNG, int numV, Biddy_String varlist, int numN, Biddy_String nodelist) |

Function Biddy_Managed_ConstructBDD constructs BDD from lists of nodes and edges. More... | |

## Variables | |

Biddy_Manager | biddyAnonymousManager = NULL |

BiddyLocalInfo * | biddyLocalInfo = NULL |

PackageName [Biddy] Synopsis [Biddy provides data structures and algorithms for the representation and manipulation of Boolean functions with ROBDDs, 0-sup-BDDs, and TZBDDs. A hash table is used for quick search of nodes. Complement edges decreases the number of nodes. An automatic garbage collection with a system age is implemented. Variable swapping and sifting are implemented.] FileName [biddyMain.c] Revision [$Revision: 621 $] Date [$Date: 2020-03-29 10:25:11 +0200 (ned, 29 mar 2020) $] Authors [Robert Meolic (robert@meolic.com)]

Copyright (C) 2006, 2019 UM FERI, Koroska cesta 46, SI-2000 Maribor, Slovenia. Copyright (C) 2019, 2020 Robert Meolic, SI-2000 Maribor, Slovenia.

Biddy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Biddy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

See also: biddy.h, biddyInt.h

Definition in file biddyMain.c.

Biddy_String Biddy_About | ( | ) |

void Biddy_ExitMNG | ( | Biddy_Manager * | mng | ) |

Deallocates all memory allocated by Biddy_InitMNG, Biddy_FoaVariable, Biddy_FoaNode etc.

Macro Biddy_Exit() will delete anonymous manager.

Definition at line 213 of file biddyMain.c.

Biddy_Edge Biddy_GetElse | ( | Biddy_Edge | fun | ) |

Input mark is not transfered! External use, only.

For terminal nodes, function returns the same node.

Macro BiddyE(fun) is defined for internal use.

Definition at line 299 of file biddyMain.c.

Biddy_Edge Biddy_GetThen | ( | Biddy_Edge | fun | ) |

Input mark is not transfered! External use, only.

For terminal nodes, function returns the same node.

Macro BiddyT(fun) is defined for internal use.

Definition at line 260 of file biddyMain.c.

Biddy_Variable Biddy_GetTopVariable | ( | Biddy_Edge | fun | ) |

External use, only.

Macro BiddyV(fun) is defined for internal use.

Definition at line 337 of file biddyMain.c.

void Biddy_InitMNG | ( | Biddy_Manager * | mng, |

int | bddtype |
||

) |

Biddy_InitMNG creates and initializes a manager. Initialization consists of creating manager structure (MNG), node table (biddyNodeTable), variable table (biddyVariableTable), formula table (biddyFormulaTable), four basic caches (biddyOPCache, biddyEACache, biddyRCCache, and biddyReplaceCache), and cache list (biddyCacheList). Biddy_InitMNG also initializes constant edges (biddyOne, biddyZero), memory management and automatic garbage collection.

Allocates a lot of memory.

Macro Biddy_InitAnonymous() will initialize anonymous manager. Macro Biddy_Init() will initialize anonymous manager for ROBDDs.

Definition at line 188 of file biddyMain.c.

void Biddy_Managed_AddCache | ( | Biddy_Manager | MNG, |

Biddy_GCFunction | gc |
||

) |

If Cache list does not exist, function creates it.

Macro Biddy_AddCache(gc) is defined for use with anonymous manager.

Definition at line 3018 of file biddyMain.c.

Biddy_Variable Biddy_Managed_AddElementByName | ( | Biddy_Manager | MNG, |

Biddy_String | x |
||

) |

Biddy_Managed_AddElementByName uses Biddy_Managed_FoaVariable to find or add element. Function returns element edge. If element already exists, function returns the existing element edge. For more details see Biddy_Managed_FoaVariable.

See Biddy_Managed_FoaVariable.

Macro Biddy_AddElementByName(x) is defined for use with anonymous manager. Macros Biddy_Managed_AddElement(MNG) and Biddy_AddElement() are defined for creating numbered elements.

Definition at line 2485 of file biddyMain.c.

unsigned int Biddy_Managed_AddFormula | ( | Biddy_Manager | MNG, |

Biddy_String | x, |
||

Biddy_Edge | f, |
||

int | c |
||

) |

Given BDD becomes a formula. If (x != NULL) then formula is accessible by its name. If (x != NULL) then index of the formula in the Formulae Table is returned, otherwise function returns 0. Nodes of the given BDD will be preserved for the given number of clearings. If (c == -1) then formula is refreshed but not preserved. If (c == 0) then formula is persistently preserved. You have to use Biddy_DeleteFormula and Biddy_Purge to remove nodes of persistently preserved formulae. There are five macros defined to simplify formulae management: Biddy_Managed_AddTmpFormula(mng,name,bdd) := Biddy_Managed_AddFormula(mng,name,bdd,-1) Biddy_Managed_AddPersistentFormula(mng,name,bdd) := Biddy_Managed_AddFormula(mng,name,bdd,0) Biddy_Managed_KeepFormula(mng,bdd) := Biddy_Managed_AddFormula(mng,NULL,bdd,1) Biddy_Managed_KeepFormulaProlonged(mng,bdd,c) := Biddy_Managed_AddFormula(mng,NULL,bdd,c) Biddy_Managed_KeepFormulaUntilPurge(mng,bdd) := Biddy_Managed_AddFormula(mng,NULL,bdd,0)

Function is prolonged or fortified. Formulae with name are ordered by name. If formula with the same name already exists, it will be overwritten - preserved (i.e. not obsolete and not fresh) and persistently preserved formulae will be deleted at the original index and recreated at new index!

Macros Biddy_AddFormula(x,f,c), Biddy_AddTmpFormula(x,f), Biddy_AddPersistentFormula(x,f), Biddy_KeepFormula(f), Biddy_KeepFormulaProlonged(f,c), and Biddy_KeepFormulaUntilPurge(f) are defined for use with anonymous manager.

Definition at line 3091 of file biddyMain.c.

Biddy_Edge Biddy_Managed_AddVariableAbove | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Biddy_Managed_AddVariableAbove uses Biddy_Managed_AddVariableByName to add new variable. Then, the order of the new variable is changed to become immediately above the given variable (above = previous = topmore in BDD) Function returns variable edge.

Macro Biddy_AddVariableAbove(v) is defined for use with anonymous manager.

Definition at line 2587 of file biddyMain.c.

Biddy_Edge Biddy_Managed_AddVariableBelow | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Biddy_Managed_AddVariableBelow uses Biddy_Managed_AddVariableByName to add new variable. Then, the order of the new variable is changed to become immediately below the given variable (below = next = bottommore in BDD) Function returns variable edge.

Macro Biddy_AddVariableBelow(v) is defined for use with anonymous manager.

Definition at line 2536 of file biddyMain.c.

Biddy_Variable Biddy_Managed_AddVariableByName | ( | Biddy_Manager | MNG, |

Biddy_String | x |
||

) |

Biddy_Managed_AddVariableByName uses Biddy_Managed_FoaVariable to find or add variable. Function returns variable edge. If variable already exists, function returns the existing variable edge. For more details see Biddy_Managed_FoaVariable.

See Biddy_Managed_FoaVariable.

Macro Biddy_AddVariableByName(x) is defined for use with anonymous manager. Macros Biddy_Managed_AddVariable(MNG) and Biddy_AddVariable() are defined for creating numbered variables.

Definition at line 2431 of file biddyMain.c.

void Biddy_Managed_ChangeVariableName | ( | Biddy_Manager | MNG, |

Biddy_Variable | v, |
||

Biddy_String | x |
||

) |

It is not checked that the same variable/element does not already exist. The ordering of the variable is not changed.

Macro Biddy_ChangeVariableName(v,x) is defined for use with anonymous manager.

Definition at line 2377 of file biddyMain.c.

void Biddy_Managed_Clean | ( | Biddy_Manager | MNG | ) |

Discard all nodes which are not preserved or which are not preserved anymore. Obsolete nodes are not immediately removed, they will be removed during the first garbage collection.

Field deleted is not considered and thus no fortified node and no prolonged node is discarded.

Macro Biddy_Clean() is defined for use with anonymous manager.

Definition at line 2857 of file biddyMain.c.

void Biddy_Managed_ClearVariablesData | ( | Biddy_Manager | MNG | ) |

Only active (used) variables are considered.

Macro Biddy_ClearVariablesData() is defined for use with anonymous manager.

Definition at line 2056 of file biddyMain.c.

Biddy_Edge Biddy_Managed_ConstructBDD | ( | Biddy_Manager | MNG, |

int | numV, |
||

Biddy_String | varlist, |
||

int | numN, |
||

Biddy_String | nodelist |
||

) |

In both lists, elements are separated with spaces. Elements of node list has the following format: terminal node zero = (type=0,l=-1,r=-1), terminal node one = (type=1,l=-1,r=-1), regular label = (type=2,r=-1), complemented label = (type=3,r=-1), regular node = (type=4), node with complemented successor(s) = (type=5) The first element in nodelist is ignored. An example node list is: 'Biddy 0 Biddy 2 1 -1 1 B 4 2 3 2 0 0 -1 -1 3 i 4 4 9 4 d 4 5 6 5 0 0 -1 -1 6 y 4 7 8 7 0 0 -1 -1 8 1 1 -1 -1 9 d 4 6 10 10 1 1 -1 -1' which is constructed as: '{Biddy} {0 Biddy 2 1 -1} {1 B 4 2 3} {2 0 0 -1 -1} {3 i 4 4 9} {4 d 4 5 6} {5 0 0 -1 -1} {6 y 4 7 8} {7 0 0 -1 -1} {8 1 1 -1 -1} {9 d 4 6 10} {10 1 1 -1 -1}'.

If variable ordering in the file is not compatible with the active ordering then the result will be wrong.

Macro Biddy_ConstructBDD(MNG,numV,varlist,numN,nodelist) is defined for use with anonymous manager.

Definition at line 4007 of file biddyMain.c.

Biddy_Edge Biddy_Managed_Copy | ( | Biddy_Manager | MNG1, |

Biddy_Manager | MNG2, |
||

Biddy_Edge | f |
||

) |

The function takes a graph from one manager and creates the same graph in another manager. If the managers do not use the same BDD type then a graph is converted. The resulting graph will represent the same Boolean function assuming the domain from the target manager. If (f == biddyZero) then only the domain (all variables) is copied.

If source and target manager are the same then function does nothing. The variable ordering of the created BDD is trying to follow the original ordering, but if some variables already exist in the target manager then the final ordering is adapted to the target manager. Please note, that indices of variables in the target manager may not be the same as in the source manager (for example, if source managet does not use initial ordering the indices in the target manager will follow the variable's ordering and not variable's original indices)

Macros Biddy_Copy(MNG2,f) and Biddy_CopyFrom(MNG1,f) are defined for use with anonymous manager.

Definition at line 3842 of file biddyMain.c.

void Biddy_Managed_CopyFormula | ( | Biddy_Manager | MNG1, |

Biddy_Manager | MNG2, |
||

Biddy_String | x |
||

) |

See Biddy_Managed_Copy.

If source and target manager are the same then function does nothing. The variable ordering of created BDD is adapted to the target manager. The created formula is refreshed but not preserved.

Macros Biddy_CopyFormulaTo(MNG2,x) and Biddy_CopyFormulaFrom(MNG1,f) are defined for use with anonymous manager.

Definition at line 3919 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_DeleteFormula | ( | Biddy_Manager | MNG, |

Biddy_String | x |
||

) |

Formula is labelled but not immediately removed. Nodes of the given formula are not immediately removed. Nodes of the given formula remains fresh or preserved.

Formula is not accessible by its name anymore. Formulae representing constants and variables will not be deleted.

Macro Biddy_DeleteFormula(x) is defined for use with anonymous manager.

Definition at line 3195 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_DeleteIthFormula | ( | Biddy_Manager | MNG, |

unsigned int | i |
||

) |

Formula is labelled but not immediately removed. Nodes of the given formula are not immediately removed. Nodes of the given formula remains fresh or preserved.

Formula is not accessible by its name anymore. The first two formulae ("0" and "1") will not be deleted. Formulae representing variables will not be deleted.

Macro Biddy_DeleteIthFormula(x) is defined for use with anonymous manager.

Definition at line 3248 of file biddyMain.c.

void Biddy_Managed_DeselectAll | ( | Biddy_Manager | MNG | ) |

Deselect all nodes.

Macro Biddy_DeselectAll() is defined for use with anonymous manager.

Definition at line 1328 of file biddyMain.c.

void Biddy_Managed_DeselectNode | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

Macro Biddy_DeselectNode(f) is defined for use with anonymous manager.

Definition at line 1183 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_Eval | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

Variables must have values assigned. Variable is considered to be FALSE iff variable.value == biddyZero, otherwise it is considered to be TRUE.

Macro Biddy_Eval(f) is defined for use with anonymous manager.

Definition at line 2203 of file biddyMain.c.

double Biddy_Managed_EvalProbability | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

Each variable should be associated with a probability q (0-1) via data element in BiddyVariable. For each 1-path a product of variable's probability is calculated (q for 'then' successor and (1-q) for 'else' successor). The result of the function is the sum of all such products.

Macro Biddy_EvalProbability(f) is defined for use with anonymous manager.

Definition at line 2254 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_FindFormula | ( | Biddy_Manager | MNG, |

Biddy_String | x, |
||

unsigned int * | idx, |
||

Biddy_Edge * | f |
||

) |

Return TRUE/FALSE, index, and the formula. If formula is constant or variable then idx = 0 and f != biddyNull. If formula is not found then idx is a position where the formulae should exist and f == biddyNull.

Macro Biddy_FindFormula(x,f) is defined for use with anonymous manager.

Definition at line 3142 of file biddyMain.c.

Biddy_Variable Biddy_Managed_FoaVariable | ( | Biddy_Manager | MNG, |

Biddy_String | x, |
||

Biddy_Boolean | varelem |
||

) |

If variable/element already exists, function returns the existing one. If x == NULL then numbered variable/element is added. Numbered variables/elements have only digits in its name. The current number of numbered variables/elements is stored in numnum. If numbered variable/element is requested then function increments numnum and creates a new (non-existing) variable/element. Parameter varelem is used to determine how to adapt the existing BDD base to keep the current formula valid (use varelem = TRUE if formulae represent Boolean functions and varelem = FALSE if they represent combination sets). The ordering of the new variable/element is determined in Biddy_InitMNG. Function always returns variable.

Adding new variable/element may change the meaning of the existing BDDs. The meaning of variables and elements is always automatically repaired. The meaning of formulae are repaired with regards to the parameter varelem. BDDs without external references are not repaired. For OBDDs, OFDDs, TZBDDS, and TZFDDs, it is safe to add new variables/elements if BDDs are used to represent Boolean functions. For ZBDDs and ZFDDs, it is safe to add new variables/elements if BDDs are used to represent combination sets. User should not add numbered variables/elements with some other function. TO DO: Formulae in user's formula tables are not repaired, yet! TO DO: Variables cannot be deleted, yet!

Macro Biddy_FoaVariable(x) is defined for use with anonymous manager.

Definition at line 2325 of file biddyMain.c.

void Biddy_Managed_GC | ( | Biddy_Manager | MNG, |

Biddy_Variable | targetLT, |
||

Biddy_Variable | targetGEQ, |
||

Biddy_Boolean | purge, |
||

Biddy_Boolean | total |
||

) |

All obsolete nodes are deleted. Parameter purge should not be true during automatic garbage collection. Iff parameter purge is true then all formulae without name are deleted. Iff parameter purge is true then all nodes which are not part of non-obsolete non-deleted formulae are removed even if they are fresh or fortified. If parameter total is true than all unnecessary nodes are immediately deleted, otherwise they are deleted only when there are enough of them. If (targetLT != 0) then node table resizing is disabled. If (targetLT != 0) then there should not exist obsolete formulae. If (targetLT != 0) then there should not exist obsolete nodes which are not part of any non-obsolete non-deleted formulae. If (targetLT != 0) then there should not exist obsolete nodes with variable equal or higher (bottom-more) than target and smaller (top-more) than targetGEQ.

The first element of each chain in a node table should have a special value for its 'prev' element to allow tricky but efficient deleting. Moreover, 'prev' and 'next' should be the first and the second element in the structure BiddyNode, respectively. Garbage collecion is reported by biddyNodeTable.garbage only if some bad nodes are purged! Parameters targetLT and targetGEQ are used during sifting, only, in all other cases 0 is used.

Macro Biddy_GC(targetLT,targetGEQ,purge,total) is defined for use with anonymous manager. Macros Biddy_Managed_AutoGC(MNG) and Biddy_AutoGC() are useful variants with targetLT = targetGEQ = 0, purge = FALSE, and total = FALSE. Macros Biddy_Managed_ForceGC(MNG) and Biddy_ForceGC() are useful variants with targetLT = targetGEQ = 0, purge = FALSE, and total = TRUE.

Definition at line 2802 of file biddyMain.c.

Biddy_Edge Biddy_Managed_GetBaseSet | ( | Biddy_Manager | MNG | ) |

Macro Biddy_GetBaseSet() is defined for use with anonymous manager.

Definition at line 948 of file biddyMain.c.

Biddy_Edge Biddy_Managed_GetConstantOne | ( | Biddy_Manager | MNG | ) |

Constants 0 and 1 depend on a manager. For combination sets, constant 1 coincides with universal set.

For ZBDDs and ZFDDs, you should always obtain constant 1 through the call of this function!

Internally, use macro biddyOne (also for ZBDDs and ZFDDs!). Macro Biddy_GetConstantOne() is defined for use with anonymous manager. Macros Biddy_Managed_GetUniversalSet(MNG) and Biddy_GetUniversalSet() are defined for manipulation of combination sets.

Definition at line 469 of file biddyMain.c.

Biddy_Edge Biddy_Managed_GetConstantZero | ( | Biddy_Manager | MNG | ) |

Constants 0 and 1 depend on a manager. For combination sets, constant 0 coincides with empty set.

Internally, use macro biddyZero. Macro Biddy_GetConstantZero() is defined for use with anonymous manager. Macros Biddy_Managed_GetEmptySet(MNG) and Biddy_GetEmptySet() are defined for manipulation of combination sets.

Definition at line 415 of file biddyMain.c.

Biddy_Edge Biddy_Managed_GetElementEdge | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Macro Biddy_GetElementEdge(v) is defined for use with anonymous manager.

Definition at line 1669 of file biddyMain.c.

Biddy_Edge Biddy_Managed_GetIthFormula | ( | Biddy_Manager | MNG, |

unsigned int | i |
||

) |

Return biddyNull if ith formulae does not exist.

After addding new formula the index of others may change!

Macro Biddy_GetIthFormula(i) is defined for use with anonymous manager.

Definition at line 3298 of file biddyMain.c.

Biddy_String Biddy_Managed_GetIthFormulaName | ( | Biddy_Manager | MNG, |

unsigned int | i |
||

) |

Return NULL if ith formulae does not exist.

After addding new formula the index of others may change!

Macro Biddy_GetIthFormulaName(i) is defined for use with anonymous manager.

Definition at line 3348 of file biddyMain.c.

Biddy_Variable Biddy_Managed_GetIthVariable | ( | Biddy_Manager | MNG, |

Biddy_Variable | i |
||

) |

The lowest (topmost) variable has global ordering 1. The highest (bottommost) variable is '1' and has global ordering equal to numUsedVariables.

If argument is 0, function returns 0. If argument is larger than the number of variables, function returns 0.

Macro Biddy_GetIthVariable(x) is defined for use with anonymous manager.

Definition at line 1479 of file biddyMain.c.

Biddy_Variable Biddy_Managed_GetLowestVariable | ( | Biddy_Manager | MNG | ) |

The lowest variable is the tompost variable.

Macro Biddy_GetLowestVariable(x) is defined for use with anonymous manager.

Definition at line 1426 of file biddyMain.c.

Biddy_String Biddy_Managed_GetManagerName | ( | Biddy_Manager | MNG | ) |

Macro Biddy_GetManagerName() is defined for use with anonymous manager.

Definition at line 834 of file biddyMain.c.

int Biddy_Managed_GetManagerType | ( | Biddy_Manager | MNG | ) |

Macro Biddy_GetManagerType() is defined for use with anonymous manager.

Definition at line 786 of file biddyMain.c.

Biddy_Variable Biddy_Managed_GetNextVariable | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Macro Biddy_GetNextVariable(v) is defined for use with anonymous manager.

Definition at line 1575 of file biddyMain.c.

Biddy_Variable Biddy_Managed_GetPrevVariable | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Macro Biddy_GetPrevVariable(v) is defined for use with anonymous manager.

Definition at line 1527 of file biddyMain.c.

Biddy_Edge Biddy_Managed_GetTerminal | ( | Biddy_Manager | MNG | ) |

Terminal node depends on a manager.

Internally, use macro biddyTerminal. Macro Biddy_GetTerminal() is defined for use with anonymous manager.

Definition at line 363 of file biddyMain.c.

char Biddy_Managed_GetTopVariableChar | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

Macro Biddy_GetTopVariableChar(f) is defined for use with anonymous manager.

Definition at line 1862 of file biddyMain.c.

Biddy_Edge Biddy_Managed_GetTopVariableEdge | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

TO DO: For ZBDDs, element edge is sometimes preffered over variable edge.

Macro Biddy_GetTopVariableEdge(f) is defined for use with anonymous manager.

Definition at line 1766 of file biddyMain.c.

Biddy_String Biddy_Managed_GetTopVariableName | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

Macro Biddy_GetTopVariableName(f) is defined for use with anonymous manager.

Definition at line 1814 of file biddyMain.c.

Biddy_Variable Biddy_Managed_GetVariable | ( | Biddy_Manager | MNG, |

Biddy_String | x |
||

) |

If variable is not found function returns 0!

Macro Biddy_GetVariable(x) is defined for use with anonymous manager.

Definition at line 1377 of file biddyMain.c.

void* Biddy_Managed_GetVariableData | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

It is not checked that the given variable is valid.

Macro Biddy_GetVariableData(v) is defined for use with anonymous manager.

Definition at line 2152 of file biddyMain.c.

Biddy_Edge Biddy_Managed_GetVariableEdge | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Macro Biddy_GetVariableEdge(v) is defined for use with anonymous manager.

Definition at line 1622 of file biddyMain.c.

Biddy_String Biddy_Managed_GetVariableName | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Macro Biddy_GetVariableName(v) is defined for use with anonymous manager.

Definition at line 1716 of file biddyMain.c.

Biddy_Edge Biddy_Managed_GetVariableValue | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

It is not checked that the given variable is valid.

Macro Biddy_GetVariableValue(v) is defined for use with anonymous manager.

Definition at line 2007 of file biddyMain.c.

Biddy_Edge Biddy_Managed_IncTag | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

Used for TZBDDs and TZFDDs, only.

It is not checked, that the resulting tag is not greater than top variable. Function may return non-fresh node even if f is fresh.

Macro Biddy_IncTag() is defined for use with anonymous manager.

Definition at line 2637 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_IsEqv | ( | Biddy_Manager | MNG1, |

Biddy_Edge | f1, |
||

Biddy_Manager | MNG2, |
||

Biddy_Edge | f2 |
||

) |

It is assumed that f1 and f2 have the same ordering.

Macro Biddy_IsEqv(f1,MNG2,f2) is defined for use with anonymous manager.

Definition at line 1064 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_IsHighest | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Internally, use macro BiddyIsHighest(v). Macro Biddy_IsHighest(v) is defined for use with anonymous manager.

Definition at line 626 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_IsLowest | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Internally, use macro BiddyIsLowest(v). Macro Biddy_IsLowest(v) is defined for use with anonymous manager.

Definition at line 567 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_IsOK | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

This is needed for implementation of user caches. TO DO: implement internal macro to avoid using BiddyManagedIsOK.

Internally, use macro BiddyIsOK(f) - NOT IMPLEMENTED, YET! Macro BiddyIsOKDebug(f) is defined for debugging, it checks more properties and not only the expiry value. Macro Biddy_IsOK(f) is defined for use with anonymous manager.

Definition at line 738 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_IsSelected | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

Macro Biddy_IsSelected(f) is defined for use with anonymous manager.

Definition at line 1231 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_IsSmaller | ( | Biddy_Manager | MNG, |

Biddy_Variable | fv, |
||

Biddy_Variable | gv |
||

) |

Internally, use macro BiddyIsSmaller(fv,gv). Macro Biddy_IsSmaller(fv,gv) is defined for use with anonymous manager.

Definition at line 518 of file biddyMain.c.

void Biddy_Managed_MaximizeBDD | ( | Biddy_Manager | MNG, |

Biddy_String | name |
||

) |

Steinhaus–Johnson–Trotter algorithm is used to generate all possible permutations. An optimized version of Bubble Sort is used to setup the final ordering. Variables are reordered globally. All obsolete nodes will be removed.

Indeed, this function may take a lot of time! For TZBDD, all unreferenced nodes (not part of registered formulae) will be removed. For TZBDD, this function may change top edge or even a top node of any function/formula - this is a problem, because functions referenced by local variables only may become wrong. Consequently, for TZBDDs, sifting is not safe to start automatically!

Macro Biddy_MaximizeBDD(f) is defined for use with anonymous manager.

Definition at line 3780 of file biddyMain.c.

void Biddy_Managed_MinimizeBDD | ( | Biddy_Manager | MNG, |

Biddy_String | name |
||

) |

Steinhaus–Johnson–Trotter algorithm is used to generate all possible permutations. An optimized version of Bubble Sort is used to setup the final ordering. Variables are reordered globally. All obsolete nodes will be removed.

Indeed, this function may take a lot of time! For TZBDD, all unreferenced nodes (not part of registered formulae) will be removed. For TZBDD, this function may change top edge or even a top node of any function/formula - this is a problem, because functions referenced by local variables only may become wrong. Consequently, for TZBDDs, sifting is not safe to start automatically!

Macro Biddy_MinimizeBDD(f) is defined for use with anonymous manager.

Definition at line 3721 of file biddyMain.c.

void Biddy_Managed_Purge | ( | Biddy_Manager | MNG | ) |

All formulae without name are deleted. All deleted formulae (including prolonged/fortified formulae) are removed. All fresh and obsolete nodes are immediatelly removed. Moreover, all prolonged and fortified nodes are immediatelly removed if they are not needed by some of the remaining formula. Call to Biddy_Purge does not count as clearing and thus all preserved formulae remains preserved for the same number of clearings.

Removes all fresh nodes!

Macro Biddy_Purge(f) is defined for use with anonymous manager.

Definition at line 2913 of file biddyMain.c.

void Biddy_Managed_PurgeAndReorder | ( | Biddy_Manager | MNG, |

Biddy_Edge | f, |
||

Biddy_Boolean | converge |
||

) |

All obsolete nodes are immediatelly removed. Moreover, nodes from deleted prolonged formulae and nodes from deleted fortified formulae are removed if they are not needed by other formulae. If BDD is given (f != NULL), reordering on function is used. Otherwise (f == NULL) global reordering is used. Call to Biddy_PurgeAndReorder does not count as clearing and thus all preserved formulae remains preserved for the same number of clearings.

Removes all fresh nodes.

Macro Biddy_PurgeAndReorder(f) is defined for use with anonymous manager.

Definition at line 2969 of file biddyMain.c.

void Biddy_Managed_Refresh | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

This is an external variant of internal macro BiddyRefresh This is needed for implementing user caches.

Internally, use macro BiddyRefresh(f). Macro Biddy_Refresh(f) is defined for use with anonymous manager.

Definition at line 686 of file biddyMain.c.

void Biddy_Managed_ResetVariablesValue | ( | Biddy_Manager | MNG | ) |

Only active (used) variables are reinitialized.

Macro Biddy_ResetVariablesValue() is defined for use with anonymous manager.

Definition at line 1911 of file biddyMain.c.

void Biddy_Managed_SelectFunction | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

Terminal node must be selected before starting this function!

Macro Biddy_SelectFunction(f) is defined for use with anonymous manager.

Definition at line 1280 of file biddyMain.c.

void Biddy_Managed_SelectNode | ( | Biddy_Manager | MNG, |

Biddy_Edge | f |
||

) |

Macro Biddy_SelectNode(f) is defined for use with anonymous manager.

Definition at line 1135 of file biddyMain.c.

void Biddy_Managed_SetAlphabeticOrdering | ( | Biddy_Manager | MNG | ) |

Named variables are ordered according to their names. Numbered variables are ordered according to their numbers and are always smaller (topmore) as any named variable.

Macro Biddy_SetAlphabeticOrdering() is defined for use with anonymous manager.

Definition at line 3501 of file biddyMain.c.

void Biddy_Managed_SetManagerParameters | ( | Biddy_Manager | MNG, |

float | gcr, |
||

float | gcrF, |
||

float | gcrX, |
||

float | rr, |
||

float | rrF, |
||

float | rrX, |
||

float | st, |
||

float | cst |
||

) |

Function expect 6 float values. If the value is < 0 then the parameter is not modified. The parameters are: biddyNodeTable.gcratio (do not delete nodes if the effect is to small), biddyNodeTable.gcratioF (do not delete nodes if the effect is to small), biddyNodeTable.gcratioX (do not delete nodes if the effect is to small), biddyNodeTable.resizeratio (resize Node table if there are to many nodes), biddyNodeTable.resizeratioF (resize Node table if there are to many nodes), biddyNodeTable.resizeratioX (resize Node table if there are to many nodes), biddyNodeTable.siftingtreshold (stop sifting if the size of the system grows to much), biddyNodeTable.fsiftingtreshold (stop sifting if the size of the function grows to much), biddyNodeTable.convergesiftingtreshold (stop one step of converging sifting if the size of the system grows to much), biddyNodeTable.fconvergesiftingtreshold (stop one step of converging sifting if the size of the function grows to much).

Initial values are given in Biddy_InitMNG.

Macro Biddy_SetManagerParameters() is defined for use with anonymous manager.

Definition at line 899 of file biddyMain.c.

void Biddy_Managed_SetOrdering | ( | Biddy_Manager | MNG, |

Biddy_String | ordering |
||

) |

Non-existing variables included in the string are simply ignored. Not all variables need to be given.

String should be formated in the same way as returned by Biddy_GetOrdering. It should not be prefixed with spaces.

Macro Biddy_SetOrdering(ordering) is defined for use with anonymous manager.

Definition at line 3449 of file biddyMain.c.

void Biddy_Managed_SetVariableData | ( | Biddy_Manager | MNG, |

Biddy_Variable | v, |
||

void * | x |
||

) |

It is not checked that the given variable is valid.

Macro Biddy_SetVariableData(v,x) is defined for use with anonymous manager.

Definition at line 2104 of file biddyMain.c.

void Biddy_Managed_SetVariableValue | ( | Biddy_Manager | MNG, |

Biddy_Variable | v, |
||

Biddy_Edge | f |
||

) |

It is not checked that the given variable is valid.

Macro Biddy_SetVariableValue(v,f) is defined for use with anonymous manager.

Definition at line 1959 of file biddyMain.c.

Biddy_Boolean Biddy_Managed_Sifting | ( | Biddy_Manager | MNG, |

Biddy_Edge | f, |
||

Biddy_Boolean | converge |
||

) |

Variables are reordered globally. All obsolete nodes will be removed.

For TZBDD, all unreferenced nodes (not part of registered formulae) will be removed. For TZBDD, sifting may change top edge or even a top node of any function/formula - this is a problem, because functions referenced by local variables only may become wrong. Consequently, for TZBDDs, sifting is not safe to start automatically!

Macro Biddy_Sifting(f) is defined for use with anonymous manager.

Definition at line 3661 of file biddyMain.c.

Biddy_Variable Biddy_Managed_SwapWithHigher | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Higher (greater) variable is the bottommore one! The highest variable is constant variable "1". Global ordering is number of zeros in corresponding line of orderingTable. Constant variable '1' has global ordering greater than all others.

All obsolete nodes will be removed.

Macro Biddy_SwapWithHigher(v) is defined for use with anonymous manager.

Definition at line 3553 of file biddyMain.c.

Biddy_Variable Biddy_Managed_SwapWithLower | ( | Biddy_Manager | MNG, |

Biddy_Variable | v |
||

) |

Lower (smaller) variable is the topmore one! The lowest (topmost) element is not fixed. Topmost variable has global ordering 1 (smaller than all except itself). Global ordering is the number of zeros in corresponding line of orderingTable.

All obsolete nodes will be removed.

Macro Biddy_SwapWithLower(v) is defined for use with anonymous manager.

Definition at line 3605 of file biddyMain.c.

Biddy_Edge Biddy_Managed_TaggedFoaNode | ( | Biddy_Manager | MNG, |

Biddy_Variable | v, |
||

Biddy_Edge | pf, |
||

Biddy_Edge | pt, |
||

Biddy_Variable | ptag, |
||

Biddy_Boolean | garbageAllowed |
||

) |

If such node already exists, function returns it and does not create the new one. For OBDDs, ZBDDs, OFDDs, and ZFDDs, the returned edge is not tagged (i.e. tag == 0). For TZBDDs and TZFDDs, the returned edge is tagged with the given ptag. There are two special cases:

- If (pf == pt == NULL) then new variable (for OBDDs, OFDDs, TZBDDs, and TZFDDs) or new element (for ZBDDs and ZFDDs) is created.
- (If ptag == 0) then the reduction rule and the normalization of complemented edges is not used and the node is added exactly as specified (be careful, this may create a wrong node!).
### Side effects

This function should not be called directly to add new variables and elements, you must use Biddy_Managed_FoaVariable, Biddy_Managed_AddVariableByName, or Biddy_Managed_AddElementByName. Using Biddy_Managed_TaggedFoaNode you can create node with an arbitrary ordering. It is much more safe to use Boolean operators, e.g. Biddy_Managed_ITE.

Macro Biddy_Managed_FoaNode(MNG,v,pf,pt,garbageAllowed) is defined for use without tags. Macros Biddy_TaggedFoaNode(v,pf,pt,tag,garbageAllowed) and Biddy_FoaNode(v,pf,pt,garbageAllowed) are defined for use with anonymous manager.

Definition at line 2709 of file biddyMain.c.

Biddy_Edge Biddy_Managed_TransferMark | ( | Biddy_Manager | MNG, |

Biddy_Edge | f, |
||

Biddy_Boolean | mark, |
||

Biddy_Boolean | leftright |
||

) |

Parameter leftright should be TRUE for left and FALSE for right. For OBDDC, it is better to use macro Biddy_InvCond. For OBDDC, parameter leftright is ignored.

TO DO: swap the meaning of parameter leftright (left should be FALSE)

Macro Biddy_TransferMark() is defined for use with anonymous manager.

Definition at line 1015 of file biddyMain.c.