Skip to content

Commit 2ea50f7

Browse files
karkhazPetr Bauch
authored and
Petr Bauch
committed
Make bmct::report_{success,failure} static
This is in preparation for a future commit, where the static method do_language_agnostic_bmc will need to make a final report after all paths have been exhausted. These methods were previously marked as virtual, so the zero-parameter non-static variants of these methods have been kept as a convenience; they do nothing other than call into the static variant.
1 parent d593c11 commit 2ea50f7

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

src/cbmc/bmc.cpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,14 @@ bmct::run_decision_procedure(prop_convt &prop_conv)
153153

154154
void bmct::report_success()
155155
{
156-
result() << bold << "VERIFICATION SUCCESSFUL" << reset << eom;
156+
report_success(*this, ui_message_handler);
157+
}
157158

158-
switch(ui_message_handler.get_ui())
159+
void bmct::report_success(messaget &log, ui_message_handlert &handler)
160+
{
161+
log.result() << log.bold << "VERIFICATION SUCCESSFUL" << log.reset << log.eom;
162+
163+
switch(handler.get_ui())
159164
{
160165
case ui_message_handlert::uit::PLAIN:
161166
break;
@@ -164,25 +169,30 @@ void bmct::report_success()
164169
{
165170
xmlt xml("cprover-status");
166171
xml.data="SUCCESS";
167-
result() << xml;
172+
log.result() << xml;
168173
}
169174
break;
170175

171176
case ui_message_handlert::uit::JSON_UI:
172177
{
173178
json_objectt json_result;
174179
json_result["cProverStatus"]=json_stringt("success");
175-
result() << json_result;
180+
log.result() << json_result;
176181
}
177182
break;
178183
}
179184
}
180185

181186
void bmct::report_failure()
182187
{
183-
result() << bold << "VERIFICATION FAILED" << reset << eom;
188+
report_failure(*this, ui_message_handler);
189+
}
184190

185-
switch(ui_message_handler.get_ui())
191+
void bmct::report_failure(messaget &log, ui_message_handlert &handler)
192+
{
193+
log.result() << log.bold << "VERIFICATION FAILED" << log.reset << log.eom;
194+
195+
switch(handler.get_ui())
186196
{
187197
case ui_message_handlert::uit::PLAIN:
188198
break;
@@ -191,15 +201,15 @@ void bmct::report_failure()
191201
{
192202
xmlt xml("cprover-status");
193203
xml.data="FAILURE";
194-
result() << xml;
204+
log.result() << xml;
195205
}
196206
break;
197207

198208
case ui_message_handlert::uit::JSON_UI:
199209
{
200210
json_objectt json_result;
201211
json_result["cProverStatus"]=json_stringt("failure");
202-
result() << json_result;
212+
log.result() << json_result;
203213
}
204214
break;
205215
}

src/cbmc/bmc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ class bmct:public safety_checkert
208208
virtual void report_success();
209209
virtual void report_failure();
210210

211+
static void report_success(messaget &, ui_message_handlert &);
212+
static void report_failure(messaget &, ui_message_handlert &);
213+
211214
virtual void error_trace();
212215
void output_graphml(resultt result);
213216

0 commit comments

Comments
 (0)