@@ -102,100 +102,6 @@ smt2_dect::solvert cbmc_solverst::get_smt2_solver_type() const
102
102
return s;
103
103
}
104
104
105
- /* ******************************************************************\
106
-
107
- Class: cbmc_solver_with_propt
108
-
109
- Purpose: Solvers with additional objects
110
-
111
- \*******************************************************************/
112
-
113
- class cbmc_solver_with_propt :public cbmc_solverst ::solvert
114
- {
115
- public:
116
- cbmc_solver_with_propt (
117
- prop_convt *_prop_conv,
118
- propt *_prop):
119
- cbmc_solverst::solvert (_prop_conv),
120
- prop (_prop)
121
- {
122
- assert (_prop!=NULL );
123
- }
124
-
125
- ~cbmc_solver_with_propt ()
126
- {
127
- delete prop;
128
- }
129
-
130
- protected:
131
- propt *prop;
132
- };
133
-
134
- /* ******************************************************************\
135
-
136
- Class: cbmc_solver_with_aigpropt
137
-
138
- Purpose: Solvers with additional objects
139
-
140
- \*******************************************************************/
141
-
142
- class cbmc_solver_with_aigpropt :public cbmc_solver_with_propt
143
- {
144
- public:
145
- cbmc_solver_with_aigpropt (
146
- prop_convt *_prop_conv,
147
- propt *_prop,
148
- aigt *_aig):
149
- cbmc_solver_with_propt (_prop_conv, _prop),
150
- aig (_aig)
151
- {
152
- assert (_aig!=NULL );
153
- }
154
-
155
- ~cbmc_solver_with_aigpropt ()
156
- {
157
- // delete prop before the AIG
158
- delete prop;
159
- prop=NULL ;
160
- delete aig;
161
- }
162
-
163
- protected:
164
- aigt *aig;
165
- };
166
-
167
- /* ******************************************************************\
168
-
169
- Class: cbmc_solver_with_filet
170
-
171
- Purpose: Solvers with additional objects
172
-
173
- \*******************************************************************/
174
-
175
- class cbmc_solver_with_filet :public cbmc_solverst ::solvert
176
- {
177
- public:
178
- cbmc_solver_with_filet (
179
- prop_convt *_prop_conv,
180
- std::ofstream *_out):
181
- cbmc_solverst::solvert (_prop_conv),
182
- out (_out)
183
- {
184
- assert (_out!=NULL );
185
- }
186
-
187
- ~cbmc_solver_with_filet ()
188
- {
189
- // delete the prop before the file
190
- delete prop_conv_ptr;
191
- prop_conv_ptr=NULL ;
192
- delete out;
193
- }
194
-
195
- protected:
196
- std::ofstream *out;
197
- };
198
-
199
105
/* ******************************************************************\
200
106
201
107
Function: cbmc_solverst::get_default
@@ -210,45 +116,30 @@ Function: cbmc_solverst::get_default
210
116
211
117
cbmc_solverst::solvert* cbmc_solverst::get_default ()
212
118
{
213
- solvert *solver;
119
+ solvert *solver= new solvert ;
214
120
215
121
if (options.get_bool_option (" beautify" ) ||
216
122
!options.get_bool_option (" sat-preprocessor" )) // no simplifier
217
123
{
218
124
// simplifier won't work with beautification
219
- propt *prop=new satcheck_no_simplifiert ();
220
- prop->set_message_handler (get_message_handler ());
221
-
222
- bv_cbmct *bv_cbmc=new bv_cbmct (ns, *prop);
223
-
224
- if (options.get_option (" arrays-uf" )==" never" )
225
- bv_cbmc->unbounded_array =bv_cbmct::U_NONE;
226
- else if (options.get_option (" arrays-uf" )==" always" )
227
- bv_cbmc->unbounded_array =bv_cbmct::U_ALL;
228
-
229
- solver=new cbmc_solver_with_propt (bv_cbmc, prop);
125
+ solver->set_prop (new satcheck_no_simplifiert ());
230
126
}
231
127
else // with simplifier
232
128
{
233
- #if 1
234
- propt *prop=new satcheckt ();
235
- prop->set_message_handler (get_message_handler ());
236
- bv_cbmct *bv_cbmc=new bv_cbmct (ns, *prop);
237
- solver=new cbmc_solver_with_propt (bv_cbmc, prop);
238
- #else
239
- aigt *aig=new aigt();
240
- propt *prop=new aig_propt(*aig);
241
- prop->set_message_handler(get_message_handler());
242
- bv_cbmct *bv_cbmc=new bv_cbmct(ns, *prop);
243
- solver=new cbmc_solver_with_aigpropt(bv_cbmc, prop, aig);
244
- #endif
245
-
246
- if (options.get_option (" arrays-uf" )==" never" )
247
- bv_cbmc->unbounded_array =bv_cbmct::U_NONE;
248
- else if (options.get_option (" arrays-uf" )==" always" )
249
- bv_cbmc->unbounded_array =bv_cbmct::U_ALL;
129
+ solver->set_prop (new satcheckt ());
250
130
}
251
131
132
+ solver->prop ().set_message_handler (get_message_handler ());
133
+
134
+ bv_cbmct *bv_cbmc=new bv_cbmct (ns, solver->prop ());
135
+
136
+ if (options.get_option (" arrays-uf" )==" never" )
137
+ bv_cbmc->unbounded_array =bv_cbmct::U_NONE;
138
+ else if (options.get_option (" arrays-uf" )==" always" )
139
+ bv_cbmc->unbounded_array =bv_cbmct::U_ALL;
140
+
141
+ solver->set_prop_conv (bv_cbmc);
142
+
252
143
return solver;
253
144
}
254
145
@@ -274,8 +165,7 @@ cbmc_solverst::solvert* cbmc_solverst::get_dimacs()
274
165
275
166
std::string filename=options.get_option (" outfile" );
276
167
277
- return
278
- new cbmc_solver_with_propt (new cbmc_dimacst (ns, *prop, filename), prop);
168
+ return new solvert (new cbmc_dimacst (ns, *prop, filename), prop);
279
169
}
280
170
281
171
/* ******************************************************************\
@@ -318,7 +208,7 @@ cbmc_solverst::solvert* cbmc_solverst::get_bv_refinement()
318
208
bv_refinement->do_arithmetic_refinement =
319
209
options.get_bool_option (" refine-arithmetic" );
320
210
321
- return new cbmc_solver_with_propt (bv_refinement, prop);
211
+ return new solvert (bv_refinement, prop);
322
212
}
323
213
324
214
/* ******************************************************************\
@@ -398,7 +288,7 @@ cbmc_solverst::solvert* cbmc_solverst::get_smt1(smt1_dect::solvert solver)
398
288
399
289
smt1_conv->set_message_handler (get_message_handler ());
400
290
401
- return new cbmc_solver_with_filet (smt1_conv, out);
291
+ return new solvert (smt1_conv, out);
402
292
}
403
293
}
404
294
@@ -487,7 +377,7 @@ cbmc_solverst::solvert* cbmc_solverst::get_smt2(smt2_dect::solvert solver)
487
377
488
378
smt2_conv->set_message_handler (get_message_handler ());
489
379
490
- return new cbmc_solver_with_filet (smt2_conv, out);
380
+ return new solvert (smt2_conv, out);
491
381
}
492
382
}
493
383
0 commit comments