abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
satTruth.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [satTruth.h]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [SAT solver.]
8 
9  Synopsis [Truth table computation package.]
10 
11  Author [Alan Mishchenko <alanmi@eecs.berkeley.edu>]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - January 1, 2004.]
16 
17  Revision [$Id: satTruth.h,v 1.0 2004/01/01 1:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__sat__bsat__satTruth_h
22 #define ABC__sat__bsat__satTruth_h
23 
24 ////////////////////////////////////////////////////////////////////////
25 /// INCLUDES ///
26 ////////////////////////////////////////////////////////////////////////
27 
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31 #include <assert.h>
32 #include "misc/util/abc_global.h"
33 
35 
36 ////////////////////////////////////////////////////////////////////////
37 /// PARAMETERS ///
38 ////////////////////////////////////////////////////////////////////////
39 
40 ////////////////////////////////////////////////////////////////////////
41 /// STRUCTURE DEFINITIONS ///
42 ////////////////////////////////////////////////////////////////////////
43 
44 typedef struct Tru_Man_t_ Tru_Man_t;
45 
46 ////////////////////////////////////////////////////////////////////////
47 /// GLOBAL VARIABLES ///
48 ////////////////////////////////////////////////////////////////////////
49 
50 ////////////////////////////////////////////////////////////////////////
51 /// MACRO DEFINITIONS ///
52 ////////////////////////////////////////////////////////////////////////
53 
54 static inline int Tru_ManEqual( word * pOut, word * pIn, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) if(pOut[w]!=pIn[w]) return 0; return 1; }
55 static inline int Tru_ManEqual0( word * pOut, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) if(pOut[w]!=0) return 0; return 1; }
56 static inline int Tru_ManEqual1( word * pOut, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) if(pOut[w]!=~(word)0)return 0; return 1; }
57 static inline word * Tru_ManCopy( word * pOut, word * pIn, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) pOut[w] = pIn[w]; return pOut; }
58 static inline word * Tru_ManClear( word * pOut, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) pOut[w] = 0; return pOut; }
59 static inline word * Tru_ManFill( word * pOut, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) pOut[w] = ~(word)0; return pOut; }
60 static inline word * Tru_ManNot( word * pOut, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) pOut[w] = ~pOut[w]; return pOut; }
61 static inline word * Tru_ManAnd( word * pOut, word * pIn, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) pOut[w] &= pIn[w]; return pOut; }
62 static inline word * Tru_ManOr( word * pOut, word * pIn, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) pOut[w] |= pIn[w]; return pOut; }
63 static inline word * Tru_ManCopyNot( word * pOut, word * pIn, int nWords ){ int w; for ( w = 0; w < nWords; w++ ) pOut[w] = ~pIn[w]; return pOut; }
64 static inline word * Tru_ManAndNot( word * pOut, word * pIn, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) pOut[w] &= ~pIn[w]; return pOut; }
65 static inline word * Tru_ManOrNot( word * pOut, word * pIn, int nWords ) { int w; for ( w = 0; w < nWords; w++ ) pOut[w] |= ~pIn[w]; return pOut; }
66 static inline word * Tru_ManCopyNotCond( word * pOut, word * pIn, int nWords, int fCompl ){ return fCompl ? Tru_ManCopyNot(pOut, pIn, nWords) : Tru_ManCopy(pOut, pIn, nWords); }
67 static inline word * Tru_ManAndNotCond( word * pOut, word * pIn, int nWords, int fCompl ) { return fCompl ? Tru_ManAndNot(pOut, pIn, nWords) : Tru_ManAnd(pOut, pIn, nWords); }
68 static inline word * Tru_ManOrNotCond( word * pOut, word * pIn, int nWords, int fCompl ) { return fCompl ? Tru_ManOrNot(pOut, pIn, nWords) : Tru_ManOr(pOut, pIn, nWords); }
69 
70 
71 ////////////////////////////////////////////////////////////////////////
72 /// FUNCTION DECLARATIONS ///
73 ////////////////////////////////////////////////////////////////////////
74 
75 extern Tru_Man_t * Tru_ManAlloc( int nVars );
76 extern void Tru_ManFree( Tru_Man_t * p );
77 extern word * Tru_ManVar( Tru_Man_t * p, int v );
78 extern word * Tru_ManFunc( Tru_Man_t * p, int h );
79 extern int Tru_ManInsert( Tru_Man_t * p, word * pTruth );
80 //extern int Tru_ManHandleMax( Tru_Man_t * p );
81 
83 
84 #endif
85 
86 ////////////////////////////////////////////////////////////////////////
87 /// END OF FILE ///
88 ////////////////////////////////////////////////////////////////////////
89 
static word * Tru_ManNot(word *pOut, int nWords)
Definition: satTruth.h:60
DECLARATIONS ///.
Definition: satTruth.c:35
static Llb_Mgr_t * p
Definition: llb3Image.c:950
word * Tru_ManVar(Tru_Man_t *p, int v)
Definition: satTruth.c:268
int nVars
Definition: satTruth.c:37
int Tru_ManInsert(Tru_Man_t *p, word *pTruth)
Definition: satTruth.c:158
void Tru_ManFree(Tru_Man_t *p)
Definition: satTruth.c:248
static word * Tru_ManOrNotCond(word *pOut, word *pIn, int nWords, int fCompl)
Definition: satTruth.h:68
Tru_Man_t * Tru_ManAlloc(int nVars)
FUNCTION DECLARATIONS ///.
Definition: satTruth.c:198
int nWords
Definition: abcNpn.c:127
static word * Tru_ManAndNotCond(word *pOut, word *pIn, int nWords, int fCompl)
Definition: satTruth.h:67
static int Tru_ManEqual0(word *pOut, int nWords)
Definition: satTruth.h:55
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
word * Tru_ManFunc(Tru_Man_t *p, int h)
Definition: satTruth.c:285
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
typedefABC_NAMESPACE_HEADER_START struct Tru_Man_t_ Tru_Man_t
INCLUDES ///.
Definition: satTruth.h:44
static word * Tru_ManCopy(word *pOut, word *pIn, int nWords)
Definition: satTruth.h:57
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
static int Tru_ManEqual1(word *pOut, int nWords)
Definition: satTruth.h:56
static word * Tru_ManAndNot(word *pOut, word *pIn, int nWords)
Definition: satTruth.h:64
static word * Tru_ManOrNot(word *pOut, word *pIn, int nWords)
Definition: satTruth.h:65
static word * Tru_ManClear(word *pOut, int nWords)
Definition: satTruth.h:58
static word * Tru_ManAnd(word *pOut, word *pIn, int nWords)
Definition: satTruth.h:61
static word * Tru_ManCopyNotCond(word *pOut, word *pIn, int nWords, int fCompl)
Definition: satTruth.h:66
static word * Tru_ManCopyNot(word *pOut, word *pIn, int nWords)
Definition: satTruth.h:63
static word * Tru_ManFill(word *pOut, int nWords)
Definition: satTruth.h:59
static int Tru_ManEqual(word *pOut, word *pIn, int nWords)
GLOBAL VARIABLES ///.
Definition: satTruth.h:54
static word * Tru_ManOr(word *pOut, word *pIn, int nWords)
Definition: satTruth.h:62