abc-master
|
Go to the source code of this file.
Data Structures | |
struct | MtrNode |
Macros | |
#define | SIZEOF_VOID_P 4 |
#define | SIZEOF_INT 4 |
#define | MTR_INLINE |
#define | MTR_UNUSED |
#define | MTR_DEFAULT 0x00000000 |
#define | MTR_TERMINAL 0x00000001 |
#define | MTR_SOFT 0x00000002 |
#define | MTR_FIXED 0x00000004 |
#define | MTR_NEWNODE 0x00000008 |
#define | MTR_MAXHIGH ((MtrHalfWord) ~0) |
#define | MTR_SET(node, flag) (node->flags |= (flag)) |
#define | MTR_RESET(node, flag) (node->flags &= ~ (flag)) |
#define | MTR_TEST(node, flag) (node->flags & (flag)) |
Typedefs | |
typedef unsigned short | MtrHalfWord |
typedef struct MtrNode | MtrNode |
Functions | |
MtrNode * | Mtr_AllocNode (void) |
void | Mtr_DeallocNode (MtrNode *node) |
MtrNode * | Mtr_InitTree (void) |
void | Mtr_FreeTree (MtrNode *node) |
MtrNode * | Mtr_CopyTree (MtrNode *node, int expansion) |
void | Mtr_MakeFirstChild (MtrNode *parent, MtrNode *child) |
void | Mtr_MakeLastChild (MtrNode *parent, MtrNode *child) |
MtrNode * | Mtr_CreateFirstChild (MtrNode *parent) |
MtrNode * | Mtr_CreateLastChild (MtrNode *parent) |
void | Mtr_MakeNextSibling (MtrNode *first, MtrNode *second) |
void | Mtr_PrintTree (MtrNode *node) |
MtrNode * | Mtr_InitGroupTree (int lower, int size) |
MtrNode * | Mtr_MakeGroup (MtrNode *root, unsigned int low, unsigned int high, unsigned int flags) |
MtrNode * | Mtr_DissolveGroup (MtrNode *group) |
MtrNode * | Mtr_FindGroup (MtrNode *root, unsigned int low, unsigned int high) |
int | Mtr_SwapGroups (MtrNode *first, MtrNode *second) |
void | Mtr_PrintGroups (MtrNode *root, int silent) |
MtrNode * | Mtr_ReadGroups (FILE *fp, int nleaves) |
#define MTR_MAXHIGH ((MtrHalfWord) ~0) |
#define SIZEOF_VOID_P 4 |
CHeaderFile*****************************************************************
FileName [mtr.h]
PackageName [mtr]
Synopsis [Multiway-branch tree manipulation]
Description [This package provides two layers of functions. Functions of the lower level manipulate multiway-branch trees, implemented according to the classical scheme whereby each node points to its first child and its previous and next siblings. These functions are collected in mtrBasic.c.
Functions of the upper layer deal with group trees, that is the trees used by group sifting to represent the grouping of variables. These functions are collected in mtrGroup.c.]
SeeAlso [The CUDD package documentation; specifically on group sifting.]
Author [Fabio Somenzi]
Copyright [Copyright (c) 1995-2004, Regents of the University of Colorado
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]
Revision [
]
typedef unsigned short MtrHalfWord |
MtrNode* Mtr_AllocNode | ( | void | ) |
AutomaticStart
AutomaticStart AutomaticEnd Function********************************************************************
Synopsis [Allocates new tree node.]
Description [Allocates new tree node. Returns pointer to node.]
SideEffects [None]
SeeAlso [Mtr_DeallocNode]
Definition at line 118 of file mtrBasic.c.
Function********************************************************************
Synopsis [Makes a copy of tree.]
Description [Makes a copy of tree. If parameter expansion is greater than 1, it will expand the tree by that factor. It is an error for expansion to be less than 1. Returns a pointer to the copy if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [Mtr_InitTree]
Definition at line 215 of file mtrBasic.c.
Function********************************************************************
Synopsis [Creates a new node and makes it the first child of parent.]
Description [Creates a new node and makes it the first child of parent. Returns pointer to new child.]
SideEffects [None]
SeeAlso [Mtr_MakeFirstChild Mtr_CreateLastChild]
Definition at line 337 of file mtrBasic.c.
Function********************************************************************
Synopsis [Creates a new node and makes it the last child of parent.]
Description [Creates a new node and makes it the last child of parent. Returns pointer to new child.]
SideEffects [None]
SeeAlso [Mtr_MakeLastChild Mtr_CreateFirstChild]
Definition at line 366 of file mtrBasic.c.
void Mtr_DeallocNode | ( | MtrNode * | node | ) |
Function********************************************************************
Synopsis [Deallocates tree node.]
Description []
SideEffects [None]
SeeAlso [Mtr_AllocNode]
Definition at line 140 of file mtrBasic.c.
Function********************************************************************
Synopsis [Merges the children of `group' with the children of its parent.]
Description [Merges the children of `group' with the children of its parent. Disposes of the node pointed by group. If group is the root of the group tree, this procedure leaves the tree unchanged. Returns the pointer to the parent of `group' upon successful termination; NULL otherwise.]
SideEffects [None]
SeeAlso [Mtr_MakeGroup]
Definition at line 357 of file mtrGroup.c.
Function********************************************************************
Synopsis [Finds a group with size leaves starting at low, if it exists.]
Description [Finds a group with size leaves starting at low, if it exists. This procedure relies on the low and size fields of each node. It also assumes that the children of each node are sorted in order of increasing low. Returns the pointer to the root of the group upon successful termination; NULL otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 409 of file mtrGroup.c.
void Mtr_FreeTree | ( | MtrNode * | node | ) |
Function********************************************************************
Synopsis [Disposes of tree rooted at node.]
Description []
SideEffects [None]
SeeAlso [Mtr_InitTree]
Definition at line 188 of file mtrBasic.c.
MtrNode* Mtr_InitGroupTree | ( | int | lower, |
int | size | ||
) |
AutomaticEnd Function********************************************************************
Synopsis [Allocate new tree.]
Description [Allocate new tree with one node, whose low and size fields are specified by the lower and size parameters. Returns pointer to tree root.]
SideEffects [None]
SeeAlso [Mtr_InitTree Mtr_FreeTree]
Definition at line 121 of file mtrGroup.c.
MtrNode* Mtr_InitTree | ( | void | ) |
Function********************************************************************
Synopsis [Initializes tree with one node.]
Description [Initializes tree with one node. Returns pointer to node.]
SideEffects [None]
SeeAlso [Mtr_FreeTree Mtr_InitGroupTree]
Definition at line 161 of file mtrBasic.c.
Function********************************************************************
Synopsis [Makes child the first child of parent.]
Description []
SideEffects [None]
SeeAlso [Mtr_MakeLastChild Mtr_CreateFirstChild]
Definition at line 269 of file mtrBasic.c.
Function********************************************************************
Synopsis [Makes a new group with size leaves starting at low.]
Description [Makes a new group with size leaves starting at low. If the new group intersects an existing group, it must either contain it or be contained by it. This procedure relies on the low and size fields of each node. It also assumes that the children of each node are sorted in order of increasing low. In case of a valid request, the flags of the new group are set to the value passed in `flags.' This can also be used to change the flags of an existing group. Returns the pointer to the root of the new group upon successful termination; NULL otherwise. If the group already exists, the pointer to its root is returned.]
SideEffects [None]
SeeAlso [Mtr_DissolveGroup Mtr_ReadGroups Mtr_FindGroup]
Definition at line 158 of file mtrGroup.c.
Function********************************************************************
Synopsis [Makes child the last child of parent.]
Description []
SideEffects [None]
SeeAlso [Mtr_MakeFirstChild Mtr_CreateLastChild]
Definition at line 300 of file mtrBasic.c.
Function********************************************************************
Synopsis [Makes second the next sibling of first.]
Description [Makes second the next sibling of first. Second becomes a child of the parent of first.]
SideEffects [None]
SeeAlso []
Definition at line 395 of file mtrBasic.c.
void Mtr_PrintGroups | ( | MtrNode * | root, |
int | silent | ||
) |
Function********************************************************************
Synopsis [Prints the groups as a parenthesized list.]
Description [Prints the groups as a parenthesized list. After each group, the group's flag are printed, preceded by a `|'. For each flag (except MTR_TERMINAL) a character is printed.
The second argument, silent, if different from 0, causes Mtr_PrintGroups to only check the syntax of the group tree. ]
SideEffects [None]
SeeAlso [Mtr_PrintTree]
Definition at line 537 of file mtrGroup.c.
void Mtr_PrintTree | ( | MtrNode * | node | ) |
Function********************************************************************
Synopsis [Prints a tree, one node per line.]
Description []
SideEffects [None]
SeeAlso [Mtr_PrintGroups]
Definition at line 423 of file mtrBasic.c.
MtrNode* Mtr_ReadGroups | ( | FILE * | fp, |
int | nleaves | ||
) |
Function********************************************************************
Synopsis [Reads groups from a file and creates a group tree.]
Description [Reads groups from a file and creates a group tree. Each group is specified by three fields: <xmp> low size flags. </xmp> Low and size are (short) integers. Flags is a string composed of the following characters (with associated translation):
Normally, the only flags that are needed are D and F. Groups and fields are separated by white space (spaces, tabs, and newlines). Returns a pointer to the group tree if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [Mtr_InitGroupTree Mtr_MakeGroup]
Definition at line 611 of file mtrGroup.c.
Function********************************************************************
Synopsis [Swaps two children of a tree node.]
Description [Swaps two children of a tree node. Adjusts the high and low fields of the two nodes and their descendants. The two children must be adjacent. However, first may be the younger sibling of second. Returns 1 in case of success; 0 otherwise.]
SideEffects [None]
SeeAlso []
Definition at line 470 of file mtrGroup.c.