diff options
Diffstat (limited to 'src/base/ver/verFormula.c')
-rw-r--r-- | src/base/ver/verFormula.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/base/ver/verFormula.c b/src/base/ver/verFormula.c index 3ed5f556..bf34b00f 100644 --- a/src/base/ver/verFormula.c +++ b/src/base/ver/verFormula.c @@ -20,6 +20,9 @@ #include "ver.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -84,9 +87,9 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_ Vec_IntClear( vStackOp ); if ( !strcmp(pFormula, "0") || !strcmp(pFormula, "1\'b0") ) - return Hop_ManConst0(pMan); + return Hop_ManConst0((Hop_Man_t *)pMan); if ( !strcmp(pFormula, "1") || !strcmp(pFormula, "1\'b1") ) - return Hop_ManConst1(pMan); + return Hop_ManConst1((Hop_Man_t *)pMan); // make sure that the number of opening and closing parantheses is the same nParans = 0; @@ -214,7 +217,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_ // } // perform the given operation - if ( Ver_FormulaParserTopOper( pMan, vStackFn, Oper ) == NULL ) + if ( Ver_FormulaParserTopOper( (Hop_Man_t *)pMan, vStackFn, Oper ) == NULL ) { sprintf( pErrorMessage, "Parse_FormulaParser(): Unknown operation\n" ); return NULL; @@ -245,7 +248,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_ sprintf( pErrorMessage, "Parse_FormulaParser(): Incorrect state." ); return NULL; } - bTemp = Hop_IthVar( pMan, v ); + bTemp = Hop_IthVar( (Hop_Man_t *)pMan, v ); Vec_PtrPush( vStackFn, bTemp ); // Cudd_Ref( bTemp ); Flag = VER_PARSE_FLAG_VAR; break; @@ -269,7 +272,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_ else { // Vec_PtrPush( vStackFn, Cudd_Not(Vec_PtrPop(vStackFn)) ); - Vec_PtrPush( vStackFn, Hop_Not(Vec_PtrPop(vStackFn)) ); + Vec_PtrPush( vStackFn, Hop_Not((Hop_Obj_t *)Vec_PtrPop(vStackFn)) ); } } else // if ( Flag == VER_PARSE_FLAG_OPER ) @@ -285,7 +288,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_ Oper2 = Vec_IntPop( vStackOp ); // the operation before the last one if ( Oper2 >= Oper1 && !(Oper1 == Oper2 && Oper1 == VER_PARSE_OPER_MUX) ) { // if Oper2 precedence is higher or equal, execute it - if ( Ver_FormulaParserTopOper( pMan, vStackFn, Oper2 ) == NULL ) + if ( Ver_FormulaParserTopOper( (Hop_Man_t *)pMan, vStackFn, Oper2 ) == NULL ) { sprintf( pErrorMessage, "Parse_FormulaParser(): Unknown operation\n" ); return NULL; @@ -305,7 +308,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_ { if ( Vec_PtrSize(vStackFn) ) { - bFunc = Vec_PtrPop(vStackFn); + bFunc = (Hop_Obj_t *)Vec_PtrPop(vStackFn); if ( !Vec_PtrSize(vStackFn) ) if ( !Vec_IntSize(vStackOp) ) { @@ -340,8 +343,8 @@ Hop_Obj_t * Ver_FormulaParserTopOper( Hop_Man_t * pMan, Vec_Ptr_t * vStackFn, in { Hop_Obj_t * bArg0, * bArg1, * bArg2, * bFunc; // perform the given operation - bArg2 = Vec_PtrPop( vStackFn ); - bArg1 = Vec_PtrPop( vStackFn ); + bArg2 = (Hop_Obj_t *)Vec_PtrPop( vStackFn ); + bArg1 = (Hop_Obj_t *)Vec_PtrPop( vStackFn ); if ( Oper == VER_PARSE_OPER_AND ) bFunc = Hop_And( pMan, bArg1, bArg2 ); else if ( Oper == VER_PARSE_OPER_XOR ) @@ -352,7 +355,7 @@ Hop_Obj_t * Ver_FormulaParserTopOper( Hop_Man_t * pMan, Vec_Ptr_t * vStackFn, in bFunc = Hop_Not( Hop_Exor( pMan, bArg1, bArg2 ) ); else if ( Oper == VER_PARSE_OPER_MUX ) { - bArg0 = Vec_PtrPop( vStackFn ); + bArg0 = (Hop_Obj_t *)Vec_PtrPop( vStackFn ); // bFunc = Cudd_bddIte( dd, bArg0, bArg1, bArg2 ); Cudd_Ref( bFunc ); bFunc = Hop_Mux( pMan, bArg0, bArg1, bArg2 ); // Cudd_RecursiveDeref( dd, bArg0 ); @@ -407,7 +410,7 @@ int Ver_FormulaParserFindVar( char * pString, Vec_Ptr_t * vNames ) nLength2 = (int)(ABC_PTRUINT_T)Vec_PtrEntry( vNames, 2*i + 0 ); if ( nLength2 != nLength ) continue; - pTemp2 = Vec_PtrEntry( vNames, 2*i + 1 ); + pTemp2 = (char *)Vec_PtrEntry( vNames, 2*i + 1 ); if ( strncmp( pString, pTemp2, nLength ) ) continue; return i; @@ -459,11 +462,11 @@ void * Ver_FormulaReduction( char * pFormula, void * pMan, Vec_Ptr_t * vNames, c } // compute the function if ( Symbol == '&' ) - pRes = Hop_CreateAnd( pMan, Vec_PtrSize(vNames)/2 ); + pRes = Hop_CreateAnd( (Hop_Man_t *)pMan, Vec_PtrSize(vNames)/2 ); else if ( Symbol == '|' ) - pRes = Hop_CreateOr( pMan, Vec_PtrSize(vNames)/2 ); + pRes = Hop_CreateOr( (Hop_Man_t *)pMan, Vec_PtrSize(vNames)/2 ); else if ( Symbol == '^' ) - pRes = Hop_CreateExor( pMan, Vec_PtrSize(vNames)/2 ); + pRes = Hop_CreateExor( (Hop_Man_t *)pMan, Vec_PtrSize(vNames)/2 ); return Hop_NotCond( pRes, fCompl ); } @@ -472,3 +475,5 @@ void * Ver_FormulaReduction( char * pFormula, void * pMan, Vec_Ptr_t * vNames, c //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + |