Skip to content

Commit 9bb9d1a

Browse files
Rename prop_convt to decision_procedure_incrementalt
decision_procedure_incrementalt will then be further split into support for assumptions and contexts.
1 parent f45c69c commit 9bb9d1a

30 files changed

+308
-242
lines changed

jbmc/src/jbmc/all_properties.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Author: Daniel Kroening, [email protected]
2020
#include <util/json.h>
2121
#include <util/xml.h>
2222

23-
#include <solvers/prop/prop_conv.h>
23+
#include <solvers/prop/decision_procedure.h>
2424
#include <solvers/sat/satcheck.h>
2525

2626
#include <goto-programs/json_goto_trace.h>
@@ -61,7 +61,7 @@ safety_checkert::resultt bmc_all_propertiest::operator()()
6161
auto solver_start = std::chrono::steady_clock::now();
6262

6363
convert_symex_target_equation(
64-
bmc.equation, bmc.prop_conv, get_message_handler());
64+
bmc.equation, bmc.decision_procedure, get_message_handler());
6565
bmc.freeze_program_variables();
6666

6767
// Collect _all_ goals in `goal_map'.
@@ -301,7 +301,8 @@ void bmc_all_propertiest::report(const cover_goalst &cover_goals)
301301
safety_checkert::resultt
302302
bmct::all_properties(const goto_functionst &goto_functions)
303303
{
304-
bmc_all_propertiest bmc_all_properties(goto_functions, prop_conv, *this);
304+
bmc_all_propertiest bmc_all_properties(
305+
goto_functions, decision_procedure, *this);
305306
bmc_all_properties.set_message_handler(get_message_handler());
306307
return bmc_all_properties();
307308
}

jbmc/src/jbmc/all_properties_class.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class bmc_all_propertiest : public cover_goalst::observert, public messaget
2222
public:
2323
bmc_all_propertiest(
2424
const goto_functionst &_goto_functions,
25-
prop_convt &_solver,
25+
decision_procedure_incrementalt &_solver,
2626
bmct &_bmc)
2727
: goto_functions(_goto_functions), solver(_solver), bmc(_bmc)
2828
{
@@ -96,7 +96,7 @@ class bmc_all_propertiest : public cover_goalst::observert, public messaget
9696

9797
protected:
9898
const goto_functionst &goto_functions;
99-
prop_convt &solver;
99+
decision_procedure_incrementalt &solver;
100100
bmct &bmc;
101101

102102
virtual void report(const cover_goalst &cover_goals);

jbmc/src/jbmc/bmc.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,20 @@ void bmct::freeze_program_variables()
4242

4343
decision_proceduret::resultt bmct::run_decision_procedure()
4444
{
45-
status() << "Passing problem to " << prop_conv.decision_procedure_text()
46-
<< eom;
45+
status() << "Passing problem to "
46+
<< decision_procedure.decision_procedure_text() << eom;
4747

4848
auto solver_start = std::chrono::steady_clock::now();
4949

50-
convert_symex_target_equation(equation, prop_conv, get_message_handler());
50+
convert_symex_target_equation(
51+
equation, decision_procedure, get_message_handler());
5152

5253
// hook for cegis to freeze synthesis program vars
5354
freeze_program_variables();
5455

55-
status() << "Running " << prop_conv.decision_procedure_text() << eom;
56+
status() << "Running " << decision_procedure.decision_procedure_text() << eom;
5657

57-
decision_proceduret::resultt dec_result = prop_conv();
58+
decision_proceduret::resultt dec_result = decision_procedure();
5859

5960
{
6061
auto solver_stop = std::chrono::steady_clock::now();
@@ -207,11 +208,11 @@ safety_checkert::resultt bmct::stop_on_fail()
207208
{
208209
// NOLINTNEXTLINE(whitespace/braces)
209210
counterexample_beautificationt{ui_message_handler}(
210-
dynamic_cast<boolbvt &>(prop_conv), equation);
211+
dynamic_cast<boolbvt &>(decision_procedure), equation);
211212
}
212213

213214
build_error_trace(
214-
error_trace, ns, equation, prop_conv, ui_message_handler);
215+
error_trace, ns, equation, decision_procedure, ui_message_handler);
215216
output_error_trace(error_trace, ns, trace_options(), ui_message_handler);
216217
output_graphml(error_trace, ns, options);
217218
}
@@ -265,12 +266,11 @@ int bmct::do_language_agnostic_bmc(
265266
{
266267
std::unique_ptr<solver_factoryt::solvert> cbmc_solver =
267268
solvers.get_solver();
268-
prop_convt &pc = cbmc_solver->prop_conv();
269269
bmct bmc(
270270
opts,
271271
symbol_table,
272272
ui,
273-
pc,
273+
cbmc_solver->decision_procedure_incremental(),
274274
*worklist,
275275
callback_after_symex,
276276
guard_manager);
@@ -314,13 +314,12 @@ int bmct::do_language_agnostic_bmc(
314314
{
315315
std::unique_ptr<solver_factoryt::solvert> cbmc_solver =
316316
solvers.get_solver();
317-
prop_convt &pc = cbmc_solver->prop_conv();
318317
path_storaget::patht &resume = worklist->peek();
319318
path_explorert pe(
320319
opts,
321320
symbol_table,
322321
ui,
323-
pc,
322+
cbmc_solver->decision_procedure_incremental(),
324323
resume.equation,
325324
resume.state,
326325
*worklist,

jbmc/src/jbmc/bmc.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Author: Daniel Kroening, [email protected]
3030
#include <goto-programs/safety_checker.h>
3131
#include <goto-symex/memory_model.h>
3232

33-
#include <solvers/prop/decision_procedure.h>
33+
#include <solvers/prop/decision_procedure_incremental.h>
3434

3535
class cbmc_solverst;
3636

@@ -68,7 +68,7 @@ class bmct : public safety_checkert
6868
const optionst &_options,
6969
const symbol_tablet &outer_symbol_table,
7070
ui_message_handlert &_message_handler,
71-
prop_convt &_prop_conv,
71+
decision_procedure_incrementalt &_decision_procedure,
7272
path_storaget &_path_storage,
7373
std::function<bool(void)> callback_after_symex,
7474
guard_managert &guard_manager)
@@ -86,7 +86,7 @@ class bmct : public safety_checkert
8686
options,
8787
path_storage,
8888
guard_manager),
89-
prop_conv(_prop_conv),
89+
decision_procedure(_decision_procedure),
9090
ui_message_handler(_message_handler),
9191
driver_callback_after_symex(callback_after_symex)
9292
{
@@ -141,7 +141,7 @@ class bmct : public safety_checkert
141141
const optionst &_options,
142142
const symbol_tablet &outer_symbol_table,
143143
ui_message_handlert &_message_handler,
144-
prop_convt &_prop_conv,
144+
decision_procedure_incrementalt &_decision_procedure,
145145
symex_target_equationt &_equation,
146146
path_storaget &_path_storage,
147147
std::function<bool(void)> callback_after_symex,
@@ -160,7 +160,7 @@ class bmct : public safety_checkert
160160
options,
161161
path_storage,
162162
guard_manager),
163-
prop_conv(_prop_conv),
163+
decision_procedure(_decision_procedure),
164164
ui_message_handler(_message_handler),
165165
driver_callback_after_symex(callback_after_symex)
166166
{
@@ -180,7 +180,7 @@ class bmct : public safety_checkert
180180
guard_managert &guard_manager;
181181
path_storaget &path_storage;
182182
symex_bmct symex;
183-
prop_convt &prop_conv;
183+
decision_procedure_incrementalt &decision_procedure;
184184
std::unique_ptr<memory_model_baset> memory_model;
185185
// use gui format
186186
ui_message_handlert &ui_message_handler;
@@ -235,7 +235,7 @@ class path_explorert : public bmct
235235
const optionst &_options,
236236
const symbol_tablet &outer_symbol_table,
237237
ui_message_handlert &_message_handler,
238-
prop_convt &_prop_conv,
238+
decision_procedure_incrementalt &_decision_procedure,
239239
symex_target_equationt &saved_equation,
240240
const goto_symex_statet &saved_state,
241241
path_storaget &path_storage,
@@ -245,7 +245,7 @@ class path_explorert : public bmct
245245
_options,
246246
outer_symbol_table,
247247
_message_handler,
248-
_prop_conv,
248+
_decision_procedure,
249249
saved_equation,
250250
path_storage,
251251
callback_after_symex,

src/goto-checker/bmc_util.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Author: Daniel Kroening, Peter Schrammel
2525

2626
#include <linking/static_lifetime_init.h>
2727

28-
#include <solvers/prop/prop_conv.h>
28+
#include <solvers/prop/decision_procedure.h>
2929

3030
#include <util/make_unique.h>
3131
#include <util/ui_message.h>
@@ -42,23 +42,23 @@ void build_error_trace(
4242
goto_tracet &goto_trace,
4343
const namespacet &ns,
4444
const symex_target_equationt &symex_target_equation,
45-
const prop_convt &prop_conv,
45+
const decision_proceduret &decision_procedure,
4646
ui_message_handlert &ui_message_handler)
4747
{
4848
messaget log(ui_message_handler);
4949
message_building_error_trace(log);
5050

51-
build_goto_trace(symex_target_equation, prop_conv, ns, goto_trace);
51+
build_goto_trace(symex_target_equation, decision_procedure, ns, goto_trace);
5252
}
5353

5454
ssa_step_predicatet
5555
ssa_step_matches_failing_property(const irep_idt &property_id)
5656
{
5757
return [property_id](
5858
symex_target_equationt::SSA_stepst::const_iterator step,
59-
const prop_convt &prop_conv) {
59+
const decision_proceduret &decision_procedure) {
6060
return step->is_assert() && step->get_property_id() == property_id &&
61-
prop_conv.l_get(step->cond_literal).is_false();
61+
decision_procedure.l_get(step->cond_literal).is_false();
6262
};
6363
}
6464

@@ -105,14 +105,14 @@ void output_error_trace(
105105

106106
void freeze_guards(
107107
const symex_target_equationt &equation,
108-
prop_convt &prop_conv)
108+
decision_procedure_incrementalt &decision_procedure)
109109
{
110110
for(const auto &step : equation.SSA_steps)
111111
{
112112
if(!step.guard_literal.is_constant())
113-
prop_conv.set_frozen(step.guard_literal);
113+
decision_procedure.set_frozen(step.guard_literal);
114114
if(step.is_assert() && !step.cond_literal.is_constant())
115-
prop_conv.set_frozen(step.cond_literal);
115+
decision_procedure.set_frozen(step.cond_literal);
116116
}
117117
}
118118

@@ -162,14 +162,14 @@ void output_graphml(
162162

163163
void convert_symex_target_equation(
164164
symex_target_equationt &equation,
165-
prop_convt &prop_conv,
165+
decision_proceduret &decision_procedure,
166166
message_handlert &message_handler)
167167
{
168168
messaget msg(message_handler);
169169
msg.status() << "converting SSA" << messaget::eom;
170170

171171
// convert SSA
172-
equation.convert(prop_conv);
172+
equation.convert(decision_procedure);
173173
}
174174

175175
std::unique_ptr<memory_model_baset>

src/goto-checker/bmc_util.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ class memory_model_baset;
2828
class message_handlert;
2929
class namespacet;
3030
class optionst;
31-
class prop_convt;
31+
class decision_proceduret;
32+
class decision_procedure_incrementalt;
3233
class symex_bmct;
3334
class symex_target_equationt;
3435
struct trace_optionst;
3536
class ui_message_handlert;
3637

3738
void convert_symex_target_equation(
3839
symex_target_equationt &,
39-
prop_convt &,
40+
decision_proceduret &,
4041
message_handlert &);
4142

4243
/// Returns a function that checks whether an SSA step is an assertion
@@ -51,7 +52,7 @@ void build_error_trace(
5152
goto_tracet &,
5253
const namespacet &,
5354
const symex_target_equationt &,
54-
const prop_convt &,
55+
const decision_proceduret &,
5556
ui_message_handlert &);
5657

5758
void output_error_trace(
@@ -60,7 +61,9 @@ void output_error_trace(
6061
const trace_optionst &,
6162
ui_message_handlert &);
6263

63-
void freeze_guards(const symex_target_equationt &, prop_convt &);
64+
void freeze_guards(
65+
const symex_target_equationt &,
66+
decision_procedure_incrementalt &);
6467

6568
void output_graphml(const goto_tracet &, const namespacet &, const optionst &);
6669
void output_graphml(

src/goto-checker/counterexample_beautification.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ counterexample_beautificationt::counterexample_beautificationt(
2626
}
2727

2828
void counterexample_beautificationt::get_minimization_list(
29-
prop_convt &prop_conv,
29+
decision_proceduret &decision_procedure,
3030
const symex_target_equationt &equation,
3131
minimization_listt &minimization_list)
3232
{
@@ -41,7 +41,7 @@ void counterexample_beautificationt::get_minimization_list(
4141
it->is_assignment() &&
4242
it->assignment_type == symex_targett::assignment_typet::STATE)
4343
{
44-
if(!prop_conv.l_get(it->guard_literal).is_false())
44+
if(!decision_procedure.l_get(it->guard_literal).is_false())
4545
{
4646
const typet &type = it->ssa_lhs.type();
4747

@@ -69,7 +69,7 @@ void counterexample_beautificationt::get_minimization_list(
6969

7070
symex_target_equationt::SSA_stepst::const_iterator
7171
counterexample_beautificationt::get_failed_property(
72-
const prop_convt &prop_conv,
72+
const decision_proceduret &decision_procedure,
7373
const symex_target_equationt &equation)
7474
{
7575
// find failed property
@@ -79,8 +79,9 @@ counterexample_beautificationt::get_failed_property(
7979
it != equation.SSA_steps.end();
8080
it++)
8181
if(
82-
it->is_assert() && prop_conv.l_get(it->guard_literal).is_true() &&
83-
prop_conv.l_get(it->cond_literal).is_false())
82+
it->is_assert() &&
83+
decision_procedure.l_get(it->guard_literal).is_true() &&
84+
decision_procedure.l_get(it->cond_literal).is_false())
8485
return it;
8586

8687
UNREACHABLE;

src/goto-checker/counterexample_beautification.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ class counterexample_beautificationt
2828

2929
protected:
3030
void get_minimization_list(
31-
prop_convt &prop_conv,
31+
decision_proceduret &decision_procedure,
3232
const symex_target_equationt &equation,
3333
minimization_listt &minimization_list);
3434

3535
void minimize(const exprt &expr, class prop_minimizet &prop_minimize);
3636

3737
symex_target_equationt::SSA_stepst::const_iterator get_failed_property(
38-
const prop_convt &prop_conv,
38+
const decision_proceduret &decision_procedure,
3939
const symex_target_equationt &equation);
4040

4141
// the failed property

src/goto-checker/goto_symex_fault_localizer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ Author: Peter Schrammel
1111

1212
#include "goto_symex_fault_localizer.h"
1313

14-
#include <solvers/prop/prop_conv.h>
15-
1614
goto_symex_fault_localizert::goto_symex_fault_localizert(
1715
const optionst &options,
1816
ui_message_handlert &ui_message_handler,
1917
const symex_target_equationt &equation,
20-
prop_convt &solver)
18+
decision_procedure_incrementalt &solver)
2119
: options(options),
2220
ui_message_handler(ui_message_handler),
2321
equation(equation),

src/goto-checker/goto_symex_fault_localizer.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Author: Peter Schrammel
1818

1919
#include <goto-symex/symex_target_equation.h>
2020

21+
#include <solvers/prop/decision_procedure_incremental.h>
22+
2123
#include "fault_localization_provider.h"
2224

2325
class goto_symex_fault_localizert
@@ -27,15 +29,15 @@ class goto_symex_fault_localizert
2729
const optionst &options,
2830
ui_message_handlert &ui_message_handler,
2931
const symex_target_equationt &equation,
30-
prop_convt &solver);
32+
decision_procedure_incrementalt &solver);
3133

3234
fault_location_infot operator()(const irep_idt &failed_property_id);
3335

3436
protected:
3537
const optionst &options;
3638
ui_message_handlert &ui_message_handler;
3739
const symex_target_equationt &equation;
38-
prop_convt &solver;
40+
decision_procedure_incrementalt &solver;
3941

4042
/// A localization point is a goto instruction that is potentially at fault
4143
typedef std::map<literalt, fault_location_infot::score_mapt::iterator>

0 commit comments

Comments
 (0)