Description [Returns 1 if proven. 0 if failed. -1 if undecided.]
80{
85 int s, i, RetValue,
Status;
86 abctime clk, clk2, clkTotal = Abc_Clock(), timeTemp = 0;
87 abctime nTimeNewOut = pPars->nSecLimit ? pPars->nSecLimit * CLOCKS_PER_SEC + Abc_Clock() : 0;
88
89
90 if ( pPars->nFramesK > 1 )
91 pPars->fTransLoop = 1;
92
93
94 assert( Saig_ManRegNum(pAig) > 0 );
95 assert( Saig_ManPiNum(pAig) > 0 );
96 assert( Saig_ManPoNum(pAig)-Saig_ManConstrNum(pAig) == 1 );
97 if ( pPars->fVerbose && Saig_ManConstrNum(pAig) )
98 printf( "Performing interpolation with %d constraints...\n", Saig_ManConstrNum(pAig) );
99
101 {
102 *piFrame = -1;
103 printf( "Property trivially fails in the initial state.\n" );
104 return 0;
105 }
106
107
108
109
110
111
112
113
114
116 if ( pPars->fTransLoop )
118 else
120
121clk = Abc_Clock();
122 p->pCnfAig =
Cnf_Derive(
p->pAigTrans, Aig_ManRegNum(
p->pAigTrans) );
123p->timeCnf += Abc_Clock() - clk;
124 if ( pPars->fVerbose )
125 {
126 printf( "AIG: PI/PO/Reg = %d/%d/%d. And = %d. Lev = %d. CNF: Var/Cla = %d/%d.\n",
127 Saig_ManPiNum(pAig), Saig_ManPoNum(pAig), Saig_ManRegNum(pAig),
129 p->pCnfAig->nVars,
p->pCnfAig->nClauses );
130 }
131
132
133 *piFrame = -1;
135 for ( s = 0; ; s++ )
136 {
138
139clk2 = Abc_Clock();
140
141 if ( pPars->fUseBackward )
143 else
145 assert( Aig_ManCoNum(
p->pInter) == 1 );
146clk = Abc_Clock();
148p->timeCnf += Abc_Clock() - clk;
149
151clk = Abc_Clock();
152 if ( pPars->fRewrite )
153 {
156
157
158 }
159p->timeRwr += Abc_Clock() - clk;
160
161clk = Abc_Clock();
162 if ( pPars->fUseBackward )
163 p->pCnfFrames =
Cnf_Derive(
p->pFrames, Aig_ManCoNum(
p->pFrames) );
164 else
165
167p->timeCnf += Abc_Clock() - clk;
168
169 if ( pPars->fVerbose )
170 {
171 printf( "Step = %2d. Frames = 1 + %d. And = %5d. Lev = %5d. ",
173 ABC_PRT(
"Time", Abc_Clock() - clk2 );
174 }
175
176
178
179 if ( !(pPars->fTransLoop || pPars->fUseBackward || pPars->nFramesK > 1) )
180 {
182
183clk = Abc_Clock();
185p->timeCnf += Abc_Clock() - clk;
186clk = Abc_Clock();
188p->timeEqu += Abc_Clock() - clk;
189
193 }
195
196
197 for ( i = 0; ; i++ )
198 {
199 if ( pPars->nFramesMax &&
p->nFrames + i >= pPars->nFramesMax )
200 {
201 if ( pPars->fVerbose )
202 printf( "Reached limit (%d) on the number of timeframes.\n", pPars->nFramesMax );
203 p->timeTotal = Abc_Clock() - clkTotal;
206 return -1;
207 }
208
209
210 clk = Abc_Clock();
211#ifdef ABC_USE_LIBRARIES
212 if ( pPars->fUseMiniSat )
213 {
214 assert( !pPars->fUseBackward );
215 RetValue = Inter_ManPerformOneStepM114p(
p, pPars->fUsePudlak, pPars->fUseOther );
216 }
217 else
218#endif
220
221 if ( pPars->fVerbose )
222 {
223 printf( " I = %2d. Bmc =%3d. IntAnd =%6d. IntLev =%5d. Conf =%6d. ",
224 i+1, i + 1 +
p->nFrames, Aig_ManNodeNum(
p->pInter),
Aig_ManLevelNum(
p->pInter),
p->nConfCur );
225 ABC_PRT(
"Time", Abc_Clock() - clk );
226 }
227
228 pPars->iFrameMax = i - 1 +
p->nFrames;
229 if ( RetValue == 0 )
230 {
231 if ( i == 0 )
232 {
233 if ( pPars->fVerbose )
234 printf(
"Found a real counterexample in frame %d.\n",
p->nFrames );
235 p->timeTotal = Abc_Clock() - clkTotal;
236 *piFrame =
p->nFrames;
237
238 {
239 int RetValue;
244 pParsBmc->
fVerbose = pPars->fVerbose;
246 if ( RetValue == 1 )
247 printf( "Error: The problem should be SAT but it is UNSAT.\n" );
248 else if ( RetValue == -1 )
249 printf( "Error: The problem timed out.\n" );
250 }
253 return 0;
254 }
255
258 break;
259 }
260 else if ( RetValue == -1 )
261 {
262 if ( pPars->nSecLimit && Abc_Clock() > nTimeNewOut )
263 {
264 if ( pPars->fVerbose )
265 printf( "Reached timeout (%d seconds).\n", pPars->nSecLimit );
266 }
267 else
268 {
269 assert(
p->nConfCur >=
p->nConfLimit );
270 if ( pPars->fVerbose )
271 printf(
"Reached limit (%d) on the number of conflicts.\n",
p->nConfLimit );
272 }
273 p->timeTotal = Abc_Clock() - clkTotal;
276 return -1;
277 }
279
280clk = Abc_Clock();
282 {
283
284 p->pInterNew->Time2Quit = nTimeNewOut;
285
287
289 if (
p->pInterNew == NULL )
290 {
291 printf( "Reached timeout (%d seconds) during rewriting.\n", pPars->nSecLimit );
292 p->timeTotal = Abc_Clock() - clkTotal;
295 return -1;
296 }
297 }
298p->timeRwr += Abc_Clock() - clk;
299
300
301 if (
p->pInterNew == NULL || Aig_ObjChild0(Aig_ManCo(
p->pInterNew,0)) == Aig_ManConst0(
p->pInterNew) )
302 {
303
304 if ( pPars->fVerbose )
305 printf( "The problem is trivially true for all states.\n" );
306 p->timeTotal = Abc_Clock() - clkTotal;
309 return 1;
310 }
311
312
313clk = Abc_Clock();
314 if ( pPars->fCheckKstep )
315 {
316 if ( Aig_ManCiNum(
p->pInterNew) == Aig_ManCiNum(
p->pInter) )
317 {
318 if ( pPars->fTransLoop || pPars->fUseBackward || pPars->nFramesK > 1 )
319 {
320clk2 = Abc_Clock();
322timeTemp = Abc_Clock() - clk2;
323 }
324 else
325 {
326clk2 = Abc_Clock();
328p->timeCnf += Abc_Clock() - clk2;
329timeTemp = Abc_Clock() - clk2;
330
335 }
336 }
337 else
339 }
340 else
341 {
342 if ( Aig_ManCiNum(
p->pInterNew) == Aig_ManCiNum(
p->pInter) )
344 else
346 }
347p->timeEqu += Abc_Clock() - clk - timeTemp;
348 if ( Status )
349 {
350 if ( pPars->fVerbose )
351 printf( "Proved containment of interpolants.\n" );
352 p->timeTotal = Abc_Clock() - clkTotal;
355 return 1;
356 }
357 if ( pPars->nSecLimit && Abc_Clock() > nTimeNewOut )
358 {
359 printf( "Reached timeout (%d seconds).\n", pPars->nSecLimit );
360 p->timeTotal = Abc_Clock() - clkTotal;
363 return -1;
364 }
365
366 if ( pPars->fTransLoop )
367 {
369 p->pInter =
p->pInterNew;
370 }
371 else
372 {
373 if ( pPars->fUseBackward )
374 {
378
379clk = Abc_Clock();
382p->timeRwr += Abc_Clock() - clk;
383 }
384 else
385 {
387 p->pInter =
p->pInterNew;
388 }
389 }
392clk = Abc_Clock();
394p->timeCnf += Abc_Clock() - clk;
395 }
396
397
399 }
401 return RetValue;
402}
ABC_NAMESPACE_IMPL_START Aig_Man_t * Dar_ManRwsat(Aig_Man_t *pAig, int fBalance, int fVerbose)
DECLARATIONS ///.
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
int Aig_ManLevelNum(Aig_Man_t *p)
void Aig_ManStop(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Aig_Man_t * Aig_ManCreateMiter(Aig_Man_t *p1, Aig_Man_t *p2, int fImpl)
void Saig_ParBmcSetDefaultParams(Saig_ParBmc_t *p)
int Saig_ManBmcScalable(Aig_Man_t *pAig, Saig_ParBmc_t *pPars)
struct Saig_ParBmc_t_ Saig_ParBmc_t
Cnf_Dat_t * Cnf_DeriveSimple(Aig_Man_t *p, int nOutputs)
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
struct Cnf_Dat_t_ Cnf_Dat_t
void Cnf_DataFree(Cnf_Dat_t *p)
void Inter_CheckStop(Inter_Check_t *p)
int Inter_CheckPerform(Inter_Check_t *p, Cnf_Dat_t *pCnfInt, abctime nTimeNewOut)
Inter_Check_t * Inter_CheckStart(Aig_Man_t *pTrans, int nFramesK)
MACRO DEFINITIONS ///.
int Inter_ManCheckInductiveContainment(Aig_Man_t *pTrans, Aig_Man_t *pInter, int nSteps, int fBackward)
int Inter_ManCheckContainment(Aig_Man_t *pNew, Aig_Man_t *pOld)
FUNCTION DEFINITIONS ///.
Aig_Man_t * Inter_ManStartDuplicated(Aig_Man_t *p)
Aig_Man_t * Inter_ManStartOneOutput(Aig_Man_t *p, int fAddFirstPo)
ABC_NAMESPACE_IMPL_START Aig_Man_t * Inter_ManStartInitState(int nRegs)
DECLARATIONS ///.
ABC_NAMESPACE_IMPL_START Aig_Man_t * Inter_ManFramesInter(Aig_Man_t *pAig, int nFrames, int fAddRegOuts, int fUseTwoFrames)
DECLARATIONS ///.
int Inter_ManCheckInitialState(Aig_Man_t *p)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Inter_Man_t_ Inter_Man_t
INCLUDES ///.
int Inter_ManPerformOneStep(Inter_Man_t *p, int fUseBias, int fUseBackward, abctime nTimeNewOut)
void Inter_ManStop(Inter_Man_t *p, int fProved)
void Inter_ManClean(Inter_Man_t *p)
Inter_Man_t * Inter_ManCreate(Aig_Man_t *pAig, Inter_ManParams_t *pPars)
DECLARATIONS ///.
struct Inter_Check_t_ Inter_Check_t