src/calBdd/calBddSupport.c File Reference

#include "calInt.h"
Include dependency graph for calBddSupport.c:

Go to the source code of this file.

Functions

static Cal_Bdd_tCalBddSupportStep (Cal_BddManager_t *bddManager, Cal_Bdd_t f, Cal_Bdd_t *support)
static void CalBddUnmarkNodes (Cal_BddManager_t *bddManager, Cal_Bdd_t f)
static int CalBddDependsOnStep (Cal_BddManager_t *bddManager, Cal_Bdd_t f, Cal_BddIndex_t varIndex, int mark)
void Cal_BddSupport (Cal_BddManager bddManager, Cal_Bdd fUserBdd, Cal_Bdd *support)
int Cal_BddDependsOn (Cal_BddManager bddManager, Cal_Bdd fUserBdd, Cal_Bdd varUserBdd)

Function Documentation

int Cal_BddDependsOn ( Cal_BddManager  bddManager,
Cal_Bdd  fUserBdd,
Cal_Bdd  varUserBdd 
)

Function********************************************************************

Name [Cal_BddDependsOn]

Synopsis [Returns 1 if f depends on var and returns 0 otherwise.]

Description [Returns 1 if f depends on var and returns 0 otherwise.]

SideEffects [None]

Definition at line 125 of file calBddSupport.c.

00127 {
00128   Cal_BddIndex_t bddIndex;
00129   Cal_Bdd_t f, var;
00130   
00131   if(CalBddPreProcessing(bddManager, 2, fUserBdd, varUserBdd)){
00132     f = CalBddGetInternalBdd(bddManager, fUserBdd);
00133     var = CalBddGetInternalBdd(bddManager, varUserBdd);
00134     if(CalBddIsBddConst(var)){
00135       return 1;
00136     }
00137     bddIndex = CalBddGetBddIndex(bddManager, var);
00138     CalBddDependsOnStep(bddManager, f, bddIndex, 1);
00139     return CalBddDependsOnStep(bddManager, f, bddIndex, 0);
00140   }
00141   return (0);
00142 }

void Cal_BddSupport ( Cal_BddManager  bddManager,
Cal_Bdd  fUserBdd,
Cal_Bdd support 
)

AutomaticEnd Function********************************************************************

Name [Cal_BddSupport]

Synopsis [returns the support of f as a null-terminated array of variables]

Description [optional]

SideEffects [None]

SeeAlso [optional]

Definition at line 92 of file calBddSupport.c.

00094 {
00095   if(CalBddPreProcessing(bddManager, 1, fUserBdd)){
00096     Cal_Bdd_t f = CalBddGetInternalBdd(bddManager, fUserBdd);
00097     Cal_Bdd_t *internalSupport = Cal_MemAlloc(Cal_Bdd_t, bddManager->numVars+1);
00098     Cal_Bdd_t *end;
00099     int i = 0;
00100     end = CalBddSupportStep(bddManager, f, internalSupport);
00101     *end = CalBddNull(bddManager);
00102     CalBddUnmarkNodes(bddManager, f);
00103     while (CalBddIsBddNull(bddManager, internalSupport[i]) == 0){
00104       *support = CalBddGetExternalBdd(bddManager, internalSupport[i]);
00105       support++;
00106       i++;
00107     }
00108     Cal_MemFree(internalSupport);
00109   }
00110   *support = (Cal_Bdd) 0;
00111 }

static int CalBddDependsOnStep ( Cal_BddManager_t bddManager,
Cal_Bdd_t  f,
Cal_BddIndex_t  varIndex,
int  mark 
) [static]

Function********************************************************************

Synopsis [required]

Description [optional]

SideEffects [required]

SeeAlso [optional]

Definition at line 237 of file calBddSupport.c.

00242 {
00243   Cal_BddIndex_t fIndex;
00244   Cal_Bdd_t tempBdd;
00245 
00246   fIndex=CalBddGetBddIndex(bddManager, f);
00247   if(fIndex > varIndex){
00248     return 0;
00249   }
00250   if(fIndex == varIndex){
00251     return 1;
00252   }
00253   if((mark && CalBddIsMarked(f)) || (!mark && !CalBddIsMarked(f))){
00254     return (0);
00255   }
00256   if(mark){
00257     CalBddMark(f);
00258   }
00259   else{
00260     CalBddUnmark(f);
00261   }
00262   CalBddGetThenBdd(f, tempBdd);
00263   if(CalBddDependsOnStep(bddManager, tempBdd, varIndex, mark)){
00264     return 1;
00265   }
00266   CalBddGetElseBdd(f, tempBdd);
00267   return CalBddDependsOnStep(bddManager, tempBdd, varIndex, mark);
00268 }

static Cal_Bdd_t * CalBddSupportStep ( Cal_BddManager_t bddManager,
Cal_Bdd_t  f,
Cal_Bdd_t support 
) [static]

CFile***********************************************************************

FileName [calBddSupport.c]

PackageName [cal]

Synopsis [Routines related to the support of a BDD.]

Description [ ]

SeeAlso [optional]

Author [Jagesh Sanghavi (sanghavi@eecs.berkeley.edu) Rajeev Ranjan (rajeev@eecs.berkeley.edu) Originally written by David Long. ] Copyright [Copyright (c) 1994-1996 The Regents of the Univ. of California. All rights reserved.

Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software.

IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.]

Revision [

Id
calBddSupport.c,v 1.1.1.3 1998/05/04 00:58:54 hsv Exp

]AutomaticStart

Function********************************************************************

Name [CalBddSupportStep]

Synopsis [returns the support of f as a null-terminated array of variables]

Description [optional]

SideEffects [required]

SeeAlso [optional]

Definition at line 167 of file calBddSupport.c.

00171 {
00172   Cal_Bdd_t tempBdd;
00173 
00174   if(CalBddIsMarked(f) || CalBddIsBddConst(f)){
00175     return support;
00176   }
00177   tempBdd = bddManager->varBdds[CalBddGetBddId(f)];
00178   if(!CalBddIsMarked(tempBdd)){
00179     CalBddMark(tempBdd);
00180     *support = tempBdd;
00181     ++support;
00182   }
00183   CalBddMark(f);
00184   CalBddGetThenBdd(f, tempBdd);
00185   support = CalBddSupportStep(bddManager, tempBdd, support);
00186   CalBddGetElseBdd(f, tempBdd);
00187   return CalBddSupportStep(bddManager, tempBdd, support);
00188 }

static void CalBddUnmarkNodes ( Cal_BddManager_t bddManager,
Cal_Bdd_t  f 
) [static]

Function********************************************************************

Name [CalBddUnmarkNodes]

Synopsis [recursively unmarks the nodes]

Description [optional]

SideEffects [required]

SeeAlso [optional]

Definition at line 205 of file calBddSupport.c.

00208 {
00209   Cal_Bdd_t tempBdd;
00210 
00211   if(!CalBddIsMarked(f) || CalBddIsBddConst(f)){
00212     return;
00213   }
00214   CalBddUnmark(f);
00215   tempBdd = bddManager->varBdds[CalBddGetBddId(f)];
00216   CalBddUnmark(tempBdd);
00217   CalBddGetThenBdd(f, tempBdd);
00218   CalBddUnmarkNodes(bddManager, tempBdd);
00219   CalBddGetElseBdd(f, tempBdd);
00220   CalBddUnmarkNodes(bddManager, tempBdd);
00221 }


Generated on Tue Jan 12 13:57:11 2010 for glu-2.2 by  doxygen 1.6.1