DECLARATIONS ///.
Date [Ver. 1.0. Started - June 30, 2007.]
] FUNCTION DEFINITIONS /// Function*************************************************************
47{
50 int * pStart;
51 int RetValue, Beg, End, i, k;
52 int CounterBase = 0, CounterInd = 0;
54
55 if ( nFrames != 1 )
56 {
57 printf( "Invariant verification: Can only verify for K = 1\n" );
58 return 1;
59 }
60
61
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
79
80 Beg = 0;
81 pStart = Vec_IntArray( vLits );
83 {
84
85 for ( k = Beg; k < End; k++ )
86 pStart[k] = lit_neg(pStart[k]);
88 for ( k = Beg; k < End; k++ )
89 pStart[k] = lit_neg(pStart[k]);
90 Beg = End;
92 continue;
93
94 CounterBase++;
95 }
97
98
101
102 Beg = 0;
103 pStart = Vec_IntArray( vLits );
105 {
107 Beg = End;
108 if ( RetValue == 0 )
109 {
112 printf( "Invariant verification: SAT solver is unsat after adding a clause.\n" );
113 return 0;
114 }
115 }
116
118 {
122 }
123
124
125 Beg = 0;
126 pStart = Vec_IntArray( vLits );
128 {
129
130 for ( k = Beg; k < End; k++ )
131 {
132 pStart[k] += 2 * pCnf->
nVars;
133 pStart[k] = lit_neg(pStart[k]);
134 }
135 RetValue =
sat_solver_solve( pSat, pStart + Beg, pStart + End, 0, 0, 0, 0 );
136 for ( k = Beg; k < End; k++ )
137 {
138 pStart[k] = lit_neg(pStart[k]);
139 pStart[k] -= 2 * pCnf->
nVars;
140 }
141 Beg = End;
143 continue;
144
145 CounterInd++;
146 }
149 if ( CounterBase )
150 printf( "Invariant verification: %d clauses (out of %d) FAILED the base case.\n", CounterBase, Vec_IntSize(vClauses) );
151 if ( CounterInd )
152 printf( "Invariant verification: %d clauses (out of %d) FAILED the inductive case.\n", CounterInd, Vec_IntSize(vClauses) );
153 if ( CounterBase || CounterInd )
154 return 0;
155 printf( "Invariant verification: %d clauses verified correctly. ", Vec_IntSize(vClauses) );
156 ABC_PRT(
"Time", Abc_Clock() - clk );
157 return 1;
158}
#define sat_solver_addclause
Cnf_Dat_t * Cnf_DeriveSimple(Aig_Man_t *p, int nOutputs)
struct Cnf_Dat_t_ Cnf_Dat_t
void Cnf_DataFree(Cnf_Dat_t *p)
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
int sat_solver_simplify(sat_solver *s)
void sat_solver_delete(sat_solver *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.