Commit 929e5e16 by Niklas Een

Some fixes to the Bridge code. More to do.

parent 1e40c5b7
...@@ -177,16 +177,28 @@ int Gia_ManToBridgeBadAbs( FILE * pFile ) ...@@ -177,16 +177,28 @@ int Gia_ManToBridgeBadAbs( FILE * pFile )
***********************************************************************/ ***********************************************************************/
void Gia_ManFromBridgeHolds( FILE * pFile ) void Gia_ManFromBridgeHolds( FILE * pFile )
{ {
fprintf( pFile, "%.6d", 101 /*message type = Result*/);
fprintf( pFile, " " );
fprintf( pFile, "%.16d", 4 /*size in bytes*/);
fprintf( pFile, " " );
fputc( (char)BRIDGE_VALUE_1, pFile ); // true fputc( (char)BRIDGE_VALUE_1, pFile ); // true
fputc( (char)1, pFile ); // size of vector (Armin's encoding) fputc( (char)1, pFile ); // size of vector (Armin's encoding)
fputc( (char)0, pFile ); // number of the property (Armin's encoding) fputc( (char)0, pFile ); // number of the property (Armin's encoding)
fputc( (char)0, pFile ); // no invariant fputc( (char)0, pFile ); // no invariant
fflush(pFile);
} }
void Gia_ManFromBridgeUnknown( FILE * pFile ) void Gia_ManFromBridgeUnknown( FILE * pFile )
{ {
fprintf( pFile, "%.6d", 101 /*message type = Result*/);
fprintf( pFile, " " );
fprintf( pFile, "%.16d", 3 /*size in bytes*/);
fprintf( pFile, " " );
fputc( (char)BRIDGE_VALUE_X, pFile ); // undef fputc( (char)BRIDGE_VALUE_X, pFile ); // undef
fputc( (char)1, pFile ); // size of vector (Armin's encoding) fputc( (char)1, pFile ); // size of vector (Armin's encoding)
fputc( (char)0, pFile ); // number of the property (Armin's encoding) fputc( (char)0, pFile ); // number of the property (Armin's encoding)
fflush(pFile);
} }
void Gia_ManFromBridgeCex( FILE * pFile, Abc_Cex_t * pCex ) void Gia_ManFromBridgeCex( FILE * pFile, Abc_Cex_t * pCex )
{ {
...@@ -210,9 +222,11 @@ void Gia_ManFromBridgeCex( FILE * pFile, Abc_Cex_t * pCex ) ...@@ -210,9 +222,11 @@ void Gia_ManFromBridgeCex( FILE * pFile, Abc_Cex_t * pCex )
Vec_StrPush( vStr, (char)1 ); // the number of frames (for a concrete counter-example) Vec_StrPush( vStr, (char)1 ); // the number of frames (for a concrete counter-example)
for ( i = 0; i < pCex->nRegs; i++ ) for ( i = 0; i < pCex->nRegs; i++ )
Vec_StrPush( vStr, (char)BRIDGE_VALUE_0 ); // always zero!!! Vec_StrPush( vStr, (char)BRIDGE_VALUE_0 ); // always zero!!!
RetValue = fwrite( Vec_StrArray(vStr), Vec_StrSize(vStr), 1, pFile ); // RetValue = fwrite( Vec_StrArray(vStr), Vec_StrSize(vStr), 1, pFile );
assert( RetValue == 1 ); Gia_CreateHeader(pFile, 101/*type=Result*/, Vec_StrSize(vStr), (unsigned char*)Vec_StrArray(vStr));
Vec_StrFree( vStr ); Vec_StrFree( vStr );
fflush(pFile);
} }
int Gia_ManToBridgeResult( FILE * pFile, int Result, Abc_Cex_t * pCex ) int Gia_ManToBridgeResult( FILE * pFile, int Result, Abc_Cex_t * pCex )
{ {
...@@ -484,4 +498,3 @@ void Gia_ManFromBridgeTest( char * pFileName ) ...@@ -484,4 +498,3 @@ void Gia_ManFromBridgeTest( char * pFileName )
ABC_NAMESPACE_IMPL_END ABC_NAMESPACE_IMPL_END
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