abc/src/bdd/cudd/cuddDecomp.c
/**Function********************************************************************

  Synopsis    [Check whether the given pair is in the tables.]

  Description [.Check whether the given pair is in the tables.  gTable
  and hTable are combined.
  absence in both is indicated by 0,
  presence in gTable is indicated by 1,
  presence in hTable by 2 and
  presence in both by 3.
  The values returned by this function are PAIR_ST,
  PAIR_CR, G_ST, G_CR, H_ST, H_CR, BOTH_G, BOTH_H, NONE.
  PAIR_ST implies g in gTable and h in hTable
  PAIR_CR implies g in hTable and h in gTable
  G_ST implies g in gTable and h not in any table
  G_CR implies g in hTable and h not in any table
  H_ST implies h in hTable and g not in any table
  H_CR implies h in gTable and g not in any table
  BOTH_G implies both in gTable
  BOTH_H implies both in hTable
  NONE implies none in table; ]

  SideEffects []

  SeeAlso     [CheckTablesCacheAndReturn CheckInTables]

******************************************************************************/
Function
Synopsis    [Check whether the given pair is in the tables.]

Description [.Check whether the given pair is in the tables.  gTable
and hTable are combined.
absence in both is indicated by 0,
presence in gTable is indicated by 1,
presence in hTable by 2 and
presence in both by 3.




Function Synopsis [ Check whether the given pair is in the tables . ] Description [ . Check whether the given pair is in the tables . gTable and hTable are combined . absence in both is indicated by 0 presence in gTable is indicated by 1 presence in hTable by 2 and presence in both by 3 .
static int
PairInTables(
  DdNode * g,
  DdNode * h,
  st__table * ghTable)
{
    int valueG, valueH, gPresent, hPresent;
    valueG = valueH = gPresent = hPresent = 0;
    gPresent = st__lookup_int(ghTable, (char *)Cudd_Regular(g), &valueG);
    hPresent = st__lookup_int(ghTable, (char *)Cudd_Regular(h), &valueH);
    if (!gPresent && !hPresent) return(NONE);
    if (!hPresent) {
        if (valueG & 1) return(G_ST);
        if (valueG & 2) return(G_CR);
    }
    if (!gPresent) {
        if (valueH & 1) return(H_CR);
        if (valueH & 2) return(H_ST);
    }
    if ((valueG & 1) && (valueH & 2)) return(PAIR_ST);
    if ((valueG & 2) && (valueH & 1)) return(PAIR_CR);
    if (valueG & 1) {
        return(BOTH_G);
    } else {
        return(BOTH_H);
    }
}
static int PairInTables ( DdNode * g , DdNode * h , st__table * ghTable ) { int valueG , valueH , gPresent , hPresent ; valueG = valueH = gPresent = hPresent = 0 ; gPresent = st__lookup_int ( ghTable , ( char * ) Cudd_Regular ( g ) , & valueG ) ; hPresent = st__lookup_int ( ghTable , ( char * ) Cudd_Regular ( h ) , & valueH ) ; if ( ! gPresent && ! hPresent ) return ( NONE ) ; if ( ! hPresent ) { if ( valueG & 1 ) return ( G_ST ) ; if ( valueG & 2 ) return ( G_CR ) ; } if ( ! gPresent ) { if ( valueH & 1 ) return ( H_CR ) ; if ( valueH & 2 ) return ( H_ST ) ; } if ( ( valueG & 1 ) && ( valueH & 2 ) ) return ( PAIR_ST ) ; if ( ( valueG & 2 ) && ( valueH & 1 ) ) return ( PAIR_CR ) ; if ( valueG & 1 ) { return ( BOTH_G ) ; } else { return ( BOTH_H ) ; } }
Function
Synopsis    [Check whether the given pair is in the tables.]
Function Synopsis [ Check whether the given pair is in the tables . ]
/* both in tables */