abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
intUtil.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [intUtil.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Interpolation engine.]
8 
9  Synopsis [Various interpolation utilities.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 24, 2008.]
16 
17  Revision [$Id: intUtil.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "intInt.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// FUNCTION DEFINITIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 
35 /**Function*************************************************************
36 
37  Synopsis [Returns 1 if the property fails in the initial state.]
38 
39  Description []
40 
41  SideEffects []
42 
43  SeeAlso []
44 
45 ***********************************************************************/
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 }
73 
74 /**Function*************************************************************
75 
76  Synopsis [Returns 1 if the property holds in all states.]
77 
78  Description []
79 
80  SideEffects []
81 
82  SeeAlso []
83 
84 ***********************************************************************/
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 }
101 
102 ////////////////////////////////////////////////////////////////////////
103 /// END OF FILE ///
104 ////////////////////////////////////////////////////////////////////////
105 
106 
108 
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
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
int * pVarNums
Definition: cnf.h:63
#define l_True
Definition: SolverTypes.h:84
static abctime Abc_Clock()
Definition: abc_global.h:279
Definition: cnf.h:56
static int sat_solver_var_value(sat_solver *s, int v)
Definition: satSolver.h:200
ABC_NAMESPACE_IMPL_START int Inter_ManCheckInitialState(Aig_Man_t *p)
DECLARATIONS ///.
Definition: intUtil.c:46
Cnf_Dat_t * pCnf
Definition: intCheck.c:36
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
Definition: aig.h:69
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
static void Abc_InfoSetBit(unsigned *p, int i)
Definition: abc_global.h:259
int Inter_ManCheckAllStates(Aig_Man_t *p)
Definition: intUtil.c:85
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
#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
static int Aig_ObjId(Aig_Obj_t *pObj)
Definition: aig.h:286
ABC_INT64_T abctime
Definition: abc_global.h:278
sat_solver * pSat
Definition: intCheck.c:37
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91