summaryrefslogtreecommitdiffstats
path: root/src/misc/extra
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/extra')
-rw-r--r--src/misc/extra/extra.h36
-rw-r--r--src/misc/extra/extraBddAuto.c5
-rw-r--r--src/misc/extra/extraBddCas.c31
-rw-r--r--src/misc/extra/extraBddImage.c5
-rw-r--r--src/misc/extra/extraBddKmap.c6
-rw-r--r--src/misc/extra/extraBddMisc.c26
-rw-r--r--src/misc/extra/extraBddSymm.c5
-rw-r--r--src/misc/extra/extraBddUnate.c5
-rw-r--r--src/misc/extra/extraUtilBitMatrix.c5
-rw-r--r--src/misc/extra/extraUtilCanon.c603
-rw-r--r--src/misc/extra/extraUtilFile.c37
-rw-r--r--src/misc/extra/extraUtilMemory.c23
-rw-r--r--src/misc/extra/extraUtilMisc.c9
-rw-r--r--src/misc/extra/extraUtilProgress.c9
-rw-r--r--src/misc/extra/extraUtilReader.c7
-rw-r--r--src/misc/extra/extraUtilTruth.c5
-rw-r--r--src/misc/extra/extraUtilUtil.c29
17 files changed, 490 insertions, 356 deletions
diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h
index dc2c2b0b..96ff6072 100644
--- a/src/misc/extra/extra.h
+++ b/src/misc/extra/extra.h
@@ -29,6 +29,7 @@
#ifndef __EXTRA_H__
#define __EXTRA_H__
+
#ifdef _WIN32
#define inline __inline // compatible with MS VS 6.0
#endif
@@ -42,13 +43,14 @@
#include <string.h>
#include <assert.h>
#include <time.h>
-#include "abc_global.h"
+
#include "st.h"
#include "cuddInt.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+
+
+ABC_NAMESPACE_HEADER_START
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
@@ -173,6 +175,7 @@ extern DdNode * Extra_bddMove( DdManager * dd, DdNode * bF, int nVars );
extern DdNode * extraBddMove( DdManager * dd, DdNode * bF, DdNode * bFlag );
extern void Extra_StopManager( DdManager * dd );
extern void Extra_bddPrint( DdManager * dd, DdNode * F );
+extern void Extra_bddPrintSupport( DdManager * dd, DdNode * F );
extern void extraDecomposeCover( DdManager* dd, DdNode* zC, DdNode** zC0, DdNode** zC1, DdNode** zC2 );
extern int Extra_bddSuppSize( DdManager * dd, DdNode * bSupp );
extern int Extra_bddSuppContainVar( DdManager * dd, DdNode * bS, DdNode * bVar );
@@ -325,6 +328,7 @@ extern char * Extra_FileNameGeneric( char * FileName );
extern char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix );
extern int Extra_FileSize( char * pFileName );
extern char * Extra_FileRead( FILE * pFile );
+extern int Extra_FileIsType( char * pFileName, char * pS1, char * pS2, char * pS3 );
extern char * Extra_TimeStamp();
extern char * Extra_StringAppend( char * pStrGiven, char * pStrAdd );
extern unsigned Extra_ReadBinary( char * Buffer );
@@ -332,7 +336,7 @@ extern void Extra_PrintBinary( FILE * pFile, unsigned Sign[], int nBits
extern int Extra_ReadHexadecimal( unsigned Sign[], char * pString, int nVars );
extern void Extra_PrintHexadecimal( FILE * pFile, unsigned Sign[], int nVars );
extern void Extra_PrintHexadecimalString( char * pString, unsigned Sign[], int nVars );
-extern void Extra_PrintHex( FILE * pFile, unsigned uTruth, int nVars );
+extern void Extra_PrintHex( FILE * pFile, unsigned * pTruth, int nVars );
extern void Extra_PrintSymbols( FILE * pFile, char Char, int nTimes, int fPrintNewLine );
/*=== extraUtilReader.c ========================================================*/
@@ -437,8 +441,10 @@ static inline void Extra_ProgressBarUpdate( ProgressBar * p, int nItemsCur, char
/*=== extraUtilTruth.c ================================================================*/
-static inline int Extra_Float2Int( float Val ) { return *((int *)&Val); }
-static inline float Extra_Int2Float( int Num ) { return *((float *)&Num); }
+//static inline int Extra_Float2Int( float Val ) { return *((int *)&Val); }
+//static inline float Extra_Int2Float( int Num ) { return *((float *)&Num); }
+static inline int Extra_Float2Int( float Val ) { union { int x; float y; } v; v.y = Val; return v.x; }
+static inline float Extra_Int2Float( int Num ) { union { int x; float y; } v; v.x = Num; return v.y; }
static inline int Extra_BitWordNum( int nBits ) { return nBits/(8*sizeof(unsigned)) + ((nBits%(8*sizeof(unsigned))) > 0); }
static inline int Extra_TruthWordNum( int nVars ) { return nVars <= 5 ? 1 : (1 << (nVars - 5)); }
@@ -590,20 +596,22 @@ extern long Extra_CpuTime();
extern double Extra_CpuTimeDouble();
extern int Extra_GetSoftDataLimit();
extern ABC_DLL void Extra_UtilGetoptReset();
-extern int Extra_UtilGetopt( int argc, char *argv[], char *optstring );
+extern int Extra_UtilGetopt( int argc, char *argv[], const char *optstring );
extern char * Extra_UtilPrintTime( long t );
-extern char * Extra_UtilStrsav( char *s );
+extern char * Extra_UtilStrsav( const char *s );
extern char * Extra_UtilTildeExpand( char *fname );
extern char * Extra_UtilFileSearch( char *file, char *path, char *mode );
-extern void (*Extra_UtilMMoutOfMemory)();
+extern void (*Extra_UtilMMoutOfMemory)( long size );
-extern char * globalUtilOptarg;
+extern const char * globalUtilOptarg;
extern int globalUtilOptind;
/**AutomaticEnd***************************************************************/
-#ifdef __cplusplus
-}
-#endif
+
+
+ABC_NAMESPACE_HEADER_END
+
+
#endif /* __EXTRA_H__ */
diff --git a/src/misc/extra/extraBddAuto.c b/src/misc/extra/extraBddAuto.c
index ebafb3a8..3b0e2aa0 100644
--- a/src/misc/extra/extraBddAuto.c
+++ b/src/misc/extra/extraBddAuto.c
@@ -18,6 +18,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -1556,3 +1559,5 @@ DdNode * extraBddSpaceFromMatrixNeg( DdManager * dd, DdNode * zA )
/* Definition of static functions */
/*---------------------------------------------------------------------------*/
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraBddCas.c b/src/misc/extra/extraBddCas.c
index ccf7397d..14de2d2b 100644
--- a/src/misc/extra/extraBddCas.c
+++ b/src/misc/extra/extraBddCas.c
@@ -18,6 +18,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -266,7 +269,7 @@ st_table * Extra_bddNodePathsUnderCut( DdManager * dd, DdNode * bFunc, int CutLe
s_CutLevel = CutLevel;
- Result = st_init_table(st_ptrcmp,st_ptrhash);
+ Result = st_init_table(st_ptrcmp, st_ptrhash);;
// the terminal cases
if ( Cudd_IsConstant( bFunc ) )
{
@@ -290,8 +293,8 @@ st_table * Extra_bddNodePathsUnderCut( DdManager * dd, DdNode * bFunc, int CutLe
// Step 1: Start the tables and collect information about the nodes above the cut
// this information tells how many edges point to each node
- Visited = st_init_table(st_ptrcmp,st_ptrhash);
- CutNodes = st_init_table(st_ptrcmp,st_ptrhash);
+ Visited = st_init_table(st_ptrcmp, st_ptrhash);;
+ CutNodes = st_init_table(st_ptrcmp, st_ptrhash);;
CountNodeVisits_rec( dd, aFunc, Visited );
@@ -303,7 +306,7 @@ st_table * Extra_bddNodePathsUnderCut( DdManager * dd, DdNode * bFunc, int CutLe
st_generator * gen;
DdNode * aNode;
traventry * p;
- st_foreach_item( Visited, gen, (char**)&aNode, (char**)&p )
+ st_foreach_item( Visited, gen, (const char**)&aNode, (char**)&p )
{
Cudd_RecursiveDeref( dd, p->bSum );
ABC_FREE( p );
@@ -315,7 +318,7 @@ st_table * Extra_bddNodePathsUnderCut( DdManager * dd, DdNode * bFunc, int CutLe
{
st_generator * gen;
DdNode * aNode, * bNode, * bSum;
- st_foreach_item( CutNodes, gen, (char**)&aNode, (char**)&bSum)
+ st_foreach_item( CutNodes, gen, (const char**)&aNode, (char**)&bSum)
{
// aNode is not referenced, because aFunc is holding it
bNode = Cudd_addBddPattern( dd, aNode ); Cudd_Ref( bNode );
@@ -376,8 +379,8 @@ int Extra_bddNodePathsUnderCutArray( DdManager * dd, DdNode ** paNodes, DdNode *
// Step 1: Start the table and collect information about the nodes above the cut
// this information tells how many edges point to each node
- CutNodes = st_init_table(st_ptrcmp,st_ptrhash);
- Visited = st_init_table(st_ptrcmp,st_ptrhash);
+ CutNodes = st_init_table(st_ptrcmp, st_ptrhash);;
+ Visited = st_init_table(st_ptrcmp, st_ptrhash);;
for ( i = 0; i < nNodes; i++ )
CountNodeVisits_rec( dd, paNodes[i], Visited );
@@ -391,7 +394,7 @@ int Extra_bddNodePathsUnderCutArray( DdManager * dd, DdNode ** paNodes, DdNode *
st_generator * gen;
DdNode * aNode;
traventry * p;
- st_foreach_item( Visited, gen, (char**)&aNode, (char**)&p )
+ st_foreach_item( Visited, gen, (const char**)&aNode, (char**)&p )
{
Cudd_RecursiveDeref( dd, p->bSum );
ABC_FREE( p );
@@ -404,7 +407,7 @@ int Extra_bddNodePathsUnderCutArray( DdManager * dd, DdNode ** paNodes, DdNode *
st_generator * gen;
DdNode * aNode, * bSum;
Counter = 0;
- st_foreach_item( CutNodes, gen, (char**)&aNode, (char**)&bSum)
+ st_foreach_item( CutNodes, gen, (const char**)&aNode, (char**)&bSum)
{
paNodesRes[Counter] = aNode; Cudd_Ref( aNode );
pbCubesRes[Counter] = bSum;
@@ -525,7 +528,7 @@ int Extra_ProfileWidth( DdManager * dd, DdNode * Func, int * pProfile, int CutLe
int WidthMax;
// start the mapping table
- tNodeTopRef = st_init_table(st_ptrcmp,st_ptrhash);
+ tNodeTopRef = st_init_table(st_ptrcmp, st_ptrhash);;
// add the topmost node to the profile
extraProfileUpdateTopLevel( tNodeTopRef, 0, Func );
@@ -533,7 +536,7 @@ int Extra_ProfileWidth( DdManager * dd, DdNode * Func, int * pProfile, int CutLe
tNodes = Extra_CollectNodes( Func );
// go though all the nodes and set the top level the cofactors are pointed from
// Cudd_ForeachNode( dd, Func, genDD, node )
- st_foreach_item( tNodes, gen, (char**)&node, NULL )
+ st_foreach_item( tNodes, gen, (const char**)&node, NULL )
{
// assert( Cudd_Regular(node) ); // this procedure works only with ADD/ZDD (not BDD w/ compl.edges)
nodeR = Cudd_Regular(node);
@@ -551,7 +554,7 @@ int Extra_ProfileWidth( DdManager * dd, DdNode * Func, int * pProfile, int CutLe
pProfile[i] = 0;
// create the profile
- st_foreach_item( tNodeTopRef, gen, (char**)&node, (char**)&LevelStart )
+ st_foreach_item( tNodeTopRef, gen, (const char**)&node, (char**)&LevelStart )
{
nodeR = Cudd_Regular(node);
Limit = (cuddIsConstant(nodeR))? dd->size: dd->perm[nodeR->index];
@@ -634,7 +637,7 @@ DdNode * CreateTheCodes_rec( DdManager * dd, DdNode * bEncoded, int Level, DdNod
st_generator * gen;
DdNode * bColumn, * bCode;
nCols = 0;
- st_foreach_item( CutNodes, gen, (char**)&bCode, (char**)&bColumn )
+ st_foreach_item( CutNodes, gen, (const char**)&bCode, (char**)&bColumn )
{
if ( bCode == b0 )
{ // the unused part of the columns
@@ -1228,3 +1231,5 @@ void CollectNodesAndComputePaths_rec( DdManager * dd, DdNode * aFunc, DdNode * b
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraBddImage.c b/src/misc/extra/extraBddImage.c
index 11d60a40..38c18f63 100644
--- a/src/misc/extra/extraBddImage.c
+++ b/src/misc/extra/extraBddImage.c
@@ -18,6 +18,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
The ideas implemented in this file are inspired by the paper:
Pankaj Chauhan, Edmund Clarke, Somesh Jha, Jim Kukula, Tom Shiple,
@@ -1155,3 +1158,5 @@ DdNode * Extra_bddImageRead2( Extra_ImageTree2_t * pTree )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraBddKmap.c b/src/misc/extra/extraBddKmap.c
index 6b54b450..5f384bc9 100644
--- a/src/misc/extra/extraBddKmap.c
+++ b/src/misc/extra/extraBddKmap.c
@@ -22,6 +22,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -283,6 +286,7 @@ void Extra_PrintKMap(
// determine the Karnaugh map parameters
nVarsVer = nVars/2;
nVarsHor = nVars - nVarsVer;
+
nCellsVer = (1<<nVarsVer);
nCellsHor = (1<<nVarsHor);
nSkipSpaces = nVarsVer + 1;
@@ -801,3 +805,5 @@ int BinCode ( int GrayCode )
}
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraBddMisc.c b/src/misc/extra/extraBddMisc.c
index 0c285fc7..cdded9b8 100644
--- a/src/misc/extra/extraBddMisc.c
+++ b/src/misc/extra/extraBddMisc.c
@@ -20,6 +20,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -285,6 +288,25 @@ void Extra_bddPrint( DdManager * dd, DdNode * F )
/**Function********************************************************************
+ Synopsis [Outputs the BDD in a readable format.]
+
+ Description []
+
+ SideEffects [None]
+
+ SeeAlso []
+
+******************************************************************************/
+void Extra_bddPrintSupport( DdManager * dd, DdNode * F )
+{
+ DdNode * bSupp;
+ bSupp = Cudd_Support( dd, F ); Cudd_Ref( bSupp );
+ Extra_bddPrint( dd, bSupp );
+ Cudd_RecursiveDeref( dd, bSupp );
+}
+
+/**Function********************************************************************
+
Synopsis [Returns the size of the support.]
Description []
@@ -1164,7 +1186,7 @@ DdNode * extraTransferPermute( DdManager * ddS, DdManager * ddD, DdNode * f, int
gen = st_init_gen( table );
if ( gen == NULL )
goto failure;
- while ( st_gen( gen, ( char ** ) &key, ( char ** ) &value ) )
+ while ( st_gen( gen, ( const char ** ) &key, ( char ** ) &value ) )
{
Cudd_RecursiveDeref( ddD, value );
}
@@ -1642,3 +1664,5 @@ cuddBddPermuteRecur( DdManager * manager /* DD manager */ ,
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraBddSymm.c b/src/misc/extra/extraBddSymm.c
index e42130d4..0adcbd2a 100644
--- a/src/misc/extra/extraBddSymm.c
+++ b/src/misc/extra/extraBddSymm.c
@@ -21,6 +21,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -1467,3 +1470,5 @@ DdNode * extraZddSelectOneSubset(
/*---------------------------------------------------------------------------*/
/* Definition of static Functions */
/*---------------------------------------------------------------------------*/
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraBddUnate.c b/src/misc/extra/extraBddUnate.c
index 715731bd..3aa18e51 100644
--- a/src/misc/extra/extraBddUnate.c
+++ b/src/misc/extra/extraBddUnate.c
@@ -22,6 +22,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -639,3 +642,5 @@ DdNode * extraZddGetSingletonsBoth(
/*---------------------------------------------------------------------------*/
/* Definition of static Functions */
/*---------------------------------------------------------------------------*/
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraUtilBitMatrix.c b/src/misc/extra/extraUtilBitMatrix.c
index dd63e05c..c3651fe4 100644
--- a/src/misc/extra/extraUtilBitMatrix.c
+++ b/src/misc/extra/extraUtilBitMatrix.c
@@ -18,6 +18,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -413,3 +416,5 @@ int Extra_BitMatrixIsClique( Extra_BitMat_t * pMat )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraUtilCanon.c b/src/misc/extra/extraUtilCanon.c
index c9c199d8..99d5dc42 100644
--- a/src/misc/extra/extraUtilCanon.c
+++ b/src/misc/extra/extraUtilCanon.c
@@ -20,6 +20,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -36,8 +39,303 @@
/* Variable declarations */
/*---------------------------------------------------------------------------*/
-static unsigned s_Truths3[256];
-static char s_Phases3[256][9];
+
+static unsigned s_Truths3[256] =
+{
+ 0x00000000, 0x01010101, 0x01010101, 0x03030303, 0x01010101, 0x05050505, 0x06060606, 0x07070707,
+ 0x01010101, 0x06060606, 0x05050505, 0x07070707, 0x03030303, 0x07070707, 0x07070707, 0x0f0f0f0f,
+ 0x01010101, 0x11111111, 0x12121212, 0x13131313, 0x14141414, 0x15151515, 0x16161616, 0x17171717,
+ 0x18181818, 0x19191919, 0x1a1a1a1a, 0x1b1b1b1b, 0x1c1c1c1c, 0x1d1d1d1d, 0x1e1e1e1e, 0x1f1f1f1f,
+ 0x01010101, 0x12121212, 0x11111111, 0x13131313, 0x18181818, 0x1a1a1a1a, 0x19191919, 0x1b1b1b1b,
+ 0x14141414, 0x16161616, 0x15151515, 0x17171717, 0x1c1c1c1c, 0x1e1e1e1e, 0x1d1d1d1d, 0x1f1f1f1f,
+ 0x03030303, 0x13131313, 0x13131313, 0x33333333, 0x1c1c1c1c, 0x35353535, 0x36363636, 0x37373737,
+ 0x1c1c1c1c, 0x36363636, 0x35353535, 0x37373737, 0x3c3c3c3c, 0x3d3d3d3d, 0x3d3d3d3d, 0x3f3f3f3f,
+ 0x01010101, 0x14141414, 0x18181818, 0x1c1c1c1c, 0x11111111, 0x15151515, 0x19191919, 0x1d1d1d1d,
+ 0x12121212, 0x16161616, 0x1a1a1a1a, 0x1e1e1e1e, 0x13131313, 0x17171717, 0x1b1b1b1b, 0x1f1f1f1f,
+ 0x05050505, 0x15151515, 0x1a1a1a1a, 0x35353535, 0x15151515, 0x55555555, 0x56565656, 0x57575757,
+ 0x1a1a1a1a, 0x56565656, 0x5a5a5a5a, 0x5b5b5b5b, 0x35353535, 0x57575757, 0x5b5b5b5b, 0x5f5f5f5f,
+ 0x06060606, 0x16161616, 0x19191919, 0x36363636, 0x19191919, 0x56565656, 0x66666666, 0x67676767,
+ 0x16161616, 0x69696969, 0x56565656, 0x6b6b6b6b, 0x36363636, 0x6b6b6b6b, 0x67676767, 0x6f6f6f6f,
+ 0x07070707, 0x17171717, 0x1b1b1b1b, 0x37373737, 0x1d1d1d1d, 0x57575757, 0x67676767, 0x77777777,
+ 0x1e1e1e1e, 0x6b6b6b6b, 0x5b5b5b5b, 0x7b7b7b7b, 0x3d3d3d3d, 0x7d7d7d7d, 0x7e7e7e7e, 0x7f7f7f7f,
+ 0x01010101, 0x18181818, 0x14141414, 0x1c1c1c1c, 0x12121212, 0x1a1a1a1a, 0x16161616, 0x1e1e1e1e,
+ 0x11111111, 0x19191919, 0x15151515, 0x1d1d1d1d, 0x13131313, 0x1b1b1b1b, 0x17171717, 0x1f1f1f1f,
+ 0x06060606, 0x19191919, 0x16161616, 0x36363636, 0x16161616, 0x56565656, 0x69696969, 0x6b6b6b6b,
+ 0x19191919, 0x66666666, 0x56565656, 0x67676767, 0x36363636, 0x67676767, 0x6b6b6b6b, 0x6f6f6f6f,
+ 0x05050505, 0x1a1a1a1a, 0x15151515, 0x35353535, 0x1a1a1a1a, 0x5a5a5a5a, 0x56565656, 0x5b5b5b5b,
+ 0x15151515, 0x56565656, 0x55555555, 0x57575757, 0x35353535, 0x5b5b5b5b, 0x57575757, 0x5f5f5f5f,
+ 0x07070707, 0x1b1b1b1b, 0x17171717, 0x37373737, 0x1e1e1e1e, 0x5b5b5b5b, 0x6b6b6b6b, 0x7b7b7b7b,
+ 0x1d1d1d1d, 0x67676767, 0x57575757, 0x77777777, 0x3d3d3d3d, 0x7e7e7e7e, 0x7d7d7d7d, 0x7f7f7f7f,
+ 0x03030303, 0x1c1c1c1c, 0x1c1c1c1c, 0x3c3c3c3c, 0x13131313, 0x35353535, 0x36363636, 0x3d3d3d3d,
+ 0x13131313, 0x36363636, 0x35353535, 0x3d3d3d3d, 0x33333333, 0x37373737, 0x37373737, 0x3f3f3f3f,
+ 0x07070707, 0x1d1d1d1d, 0x1e1e1e1e, 0x3d3d3d3d, 0x17171717, 0x57575757, 0x6b6b6b6b, 0x7d7d7d7d,
+ 0x1b1b1b1b, 0x67676767, 0x5b5b5b5b, 0x7e7e7e7e, 0x37373737, 0x77777777, 0x7b7b7b7b, 0x7f7f7f7f,
+ 0x07070707, 0x1e1e1e1e, 0x1d1d1d1d, 0x3d3d3d3d, 0x1b1b1b1b, 0x5b5b5b5b, 0x67676767, 0x7e7e7e7e,
+ 0x17171717, 0x6b6b6b6b, 0x57575757, 0x7d7d7d7d, 0x37373737, 0x7b7b7b7b, 0x77777777, 0x7f7f7f7f,
+ 0x0f0f0f0f, 0x1f1f1f1f, 0x1f1f1f1f, 0x3f3f3f3f, 0x1f1f1f1f, 0x5f5f5f5f, 0x6f6f6f6f, 0x7f7f7f7f,
+ 0x1f1f1f1f, 0x6f6f6f6f, 0x5f5f5f5f, 0x7f7f7f7f, 0x3f3f3f3f, 0x7f7f7f7f, 0x7f7f7f7f, 0xffffffff
+};
+
+static char s_Phases3[256][9] =
+{
+/* 0 */ { 8, 0, 1, 2, 3, 4, 5, 6, 7 },
+/* 1 */ { 1, 0 },
+/* 2 */ { 1, 1 },
+/* 3 */ { 2, 0, 1 },
+/* 4 */ { 1, 2 },
+/* 5 */ { 2, 0, 2 },
+/* 6 */ { 2, 0, 3 },
+/* 7 */ { 1, 0 },
+/* 8 */ { 1, 3 },
+/* 9 */ { 2, 1, 2 },
+/* 10 */ { 2, 1, 3 },
+/* 11 */ { 1, 1 },
+/* 12 */ { 2, 2, 3 },
+/* 13 */ { 1, 2 },
+/* 14 */ { 1, 3 },
+/* 15 */ { 4, 0, 1, 2, 3 },
+/* 16 */ { 1, 4 },
+/* 17 */ { 2, 0, 4 },
+/* 18 */ { 2, 0, 5 },
+/* 19 */ { 1, 0 },
+/* 20 */ { 2, 0, 6 },
+/* 21 */ { 1, 0 },
+/* 22 */ { 1, 0 },
+/* 23 */ { 1, 0 },
+/* 24 */ { 2, 0, 7 },
+/* 25 */ { 1, 0 },
+/* 26 */ { 1, 0 },
+/* 27 */ { 1, 0 },
+/* 28 */ { 1, 0 },
+/* 29 */ { 1, 0 },
+/* 30 */ { 1, 0 },
+/* 31 */ { 1, 0 },
+/* 32 */ { 1, 5 },
+/* 33 */ { 2, 1, 4 },
+/* 34 */ { 2, 1, 5 },
+/* 35 */ { 1, 1 },
+/* 36 */ { 2, 1, 6 },
+/* 37 */ { 1, 1 },
+/* 38 */ { 1, 1 },
+/* 39 */ { 1, 1 },
+/* 40 */ { 2, 1, 7 },
+/* 41 */ { 1, 1 },
+/* 42 */ { 1, 1 },
+/* 43 */ { 1, 1 },
+/* 44 */ { 1, 1 },
+/* 45 */ { 1, 1 },
+/* 46 */ { 1, 1 },
+/* 47 */ { 1, 1 },
+/* 48 */ { 2, 4, 5 },
+/* 49 */ { 1, 4 },
+/* 50 */ { 1, 5 },
+/* 51 */ { 4, 0, 1, 4, 5 },
+/* 52 */ { 1, 6 },
+/* 53 */ { 1, 0 },
+/* 54 */ { 1, 0 },
+/* 55 */ { 1, 0 },
+/* 56 */ { 1, 7 },
+/* 57 */ { 1, 1 },
+/* 58 */ { 1, 1 },
+/* 59 */ { 1, 1 },
+/* 60 */ { 4, 0, 1, 6, 7 },
+/* 61 */ { 1, 0 },
+/* 62 */ { 1, 1 },
+/* 63 */ { 2, 0, 1 },
+/* 64 */ { 1, 6 },
+/* 65 */ { 2, 2, 4 },
+/* 66 */ { 2, 2, 5 },
+/* 67 */ { 1, 2 },
+/* 68 */ { 2, 2, 6 },
+/* 69 */ { 1, 2 },
+/* 70 */ { 1, 2 },
+/* 71 */ { 1, 2 },
+/* 72 */ { 2, 2, 7 },
+/* 73 */ { 1, 2 },
+/* 74 */ { 1, 2 },
+/* 75 */ { 1, 2 },
+/* 76 */ { 1, 2 },
+/* 77 */ { 1, 2 },
+/* 78 */ { 1, 2 },
+/* 79 */ { 1, 2 },
+/* 80 */ { 2, 4, 6 },
+/* 81 */ { 1, 4 },
+/* 82 */ { 1, 5 },
+/* 83 */ { 1, 4 },
+/* 84 */ { 1, 6 },
+/* 85 */ { 4, 0, 2, 4, 6 },
+/* 86 */ { 1, 0 },
+/* 87 */ { 1, 0 },
+/* 88 */ { 1, 7 },
+/* 89 */ { 1, 2 },
+/* 90 */ { 4, 0, 2, 5, 7 },
+/* 91 */ { 1, 0 },
+/* 92 */ { 1, 6 },
+/* 93 */ { 1, 2 },
+/* 94 */ { 1, 2 },
+/* 95 */ { 2, 0, 2 },
+/* 96 */ { 2, 4, 7 },
+/* 97 */ { 1, 4 },
+/* 98 */ { 1, 5 },
+/* 99 */ { 1, 4 },
+/* 100 */ { 1, 6 },
+/* 101 */ { 1, 4 },
+/* 102 */ { 4, 0, 3, 4, 7 },
+/* 103 */ { 1, 0 },
+/* 104 */ { 1, 7 },
+/* 105 */ { 4, 0, 3, 5, 6 },
+/* 106 */ { 1, 7 },
+/* 107 */ { 1, 0 },
+/* 108 */ { 1, 7 },
+/* 109 */ { 1, 3 },
+/* 110 */ { 1, 3 },
+/* 111 */ { 2, 0, 3 },
+/* 112 */ { 1, 4 },
+/* 113 */ { 1, 4 },
+/* 114 */ { 1, 5 },
+/* 115 */ { 1, 4 },
+/* 116 */ { 1, 6 },
+/* 117 */ { 1, 4 },
+/* 118 */ { 1, 4 },
+/* 119 */ { 2, 0, 4 },
+/* 120 */ { 1, 7 },
+/* 121 */ { 1, 5 },
+/* 122 */ { 1, 5 },
+/* 123 */ { 2, 0, 5 },
+/* 124 */ { 1, 6 },
+/* 125 */ { 2, 0, 6 },
+/* 126 */ { 2, 0, 7 },
+/* 127 */ { 1, 0 },
+/* 128 */ { 1, 7 },
+/* 129 */ { 2, 3, 4 },
+/* 130 */ { 2, 3, 5 },
+/* 131 */ { 1, 3 },
+/* 132 */ { 2, 3, 6 },
+/* 133 */ { 1, 3 },
+/* 134 */ { 1, 3 },
+/* 135 */ { 1, 3 },
+/* 136 */ { 2, 3, 7 },
+/* 137 */ { 1, 3 },
+/* 138 */ { 1, 3 },
+/* 139 */ { 1, 3 },
+/* 140 */ { 1, 3 },
+/* 141 */ { 1, 3 },
+/* 142 */ { 1, 3 },
+/* 143 */ { 1, 3 },
+/* 144 */ { 2, 5, 6 },
+/* 145 */ { 1, 4 },
+/* 146 */ { 1, 5 },
+/* 147 */ { 1, 5 },
+/* 148 */ { 1, 6 },
+/* 149 */ { 1, 6 },
+/* 150 */ { 4, 1, 2, 4, 7 },
+/* 151 */ { 1, 1 },
+/* 152 */ { 1, 7 },
+/* 153 */ { 4, 1, 2, 5, 6 },
+/* 154 */ { 1, 5 },
+/* 155 */ { 1, 1 },
+/* 156 */ { 1, 6 },
+/* 157 */ { 1, 2 },
+/* 158 */ { 1, 2 },
+/* 159 */ { 2, 1, 2 },
+/* 160 */ { 2, 5, 7 },
+/* 161 */ { 1, 4 },
+/* 162 */ { 1, 5 },
+/* 163 */ { 1, 5 },
+/* 164 */ { 1, 6 },
+/* 165 */ { 4, 1, 3, 4, 6 },
+/* 166 */ { 1, 3 },
+/* 167 */ { 1, 1 },
+/* 168 */ { 1, 7 },
+/* 169 */ { 1, 1 },
+/* 170 */ { 4, 1, 3, 5, 7 },
+/* 171 */ { 1, 1 },
+/* 172 */ { 1, 7 },
+/* 173 */ { 1, 3 },
+/* 174 */ { 1, 3 },
+/* 175 */ { 2, 1, 3 },
+/* 176 */ { 1, 5 },
+/* 177 */ { 1, 4 },
+/* 178 */ { 1, 5 },
+/* 179 */ { 1, 5 },
+/* 180 */ { 1, 6 },
+/* 181 */ { 1, 4 },
+/* 182 */ { 1, 4 },
+/* 183 */ { 2, 1, 4 },
+/* 184 */ { 1, 7 },
+/* 185 */ { 1, 5 },
+/* 186 */ { 1, 5 },
+/* 187 */ { 2, 1, 5 },
+/* 188 */ { 1, 7 },
+/* 189 */ { 2, 1, 6 },
+/* 190 */ { 2, 1, 7 },
+/* 191 */ { 1, 1 },
+/* 192 */ { 2, 6, 7 },
+/* 193 */ { 1, 4 },
+/* 194 */ { 1, 5 },
+/* 195 */ { 4, 2, 3, 4, 5 },
+/* 196 */ { 1, 6 },
+/* 197 */ { 1, 2 },
+/* 198 */ { 1, 3 },
+/* 199 */ { 1, 2 },
+/* 200 */ { 1, 7 },
+/* 201 */ { 1, 2 },
+/* 202 */ { 1, 3 },
+/* 203 */ { 1, 3 },
+/* 204 */ { 4, 2, 3, 6, 7 },
+/* 205 */ { 1, 2 },
+/* 206 */ { 1, 3 },
+/* 207 */ { 2, 2, 3 },
+/* 208 */ { 1, 6 },
+/* 209 */ { 1, 4 },
+/* 210 */ { 1, 5 },
+/* 211 */ { 1, 4 },
+/* 212 */ { 1, 6 },
+/* 213 */ { 1, 6 },
+/* 214 */ { 1, 7 },
+/* 215 */ { 2, 2, 4 },
+/* 216 */ { 1, 7 },
+/* 217 */ { 1, 6 },
+/* 218 */ { 1, 7 },
+/* 219 */ { 2, 2, 5 },
+/* 220 */ { 1, 6 },
+/* 221 */ { 2, 2, 6 },
+/* 222 */ { 2, 2, 7 },
+/* 223 */ { 1, 2 },
+/* 224 */ { 1, 7 },
+/* 225 */ { 1, 4 },
+/* 226 */ { 1, 5 },
+/* 227 */ { 1, 5 },
+/* 228 */ { 1, 6 },
+/* 229 */ { 1, 6 },
+/* 230 */ { 1, 7 },
+/* 231 */ { 2, 3, 4 },
+/* 232 */ { 1, 7 },
+/* 233 */ { 1, 6 },
+/* 234 */ { 1, 7 },
+/* 235 */ { 2, 3, 5 },
+/* 236 */ { 1, 7 },
+/* 237 */ { 2, 3, 6 },
+/* 238 */ { 2, 3, 7 },
+/* 239 */ { 1, 3 },
+/* 240 */ { 4, 4, 5, 6, 7 },
+/* 241 */ { 1, 4 },
+/* 242 */ { 1, 5 },
+/* 243 */ { 2, 4, 5 },
+/* 244 */ { 1, 6 },
+/* 245 */ { 2, 4, 6 },
+/* 246 */ { 2, 4, 7 },
+/* 247 */ { 1, 4 },
+/* 248 */ { 1, 7 },
+/* 249 */ { 2, 5, 6 },
+/* 250 */ { 2, 5, 7 },
+/* 251 */ { 1, 5 },
+/* 252 */ { 2, 6, 7 },
+/* 253 */ { 1, 6 },
+/* 254 */ { 1, 7 },
+/* 255 */ { 8, 0, 1, 2, 3, 4, 5, 6, 7 }
+};
+
/*---------------------------------------------------------------------------*/
/* Macro declarations */
@@ -299,7 +597,7 @@ void Map_Var3Print()
{
if ( i % 8 == 0 )
printf( "\n" );
- Extra_PrintHex( stdout, uCanons[i], 5 );
+ Extra_PrintHex( stdout, uCanons + i, 5 );
printf( ", " );
}
printf( "\n" );
@@ -384,305 +682,10 @@ void Map_Var4Test()
/* Definition of static Functions */
/*---------------------------------------------------------------------------*/
-static unsigned s_Truths3[256] =
-{
- 0x00000000, 0x01010101, 0x01010101, 0x03030303, 0x01010101, 0x05050505, 0x06060606, 0x07070707,
- 0x01010101, 0x06060606, 0x05050505, 0x07070707, 0x03030303, 0x07070707, 0x07070707, 0x0f0f0f0f,
- 0x01010101, 0x11111111, 0x12121212, 0x13131313, 0x14141414, 0x15151515, 0x16161616, 0x17171717,
- 0x18181818, 0x19191919, 0x1a1a1a1a, 0x1b1b1b1b, 0x1c1c1c1c, 0x1d1d1d1d, 0x1e1e1e1e, 0x1f1f1f1f,
- 0x01010101, 0x12121212, 0x11111111, 0x13131313, 0x18181818, 0x1a1a1a1a, 0x19191919, 0x1b1b1b1b,
- 0x14141414, 0x16161616, 0x15151515, 0x17171717, 0x1c1c1c1c, 0x1e1e1e1e, 0x1d1d1d1d, 0x1f1f1f1f,
- 0x03030303, 0x13131313, 0x13131313, 0x33333333, 0x1c1c1c1c, 0x35353535, 0x36363636, 0x37373737,
- 0x1c1c1c1c, 0x36363636, 0x35353535, 0x37373737, 0x3c3c3c3c, 0x3d3d3d3d, 0x3d3d3d3d, 0x3f3f3f3f,
- 0x01010101, 0x14141414, 0x18181818, 0x1c1c1c1c, 0x11111111, 0x15151515, 0x19191919, 0x1d1d1d1d,
- 0x12121212, 0x16161616, 0x1a1a1a1a, 0x1e1e1e1e, 0x13131313, 0x17171717, 0x1b1b1b1b, 0x1f1f1f1f,
- 0x05050505, 0x15151515, 0x1a1a1a1a, 0x35353535, 0x15151515, 0x55555555, 0x56565656, 0x57575757,
- 0x1a1a1a1a, 0x56565656, 0x5a5a5a5a, 0x5b5b5b5b, 0x35353535, 0x57575757, 0x5b5b5b5b, 0x5f5f5f5f,
- 0x06060606, 0x16161616, 0x19191919, 0x36363636, 0x19191919, 0x56565656, 0x66666666, 0x67676767,
- 0x16161616, 0x69696969, 0x56565656, 0x6b6b6b6b, 0x36363636, 0x6b6b6b6b, 0x67676767, 0x6f6f6f6f,
- 0x07070707, 0x17171717, 0x1b1b1b1b, 0x37373737, 0x1d1d1d1d, 0x57575757, 0x67676767, 0x77777777,
- 0x1e1e1e1e, 0x6b6b6b6b, 0x5b5b5b5b, 0x7b7b7b7b, 0x3d3d3d3d, 0x7d7d7d7d, 0x7e7e7e7e, 0x7f7f7f7f,
- 0x01010101, 0x18181818, 0x14141414, 0x1c1c1c1c, 0x12121212, 0x1a1a1a1a, 0x16161616, 0x1e1e1e1e,
- 0x11111111, 0x19191919, 0x15151515, 0x1d1d1d1d, 0x13131313, 0x1b1b1b1b, 0x17171717, 0x1f1f1f1f,
- 0x06060606, 0x19191919, 0x16161616, 0x36363636, 0x16161616, 0x56565656, 0x69696969, 0x6b6b6b6b,
- 0x19191919, 0x66666666, 0x56565656, 0x67676767, 0x36363636, 0x67676767, 0x6b6b6b6b, 0x6f6f6f6f,
- 0x05050505, 0x1a1a1a1a, 0x15151515, 0x35353535, 0x1a1a1a1a, 0x5a5a5a5a, 0x56565656, 0x5b5b5b5b,
- 0x15151515, 0x56565656, 0x55555555, 0x57575757, 0x35353535, 0x5b5b5b5b, 0x57575757, 0x5f5f5f5f,
- 0x07070707, 0x1b1b1b1b, 0x17171717, 0x37373737, 0x1e1e1e1e, 0x5b5b5b5b, 0x6b6b6b6b, 0x7b7b7b7b,
- 0x1d1d1d1d, 0x67676767, 0x57575757, 0x77777777, 0x3d3d3d3d, 0x7e7e7e7e, 0x7d7d7d7d, 0x7f7f7f7f,
- 0x03030303, 0x1c1c1c1c, 0x1c1c1c1c, 0x3c3c3c3c, 0x13131313, 0x35353535, 0x36363636, 0x3d3d3d3d,
- 0x13131313, 0x36363636, 0x35353535, 0x3d3d3d3d, 0x33333333, 0x37373737, 0x37373737, 0x3f3f3f3f,
- 0x07070707, 0x1d1d1d1d, 0x1e1e1e1e, 0x3d3d3d3d, 0x17171717, 0x57575757, 0x6b6b6b6b, 0x7d7d7d7d,
- 0x1b1b1b1b, 0x67676767, 0x5b5b5b5b, 0x7e7e7e7e, 0x37373737, 0x77777777, 0x7b7b7b7b, 0x7f7f7f7f,
- 0x07070707, 0x1e1e1e1e, 0x1d1d1d1d, 0x3d3d3d3d, 0x1b1b1b1b, 0x5b5b5b5b, 0x67676767, 0x7e7e7e7e,
- 0x17171717, 0x6b6b6b6b, 0x57575757, 0x7d7d7d7d, 0x37373737, 0x7b7b7b7b, 0x77777777, 0x7f7f7f7f,
- 0x0f0f0f0f, 0x1f1f1f1f, 0x1f1f1f1f, 0x3f3f3f3f, 0x1f1f1f1f, 0x5f5f5f5f, 0x6f6f6f6f, 0x7f7f7f7f,
- 0x1f1f1f1f, 0x6f6f6f6f, 0x5f5f5f5f, 0x7f7f7f7f, 0x3f3f3f3f, 0x7f7f7f7f, 0x7f7f7f7f, 0xffffffff
-};
-
-static char s_Phases3[256][9] =
-{
-/* 0 */ { 8, 0, 1, 2, 3, 4, 5, 6, 7 },
-/* 1 */ { 1, 0 },
-/* 2 */ { 1, 1 },
-/* 3 */ { 2, 0, 1 },
-/* 4 */ { 1, 2 },
-/* 5 */ { 2, 0, 2 },
-/* 6 */ { 2, 0, 3 },
-/* 7 */ { 1, 0 },
-/* 8 */ { 1, 3 },
-/* 9 */ { 2, 1, 2 },
-/* 10 */ { 2, 1, 3 },
-/* 11 */ { 1, 1 },
-/* 12 */ { 2, 2, 3 },
-/* 13 */ { 1, 2 },
-/* 14 */ { 1, 3 },
-/* 15 */ { 4, 0, 1, 2, 3 },
-/* 16 */ { 1, 4 },
-/* 17 */ { 2, 0, 4 },
-/* 18 */ { 2, 0, 5 },
-/* 19 */ { 1, 0 },
-/* 20 */ { 2, 0, 6 },
-/* 21 */ { 1, 0 },
-/* 22 */ { 1, 0 },
-/* 23 */ { 1, 0 },
-/* 24 */ { 2, 0, 7 },
-/* 25 */ { 1, 0 },
-/* 26 */ { 1, 0 },
-/* 27 */ { 1, 0 },
-/* 28 */ { 1, 0 },
-/* 29 */ { 1, 0 },
-/* 30 */ { 1, 0 },
-/* 31 */ { 1, 0 },
-/* 32 */ { 1, 5 },
-/* 33 */ { 2, 1, 4 },
-/* 34 */ { 2, 1, 5 },
-/* 35 */ { 1, 1 },
-/* 36 */ { 2, 1, 6 },
-/* 37 */ { 1, 1 },
-/* 38 */ { 1, 1 },
-/* 39 */ { 1, 1 },
-/* 40 */ { 2, 1, 7 },
-/* 41 */ { 1, 1 },
-/* 42 */ { 1, 1 },
-/* 43 */ { 1, 1 },
-/* 44 */ { 1, 1 },
-/* 45 */ { 1, 1 },
-/* 46 */ { 1, 1 },
-/* 47 */ { 1, 1 },
-/* 48 */ { 2, 4, 5 },
-/* 49 */ { 1, 4 },
-/* 50 */ { 1, 5 },
-/* 51 */ { 4, 0, 1, 4, 5 },
-/* 52 */ { 1, 6 },
-/* 53 */ { 1, 0 },
-/* 54 */ { 1, 0 },
-/* 55 */ { 1, 0 },
-/* 56 */ { 1, 7 },
-/* 57 */ { 1, 1 },
-/* 58 */ { 1, 1 },
-/* 59 */ { 1, 1 },
-/* 60 */ { 4, 0, 1, 6, 7 },
-/* 61 */ { 1, 0 },
-/* 62 */ { 1, 1 },
-/* 63 */ { 2, 0, 1 },
-/* 64 */ { 1, 6 },
-/* 65 */ { 2, 2, 4 },
-/* 66 */ { 2, 2, 5 },
-/* 67 */ { 1, 2 },
-/* 68 */ { 2, 2, 6 },
-/* 69 */ { 1, 2 },
-/* 70 */ { 1, 2 },
-/* 71 */ { 1, 2 },
-/* 72 */ { 2, 2, 7 },
-/* 73 */ { 1, 2 },
-/* 74 */ { 1, 2 },
-/* 75 */ { 1, 2 },
-/* 76 */ { 1, 2 },
-/* 77 */ { 1, 2 },
-/* 78 */ { 1, 2 },
-/* 79 */ { 1, 2 },
-/* 80 */ { 2, 4, 6 },
-/* 81 */ { 1, 4 },
-/* 82 */ { 1, 5 },
-/* 83 */ { 1, 4 },
-/* 84 */ { 1, 6 },
-/* 85 */ { 4, 0, 2, 4, 6 },
-/* 86 */ { 1, 0 },
-/* 87 */ { 1, 0 },
-/* 88 */ { 1, 7 },
-/* 89 */ { 1, 2 },
-/* 90 */ { 4, 0, 2, 5, 7 },
-/* 91 */ { 1, 0 },
-/* 92 */ { 1, 6 },
-/* 93 */ { 1, 2 },
-/* 94 */ { 1, 2 },
-/* 95 */ { 2, 0, 2 },
-/* 96 */ { 2, 4, 7 },
-/* 97 */ { 1, 4 },
-/* 98 */ { 1, 5 },
-/* 99 */ { 1, 4 },
-/* 100 */ { 1, 6 },
-/* 101 */ { 1, 4 },
-/* 102 */ { 4, 0, 3, 4, 7 },
-/* 103 */ { 1, 0 },
-/* 104 */ { 1, 7 },
-/* 105 */ { 4, 0, 3, 5, 6 },
-/* 106 */ { 1, 7 },
-/* 107 */ { 1, 0 },
-/* 108 */ { 1, 7 },
-/* 109 */ { 1, 3 },
-/* 110 */ { 1, 3 },
-/* 111 */ { 2, 0, 3 },
-/* 112 */ { 1, 4 },
-/* 113 */ { 1, 4 },
-/* 114 */ { 1, 5 },
-/* 115 */ { 1, 4 },
-/* 116 */ { 1, 6 },
-/* 117 */ { 1, 4 },
-/* 118 */ { 1, 4 },
-/* 119 */ { 2, 0, 4 },
-/* 120 */ { 1, 7 },
-/* 121 */ { 1, 5 },
-/* 122 */ { 1, 5 },
-/* 123 */ { 2, 0, 5 },
-/* 124 */ { 1, 6 },
-/* 125 */ { 2, 0, 6 },
-/* 126 */ { 2, 0, 7 },
-/* 127 */ { 1, 0 },
-/* 128 */ { 1, 7 },
-/* 129 */ { 2, 3, 4 },
-/* 130 */ { 2, 3, 5 },
-/* 131 */ { 1, 3 },
-/* 132 */ { 2, 3, 6 },
-/* 133 */ { 1, 3 },
-/* 134 */ { 1, 3 },
-/* 135 */ { 1, 3 },
-/* 136 */ { 2, 3, 7 },
-/* 137 */ { 1, 3 },
-/* 138 */ { 1, 3 },
-/* 139 */ { 1, 3 },
-/* 140 */ { 1, 3 },
-/* 141 */ { 1, 3 },
-/* 142 */ { 1, 3 },
-/* 143 */ { 1, 3 },
-/* 144 */ { 2, 5, 6 },
-/* 145 */ { 1, 4 },
-/* 146 */ { 1, 5 },
-/* 147 */ { 1, 5 },
-/* 148 */ { 1, 6 },
-/* 149 */ { 1, 6 },
-/* 150 */ { 4, 1, 2, 4, 7 },
-/* 151 */ { 1, 1 },
-/* 152 */ { 1, 7 },
-/* 153 */ { 4, 1, 2, 5, 6 },
-/* 154 */ { 1, 5 },
-/* 155 */ { 1, 1 },
-/* 156 */ { 1, 6 },
-/* 157 */ { 1, 2 },
-/* 158 */ { 1, 2 },
-/* 159 */ { 2, 1, 2 },
-/* 160 */ { 2, 5, 7 },
-/* 161 */ { 1, 4 },
-/* 162 */ { 1, 5 },
-/* 163 */ { 1, 5 },
-/* 164 */ { 1, 6 },
-/* 165 */ { 4, 1, 3, 4, 6 },
-/* 166 */ { 1, 3 },
-/* 167 */ { 1, 1 },
-/* 168 */ { 1, 7 },
-/* 169 */ { 1, 1 },
-/* 170 */ { 4, 1, 3, 5, 7 },
-/* 171 */ { 1, 1 },
-/* 172 */ { 1, 7 },
-/* 173 */ { 1, 3 },
-/* 174 */ { 1, 3 },
-/* 175 */ { 2, 1, 3 },
-/* 176 */ { 1, 5 },
-/* 177 */ { 1, 4 },
-/* 178 */ { 1, 5 },
-/* 179 */ { 1, 5 },
-/* 180 */ { 1, 6 },
-/* 181 */ { 1, 4 },
-/* 182 */ { 1, 4 },
-/* 183 */ { 2, 1, 4 },
-/* 184 */ { 1, 7 },
-/* 185 */ { 1, 5 },
-/* 186 */ { 1, 5 },
-/* 187 */ { 2, 1, 5 },
-/* 188 */ { 1, 7 },
-/* 189 */ { 2, 1, 6 },
-/* 190 */ { 2, 1, 7 },
-/* 191 */ { 1, 1 },
-/* 192 */ { 2, 6, 7 },
-/* 193 */ { 1, 4 },
-/* 194 */ { 1, 5 },
-/* 195 */ { 4, 2, 3, 4, 5 },
-/* 196 */ { 1, 6 },
-/* 197 */ { 1, 2 },
-/* 198 */ { 1, 3 },
-/* 199 */ { 1, 2 },
-/* 200 */ { 1, 7 },
-/* 201 */ { 1, 2 },
-/* 202 */ { 1, 3 },
-/* 203 */ { 1, 3 },
-/* 204 */ { 4, 2, 3, 6, 7 },
-/* 205 */ { 1, 2 },
-/* 206 */ { 1, 3 },
-/* 207 */ { 2, 2, 3 },
-/* 208 */ { 1, 6 },
-/* 209 */ { 1, 4 },
-/* 210 */ { 1, 5 },
-/* 211 */ { 1, 4 },
-/* 212 */ { 1, 6 },
-/* 213 */ { 1, 6 },
-/* 214 */ { 1, 7 },
-/* 215 */ { 2, 2, 4 },
-/* 216 */ { 1, 7 },
-/* 217 */ { 1, 6 },
-/* 218 */ { 1, 7 },
-/* 219 */ { 2, 2, 5 },
-/* 220 */ { 1, 6 },
-/* 221 */ { 2, 2, 6 },
-/* 222 */ { 2, 2, 7 },
-/* 223 */ { 1, 2 },
-/* 224 */ { 1, 7 },
-/* 225 */ { 1, 4 },
-/* 226 */ { 1, 5 },
-/* 227 */ { 1, 5 },
-/* 228 */ { 1, 6 },
-/* 229 */ { 1, 6 },
-/* 230 */ { 1, 7 },
-/* 231 */ { 2, 3, 4 },
-/* 232 */ { 1, 7 },
-/* 233 */ { 1, 6 },
-/* 234 */ { 1, 7 },
-/* 235 */ { 2, 3, 5 },
-/* 236 */ { 1, 7 },
-/* 237 */ { 2, 3, 6 },
-/* 238 */ { 2, 3, 7 },
-/* 239 */ { 1, 3 },
-/* 240 */ { 4, 4, 5, 6, 7 },
-/* 241 */ { 1, 4 },
-/* 242 */ { 1, 5 },
-/* 243 */ { 2, 4, 5 },
-/* 244 */ { 1, 6 },
-/* 245 */ { 2, 4, 6 },
-/* 246 */ { 2, 4, 7 },
-/* 247 */ { 1, 4 },
-/* 248 */ { 1, 7 },
-/* 249 */ { 2, 5, 6 },
-/* 250 */ { 2, 5, 7 },
-/* 251 */ { 1, 5 },
-/* 252 */ { 2, 6, 7 },
-/* 253 */ { 1, 6 },
-/* 254 */ { 1, 7 },
-/* 255 */ { 8, 0, 1, 2, 3, 4, 5, 6, 7 }
-};
-
-
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c
index 96cf8601..2ddec21e 100644
--- a/src/misc/extra/extraUtilFile.c
+++ b/src/misc/extra/extraUtilFile.c
@@ -20,6 +20,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -248,6 +251,32 @@ char * Extra_FileRead( FILE * pFile )
/**Function*************************************************************
+ Synopsis [Returns one if the file has a given extension.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Extra_FileIsType( char * pFileName, char * pS1, char * pS2, char * pS3 )
+{
+ int lenS, lenF = strlen(pFileName);
+ lenS = pS1 ? strlen(pS1) : 0;
+ if ( lenS && lenF > lenS && !strncmp( pFileName+lenF-lenS, pS1, lenS ) )
+ return 1;
+ lenS = pS2 ? strlen(pS2) : 0;
+ if ( lenS && lenF > lenS && !strncmp( pFileName+lenF-lenS, pS2, lenS ) )
+ return 1;
+ lenS = pS3 ? strlen(pS3) : 0;
+ if ( lenS && lenF > lenS && !strncmp( pFileName+lenF-lenS, pS3, lenS ) )
+ return 1;
+ return 0;
+}
+
+/**Function*************************************************************
+
Synopsis [Returns the time stamp.]
Description [The file should be closed.]
@@ -425,7 +454,7 @@ void Extra_PrintHexadecimalString( char * pString, unsigned Sign[], int nVars )
SeeAlso []
***********************************************************************/
-void Extra_PrintHex( FILE * pFile, unsigned uTruth, int nVars )
+void Extra_PrintHex( FILE * pFile, unsigned * pTruth, int nVars )
{
int nMints, nDigits, Digit, k;
@@ -435,11 +464,11 @@ void Extra_PrintHex( FILE * pFile, unsigned uTruth, int nVars )
nDigits = nMints / 4;
for ( k = nDigits - 1; k >= 0; k-- )
{
- Digit = ((uTruth >> (k * 4)) & 15);
+ Digit = ((pTruth[k/8] >> (k * 4)) & 15);
if ( Digit < 10 )
fprintf( pFile, "%d", Digit );
else
- fprintf( pFile, "%c", 'a' + Digit-10 );
+ fprintf( pFile, "%c", 'A' + Digit-10 );
}
// fprintf( pFile, "\n" );
}
@@ -505,3 +534,5 @@ char * Extra_StringAppend( char * pStrGiven, char * pStrAdd )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraUtilMemory.c b/src/misc/extra/extraUtilMemory.c
index 626d58b5..673887fa 100644
--- a/src/misc/extra/extraUtilMemory.c
+++ b/src/misc/extra/extraUtilMemory.c
@@ -20,6 +20,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -35,7 +38,7 @@ struct Extra_MmFixed_t_
int nEntriesAlloc; // the total number of entries allocated
int nEntriesUsed; // the number of entries in use
int nEntriesMax; // the max number of entries in use
- char * pEntriesFree; // the linked list of ABC_FREE entries
+ char * pEntriesFree; // the linked list of free entries
// this is where the memory is stored
int nChunkSize; // the size of one chunk
@@ -52,8 +55,8 @@ struct Extra_MmFlex_t_
{
// information about individual entries
int nEntriesUsed; // the number of entries allocated
- char * pCurrent; // the current pointer to ABC_FREE memory
- char * pEnd; // the first entry outside the ABC_FREE memory
+ char * pCurrent; // the current pointer to free memory
+ char * pEnd; // the first entry outside the free memory
// this is where the memory is stored
int nChunkSize; // the size of one chunk
@@ -201,7 +204,7 @@ char * Extra_MmFixedEntryFetch( Extra_MmFixed_t * p )
char * pTemp;
int i;
- // check if there are still ABC_FREE entries
+ // check if there are still free entries
if ( p->nEntriesUsed == p->nEntriesAlloc )
{ // need to allocate more entries
assert( p->pEntriesFree == NULL );
@@ -230,7 +233,7 @@ char * Extra_MmFixedEntryFetch( Extra_MmFixed_t * p )
p->nEntriesUsed++;
if ( p->nEntriesMax < p->nEntriesUsed )
p->nEntriesMax = p->nEntriesUsed;
- // return the first entry in the ABC_FREE entry list
+ // return the first entry in the free entry list
pTemp = p->pEntriesFree;
p->pEntriesFree = *((char **)pTemp);
return pTemp;
@@ -251,7 +254,7 @@ void Extra_MmFixedEntryRecycle( Extra_MmFixed_t * p, char * pEntry )
{
// decrement the counter of used entries
p->nEntriesUsed--;
- // add the entry to the linked list of ABC_FREE entries
+ // add the entry to the linked list of free entries
*((char **)pEntry) = p->pEntriesFree;
p->pEntriesFree = pEntry;
}
@@ -285,7 +288,7 @@ void Extra_MmFixedRestart( Extra_MmFixed_t * p )
}
// set the last link
*((char **)pTemp) = NULL;
- // set the ABC_FREE entry list
+ // set the free entry list
p->pEntriesFree = p->pChunks[0];
// set the correct statistics
p->nMemoryAlloc = p->nEntrySize * p->nChunkSize;
@@ -415,7 +418,7 @@ void Extra_MmFlexStop( Extra_MmFlex_t * p )
char * Extra_MmFlexEntryFetch( Extra_MmFlex_t * p, int nBytes )
{
char * pTemp;
- // check if there are still ABC_FREE entries
+ // check if there are still free entries
if ( p->pCurrent == NULL || p->pCurrent + nBytes > p->pEnd )
{ // need to allocate more entries
if ( p->nChunks == p->nChunksAlloc )
@@ -565,7 +568,7 @@ char * Extra_MmStepEntryFetch( Extra_MmStep_t * p, int nBytes )
p->pLargeChunks = ABC_REALLOC( void *, p->pLargeChunks, p->nLargeChunksAlloc );
}
p->pLargeChunks[ p->nLargeChunks++ ] = ABC_ALLOC( char, nBytes );
- return p->pLargeChunks[ p->nLargeChunks - 1 ];
+ return (char *)p->pLargeChunks[ p->nLargeChunks - 1 ];
}
return Extra_MmFixedEntryFetch( p->pMap[nBytes] );
}
@@ -621,3 +624,5 @@ int Extra_MmStepReadMemUsage( Extra_MmStep_t * p )
/* Definition of static functions */
/*---------------------------------------------------------------------------*/
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraUtilMisc.c b/src/misc/extra/extraUtilMisc.c
index 293b23e7..e4c5acd5 100644
--- a/src/misc/extra/extraUtilMisc.c
+++ b/src/misc/extra/extraUtilMisc.c
@@ -20,6 +20,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -70,7 +73,6 @@ static void Extra_Permutations_rec( char ** pRes, int nFact, int n, char Array[]
int Extra_Base2Log( unsigned Num )
{
int Res;
- assert( Num >= 0 );
if ( Num == 0 ) return 0;
if ( Num == 1 ) return 1;
for ( Res = 0, Num--; Num; Num >>= 1, Res++ );
@@ -115,7 +117,6 @@ int Extra_Base2LogDouble( double Num )
int Extra_Base10Log( unsigned Num )
{
int Res;
- assert( Num >= 0 );
if ( Num == 0 ) return 0;
if ( Num == 1 ) return 1;
for ( Res = 0, Num--; Num; Num /= 10, Res++ );
@@ -265,7 +266,7 @@ int Extra_Factorial( int n )
Description [The number of permutations in the array is n!. The number of
entries in each permutation is n. Therefore, the resulting array is a
- two-dimentional array of the size: n! x n. To ABC_FREE the resulting array,
+ two-dimentional array of the size: n! x n. To free the resulting array,
call ABC_FREE() on the pointer returned by this procedure.]
SideEffects []
@@ -2233,3 +2234,5 @@ void Extra_TruthExpandGeneratePermTable()
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraUtilProgress.c b/src/misc/extra/extraUtilProgress.c
index 5e3b0f06..e7add47f 100644
--- a/src/misc/extra/extraUtilProgress.c
+++ b/src/misc/extra/extraUtilProgress.c
@@ -20,6 +20,10 @@
#include <stdio.h>
#include "extra.h"
+#include "main.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -58,9 +62,6 @@ static void Extra_ProgressBarClean( ProgressBar * p );
ProgressBar * Extra_ProgressBarStart( FILE * pFile, int nItemsTotal )
{
ProgressBar * p;
- extern int Abc_FrameShowProgress( void * p );
- extern void * Abc_FrameGetGlobalFrame();
-
if ( !Abc_FrameShowProgress(Abc_FrameGetGlobalFrame()) ) return NULL;
p = ABC_ALLOC( ProgressBar, 1 );
memset( p, 0, sizeof(ProgressBar) );
@@ -174,3 +175,5 @@ void Extra_ProgressBarClean( ProgressBar * p )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraUtilReader.c b/src/misc/extra/extraUtilReader.c
index 46179e50..bcf3da37 100644
--- a/src/misc/extra/extraUtilReader.c
+++ b/src/misc/extra/extraUtilReader.c
@@ -22,6 +22,9 @@
#include "extra.h"
#include "vec.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -232,7 +235,7 @@ int Extra_FileReaderGetLineNumber( Extra_FileReader_t * p, int iToken )
void * Extra_FileReaderGetTokens( Extra_FileReader_t * p )
{
Vec_Ptr_t * vTokens;
- while ( (vTokens = Extra_FileReaderGetTokens_int( p )) )
+ while ( (vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens_int( p )) )
if ( vTokens->nSize > 0 )
break;
return vTokens;
@@ -381,3 +384,5 @@ void Extra_FileReaderReload( Extra_FileReader_t * p )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraUtilTruth.c b/src/misc/extra/extraUtilTruth.c
index 3b0b16eb..4da5cb6a 100644
--- a/src/misc/extra/extraUtilTruth.c
+++ b/src/misc/extra/extraUtilTruth.c
@@ -20,6 +20,9 @@
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*---------------------------------------------------------------------------*/
/* Constant declarations */
/*---------------------------------------------------------------------------*/
@@ -1146,3 +1149,5 @@ unsigned Extra_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVar
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/misc/extra/extraUtilUtil.c b/src/misc/extra/extraUtilUtil.c
index 3f0dd365..37ea9321 100644
--- a/src/misc/extra/extraUtilUtil.c
+++ b/src/misc/extra/extraUtilUtil.c
@@ -19,8 +19,11 @@
***********************************************************************/
#include <stdio.h>
+#include <string.h>
#include "extra.h"
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -38,10 +41,10 @@
* Purpose: get option letter from argv.
*/
-char * globalUtilOptarg; // Global argument pointer (util_optarg)
+const char * globalUtilOptarg; // Global argument pointer (util_optarg)
int globalUtilOptind = 0; // Global argv index (util_optind)
-static char *pScanStr;
+static const char *pScanStr;
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -92,10 +95,10 @@ void Extra_UtilGetoptReset()
SeeAlso []
***********************************************************************/
-int Extra_UtilGetopt( int argc, char *argv[], char *optstring )
+int Extra_UtilGetopt( int argc, char *argv[], const char *optstring )
{
register int c;
- register char *place;
+ register const char *place;
globalUtilOptarg = NULL;
@@ -163,10 +166,10 @@ char * Extra_UtilPrintTime( long t )
SeeAlso []
***********************************************************************/
-char * Extra_UtilStrsav( char *s )
+char * Extra_UtilStrsav( const char *s )
{
if(s == NULL) { /* added 7/95, for robustness */
- return s;
+ return NULL;
}
else {
return strcpy(ABC_ALLOC(char, strlen(s)+1), s);
@@ -226,7 +229,7 @@ char * Extra_UtilTildeExpand( char *fname )
SeeAlso []
***********************************************************************/
-int Extra_UtilCheckFile(char *filename, char *mode)
+int Extra_UtilCheckFile(char *filename, const char *mode)
{
FILE *fp;
int got_file;
@@ -310,7 +313,7 @@ char * Extra_UtilFileSearch(char *file, char *path, char *mode)
***********************************************************************/
/* MMout_of_memory -- out of memory for lazy people, flush and exit */
-void Extra_UtilMMout_Of_Memory( long size )
+void Extra_UtilMMout_Of_Memory( long size )
{
(void) fflush(stdout);
(void) fprintf(stderr, "\nout of memory allocating %u bytes\n",
@@ -330,7 +333,7 @@ void Extra_UtilMMout_Of_Memory( long size )
SeeAlso []
***********************************************************************/
-void (*Extra_UtilMMoutOfMemory)() = Extra_UtilMMout_Of_Memory;
+void (*Extra_UtilMMoutOfMemory)( long size ) = (void (*)( long size ))Extra_UtilMMout_Of_Memory;
/**Function*************************************************************
@@ -366,9 +369,15 @@ double Extra_CpuTimeDouble()
return (double)clock()/CLOCKS_PER_SEC;
}
#else
+
+ABC_NAMESPACE_IMPL_END
+
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
+
+ABC_NAMESPACE_IMPL_START
+
double Extra_CpuTimeDouble()
{
struct rusage ru;
@@ -398,3 +407,5 @@ void Extra_MemTest()
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+