abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
intInt.h File Reference
#include "aig/saig/saig.h"
#include "sat/cnf/cnf.h"
#include "sat/bsat/satSolver.h"
#include "sat/bsat/satStore.h"
#include "int.h"

Go to the source code of this file.

Data Structures

struct  Inter_Man_t_
 

Typedefs

typedef
typedefABC_NAMESPACE_HEADER_START
struct Inter_Man_t_ 
Inter_Man_t
 INCLUDES ///. More...
 
typedef struct Inter_Check_t_ Inter_Check_t
 

Functions

Inter_Check_tInter_CheckStart (Aig_Man_t *pTrans, int nFramesK)
 MACRO DEFINITIONS ///. More...
 
void Inter_CheckStop (Inter_Check_t *p)
 
int Inter_CheckPerform (Inter_Check_t *p, Cnf_Dat_t *pCnf, abctime nTimeNewOut)
 
int Inter_ManCheckContainment (Aig_Man_t *pNew, Aig_Man_t *pOld)
 FUNCTION DEFINITIONS ///. More...
 
int Inter_ManCheckEquivalence (Aig_Man_t *pNew, Aig_Man_t *pOld)
 
int Inter_ManCheckInductiveContainment (Aig_Man_t *pTrans, Aig_Man_t *pInter, int nSteps, int fBackward)
 
void * Inter_ManGetCounterExample (Aig_Man_t *pAig, int nFrames, int fVerbose)
 
Aig_Man_tInter_ManStartInitState (int nRegs)
 DECLARATIONS ///. More...
 
Aig_Man_tInter_ManStartDuplicated (Aig_Man_t *p)
 
Aig_Man_tInter_ManStartOneOutput (Aig_Man_t *p, int fAddFirstPo)
 
Aig_Man_tInter_ManFramesInter (Aig_Man_t *pAig, int nFrames, int fAddRegOuts, int fUseTwoFrames)
 DECLARATIONS ///. More...
 
Inter_Man_tInter_ManCreate (Aig_Man_t *pAig, Inter_ManParams_t *pPars)
 DECLARATIONS ///. More...
 
void Inter_ManClean (Inter_Man_t *p)
 
void Inter_ManStop (Inter_Man_t *p, int fProved)
 
int Inter_ManPerformOneStep (Inter_Man_t *p, int fUseBias, int fUseBackward, abctime nTimeNewOut)
 
int Inter_ManCheckInitialState (Aig_Man_t *p)
 DECLARATIONS ///. More...
 
int Inter_ManCheckAllStates (Aig_Man_t *p)
 

Typedef Documentation

typedef struct Inter_Check_t_ Inter_Check_t

Definition at line 84 of file intInt.h.

typedef typedefABC_NAMESPACE_HEADER_START struct Inter_Man_t_ Inter_Man_t

INCLUDES ///.

CFile****************************************************************

FileName [intInt.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Interpolation engine.]

Synopsis [Internal declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 24, 2008.]

Revision [

Id:
intInt.h,v 1.00 2005/06/20 00:00:00 alanmi Exp

]PARAMETERS ///BASIC TYPES ///

Definition at line 49 of file intInt.h.

Function Documentation

int Inter_CheckPerform ( Inter_Check_t p,
Cnf_Dat_t pCnfInt,
abctime  nTimeNewOut 
)

Function*************************************************************

Synopsis [Perform the checking.]

Description [Returns 1 if the check has passed.]

SideEffects []

SeeAlso []

Definition at line 220 of file intCheck.c.

221 {
222  Aig_Obj_t * pObj, * pObj2;
223  int i, f, VarA, VarB, RetValue, Entry, status;
224  int nRegs = Aig_ManCiNum(pCnfInt->pMan);
225  assert( Aig_ManCoNum(p->pCnf->pMan) == p->nFramesK * nRegs );
226  assert( Aig_ManCoNum(pCnfInt->pMan) == 1 );
227 
228  // set runtime limit
229  if ( nTimeNewOut )
230  sat_solver_set_runtime_limit( p->pSat, nTimeNewOut );
231 
232  // add clauses to the SAT solver
233  Cnf_DataLift( pCnfInt, p->nVars );
234  for ( f = 0; f <= p->nFramesK; f++ )
235  {
236  // add clauses to the solver
237  for ( i = 0; i < pCnfInt->nClauses; i++ )
238  {
239  RetValue = sat_solver_addclause( p->pSat, pCnfInt->pClauses[i], pCnfInt->pClauses[i+1] );
240  assert( RetValue );
241  }
242  // add equality clauses for the flop variables
243  Aig_ManForEachCi( pCnfInt->pMan, pObj, i )
244  {
245  pObj2 = f ? Aig_ManCo(p->pFrames, i + (f-1) * nRegs) : Aig_ManCi(p->pFrames, i);
246  Inter_CheckAddEqual( p, pCnfInt->pVarNums[pObj->Id], p->pCnf->pVarNums[pObj2->Id] );
247  }
248  // add final clauses
249  if ( f < p->nFramesK )
250  {
251  if ( f == Vec_IntSize(p->vOrLits) ) // find time here
252  {
253  // add literal to this frame
254  VarB = pCnfInt->pVarNums[ Aig_ManCo(pCnfInt->pMan, 0)->Id ];
255  Vec_IntPush( p->vOrLits, VarB );
256  }
257  else
258  {
259  // add OR gate for this frame
260  VarA = Vec_IntEntry( p->vOrLits, f );
261  VarB = pCnfInt->pVarNums[ Aig_ManCo(pCnfInt->pMan, 0)->Id ];
262  Inter_CheckAddOrGate( p, VarA, VarB, p->nVars + pCnfInt->nVars );
263  Vec_IntWriteEntry( p->vOrLits, f, p->nVars + pCnfInt->nVars ); // using var ID!
264  }
265  }
266  else
267  {
268  // add AND gate for this frame
269  VarB = pCnfInt->pVarNums[ Aig_ManCo(pCnfInt->pMan, 0)->Id ];
270  Vec_IntPush( p->vAndLits, VarB );
271  }
272  // update variable IDs
273  Cnf_DataLift( pCnfInt, pCnfInt->nVars + 1 );
274  p->nVars += pCnfInt->nVars + 1;
275  }
276  Cnf_DataLift( pCnfInt, -p->nVars );
277  assert( Vec_IntSize(p->vOrLits) == p->nFramesK );
278 
279  // collect the assumption literals
280  Vec_IntClear( p->vAssLits );
281  Vec_IntForEachEntry( p->vOrLits, Entry, i )
282  Vec_IntPush( p->vAssLits, toLitCond(Entry, 0) );
283  Vec_IntForEachEntry( p->vAndLits, Entry, i )
284  Vec_IntPush( p->vAssLits, toLitCond(Entry, 1) );
285 /*
286  if ( pCnfInt->nLiterals == 3635 )
287  {
288  int s = 0;
289  }
290 */
291  // call the SAT solver
292  status = sat_solver_solve( p->pSat, Vec_IntArray(p->vAssLits),
293  Vec_IntArray(p->vAssLits) + Vec_IntSize(p->vAssLits),
294  (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
295 
296  return status == l_False;
297 }
static abctime sat_solver_set_runtime_limit(sat_solver *s, abctime Limit)
Definition: satSolver.h:233
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
Vec_Int_t * vOrLits
Definition: intCheck.c:38
void Inter_CheckAddOrGate(Inter_Check_t *p, int iVarA, int iVarB, int iVarC)
Definition: intCheck.c:162
Vec_Int_t * vAssLits
Definition: intCheck.c:40
int sat_solver_addclause(sat_solver *s, lit *begin, lit *end)
Definition: satSolver.c:1492
int nClauses
Definition: cnf.h:61
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
int nVars
Definition: cnf.h:59
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
int * pVarNums
Definition: cnf.h:63
Aig_Man_t * pMan
Definition: cnf.h:58
Cnf_Dat_t * pCnf
Definition: intCheck.c:36
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
int ** pClauses
Definition: cnf.h:62
static Aig_Obj_t * Aig_ManCi(Aig_Man_t *p, int i)
Definition: aig.h:266
static lit toLitCond(int v, int c)
Definition: satVec.h:143
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
Definition: aig.h:69
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Aig_Man_t * pFrames
Definition: intCheck.c:35
void Cnf_DataLift(Cnf_Dat_t *p, int nVarsPlus)
Definition: cnfMan.c:205
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Vec_Int_t * vAndLits
Definition: intCheck.c:39
#define l_False
Definition: SolverTypes.h:85
void Inter_CheckAddEqual(Inter_Check_t *p, int iVarA, int iVarB)
Definition: intCheck.c:194
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
int Id
Definition: aig.h:85
sat_solver * pSat
Definition: intCheck.c:37
Inter_Check_t* Inter_CheckStart ( Aig_Man_t pTrans,
int  nFramesK 
)

MACRO DEFINITIONS ///.

FUNCTION DECLARATIONS ///

Function*************************************************************

Synopsis [This procedure sets default values of interpolation parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 105 of file intCheck.c.

106 {
107  Inter_Check_t * p;
108  // create solver
109  p = ABC_CALLOC( Inter_Check_t, 1 );
110  p->vOrLits = Vec_IntAlloc( 100 );
111  p->vAndLits = Vec_IntAlloc( 100 );
112  p->vAssLits = Vec_IntAlloc( 100 );
113  // generate the timeframes
114  p->pFrames = Inter_ManUnrollFrames( pTrans, nFramesK );
115  assert( Aig_ManCiNum(p->pFrames) == nFramesK * Saig_ManPiNum(pTrans) + Saig_ManRegNum(pTrans) );
116  assert( Aig_ManCoNum(p->pFrames) == nFramesK * Saig_ManRegNum(pTrans) );
117  // convert to CNF
118  p->pCnf = Cnf_Derive( p->pFrames, Aig_ManCoNum(p->pFrames) );
119  p->pSat = (sat_solver *)Cnf_DataWriteIntoSolver( p->pCnf, 1, 0 );
120  // assign parameters
121  p->nFramesK = nFramesK;
122  p->nVars = p->pCnf->nVars;
123  return p;
124 }
Vec_Int_t * vOrLits
Definition: intCheck.c:38
Vec_Int_t * vAssLits
Definition: intCheck.c:40
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
Definition: cnfCore.c:165
static Llb_Mgr_t * p
Definition: llb3Image.c:950
DECLARATIONS ///.
Definition: intCheck.c:31
int nVars
Definition: cnf.h:59
Cnf_Dat_t * pCnf
Definition: intCheck.c:36
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
Aig_Man_t * pFrames
Definition: intCheck.c:35
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition: cnfMan.c:463
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Definition: saig.h:73
Vec_Int_t * vAndLits
Definition: intCheck.c:39
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
Aig_Man_t * Inter_ManUnrollFrames(Aig_Man_t *pAig, int nFrames)
FUNCTION DEFINITIONS ///.
Definition: intCheck.c:59
#define assert(ex)
Definition: util_old.h:213
sat_solver * pSat
Definition: intCheck.c:37
void Inter_CheckStop ( Inter_Check_t p)

Function*************************************************************

Synopsis [This procedure sets default values of interpolation parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 137 of file intCheck.c.

138 {
139  if ( p == NULL )
140  return;
141  Vec_IntFree( p->vOrLits );
142  Vec_IntFree( p->vAndLits );
143  Vec_IntFree( p->vAssLits );
144  Cnf_DataFree( p->pCnf );
145  Aig_ManStop( p->pFrames );
146  sat_solver_delete( p->pSat );
147  ABC_FREE( p );
148 }
Vec_Int_t * vOrLits
Definition: intCheck.c:38
Vec_Int_t * vAssLits
Definition: intCheck.c:40
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
Cnf_Dat_t * pCnf
Definition: intCheck.c:36
Aig_Man_t * pFrames
Definition: intCheck.c:35
#define ABC_FREE(obj)
Definition: abc_global.h:232
Vec_Int_t * vAndLits
Definition: intCheck.c:39
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
sat_solver * pSat
Definition: intCheck.c:37
int Inter_ManCheckAllStates ( Aig_Man_t p)

Function*************************************************************

Synopsis [Returns 1 if the property holds in all states.]

Description []

SideEffects []

SeeAlso []

Definition at line 85 of file intUtil.c.

86 {
87  Cnf_Dat_t * pCnf;
88  sat_solver * pSat;
89  int status;
90  abctime clk = Abc_Clock();
91  pCnf = Cnf_Derive( p, Saig_ManRegNum(p) );
92  pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 0 );
93  Cnf_DataFree( pCnf );
94  if ( pSat == NULL )
95  return 1;
96  status = sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
97  sat_solver_delete( pSat );
98  ABC_PRT( "Time", Abc_Clock() - clk );
99  return status == l_False;
100 }
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
Definition: cnfCore.c:165
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
static abctime Abc_Clock()
Definition: abc_global.h:279
Definition: cnf.h:56
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition: cnfMan.c:463
#define ABC_PRT(a, t)
Definition: abc_global.h:220
#define l_False
Definition: SolverTypes.h:85
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
ABC_INT64_T abctime
Definition: abc_global.h:278
int Inter_ManCheckContainment ( Aig_Man_t pNew,
Aig_Man_t pOld 
)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Checks constainment of two interpolants.]

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file intContain.c.

48 {
49  Aig_Man_t * pMiter, * pAigTemp;
50  int RetValue;
51  pMiter = Aig_ManCreateMiter( pNew, pOld, 1 );
52 // pMiter = Dar_ManRwsat( pAigTemp = pMiter, 1, 0 );
53 // Aig_ManStop( pAigTemp );
54  RetValue = Fra_FraigMiterStatus( pMiter );
55  if ( RetValue == -1 )
56  {
57  pAigTemp = Fra_FraigEquivence( pMiter, 1000000, 1 );
58  RetValue = Fra_FraigMiterStatus( pAigTemp );
59  Aig_ManStop( pAigTemp );
60 // RetValue = Fra_FraigSat( pMiter, 1000000, 0, 0, 0, 0, 0, 0 );
61  }
62  assert( RetValue != -1 );
63  Aig_ManStop( pMiter );
64  return RetValue;
65 }
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
Aig_Man_t * Aig_ManCreateMiter(Aig_Man_t *p1, Aig_Man_t *p2, int fImpl)
Definition: aigDup.c:1049
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Aig_Man_t * Fra_FraigEquivence(Aig_Man_t *pManAig, int nConfMax, int fProve)
Definition: fraCore.c:468
#define assert(ex)
Definition: util_old.h:213
int Fra_FraigMiterStatus(Aig_Man_t *p)
DECLARATIONS ///.
Definition: fraCore.c:62
int Inter_ManCheckEquivalence ( Aig_Man_t pNew,
Aig_Man_t pOld 
)

Function*************************************************************

Synopsis [Checks constainment of two interpolants.]

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file intContain.c.

79 {
80  Aig_Man_t * pMiter, * pAigTemp;
81  int RetValue;
82  pMiter = Aig_ManCreateMiter( pNew, pOld, 0 );
83 // pMiter = Dar_ManRwsat( pAigTemp = pMiter, 1, 0 );
84 // Aig_ManStop( pAigTemp );
85  RetValue = Fra_FraigMiterStatus( pMiter );
86  if ( RetValue == -1 )
87  {
88  pAigTemp = Fra_FraigEquivence( pMiter, 1000000, 1 );
89  RetValue = Fra_FraigMiterStatus( pAigTemp );
90  Aig_ManStop( pAigTemp );
91 // RetValue = Fra_FraigSat( pMiter, 1000000, 0, 0, 0, 0, 0, 0 );
92  }
93  assert( RetValue != -1 );
94  Aig_ManStop( pMiter );
95  return RetValue;
96 }
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
Aig_Man_t * Aig_ManCreateMiter(Aig_Man_t *p1, Aig_Man_t *p2, int fImpl)
Definition: aigDup.c:1049
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Aig_Man_t * Fra_FraigEquivence(Aig_Man_t *pManAig, int nConfMax, int fProve)
Definition: fraCore.c:468
#define assert(ex)
Definition: util_old.h:213
int Fra_FraigMiterStatus(Aig_Man_t *p)
DECLARATIONS ///.
Definition: fraCore.c:62
int Inter_ManCheckInductiveContainment ( Aig_Man_t pTrans,
Aig_Man_t pInter,
int  nSteps,
int  fBackward 
)

Function*************************************************************

Synopsis [Checks constainment of two interpolants inductively.]

Description []

SideEffects []

SeeAlso []

Definition at line 190 of file intContain.c.

191 {
192  Aig_Man_t * pFrames;
193  Aig_Obj_t ** ppNodes;
194  Vec_Ptr_t * vMapRegs;
195  Cnf_Dat_t * pCnf;
196  sat_solver * pSat;
197  int f, nRegs, status;
198  nRegs = Saig_ManRegNum(pTrans);
199  assert( nRegs > 0 );
200  // generate the timeframes
201  pFrames = Inter_ManFramesLatches( pTrans, nSteps, &vMapRegs );
202  assert( Vec_PtrSize(vMapRegs) == (nSteps + 1) * nRegs );
203  // add main constraints to the timeframes
204  ppNodes = (Aig_Obj_t **)Vec_PtrArray(vMapRegs);
205  if ( !fBackward )
206  {
207  // forward inductive check: p -> p -> ... -> !p
208  for ( f = 0; f < nSteps; f++ )
209  Inter_ManAppendCone( pInter, pFrames, ppNodes + f * nRegs, 0 );
210  Inter_ManAppendCone( pInter, pFrames, ppNodes + f * nRegs, 1 );
211  }
212  else
213  {
214  // backward inductive check: p -> !p -> ... -> !p
215  Inter_ManAppendCone( pInter, pFrames, ppNodes + 0 * nRegs, 1 );
216  for ( f = 1; f <= nSteps; f++ )
217  Inter_ManAppendCone( pInter, pFrames, ppNodes + f * nRegs, 0 );
218  }
219  Vec_PtrFree( vMapRegs );
220  Aig_ManCleanup( pFrames );
221 
222  // convert to CNF
223  pCnf = Cnf_Derive( pFrames, 0 );
224  pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 0 );
225 // Cnf_DataFree( pCnf );
226 // Aig_ManStop( pFrames );
227 
228  if ( pSat == NULL )
229  {
230  Cnf_DataFree( pCnf );
231  Aig_ManStop( pFrames );
232  return 1;
233  }
234 
235  // solve the problem
236  status = sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
237 
238 // Inter_ManCheckUniqueness( pTrans, pSat, pCnf, nSteps );
239 
240  Cnf_DataFree( pCnf );
241  Aig_ManStop( pFrames );
242 
243  sat_solver_delete( pSat );
244  return status == l_False;
245 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
Definition: cnfCore.c:165
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
Aig_Man_t * Inter_ManFramesLatches(Aig_Man_t *pAig, int nFrames, Vec_Ptr_t **pvMapReg)
Definition: intContain.c:111
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
Definition: cnf.h:56
void Inter_ManAppendCone(Aig_Man_t *pOld, Aig_Man_t *pNew, Aig_Obj_t **ppNewPis, int fCompl)
Definition: intContain.c:160
Definition: aig.h:69
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition: cnfMan.c:463
#define l_False
Definition: SolverTypes.h:85
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
#define assert(ex)
Definition: util_old.h:213
static void ** Vec_PtrArray(Vec_Ptr_t *p)
Definition: vecPtr.h:279
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
int Inter_ManCheckInitialState ( Aig_Man_t p)

DECLARATIONS ///.

CFile****************************************************************

FileName [intUtil.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Interpolation engine.]

Synopsis [Various interpolation utilities.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 24, 2008.]

Revision [

Id:
intUtil.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Returns 1 if the property fails in the initial state.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file intUtil.c.

47 {
48  Cnf_Dat_t * pCnf;
49  Aig_Obj_t * pObj;
50  sat_solver * pSat;
51  int i, status;
52  //abctime clk = Abc_Clock();
53  pCnf = Cnf_Derive( p, Saig_ManRegNum(p) );
54  pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 1 );
55  if ( pSat == NULL )
56  {
57  Cnf_DataFree( pCnf );
58  return 0;
59  }
60  status = sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
61  //ABC_PRT( "Time", Abc_Clock() - clk );
62  if ( status == l_True )
63  {
64  p->pSeqModel = Abc_CexAlloc( Aig_ManRegNum(p), Saig_ManPiNum(p), 1 );
65  Saig_ManForEachPi( p, pObj, i )
66  if ( sat_solver_var_value( pSat, pCnf->pVarNums[Aig_ObjId(pObj)] ) )
67  Abc_InfoSetBit( p->pSeqModel->pData, Aig_ManRegNum(p) + i );
68  }
69  Cnf_DataFree( pCnf );
70  sat_solver_delete( pSat );
71  return status == l_True;
72 }
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
Definition: cnfCore.c:165
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
Definition: utilCex.c:51
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
#define l_True
Definition: SolverTypes.h:84
Definition: cnf.h:56
static int sat_solver_var_value(sat_solver *s, int v)
Definition: satSolver.h:200
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
static void Abc_InfoSetBit(unsigned *p, int i)
Definition: abc_global.h:259
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition: cnfMan.c:463
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Definition: saig.h:73
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
static int Aig_ObjId(Aig_Obj_t *pObj)
Definition: aig.h:286
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
void Inter_ManClean ( Inter_Man_t p)

Function*************************************************************

Synopsis [Cleans the interpolation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 73 of file intMan.c.

74 {
75  if ( p->vInters )
76  {
77  Aig_Man_t * pMan;
78  int i;
79  Vec_PtrForEachEntry( Aig_Man_t *, p->vInters, pMan, i )
80  Aig_ManStop( pMan );
81  Vec_PtrClear( p->vInters );
82  }
83  if ( p->pCnfInter )
84  Cnf_DataFree( p->pCnfInter );
85  if ( p->pCnfFrames )
86  Cnf_DataFree( p->pCnfFrames );
87  if ( p->pInter )
88  Aig_ManStop( p->pInter );
89  if ( p->pFrames )
90  Aig_ManStop( p->pFrames );
91 }
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
if(last==0)
Definition: sparse_int.h:34
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Inter_Man_t* Inter_ManCreate ( Aig_Man_t pAig,
Inter_ManParams_t pPars 
)

DECLARATIONS ///.

CFile****************************************************************

FileName [intMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Interpolation engine.]

Synopsis [Interpolation manager procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 24, 2008.]

Revision [

Id:
intMan.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Creates the interpolation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file intMan.c.

47 {
48  Inter_Man_t * p;
49  // create interpolation manager
50  p = ABC_ALLOC( Inter_Man_t, 1 );
51  memset( p, 0, sizeof(Inter_Man_t) );
52  p->vVarsAB = Vec_IntAlloc( Aig_ManRegNum(pAig) );
53  p->nConfLimit = pPars->nBTLimit;
54  p->fVerbose = pPars->fVerbose;
55  p->pFileName = pPars->pFileName;
56  p->pAig = pAig;
57  if ( pPars->fDropInvar )
58  p->vInters = Vec_PtrAlloc( 100 );
59  return p;
60 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
typedefABC_NAMESPACE_HEADER_START struct Inter_Man_t_ Inter_Man_t
INCLUDES ///.
Definition: intInt.h:49
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
Aig_Man_t* Inter_ManFramesInter ( Aig_Man_t pAig,
int  nFrames,
int  fAddRegOuts,
int  fUseTwoFrames 
)

DECLARATIONS ///.

CFile****************************************************************

FileName [intFrames.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Interpolation engine.]

Synopsis [Sequential AIG unrolling for interpolation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 24, 2008.]

Revision [

Id:
intFrames.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Create timeframes of the manager for interpolation.]

Description [The resulting manager is combinational. The primary inputs corresponding to register outputs are ordered first. The only POs of the manager is the property output of the last timeframe.]

SideEffects []

SeeAlso []

Definition at line 47 of file intFrames.c.

48 {
49  Aig_Man_t * pFrames;
50  Aig_Obj_t * pObj, * pObjLi, * pObjLo;
51  Aig_Obj_t * pLastPo = NULL;
52  int i, f;
53  assert( Saig_ManRegNum(pAig) > 0 );
54  assert( Saig_ManPoNum(pAig)-Saig_ManConstrNum(pAig) == 1 );
55  pFrames = Aig_ManStart( Aig_ManNodeNum(pAig) * nFrames );
56  // map the constant node
57  Aig_ManConst1(pAig)->pData = Aig_ManConst1( pFrames );
58  // create variables for register outputs
59  if ( fAddRegOuts )
60  {
61  Saig_ManForEachLo( pAig, pObj, i )
62  pObj->pData = Aig_ManConst0( pFrames );
63  }
64  else
65  {
66  Saig_ManForEachLo( pAig, pObj, i )
67  pObj->pData = Aig_ObjCreateCi( pFrames );
68  }
69  // add timeframes
70  for ( f = 0; f < nFrames; f++ )
71  {
72  // create PI nodes for this frame
73  Saig_ManForEachPi( pAig, pObj, i )
74  pObj->pData = Aig_ObjCreateCi( pFrames );
75  // add internal nodes of this frame
76  Aig_ManForEachNode( pAig, pObj, i )
77  pObj->pData = Aig_And( pFrames, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
78  // add outputs for constraints
79  Saig_ManForEachPo( pAig, pObj, i )
80  {
81  if ( i < Saig_ManPoNum(pAig)-Saig_ManConstrNum(pAig) )
82  continue;
83  Aig_ObjCreateCo( pFrames, Aig_Not( Aig_ObjChild0Copy(pObj) ) );
84  }
85  if ( f == nFrames - 1 )
86  break;
87  // remember the last PO
88  pObj = Aig_ManCo( pAig, 0 );
89  pLastPo = Aig_ObjChild0Copy(pObj);
90  // save register inputs
91  Saig_ManForEachLi( pAig, pObj, i )
92  pObj->pData = Aig_ObjChild0Copy(pObj);
93  // transfer to register outputs
94  Saig_ManForEachLiLo( pAig, pObjLi, pObjLo, i )
95  pObjLo->pData = pObjLi->pData;
96  }
97  // create POs for each register output
98  if ( fAddRegOuts )
99  {
100  Saig_ManForEachLi( pAig, pObj, i )
101  Aig_ObjCreateCo( pFrames, Aig_ObjChild0Copy(pObj) );
102  }
103  // create the only PO of the manager
104  else
105  {
106  pObj = Aig_ManCo( pAig, 0 );
107  // add the last PO
108  if ( pLastPo == NULL || !fUseTwoFrames )
109  pLastPo = Aig_ObjChild0Copy(pObj);
110  else
111  pLastPo = Aig_Or( pFrames, pLastPo, Aig_ObjChild0Copy(pObj) );
112  Aig_ObjCreateCo( pFrames, pLastPo );
113  }
114  Aig_ManCleanup( pFrames );
115  return pFrames;
116 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
static int Saig_ManPoNum(Aig_Man_t *p)
Definition: saig.h:74
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
Definition: saig.h:101
void * pData
Definition: aig.h:87
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
static Aig_Obj_t * Aig_ManConst0(Aig_Man_t *p)
Definition: aig.h:263
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Definition: aig.h:247
for(p=first;p->value< newval;p=p->next)
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static int Saig_ManConstrNum(Aig_Man_t *p)
Definition: saig.h:78
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
#define Saig_ManForEachLi(p, pObj, i)
Definition: saig.h:98
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Definition: aig.h:313
Aig_Obj_t * Aig_Or(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:259
Definition: aig.h:69
#define Saig_ManForEachLo(p, pObj, i)
Definition: saig.h:96
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Definition: aig.h:312
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
#define Saig_ManForEachPo(p, pObj, i)
Definition: saig.h:93
#define assert(ex)
Definition: util_old.h:213
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
void* Inter_ManGetCounterExample ( Aig_Man_t pAig,
int  nFrames,
int  fVerbose 
)

Function*************************************************************

Synopsis [Run the SAT solver on the unrolled instance.]

Description []

SideEffects []

SeeAlso []

Definition at line 95 of file intCtrex.c.

96 {
97  int nConfLimit = 1000000;
98  Abc_Cex_t * pCtrex = NULL;
99  Aig_Man_t * pFrames;
100  sat_solver * pSat;
101  Cnf_Dat_t * pCnf;
102  int status;
103  abctime clk = Abc_Clock();
104  Vec_Int_t * vCiIds;
105  // create timeframes
106  assert( Saig_ManPoNum(pAig) == 1 );
107  pFrames = Inter_ManFramesBmc( pAig, nFrames );
108  // derive CNF
109  pCnf = Cnf_Derive( pFrames, 0 );
110  Cnf_DataTranformPolarity( pCnf, 0 );
111  vCiIds = Cnf_DataCollectPiSatNums( pCnf, pFrames );
112  Aig_ManStop( pFrames );
113  // convert into SAT solver
114  pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 0 );
115  Cnf_DataFree( pCnf );
116  if ( pSat == NULL )
117  {
118  printf( "Counter-example generation in command \"int\" has failed.\n" );
119  printf( "Use command \"bmc2\" to produce a valid counter-example.\n" );
120  Vec_IntFree( vCiIds );
121  return NULL;
122  }
123  // simplify the problem
124  status = sat_solver_simplify(pSat);
125  if ( status == 0 )
126  {
127  Vec_IntFree( vCiIds );
128  sat_solver_delete( pSat );
129  return NULL;
130  }
131  // solve the miter
132  status = sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
133  // if the problem is SAT, get the counterexample
134  if ( status == l_True )
135  {
136  int i, * pModel = Sat_SolverGetModel( pSat, vCiIds->pArray, vCiIds->nSize );
137  pCtrex = Abc_CexAlloc( Saig_ManRegNum(pAig), Saig_ManPiNum(pAig), nFrames );
138  pCtrex->iFrame = nFrames - 1;
139  pCtrex->iPo = 0;
140  for ( i = 0; i < Vec_IntSize(vCiIds); i++ )
141  if ( pModel[i] )
142  Abc_InfoSetBit( pCtrex->pData, Saig_ManRegNum(pAig) + i );
143  ABC_FREE( pModel );
144  }
145  // free the sat_solver
146  sat_solver_delete( pSat );
147  Vec_IntFree( vCiIds );
148  // verify counter-example
149  status = Saig_ManVerifyCex( pAig, pCtrex );
150  if ( status == 0 )
151  printf( "Inter_ManGetCounterExample(): Counter-example verification has FAILED.\n" );
152  // report the results
153  if ( fVerbose )
154  {
155  ABC_PRT( "Total ctrex generation time", Abc_Clock() - clk );
156  }
157  return pCtrex;
158 
159 }
ABC_NAMESPACE_IMPL_START Aig_Man_t * Inter_ManFramesBmc(Aig_Man_t *pAig, int nFrames)
DECLARATIONS ///.
Definition: intCtrex.c:46
static int Saig_ManPoNum(Aig_Man_t *p)
Definition: saig.h:74
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
Definition: cnfCore.c:165
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
Definition: utilCex.c:51
int Saig_ManVerifyCex(Aig_Man_t *pAig, Abc_Cex_t *p)
Definition: saigDup.c:279
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
void Cnf_DataTranformPolarity(Cnf_Dat_t *pCnf, int fTransformPos)
Definition: cnfMan.c:652
#define l_True
Definition: SolverTypes.h:84
static abctime Abc_Clock()
Definition: abc_global.h:279
Definition: cnf.h:56
Vec_Int_t * Cnf_DataCollectPiSatNums(Cnf_Dat_t *pCnf, Aig_Man_t *p)
Definition: cnfMan.c:104
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
static void Abc_InfoSetBit(unsigned *p, int i)
Definition: abc_global.h:259
int sat_solver_simplify(sat_solver *s)
Definition: satSolver.c:1276
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition: cnfMan.c:463
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Definition: saig.h:73
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_PRT(a, t)
Definition: abc_global.h:220
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
ABC_INT64_T abctime
Definition: abc_global.h:278
int * Sat_SolverGetModel(sat_solver *p, int *pVars, int nVars)
Definition: satUtil.c:266
int Inter_ManPerformOneStep ( Inter_Man_t p,
int  fUseBias,
int  fUseBackward,
abctime  nTimeNewOut 
)

Function*************************************************************

Synopsis [Performs one SAT run with interpolation.]

Description [Returns 1 if proven. 0 if failed. -1 if undecided.]

SideEffects []

SeeAlso []

Definition at line 203 of file intM114.c.

204 {
205  sat_solver * pSat;
206  void * pSatCnf = NULL;
207  Inta_Man_t * pManInterA;
208 // Intb_Man_t * pManInterB;
209  int * pGlobalVars;
210  int status, RetValue;
211  int i, Var;
212  abctime clk;
213 // assert( p->pInterNew == NULL );
214 
215  // derive the SAT solver
216  pSat = Inter_ManDeriveSatSolver( p->pInter, p->pCnfInter, p->pAigTrans, p->pCnfAig, p->pFrames, p->pCnfFrames, p->vVarsAB, fUseBackward );
217  if ( pSat == NULL )
218  {
219  p->pInterNew = NULL;
220  return 1;
221  }
222 
223  // set runtime limit
224  if ( nTimeNewOut )
225  sat_solver_set_runtime_limit( pSat, nTimeNewOut );
226 
227  // collect global variables
228  pGlobalVars = ABC_CALLOC( int, sat_solver_nvars(pSat) );
229  Vec_IntForEachEntry( p->vVarsAB, Var, i )
230  pGlobalVars[Var] = 1;
231  pSat->pGlobalVars = fUseBias? pGlobalVars : NULL;
232 
233  // solve the problem
234 clk = Abc_Clock();
235  status = sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)p->nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
236  p->nConfCur = pSat->stats.conflicts;
237 p->timeSat += Abc_Clock() - clk;
238 
239  pSat->pGlobalVars = NULL;
240  ABC_FREE( pGlobalVars );
241  if ( status == l_False )
242  {
243  pSatCnf = sat_solver_store_release( pSat );
244  RetValue = 1;
245  }
246  else if ( status == l_True )
247  {
248  RetValue = 0;
249  }
250  else
251  {
252  RetValue = -1;
253  }
254  sat_solver_delete( pSat );
255  if ( pSatCnf == NULL )
256  return RetValue;
257 
258  // create the resulting manager
259 clk = Abc_Clock();
260 /*
261  if ( !fUseIp )
262  {
263  pManInterA = Inta_ManAlloc();
264  p->pInterNew = Inta_ManInterpolate( pManInterA, pSatCnf, p->vVarsAB, 0 );
265  Inta_ManFree( pManInterA );
266  }
267  else
268  {
269  Aig_Man_t * pInterNew2;
270  int RetValue;
271 
272  pManInterA = Inta_ManAlloc();
273  p->pInterNew = Inta_ManInterpolate( pManInterA, pSatCnf, p->vVarsAB, 0 );
274 // Inter_ManVerifyInterpolant1( pManInterA, pSatCnf, p->pInterNew );
275  Inta_ManFree( pManInterA );
276 
277  pManInterB = Intb_ManAlloc();
278  pInterNew2 = Intb_ManInterpolate( pManInterB, pSatCnf, p->vVarsAB, 0 );
279  Inter_ManVerifyInterpolant2( pManInterB, pSatCnf, pInterNew2 );
280  Intb_ManFree( pManInterB );
281 
282  // check relationship
283  RetValue = Inter_ManCheckEquivalence( pInterNew2, p->pInterNew );
284  if ( RetValue )
285  printf( "Equivalence \"Ip == Im\" holds\n" );
286  else
287  {
288 // printf( "Equivalence \"Ip == Im\" does not hold\n" );
289  RetValue = Inter_ManCheckContainment( pInterNew2, p->pInterNew );
290  if ( RetValue )
291  printf( "Containment \"Ip -> Im\" holds\n" );
292  else
293  printf( "Containment \"Ip -> Im\" does not hold\n" );
294 
295  RetValue = Inter_ManCheckContainment( p->pInterNew, pInterNew2 );
296  if ( RetValue )
297  printf( "Containment \"Im -> Ip\" holds\n" );
298  else
299  printf( "Containment \"Im -> Ip\" does not hold\n" );
300  }
301 
302  Aig_ManStop( pInterNew2 );
303  }
304 */
305 
306  pManInterA = Inta_ManAlloc();
307  p->pInterNew = (Aig_Man_t *)Inta_ManInterpolate( pManInterA, (Sto_Man_t *)pSatCnf, nTimeNewOut, p->vVarsAB, 0 );
308  Inta_ManFree( pManInterA );
309 
310 p->timeInt += Abc_Clock() - clk;
311  Sto_ManFree( (Sto_Man_t *)pSatCnf );
312  if ( p->pInterNew == NULL )
313  RetValue = -1;
314  return RetValue;
315 }
static abctime sat_solver_set_runtime_limit(sat_solver *s, abctime Limit)
Definition: satSolver.h:233
Inta_Man_t * Inta_ManAlloc()
FUNCTION DEFINITIONS ///.
Definition: satInterA.c:106
void * Inta_ManInterpolate(Inta_Man_t *p, Sto_Man_t *pCnf, abctime TimeToStop, void *vVarsAB, int fVerbose)
Definition: satInterA.c:944
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int sat_solver_solve(sat_solver *s, lit *begin, lit *end, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, ABC_INT64_T nConfLimitGlobal, ABC_INT64_T nInsLimitGlobal)
Definition: satSolver.c:1700
void sat_solver_delete(sat_solver *s)
Definition: satSolver.c:1141
void * sat_solver_store_release(sat_solver *s)
Definition: satSolver.c:1949
#define l_True
Definition: SolverTypes.h:84
static abctime Abc_Clock()
Definition: abc_global.h:279
int sat_solver_nvars(sat_solver *s)
Definition: satSolver.c:1896
if(last==0)
Definition: sparse_int.h:34
ABC_NAMESPACE_IMPL_START sat_solver * Inter_ManDeriveSatSolver(Aig_Man_t *pInter, Cnf_Dat_t *pCnfInter, Aig_Man_t *pAig, Cnf_Dat_t *pCnfAig, Aig_Man_t *pFrames, Cnf_Dat_t *pCnfFrames, Vec_Int_t *vVarsAB, int fUseBackward)
DECLARATIONS ///.
Definition: intM114.c:46
void Sto_ManFree(Sto_Man_t *p)
Definition: satStore.c:143
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Inta_ManFree(Inta_Man_t *p)
Definition: satInterA.c:250
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
#define l_False
Definition: SolverTypes.h:85
int Var
Definition: SolverTypes.h:42
abctime timeSat
Definition: abcDar.c:3799
ABC_INT64_T abctime
Definition: abc_global.h:278
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
Aig_Man_t* Inter_ManStartDuplicated ( Aig_Man_t p)

Function*************************************************************

Synopsis [Duplicate the AIG w/o POs.]

Description []

SideEffects []

SeeAlso []

Definition at line 73 of file intDup.c.

74 {
75  Aig_Man_t * pNew;
76  Aig_Obj_t * pObj;
77  int i;
78  assert( Aig_ManRegNum(p) > 0 );
79  // create the new manager
80  pNew = Aig_ManStart( Aig_ManObjNumMax(p) );
81  pNew->pName = Abc_UtilStrsav( p->pName );
82  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
83  // create the PIs
86  Aig_ManForEachCi( p, pObj, i )
87  pObj->pData = Aig_ObjCreateCi( pNew );
88  // set registers
89  pNew->nTruePis = p->nTruePis;
90  pNew->nTruePos = Saig_ManConstrNum(p);
91  pNew->nRegs = p->nRegs;
92  // duplicate internal nodes
93  Aig_ManForEachNode( p, pObj, i )
94  pObj->pData = Aig_And( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
95 
96  // create constraint outputs
97  Saig_ManForEachPo( p, pObj, i )
98  {
99  if ( i < Saig_ManPoNum(p)-Saig_ManConstrNum(p) )
100  continue;
101  Aig_ObjCreateCo( pNew, Aig_Not( Aig_ObjChild0Copy(pObj) ) );
102  }
103 
104  // create register inputs with MUXes
105  Saig_ManForEachLi( p, pObj, i )
106  Aig_ObjCreateCo( pNew, Aig_ObjChild0Copy(pObj) );
107  Aig_ManCleanup( pNew );
108  return pNew;
109 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
static int Saig_ManPoNum(Aig_Man_t *p)
Definition: saig.h:74
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void * pData
Definition: aig.h:87
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Definition: aig.h:247
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static int Saig_ManConstrNum(Aig_Man_t *p)
Definition: saig.h:78
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
#define Saig_ManForEachLi(p, pObj, i)
Definition: saig.h:98
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Definition: aig.h:313
Definition: aig.h:69
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Definition: aig.h:312
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
#define Saig_ManForEachPo(p, pObj, i)
Definition: saig.h:93
#define assert(ex)
Definition: util_old.h:213
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
void Aig_ManCleanData(Aig_Man_t *p)
Definition: aigUtil.c:205
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
Aig_Man_t* Inter_ManStartInitState ( int  nRegs)

DECLARATIONS ///.

CFile****************************************************************

FileName [intDup.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Interpolation engine.]

Synopsis [Specialized AIG duplication procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 24, 2008.]

Revision [

Id:
intDup.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Create trivial AIG manager for the init state.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file intDup.c.

46 {
47  Aig_Man_t * p;
48  Aig_Obj_t * pRes;
49  Aig_Obj_t ** ppInputs;
50  int i;
51  assert( nRegs > 0 );
52  ppInputs = ABC_ALLOC( Aig_Obj_t *, nRegs );
53  p = Aig_ManStart( nRegs );
54  for ( i = 0; i < nRegs; i++ )
55  ppInputs[i] = Aig_Not( Aig_ObjCreateCi(p) );
56  pRes = Aig_Multi( p, ppInputs, nRegs, AIG_OBJ_AND );
57  Aig_ObjCreateCo( p, pRes );
58  ABC_FREE( ppInputs );
59  return p;
60 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Definition: aig.h:247
Definition: aig.h:69
Aig_Obj_t * Aig_Multi(Aig_Man_t *p, Aig_Obj_t **pArgs, int nArgs, Aig_Type_t Type)
Definition: aigOper.c:413
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define assert(ex)
Definition: util_old.h:213
Aig_Man_t* Inter_ManStartOneOutput ( Aig_Man_t p,
int  fAddFirstPo 
)

Function*************************************************************

Synopsis [Duplicate the AIG w/o POs and transforms to transit into init state.]

Description []

SideEffects []

SeeAlso []

Definition at line 122 of file intDup.c.

123 {
124  Aig_Man_t * pNew;
125  Aig_Obj_t * pObj, * pObjLi, * pObjLo;
126  Aig_Obj_t * pCtrl = NULL; // Suppress "might be used uninitialized"
127  int i;
128  assert( Aig_ManRegNum(p) > 0 );
129  // create the new manager
130  pNew = Aig_ManStart( Aig_ManObjNumMax(p) );
131  pNew->pName = Abc_UtilStrsav( p->pName );
132  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
133  // create the PIs
134  Aig_ManCleanData( p );
136  Aig_ManForEachCi( p, pObj, i )
137  {
138  if ( i == Saig_ManPiNum(p) )
139  pCtrl = Aig_ObjCreateCi( pNew );
140  pObj->pData = Aig_ObjCreateCi( pNew );
141  }
142  // set registers
143  pNew->nRegs = fAddFirstPo? 0 : p->nRegs;
144  pNew->nTruePis = fAddFirstPo? Aig_ManCiNum(p) + 1 : p->nTruePis + 1;
145  pNew->nTruePos = fAddFirstPo + Saig_ManConstrNum(p);
146  // duplicate internal nodes
147  Aig_ManForEachNode( p, pObj, i )
148  pObj->pData = Aig_And( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
149 
150  // create constraint outputs
151  Saig_ManForEachPo( p, pObj, i )
152  {
153  if ( i < Saig_ManPoNum(p)-Saig_ManConstrNum(p) )
154  continue;
155  Aig_ObjCreateCo( pNew, Aig_Not( Aig_ObjChild0Copy(pObj) ) );
156  }
157 
158  // add the PO
159  if ( fAddFirstPo )
160  {
161  pObj = Aig_ManCo( p, 0 );
162  Aig_ObjCreateCo( pNew, Aig_ObjChild0Copy(pObj) );
163  }
164  else
165  {
166  // create register inputs with MUXes
167  Saig_ManForEachLiLo( p, pObjLi, pObjLo, i )
168  {
169  pObj = Aig_Mux( pNew, pCtrl, (Aig_Obj_t *)pObjLo->pData, Aig_ObjChild0Copy(pObjLi) );
170  // pObj = Aig_Mux( pNew, pCtrl, Aig_ManConst0(pNew), Aig_ObjChild0Copy(pObjLi) );
171  Aig_ObjCreateCo( pNew, pObj );
172  }
173  }
174  Aig_ManCleanup( pNew );
175  return pNew;
176 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
static int Saig_ManPoNum(Aig_Man_t *p)
Definition: saig.h:74
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Saig_ManForEachLiLo(p, pObjLi, pObjLo, i)
Definition: saig.h:101
void * pData
Definition: aig.h:87
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Definition: aig.h:247
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static int Saig_ManConstrNum(Aig_Man_t *p)
Definition: saig.h:78
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Definition: aig.h:313
Definition: aig.h:69
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Definition: aig.h:312
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static Aig_Obj_t * Aig_ManCo(Aig_Man_t *p, int i)
Definition: aig.h:267
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
Aig_Obj_t * Aig_Mux(Aig_Man_t *p, Aig_Obj_t *pC, Aig_Obj_t *p1, Aig_Obj_t *p0)
Definition: aigOper.c:317
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Definition: saig.h:73
#define Saig_ManForEachPo(p, pObj, i)
Definition: saig.h:93
#define assert(ex)
Definition: util_old.h:213
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
void Aig_ManCleanData(Aig_Man_t *p)
Definition: aigUtil.c:205
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
void Inter_ManStop ( Inter_Man_t p,
int  fProved 
)

Function*************************************************************

Synopsis [Frees the interpolation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 128 of file intMan.c.

129 {
130  if ( p->fVerbose )
131  {
132  p->timeOther = p->timeTotal-p->timeRwr-p->timeCnf-p->timeSat-p->timeInt-p->timeEqu;
133  printf( "Runtime statistics:\n" );
134  ABC_PRTP( "Rewriting ", p->timeRwr, p->timeTotal );
135  ABC_PRTP( "CNF mapping", p->timeCnf, p->timeTotal );
136  ABC_PRTP( "SAT solving", p->timeSat, p->timeTotal );
137  ABC_PRTP( "Interpol ", p->timeInt, p->timeTotal );
138  ABC_PRTP( "Containment", p->timeEqu, p->timeTotal );
139  ABC_PRTP( "Other ", p->timeOther, p->timeTotal );
140  ABC_PRTP( "TOTAL ", p->timeTotal, p->timeTotal );
141  }
142 
143  if ( p->vInters )
144  Inter_ManInterDump( p, fProved );
145 
146  if ( p->pCnfAig )
147  Cnf_DataFree( p->pCnfAig );
148  if ( p->pAigTrans )
149  Aig_ManStop( p->pAigTrans );
150  if ( p->pInterNew )
151  Aig_ManStop( p->pInterNew );
152  Inter_ManClean( p );
153  Vec_PtrFreeP( &p->vInters );
154  Vec_IntFreeP( &p->vVarsAB );
155  ABC_FREE( p );
156 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
#define ABC_PRTP(a, t, T)
Definition: abc_global.h:223
void Inter_ManInterDump(Inter_Man_t *p, int fProved)
Definition: intMan.c:104
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_PtrFreeP(Vec_Ptr_t **p)
Definition: vecPtr.h:240
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
void Inter_ManClean(Inter_Man_t *p)
Definition: intMan.c:73