Commit 5a20a27c by Alan Mishchenko

Extend ISOP to return the truth table.

parent 65dce2fa
......@@ -5227,10 +5227,6 @@ SOURCE=.\src\bool\kit\kit.h
# End Source File
# Begin Source File
SOURCE=.\src\bool\kit\kit_.c
# End Source File
# Begin Source File
SOURCE=.\src\bool\kit\kitAig.c
# End Source File
# Begin Source File
......
......@@ -575,7 +575,7 @@ extern int Kit_GraphLeafDepth_rec( Kit_Graph_t * pGraph, Kit_Node_t
//extern Hop_Obj_t * Kit_CoverToHop( Hop_Man_t * pMan, Vec_Int_t * vCover, int nVars, Vec_Int_t * vMemory );
/*=== kitIsop.c ==========================================================*/
extern int Kit_TruthIsop( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryBoth );
extern int Kit_TruthIsop2( unsigned * puTruth0, unsigned * puTruth1, int nVars, Vec_Int_t * vMemory, int fTryBoth );
extern int Kit_TruthIsop2( unsigned * puTruth0, unsigned * puTruth1, int nVars, Vec_Int_t * vMemory, int fTryBoth, int fReturnTt );
extern void Kit_TruthIsopPrint( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryBoth );
extern void Kit_TruthIsopPrintCover( Vec_Int_t * vCover, int nVars, int fCompl );
/*=== kitPla.c ==========================================================*/
......
......@@ -385,7 +385,7 @@ Kit_Graph_t * Kit_TruthToGraph2( unsigned * pTruth0, unsigned * pTruth1, int nVa
Kit_Graph_t * pGraph;
int RetValue;
// derive SOP
RetValue = Kit_TruthIsop2( pTruth0, pTruth1, nVars, vMemory, 1 ); // tried 1 and found not useful in "renode"
RetValue = Kit_TruthIsop2( pTruth0, pTruth1, nVars, vMemory, 1, 0 ); // tried 1 and found not useful in "renode"
if ( RetValue == -1 )
return NULL;
if ( Vec_IntSize(vMemory) > (1<<16) )
......
......@@ -52,7 +52,7 @@ static unsigned Kit_TruthIsop5_rec( unsigned uOn, unsigned uOnDc, int nVars, K
SeeAlso []
***********************************************************************/
int Kit_TruthIsop2( unsigned * puTruth0, unsigned * puTruth1, int nVars, Vec_Int_t * vMemory, int fTryBoth )
int Kit_TruthIsop2( unsigned * puTruth0, unsigned * puTruth1, int nVars, Vec_Int_t * vMemory, int fTryBoth, int fReturnTt )
{
Kit_Sop_t cRes, * pcRes = &cRes;
Kit_Sop_t cRes2, * pcRes2 = &cRes2;
......@@ -102,8 +102,17 @@ int Kit_TruthIsop2( unsigned * puTruth0, unsigned * puTruth1, int nVars, Vec_Int
}
// printf( "%d ", vMemory->nSize );
// move the cover representation to the beginning of the memory buffer
memmove( vMemory->pArray, pcRes->pCubes, pcRes->nCubes * sizeof(unsigned) );
Vec_IntShrink( vMemory, pcRes->nCubes );
if ( fReturnTt )
{
int nWords = Kit_TruthWordNum( nVars );
memmove( vMemory->pArray, pResult, nWords * sizeof(unsigned) );
Vec_IntShrink( vMemory, nWords );
}
else
{
memmove( vMemory->pArray, pcRes->pCubes, pcRes->nCubes * sizeof(unsigned) );
Vec_IntShrink( vMemory, pcRes->nCubes );
}
return RetValue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment