21#ifndef ABC__bool__rpo__literal_h
22#define ABC__bool__rpo__literal_h
75static inline void Lit_TruthPositiveTransition(
unsigned * pIn,
unsigned * pOut,
int nVars,
int varIdx )
77 unsigned * cof0 =
ABC_ALLOC (
unsigned, Kit_TruthWordNum(nVars) );
78 unsigned * cof1 =
ABC_ALLOC (
unsigned, Kit_TruthWordNum(nVars) );
82 ncof0 =
ABC_ALLOC (
unsigned, Kit_TruthWordNum(nVars) );
83 Kit_TruthNot(ncof0,cof0,nVars);
84 Kit_TruthAnd(pOut,ncof0,cof1, nVars);
103static inline void Lit_TruthNegativeTransition(
unsigned * pIn,
unsigned * pOut,
int nVars,
int varIdx )
105 unsigned * cof0 =
ABC_ALLOC (
unsigned, Kit_TruthWordNum(nVars) );
106 unsigned * cof1 =
ABC_ALLOC (
unsigned, Kit_TruthWordNum(nVars) );
110 ncof1 =
ABC_ALLOC (
unsigned, Kit_TruthWordNum(nVars) );
111 Kit_TruthNot(ncof1,cof1,nVars);
112 Kit_TruthAnd(pOut,ncof1,cof0,nVars);
131static inline Literal_t* Lit_Alloc(
unsigned* pTruth,
int nVars,
int varIdx,
char pol) {
132 unsigned * transition;
136 assert(pol ==
'+' || pol ==
'-');
137 transition =
ABC_ALLOC(
unsigned, Kit_TruthWordNum(nVars));
139 Lit_TruthPositiveTransition(pTruth, transition, nVars, varIdx);
141 Lit_TruthNegativeTransition(pTruth, transition, nVars, varIdx);
143 if (!Kit_TruthIsConst0(transition,nVars)) {
144 function =
ABC_ALLOC(
unsigned, Kit_TruthWordNum(nVars));
145 Kit_TruthIthVar(function, nVars, varIdx);
147 exp = Vec_StrAlloc(5);
149 Kit_TruthNot(function, function, nVars);
150 Vec_StrPutC(exp,
'!');
152 Vec_StrPutC(exp, (
char)(
'a' + varIdx));
153 Vec_StrPutC(exp,
'\0');
155 lit->function = function;
156 lit->transition = transition;
157 lit->expression = exp;
179 unsigned * newFunction =
ABC_ALLOC(
unsigned, Kit_TruthWordNum(nVars));
180 unsigned * newTransition =
ABC_ALLOC(
unsigned, Kit_TruthWordNum(nVars));
201 Abc_Print(-2,
"Lit_GroupLiterals with op not defined.");
208 Vec_StrPutC(newExp,
'(');
211 Vec_StrPutC(newExp, opChar);
214 Vec_StrPutC(newExp,
')');
215 Vec_StrPutC(newExp,
'\0');
237static inline Literal_t* Lit_CreateLiteralConst(
unsigned* pTruth,
int nVars,
int constant) {
240 Vec_StrPutC(exp, (
char)(
'0' + constant));
241 Vec_StrPutC(exp,
'\0');
243 lit->expression = exp;
244 lit->function = pTruth;
245 lit->transition = pTruth;
252 Kit_TruthCopy(newLit->
function,
lit->function,nVars);
260static inline void Lit_PrintTT(
unsigned* tt,
int nVars) {
262 for(w=nVars-1; w>=0; w--) {
263 Abc_Print(-2,
"%08X", tt[w]);
268 Abc_Print(-2,
"%s",
lit->expression->pArray);
290 Vec_StrFree(
lit->expression);
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
struct Vec_Str_t_ Vec_Str_t
struct Literal_t_ Literal_t
void Kit_TruthCofactor1New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
void Kit_TruthCofactor0New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)