abc/src/misc/extra/extraUtilCanon.c
/**Function********************************************************************

  Synopsis    [Computes the N-canonical form of the Boolean function up to 6 inputs.]

  Description [The N-canonical form is defined as the truth table with 
  the minimum integer value. This function exhaustively enumerates 
  through the complete set of 2^N phase assignments.
  Returns pointers to the static storage to the truth table and phases. 
  This data should be used before the function is called again.]

  SideEffects []

  SeeAlso     []

******************************************************************************/
Function
Synopsis    [Computes the N-canonical form of the Boolean function up to 6 inputs.]

Description [The N-canonical form is defined as the truth table with
the minimum integer value. This function exhaustively enumerates
through the complete set of 2^N phase assignments.
Returns pointers to the static storage to the truth table and phases.
This data should be used before the function is called again.]




Function Synopsis [ Computes the N - canonical form of the Boolean function up to 6 inputs . ] Description [ The N - canonical form is defined as the truth table with the minimum integer value . This function exhaustively enumerates through the complete set of 2^N phase assignments . Returns pointers to the static storage to the truth table and phases . This data should be used before the function is called again . ]
int Extra_TruthCanonFastN( int nVarsMax, int nVarsReal, unsigned * pt, unsigned ** pptRes, char ** ppfRes )
{
    static unsigned uTruthStore6[2];
    int RetValue;
    assert( nVarsMax <= 6 );
    assert( nVarsReal <= nVarsMax );
    RetValue = Extra_TruthCanonN_rec( nVarsReal <= 3? 3: nVarsReal, (unsigned char *)pt, pptRes, ppfRes, 0 );
    if ( nVarsMax == 6 && nVarsReal < nVarsMax )
    {
        uTruthStore6[0] = **pptRes;
        uTruthStore6[1] = **pptRes;
        *pptRes = uTruthStore6;
    }
    return RetValue;
}
int Extra_TruthCanonFastN ( int nVarsMax , int nVarsReal , unsigned * pt , unsigned * * pptRes , char * * ppfRes ) { static unsigned uTruthStore6 [ 2 ] ; int RetValue ; assert ( nVarsMax <= 6 ) ; assert ( nVarsReal <= nVarsMax ) ; RetValue = Extra_TruthCanonN_rec ( nVarsReal <= 3 ? 3 : nVarsReal , ( unsigned char * ) pt , pptRes , ppfRes , 0 ) ; if ( nVarsMax == 6 && nVarsReal < nVarsMax ) { uTruthStore6 [ 0 ] = * * pptRes ; uTruthStore6 [ 1 ] = * * pptRes ; * pptRes = uTruthStore6 ; } return RetValue ; }
Function
Synopsis    [Computes the N-canonical form of the Boolean function up to 6 inputs.]
Function Synopsis [ Computes the N - canonical form of the Boolean function up to 6 inputs . ]