39 return pc->source_location.as_string() ==
40 other.
pc->source_location.as_string();
49 std::size_t ssa_index,
50 const exprt ssa_expression,
59 if(!pre_existing.second)
79 const exprt ssa_expression,
80 const std::vector<goto_programt::const_targett> &pcs)
95 const size_t cnf_clause_index,
101 for(
const auto &literal : bv)
109 std::cout << cnf_clause_index <<
": ";
110 for(
const auto &literal : cnf)
111 std::cout << literal.dimacs() <<
" ";
132 std::size_t ssa_set_bit_offset = 0;
133 const std::size_t one = 1;
135 ++ssa_set_bit_offset;
143 if(ssa_step_hardness.empty())
147 for(
const auto &key_value_pair : ssa_step_hardness)
149 auto const &ssa = key_value_pair.first;
150 auto const &hardness = key_value_pair.second;
152 hardness_stats_json[
"SSA_expr"] =
json_stringt{ssa.ssa_expression};
153 hardness_stats_json[
"GOTO"] =
160 hardness_stats_json[
"GOTO_ID"] =
162 hardness_stats_json[
"Source"] =
json(ssa.pc->source_location);
165 sat_hardness_json[
"Clauses"] =
167 sat_hardness_json[
"Literals"] =
169 sat_hardness_json[
"Variables"] =
173 for(
auto const &clause : hardness.clause_set)
178 sat_hardness_json[
"ClauseSet"] = sat_hardness_clause_set_json;
180 hardness_stats_json[
"SAT_hardness"] = sat_hardness_json;
182 json_stream_array.
push_back(hardness_stats_json);
190 assertion_stats_json[
"SSA_expr"] =
197 assertion_stats_pc_json[
"GOTO"] =
199 assertion_stats_pc_json[
"Source"] =
json(pc->source_location);
200 assertion_stats_pcs_json.push_back(assertion_stats_pc_json);
202 assertion_stats_json[
"Sources"] = assertion_stats_pcs_json;
205 assertion_hardness_json[
"Clauses"] =
207 assertion_hardness_json[
"Literals"] =
212 json_arrayt assertion_sat_hardness_clause_set_json;
215 assertion_sat_hardness_clause_set_json.
push_back(
218 assertion_hardness_json[
"ClauseSet"] =
219 assertion_sat_hardness_clause_set_json;
221 assertion_stats_json[
"SAT_hardness"] = assertion_hardness_json;
223 json_stream_array.
push_back(assertion_stats_json);
230 std::stringstream out;
231 auto instruction = *pc;
233 if(!instruction.labels.empty())
235 out <<
" // Labels:";
236 for(
const auto &label : instruction.labels)
240 if(instruction.is_target())
241 out << std::setw(6) << instruction.target_number <<
": ";
243 switch(instruction.type)
246 out <<
"NO INSTRUCTION TYPE SET";
251 if(!instruction.get_condition().is_true())
253 out <<
"IF " <<
format(instruction.get_condition()) <<
" THEN ";
258 if(instruction.is_incomplete_goto())
260 out <<
"(incomplete)";
264 for(
auto gt_it = instruction.targets.begin();
265 gt_it != instruction.targets.end();
268 if(gt_it != instruction.targets.begin())
270 out << (*gt_it)->target_number;
281 out <<
format(instruction.get_code());
286 if(instruction.is_assume())
291 out <<
format(instruction.get_condition());
299 out <<
"END_FUNCTION";
311 instruction.get_code().find(ID_exception_list).get_sub();
313 for(
const auto &ex : exception_list)
314 out <<
" " << ex.id();
317 if(instruction.get_code().operands().size() == 1)
318 out <<
": " <<
format(instruction.get_code().op0());
324 if(instruction.get_code().get_statement() == ID_exception_landingpad)
327 out <<
"EXCEPTION LANDING PAD (" <<
format(landingpad.catch_expr().type())
328 <<
' ' <<
format(landingpad.catch_expr()) <<
")";
330 else if(instruction.get_code().get_statement() == ID_push_catch)
332 out <<
"CATCH-PUSH ";
336 instruction.get_code().find(ID_exception_list).get_sub();
338 instruction.targets.size() == exception_list.size(),
339 "unexpected discrepancy between sizes of instruction"
340 "targets and exception list");
341 for(
auto gt_it = instruction.targets.begin();
342 gt_it != instruction.targets.end();
345 if(gt_it != instruction.targets.begin())
347 out << exception_list[i].id() <<
"->" << (*gt_it)->target_number;
350 else if(instruction.get_code().get_statement() == ID_pop_catch)
362 out <<
"ATOMIC_BEGIN";
370 out <<
"START THREAD " << instruction.get_target()->target_number;
383 std::stringstream ss;