summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/misc/util/utilBridge.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/misc/util/utilBridge.c b/src/misc/util/utilBridge.c
index 4303e4dd..ebacd97b 100644
--- a/src/misc/util/utilBridge.c
+++ b/src/misc/util/utilBridge.c
@@ -180,6 +180,19 @@ int Gia_ManToBridgeBadAbs( FILE * pFile )
return 1;
}
+
+static int aigerNumSize( unsigned x )
+{
+ int sz = 1;
+ while (x & ~0x7f)
+ {
+ sz++;
+ x >>= 7;
+ }
+ return sz;
+}
+
+
/**Function*************************************************************
Synopsis []
@@ -195,7 +208,7 @@ void Gia_ManFromBridgeHolds( FILE * pFile, int iPoProved )
{
fprintf( pFile, "%.6d", 101 /*message type = Result*/);
fprintf( pFile, " " );
- fprintf( pFile, "%.16d", 4 /*size in bytes*/);
+ fprintf( pFile, "%.16d", 3 + aigerNumSize(iPoProved) /*size in bytes*/);
fprintf( pFile, " " );
fputc( (char)BRIDGE_VALUE_1, pFile ); // true
@@ -208,7 +221,7 @@ void Gia_ManFromBridgeUnknown( FILE * pFile, int iPoUnknown )
{
fprintf( pFile, "%.6d", 101 /*message type = Result*/);
fprintf( pFile, " " );
- fprintf( pFile, "%.16d", 3 /*size in bytes*/);
+ fprintf( pFile, "%.16d", 2 + aigerNumSize(iPoUnknown) /*size in bytes*/);
fprintf( pFile, " " );
fputc( (char)BRIDGE_VALUE_X, pFile ); // undef