30 #define PROPAGATE_NAMES
31 #define MULTIPLE_LTL_FORMULA
32 #define ALLOW_SAFETY_PROPERTIES
34 #define FULL_BIERE_MODE 0
35 #define IGNORE_LIVENESS_KEEP_SAFETY_MODE 1
36 #define IGNORE_SAFETY_KEEP_LIVENESS_MODE 2
37 #define IGNORE_SAFETY_KEEP_LIVENESS_ONE_LOOP_MODE 3
38 #define FULL_BIERE_ONE_LOOP_MODE 4
98 printf(
"vec[%d] = %s\n", i, (
char *)
Vec_PtrEntry(vec, i) );
123 if( pObj == pObjPivot )
141 int index, oldIndex, originalLatchNum =
Saig_ManRegNum(pAigOld), strMatch, i;
142 char *dummyStr = (
char *)
malloc(
sizeof(
char) * 50 );
146 if( pObj == pObjPivot )
148 if( index < originalLatchNum )
151 pObjOld =
Aig_ManCi( pAigOld, oldIndex );
156 else if( index == originalLatchNum )
158 else if( index > originalLatchNum && index < 2 * originalLatchNum + 1 )
160 oldIndex =
Saig_ManPiNum( pAigOld ) + index - originalLatchNum - 1;
161 pObjOld =
Aig_ManCi( pAigOld, oldIndex );
166 else if( index >= 2 * originalLatchNum + 1 && index < 2 * originalLatchNum + 1 +
Vec_PtrSize( vLive ) )
168 oldIndex = index - 2 * originalLatchNum - 1;
177 if( strMatch == oldIndex )
187 assert( dummyStr[0] !=
'\0' );
192 oldIndex = index - 2 * originalLatchNum - 1 -
Vec_PtrSize( vLive );
201 if( strMatch == oldIndex )
211 assert( dummyStr[0] !=
'\0' );
250 Aig_Obj_t *pObjSavedLo = NULL, *pObjSavedLi = NULL;
252 Aig_Obj_t *pObjSaveOrSaved = NULL, *pObjSaveAndNotSaved = NULL, *pObjSavedLoAndEquality;
253 Aig_Obj_t *pObjShadowLo, *pObjShadowLi, *pObjShadowLiDriver;
254 Aig_Obj_t *pObjXor, *pObjXnor, *pObjAndAcc;
255 Aig_Obj_t *pObjLive, *pObjFair, *pObjSafetyGate;
256 Aig_Obj_t *pObjSafetyPropertyOutput = NULL;
257 Aig_Obj_t *pObjOriginalSafetyPropertyOutput;
258 Aig_Obj_t *pDriverImage, *pArgument, *collectiveAssertSafety, *collectiveAssumeSafety;
260 int piCopied = 0, liCopied = 0, loCopied = 0, liCreated = 0, loCreated = 0, liveLatch = 0, fairLatch = 0;
302 nodeName =
"SAVE_BIERE",
326 nodeName =
"SAVED_LO";
335 pObjSaveOrSaved =
Aig_Or( pNew, pObjSavePi, pObjSavedLo );
336 pObjSaveAndNotSaved =
Aig_And( pNew, pObjSavePi,
Aig_Not(pObjSavedLo) );
361 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAcc );
371 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAcc );
373 collectiveAssertSafety = pObjAndAcc;
379 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAcc );
381 collectiveAssumeSafety = pObjAndAcc;
386 printf(
"WARNING!! No safety property is found, a new (negated) constant 1 output is created\n");
414 #ifndef DUPLICATE_CKT_DEBUG
428 #ifdef PROPAGATE_NAMES
439 loCreated++; liCreated++;
444 pObjAndAcc =
Aig_And( pNew, pObjXnor, pObjAndAcc );
448 pObjSavedLoAndEquality =
Aig_And( pNew, pObjSavedLo, pObjAndAcc );
454 printf(
"Circuit without any liveness property\n");
464 #ifdef PROPAGATE_NAMES
471 pObjShadowLiDriver =
Aig_Or( pNew, pObjShadowLo,
Aig_And( pNew, pDriverImage, pObjSaveOrSaved ) );
474 loCreated++; liCreated++;
476 pObjAndAcc =
Aig_And( pNew, pObjShadowLo, pObjAndAcc );
480 pObjLive = pObjAndAcc;
484 printf(
"Circuit without any fairness property\n");
493 #ifdef PROPAGATE_NAMES
500 pObjShadowLiDriver =
Aig_Or( pNew, pObjShadowLo,
Aig_And( pNew, pDriverImage, pObjSaveOrSaved ) );
503 loCreated++; liCreated++;
505 pObjAndAcc =
Aig_And( pNew, pObjShadowLo, pObjAndAcc );
509 pObjFair = pObjAndAcc;
513 pObjSafetyGate =
Aig_And( pNew, pObjSavedLoAndEquality,
Aig_And( pNew, pObjFair,
Aig_Not( pObjLive ) ) );
546 int i, nRegCount, iEntry;
548 Aig_Obj_t *pObjSavedLi = NULL, *pObjSavedLo = NULL;
550 Aig_Obj_t *pObjSavedLoAndEquality, *pObjSaveOrSaved = NULL, *pObjSaveAndNotSaved = NULL;
551 Aig_Obj_t *pObjShadowLo, *pObjShadowLi, *pObjShadowLiDriver;
552 Aig_Obj_t *pObjXor, *pObjXnor, *pObjAndAcc;
553 Aig_Obj_t *pObjLive, *pObjFair, *pObjSafetyGate;
554 Aig_Obj_t *pObjSafetyPropertyOutput = NULL;
555 Aig_Obj_t *pDriverImage, *pArgument, *collectiveAssertSafety, *collectiveAssumeSafety;
557 int piCopied = 0, liCopied = 0, loCopied = 0, liCreated = 0, loCreated = 0, liveLatch = 0, fairLatch = 0;
599 nodeName =
"SAVE_BIERE",
623 nodeName =
"SAVED_LO";
632 pObjSaveOrSaved =
Aig_Or( pNew, pObjSavePi, pObjSavedLo );
633 pObjSaveAndNotSaved =
Aig_And( pNew, pObjSavePi,
Aig_Not(pObjSavedLo) );
658 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAcc );
668 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAcc );
670 collectiveAssertSafety = pObjAndAcc;
676 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAcc );
678 collectiveAssumeSafety = pObjAndAcc;
683 printf(
"WARNING!! No safety property is found, a new (negated) constant 1 output is created\n");
711 #ifndef DUPLICATE_CKT_DEBUG
731 #ifdef PROPAGATE_NAMES
735 printf(
"Flop copied [%d] = %s\n", iEntry, nodeName );
742 loCreated++; liCreated++;
747 pObjAndAcc =
Aig_And( pNew, pObjXnor, pObjAndAcc );
751 pObjSavedLoAndEquality =
Aig_And( pNew, pObjSavedLo, pObjAndAcc );
757 printf(
"Circuit without any liveness property\n");
767 #ifdef PROPAGATE_NAMES
774 pObjShadowLiDriver =
Aig_Or( pNew, pObjShadowLo,
Aig_And( pNew, pDriverImage, pObjSaveOrSaved ) );
777 loCreated++; liCreated++;
779 pObjAndAcc =
Aig_And( pNew, pObjShadowLo, pObjAndAcc );
783 pObjLive = pObjAndAcc;
787 printf(
"Circuit without any fairness property\n");
796 #ifdef PROPAGATE_NAMES
803 pObjShadowLiDriver =
Aig_Or( pNew, pObjShadowLo,
Aig_And( pNew, pDriverImage, pObjSaveOrSaved ) );
806 loCreated++; liCreated++;
808 pObjAndAcc =
Aig_And( pNew, pObjShadowLo, pObjAndAcc );
812 pObjFair = pObjAndAcc;
816 pObjSafetyGate =
Aig_And( pNew, pObjSavedLoAndEquality,
Aig_And( pNew, pObjFair,
Aig_Not( pObjLive ) ) );
851 Aig_Obj_t *pObjXor, *pObjXnor, *pObjAndAcc, *pObjAndAccDummy;
852 Aig_Obj_t *pObjLive, *pObjFair, *pObjSafetyGate;
853 Aig_Obj_t *pObjSafetyPropertyOutput = NULL;
857 Aig_Obj_t *collectiveAssertSafety, *collectiveAssumeSafety;
860 int piCopied = 0, liCopied = 0, loCopied = 0;
864 printf(
"The input AIG contains no register, returning the original AIG as it is\n");
907 nodeName =
"SAVE_BIERE",
931 nodeName =
"SAVED_LO";
939 pObjSaveOrSaved =
Aig_Or( pNew, pObjSavePi, pObjSavedLo );
940 pObjSaveAndNotSaved =
Aig_And( pNew, pObjSavePi,
Aig_Not(pObjSavedLo) );
970 if( pObjAndAcc == NULL )
971 pObjAndAcc = pArgument;
974 pObjAndAccDummy = pObjAndAcc;
975 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAccDummy );
987 if( pObjAndAcc == NULL )
988 pObjAndAcc = pArgument;
991 pObjAndAccDummy = pObjAndAcc;
992 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAccDummy );
995 collectiveAssertSafety = pObjAndAcc;
1001 if( pObjAndAcc == NULL )
1002 pObjAndAcc = pArgument;
1005 pObjAndAccDummy = pObjAndAcc;
1006 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAccDummy );
1009 collectiveAssumeSafety = pObjAndAcc;
1013 printf(
"No safety property is specified, hence no safety gate is created\n");
1060 pObjXnor =
Aig_Not( pObjXor );
1062 if( pObjAndAcc == NULL )
1063 pObjAndAcc = pObjXnor;
1066 pObjAndAccDummy = pObjAndAcc;
1067 pObjAndAcc =
Aig_And( pNew, pObjXnor, pObjAndAccDummy );
1072 pObjSavedLoAndEquality =
Aig_And( pNew, pObjSavePi, pObjAndAcc );
1077 printf(
"Circuit without any liveness property\n");
1083 if( pObjAndAcc == NULL )
1084 pObjAndAcc = pDriverImage;
1087 pObjAndAccDummy = pObjAndAcc;
1088 pObjAndAcc =
Aig_And( pNew, pDriverImage, pObjAndAccDummy );
1093 if( pObjAndAcc != NULL )
1094 pObjLive = pObjAndAcc;
1101 printf(
"Circuit without any fairness property\n");
1107 if( pObjAndAcc == NULL )
1108 pObjAndAcc = pDriverImage;
1111 pObjAndAccDummy = pObjAndAcc;
1112 pObjAndAcc =
Aig_And( pNew, pDriverImage, pObjAndAccDummy );
1117 if( pObjAndAcc != NULL )
1118 pObjFair = pObjAndAcc;
1122 pObjSafetyGate =
Aig_And( pNew, pObjSavedLoAndEquality,
Aig_And( pNew, pObjFair,
Aig_Not( pObjLive ) ) );
1146 int i, liveCounter = 0;
1157 printf(
"Number of liveness property found = %d\n", liveCounter);
1164 int i, fairCounter = 0;
1175 printf(
"Number of fairness property found = %d\n", fairCounter);
1182 int i, assertSafetyCounter = 0;
1191 assertSafetyCounter++;
1193 printf(
"Number of safety property found = %d\n", assertSafetyCounter);
1194 return vAssertSafety;
1200 int i, assumeSafetyCounter = 0;
1209 assumeSafetyCounter++;
1211 printf(
"Number of assume_safety property found = %d\n", assumeSafetyCounter);
1212 return vAssumeSafety;
1256 FILE * pOut, * pErr;
1257 Abc_Ntk_t * pNtk, * pNtkTemp, *pNtkNew, *pNtkOld;
1260 Vec_Ptr_t * vLive, * vFair, *vAssertSafety, *vAssumeSafety;
1269 assert( directive == -1 );
1280 if( directive == -1 )
1292 if( directive == -1 )
1303 if( directive == -1 )
1323 fprintf( pErr,
"Empty network.\n" );
1328 printf(
"The input network was not strashed, strashing....\n");
1359 printf(
"A new circuit is produced with\n\t2 POs - one for safety and one for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n");
1372 printf(
"A new circuit is produced with\n\t2 POs - one for safety and one for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
1385 printf(
"A new circuit is produced with\n\t1 PO - only for safety property; liveness properties are ignored, if any.\n\tno additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
1398 printf(
"A new circuit is produced with\n\t1 PO - only for liveness property; safety properties are ignored, if any.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n");
1411 printf(
"New circuit is produced ignoring safety outputs!\nOnly liveness and fairness outputs are considered.\nShadow registers are not created\n");
1421 printf(
"New circuit is produced considering all safety, liveness and fairness outputs.\nBiere's logic is created\n");
1431 fprintf( pErr,
"Empty network.\n" );
1436 printf(
"The input network was not strashed, strashing....\n");
1460 fprintf( pErr,
"Empty network.\n" );
1465 printf(
"The input network was not strashed, strashing....\n");
1485 printf(
"New circuit is produced ignoring liveness outputs!\nOnly safety outputs are kept.\nBiere's logic is not created\n");
1491 fprintf( pErr,
"Empty network.\n" );
1497 printf(
"The input network was not strashed, strashing....\n");
1517 printf(
"New circuit is produced ignoring safety outputs!\nOnly liveness and fairness outputs are considered.\nBiere's logic is created\n");
1528 printf(
"\nDetail statistics*************************************\n");
1529 printf(
"Number of true primary inputs = %d\n",
Saig_ManPiNum( pAigNew ));
1530 printf(
"Number of true primary outputs = %d\n",
Saig_ManPoNum( pAigNew ));
1534 printf(
"\n*******************************************************\n");
1541 fprintf( stdout,
"Abc_NtkCreateCone(): Network check has failed.\n" );
1547 #ifndef DUPLICATE_CKT_DEBUG
1560 fprintf( stdout,
"usage: l2s [-1lsh]\n" );
1561 fprintf( stdout,
"\t performs Armin Biere's live-to-safe transformation\n" );
1562 fprintf( stdout,
"\t-1 : no shadow logic, presume all loops are self loops\n");
1563 fprintf( stdout,
"\t-l : ignore liveness and fairness outputs\n");
1564 fprintf( stdout,
"\t-s : ignore safety assertions and assumptions\n");
1565 fprintf( stdout,
"\t-h : print command usage\n");
1576 for( i=0; i<vectorLength; i++ )
1601 FILE * pOut, * pErr;
1602 Abc_Ntk_t * pNtk, * pNtkTemp, *pNtkNew, *pNtkOld;
1605 Vec_Ptr_t * vLive, * vFair, *vAssertSafety, *vAssumeSafety;
1615 assert( directive == -1 );
1626 if( directive == -1 )
1638 if( directive == -1 )
1649 if( directive == -1 )
1669 fprintf( pErr,
"Empty network.\n" );
1674 printf(
"The input network was not strashed, strashing....\n");
1709 printf(
"A new circuit is produced with\n\t2 POs - one for safety and one for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n");
1722 printf(
"A new circuit is produced with\n\t2 POs - one for safety and one for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
1735 printf(
"A new circuit is produced with\n\t1 PO - only for safety property; liveness properties are ignored, if any.\n\tno additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
1748 printf(
"A new circuit is produced with\n\t1 PO - only for liveness property; safety properties are ignored, if any.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n");
1761 printf(
"New circuit is produced ignoring safety outputs!\nOnly liveness and fairness outputs are considered.\nShadow registers are not created\n");
1770 fprintf( stdout,
"Abc_NtkCreateCone(): Network check has failed.\n" );
1776 #ifndef DUPLICATE_CKT_DEBUG
1789 fprintf( stdout,
"usage: l2s [-1lsh]\n" );
1790 fprintf( stdout,
"\t performs Armin Biere's live-to-safe transformation\n" );
1791 fprintf( stdout,
"\t-1 : no shadow logic, presume all loops are self loops\n");
1792 fprintf( stdout,
"\t-l : ignore liveness and fairness outputs\n");
1793 fprintf( stdout,
"\t-s : ignore safety assertions and assumptions\n");
1794 fprintf( stdout,
"\t-h : print command usage\n");
1800 int *numLtlProcessed,
Vec_Ptr_t *ltlBuffer )
1803 int i, ii, iii, nRegCount;
1805 Aig_Obj_t *pObjSavedLo = NULL, *pObjSavedLi = NULL;
1807 Aig_Obj_t *pObjSaveOrSaved = NULL, *pObjSaveAndNotSaved = NULL, *pObjSavedLoAndEquality;
1808 Aig_Obj_t *pObjShadowLo, *pObjShadowLi, *pObjShadowLiDriver;
1809 Aig_Obj_t *pObjXor, *pObjXnor, *pObjAndAcc;
1812 Aig_Obj_t *pObjOriginalSafetyPropertyOutput;
1813 Aig_Obj_t *pDriverImage, *pArgument, *collectiveAssertSafety, *collectiveAssumeSafety;
1814 Aig_Obj_t *pNegatedSafetyConjunction = NULL;
1816 char *nodeName, *pFormula;
1817 int piCopied = 0, liCopied = 0, loCopied = 0, liCreated = 0, loCreated = 0, liveLatch = 0;
1818 Vec_Ptr_t *vSignal, *vTopASTNodeArray = NULL;
1820 ltlNode *topNodeOfAST, *tempTopASTNode;
1822 Vec_Ptr_t *vSignalMemory, *vGFFlopMemory, *vPoForLtlProps = NULL;
1838 #ifdef MULTIPLE_LTL_FORMULA
1848 *numLtlProcessed = 0;
1853 vecInputLtlFormulae = ltlBuffer;
1855 if( vecInputLtlFormulae )
1863 if( tempTopASTNode )
1865 printf(
"Formula %d: AST is created, ", i+1);
1867 printf(
"Well-formedness check PASSED, ");
1870 printf(
"Well-formedness check FAILED!!\n");
1871 printf(
"AST will be ignored for formula %d, no extra logic will be added for this formula\n", i+1 );
1876 printf(
"Signal check PASSED\n");
1879 printf(
"Signal check FAILED!!");
1880 printf(
"AST will be ignored for formula %d, no extra logic will be added for this formula\n", i+1 );
1885 (*numLtlProcessed)++;
1888 printf(
"\nNo AST has been created for formula %d, no extra logic will be added\n", i+1 );
1895 printf(
"\nCurrently aborting, need to take care when Vec_PtrSize( vTopASTNodeArray ) == 0\n");
1934 nodeName =
"SAVE_BIERE",
1958 nodeName =
"SAVED_LO";
1967 pObjSaveOrSaved =
Aig_Or( pNew, pObjSavePi, pObjSavedLo );
1968 pObjSaveAndNotSaved =
Aig_And( pNew, pObjSavePi,
Aig_Not(pObjSavedLo) );
1985 assert( pNegatedSafetyConjunction == NULL );
1994 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAcc );
1996 pNegatedSafetyConjunction =
Aig_Not(pObjAndAcc);
2006 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAcc );
2008 collectiveAssertSafety = pObjAndAcc;
2014 pObjAndAcc =
Aig_And( pNew, pArgument, pObjAndAcc );
2016 collectiveAssumeSafety = pObjAndAcc;
2017 pNegatedSafetyConjunction =
Aig_And( pNew,
Aig_Not(collectiveAssertSafety), collectiveAssumeSafety );
2023 printf(
"WARNING!! No safety property is found, a new (negated) constant 1 output is created\n");
2029 assert( pNegatedSafetyConjunction != NULL );
2043 for( i=0; i<
Vec_PtrSize( vTopASTNodeArray ); i++ )
2046 Vec_PtrPush( vPoForLtlProps, pObjSafetyPropertyOutput );
2071 #ifndef DUPLICATE_CKT_DEBUG
2092 #ifdef PROPAGATE_NAMES
2103 loCreated++; liCreated++;
2106 pObjXnor =
Aig_Not( pObjXor );
2108 pObjAndAcc =
Aig_And( pNew, pObjXnor, pObjAndAcc );
2113 pObjSavedLoAndEquality =
Aig_And( pNew, pObjSavedLo, pObjAndAcc );
2177 pDriverImage =
pObj;
2179 pObjShadowLiDriver =
Aig_Or( pNew, pObjShadowLo,
Aig_And( pNew, pDriverImage, pObjSaveOrSaved ) );
2183 loCreated++; liCreated++;
2189 #ifdef PROPAGATE_NAMES
2193 nodeName = (
char *)
malloc( 20 );
2229 pObjSafetyGate =
Aig_And( pNew, pObjSavedLoAndEquality,
Aig_Not(pObjLive) );
2230 #ifdef ALLOW_SAFETY_PROPERTIES
2231 printf(
"liveness output is conjoined with safety assertions\n");
2232 pObjSafetyAndLiveToSafety =
Aig_Or( pNew, pObjSafetyGate, pNegatedSafetyConjunction );
2236 pObjSafetyPropertyOutput =
Vec_PtrEntry( vPoForLtlProps, iii );
2270 FILE * pOut, * pErr;
2271 Abc_Ntk_t * pNtk, * pNtkTemp, *pNtkNew, *pNtkOld;
2274 Vec_Ptr_t * vLive, * vFair, *vAssertSafety, *vAssumeSafety;
2277 int numOfLtlPropOutput;
2286 assert( directive == -1 );
2297 if( directive == -1 )
2309 if( directive == -1 )
2320 if( directive == -1 )
2345 printf(
"\nILLEGAL FLAG: aborting....\n");
2358 fprintf( pErr,
"Empty network.\n" );
2363 printf(
"The input network was not strashed, strashing....\n");
2382 if( pAbc->vLTLProperties_global != NULL )
2383 ltlBuffer = pAbc->vLTLProperties_global;
2392 printf(
"A new circuit is produced with\n\t%d POs - one for safety and %d for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n", numOfLtlPropOutput+1, numOfLtlPropOutput);
2398 printf(
"A new circuit is produced with\n\t2 POs - one for safety and one for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
2403 assert( numOfLtlPropOutput == 0 );
2405 printf(
"A new circuit is produced with\n\t1 PO - only for safety property; liveness properties are ignored, if any.\n\tno additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
2411 printf(
"A new circuit is produced with\n\t%d PO - only for liveness property; safety properties are ignored, if any.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n", numOfLtlPropOutput);
2417 printf(
"New circuit is produced ignoring safety outputs!\nOnly liveness and fairness outputs are considered.\nShadow registers are not created\n");
2426 printf(
"New circuit is produced considering all safety, liveness and fairness outputs.\nBiere's logic is created\n");
2436 fprintf( pErr,
"Empty network.\n" );
2441 printf(
"The input network was not strashed, strashing....\n");
2465 fprintf( pErr,
"Empty network.\n" );
2470 printf(
"The input network was not strashed, strashing....\n");
2490 printf(
"New circuit is produced ignoring liveness outputs!\nOnly safety outputs are kept.\nBiere's logic is not created\n");
2496 fprintf( pErr,
"Empty network.\n" );
2502 printf(
"The input network was not strashed, strashing....\n");
2522 printf(
"New circuit is produced ignoring safety outputs!\nOnly liveness and fairness outputs are considered.\nBiere's logic is created\n");
2533 printf(
"\nDetail statistics*************************************\n");
2534 printf(
"Number of true primary inputs = %d\n",
Saig_ManPiNum( pAigNew ));
2535 printf(
"Number of true primary outputs = %d\n",
Saig_ManPoNum( pAigNew ));
2539 printf(
"\n*******************************************************\n");
2546 fprintf( stdout,
"Abc_NtkCreateCone(): Network check has failed.\n" );
2552 #ifndef DUPLICATE_CKT_DEBUG
2565 fprintf( stdout,
"usage: l3s [-1lsh]\n" );
2566 fprintf( stdout,
"\t performs Armin Biere's live-to-safe transformation\n" );
2567 fprintf( stdout,
"\t-1 : no shadow logic, presume all loops are self loops\n");
2568 fprintf( stdout,
"\t-l : ignore liveness and fairness outputs\n");
2569 fprintf( stdout,
"\t-s : ignore safety assertions and assumptions\n");
2570 fprintf( stdout,
"\t-h : print command usage\n");
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
#define IGNORE_SAFETY_KEEP_LIVENESS_ONE_LOOP_MODE
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
static int nodeName_starts_with(Abc_Obj_t *pNode, const char *prefix)
Vec_Ptr_t * populateSafetyAssertionVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
static Vec_Vec_t * Vec_VecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static Aig_Type_t Aig_ObjType(Aig_Obj_t *pObj)
int checkSignalNameExistence(Abc_Ntk_t *pNtk, ltlNode *topASTNode)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static int Saig_ManPoNum(Aig_Man_t *p)
Aig_Man_t * LivenessToSafetyTransformationOneStepLoop(int mode, Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair, Vec_Ptr_t *vAssertSafety, Vec_Ptr_t *vAssumeSafety)
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
void printVecPtrOfString(Vec_Ptr_t *vec)
static Aig_Obj_t * Aig_ObjChild0(Aig_Obj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Aig_Obj_t * retriveAIGPointerFromLTLNode(ltlNode *astNode)
static Aig_Obj_t * Saig_ObjLoToLi(Aig_Man_t *p, Aig_Obj_t *pObj)
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
ABC_DLL void Abc_FrameSetCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Aig_Obj_t * Aig_Exor(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Vec_Ptr_t * populateSafetyAssumptionVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
void Aig_ManPrintStats(Aig_Man_t *p)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
static Aig_Obj_t * Aig_Regular(Aig_Obj_t *p)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define IGNORE_SAFETY_KEEP_LIVENESS_MODE
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
int Abc_CommandAbcLivenessToSafetyWithLTL(Abc_Frame_t *pAbc, int argc, char **argv)
void populateBoolWithAigNodePtr(Abc_Ntk_t *pNtk, Aig_Man_t *pAigOld, Aig_Man_t *pAigNew, ltlNode *topASTNode)
static Abc_Obj_t * Abc_NtkCi(Abc_Ntk_t *pNtk, int i)
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Vec_Ptr_t * populateFairnessVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
char * retrieveLOName(Abc_Ntk_t *pNtkOld, Aig_Man_t *pAigOld, Aig_Man_t *pAigNew, Aig_Obj_t *pObjPivot, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair)
int Abc_CommandAbcLivenessToSafety(Abc_Frame_t *pAbc, int argc, char **argv)
#define FULL_BIERE_ONE_LOOP_MODE
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Aig_Man_t * LivenessToSafetyTransformation(int mode, Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair, Vec_Ptr_t *vAssertSafety, Vec_Ptr_t *vAssumeSafety)
static int Vec_PtrFind(Vec_Ptr_t *p, void *Entry)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
int checkAllBoolHaveAIGPointer(ltlNode *topASTNode)
int isWellFormed(ltlNode *topNode)
char * Nm_ManStoreIdName(Nm_Man_t *p, int ObjId, int Type, char *pName, char *pSuffix)
static int Aig_ManCoNum(Aig_Man_t *p)
#define Vec_VecForEachEntryLevel(Type, vGlob, pEntry, i, Level)
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
Aig_Man_t * LivenessToSafetyTransformationWithLTL(int mode, Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair, Vec_Ptr_t *vAssertSafety, Vec_Ptr_t *vAssumeSafety, int *numLtlProcessed, Vec_Ptr_t *ltlBuffer)
static Aig_Obj_t * Aig_ManLo(Aig_Man_t *p, int i)
#define Aig_ManForEachNode(p, pObj, i)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Aig_ObjPatchFanin0(Aig_Man_t *p, Aig_Obj_t *pObj, Aig_Obj_t *pFaninNew)
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
void populateAigPointerUnitGF(Aig_Man_t *pAigNew, ltlNode *topASTNode, Vec_Ptr_t *vSignal, Vec_Vec_t *vAigGFMap)
static int Aig_ManCiNum(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_END
Vec_Int_t * prepareFlopVector(Aig_Man_t *pAig, int vectorLength)
char * Nm_ManFindNameById(Nm_Man_t *p, int ObjId)
void updateNewNetworkNameManager(Abc_Ntk_t *pNtk, Aig_Man_t *pAig, Vec_Ptr_t *vPiNames, Vec_Ptr_t *vLoNames)
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Aig_Obj_t * Aig_Or(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
int Aig_ManCoCleanupBiere(Aig_Man_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define Saig_ManForEachLo(p, pObj, i)
Aig_Obj_t * buildLogicFromLTLNode(Aig_Man_t *pAig, ltlNode *pLtlNode)
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
#define Abc_NtkForEachLatch(pNtk, pObj, i)
static int Saig_ManCiNum(Aig_Man_t *p)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static int Saig_ManRegNum(Aig_Man_t *p)
static int Aig_ManObjNumMax(Aig_Man_t *p)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
int Abc_CommandAbcLivenessToSafetyAbstraction(Abc_Frame_t *pAbc, int argc, char **argv)
static int Aig_ManRegNum(Aig_Man_t *p)
#define IGNORE_LIVENESS_KEEP_SAFETY_MODE
static int Vec_IntSize(Vec_Int_t *p)
Aig_Obj_t * Aig_Mux(Aig_Man_t *p, Aig_Obj_t *pC, Aig_Obj_t *p1, Aig_Obj_t *p0)
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
ltlNode * readLtlFormula(char *formula)
Aig_Man_t * LivenessToSafetyTransformationAbs(int mode, Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Int_t *vFlops, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair, Vec_Ptr_t *vAssertSafety, Vec_Ptr_t *vAssumeSafety)
Nm_Man_t * Nm_ManCreate(int nSize)
MACRO DEFINITIONS ///.
void traverseAbstractSyntaxTree_postFix(ltlNode *node)
#define Saig_ManForEachPo(p, pObj, i)
static int Aig_ObjId(Aig_Obj_t *pObj)
Vec_Ptr_t * populateLivenessVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
static int Saig_ManCoNum(Aig_Man_t *p)
ltlNode * parseFormulaCreateAST(char *inputFormula)
int Aig_ManCiCleanupBiere(Aig_Man_t *p)
static Abc_Obj_t * Abc_NtkPi(Abc_Ntk_t *pNtk, int i)
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
#define Abc_NtkForEachPo(pNtk, pPo, i)
static Aig_Obj_t * Aig_NotCond(Aig_Obj_t *p, int c)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
void setAIGNodePtrOfGloballyNode(ltlNode *astNode, Aig_Obj_t *pObjLo)
int getPoIndex(Aig_Man_t *pAig, Aig_Obj_t *pPivot)
char * Abc_UtilStrsav(char *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static int Saig_ObjIsPi(Aig_Man_t *p, Aig_Obj_t *pObj)
void traverseAbstractSyntaxTree(ltlNode *node)
int Aig_ManCleanup(Aig_Man_t *p)
static int Aig_ObjCioId(Aig_Obj_t *pObj)
static void Vec_PtrFree(Vec_Ptr_t *p)
#define Saig_ManForEachPi(p, pObj, i)
char * retrieveTruePiName(Abc_Ntk_t *pNtkOld, Aig_Man_t *pAigOld, Aig_Man_t *pAigNew, Aig_Obj_t *pObjPivot)