29 "instruction_from_json: key 'code' not found"};
61 "instruction_from_json: key 'guard' not found"};
78 "instruction_from_json: key 'instructionId' not found"};
184 "instruction_from_json: got unexpected instructionId '" +
200 std::map<unsigned, goto_programt::targett> target_map;
218 "goto_program_from_json: key 'locationNumber' not found or does not "
219 "map to an unsigned number"};
229 "goto_program_from_json: duplicate locationNumber " +
241 kv.first ==
"code" ||
kv.first ==
"guard" ||
242 kv.first ==
"instruction" ||
kv.first ==
"instructionId" ||
243 kv.first ==
"locationNumber" ||
kv.first ==
"sourceLocation")
247 else if(
kv.first ==
"labels")
249 if(!
kv.second.is_array())
254 if(!label.is_string())
259 else if(
kv.first ==
"targets")
261 if(!
kv.second.is_array())
270 "target must be an unsigned number"};
282 "goto_program_from_json: invalid targets entry"};
291 "goto_program_from_json: unexpected key '" +
kv.first +
"'"};
305 for(
const auto &
kv :
json)
307 if(
kv.first ==
"instructions")
311 else if(
kv.first ==
"parameterIdentifiers")
313 if(!
kv.second.is_array())
316 "parameterIdentifiers must be an array"};
321 if(!
param.is_string())
324 "parameter identifier must be a string"};
329 else if(
kv.first ==
"isHidden")
334 else if(
kv.first ==
"name")
338 else if(
kv.first ==
"isBodyAvailable" ||
kv.first ==
"isInternal")
345 "goto_function_from_json: unexpected key '" +
kv.first +
"'"};
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Data structure for representing an arbitrary statement in a program.
const irep_idt & get_statement() const
Thrown when failing to deserialize a value from some low level format, like JSON or raw bytes.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
parameter_identifierst parameter_identifiers
The identifiers of the parameters of this function.
This class represents an instruction in the GOTO intermediate representation.
A generic container class for the GOTO intermediate representation of one function.
static instructiont make_assumption(const exprt &g, const source_locationt &l=source_locationt::nil())
instructionst instructions
The list of instructions in the goto program.
static instructiont make_set_return_value(exprt return_value, const source_locationt &l=source_locationt::nil())
static instructiont make_end_function(const source_locationt &l=source_locationt::nil())
instructionst::iterator targett
static instructiont make_atomic_end(const source_locationt &l=source_locationt::nil())
static instructiont make_assignment(const code_assignt &_code, const source_locationt &l=source_locationt::nil())
Create an assignment instruction.
static instructiont make_skip(const source_locationt &l=source_locationt::nil())
static instructiont make_function_call(const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
Create a function call instruction.
static instructiont make_throw(const source_locationt &l=source_locationt::nil())
static instructiont make_other(const goto_instruction_codet &_code, const source_locationt &l=source_locationt::nil())
static instructiont make_catch(const source_locationt &l=source_locationt::nil())
static instructiont make_atomic_begin(const source_locationt &l=source_locationt::nil())
static instructiont make_location(const source_locationt &l)
targett add(instructiont &&instruction)
Adds a given instruction at the end.
static instructiont make_decl(const symbol_exprt &symbol, const source_locationt &l=source_locationt::nil())
static instructiont make_assertion(const exprt &g, const source_locationt &l=source_locationt::nil())
static instructiont make_incomplete_goto(const exprt &_cond, const source_locationt &l=source_locationt::nil())
There are a large number of kinds of tree structured or tree-like data in CPROVER.
static const source_locationt & nil()
const code_function_callt & to_code_function_call(const goto_instruction_codet &code)
const code_deadt & to_code_dead(const goto_instruction_codet &code)
const code_assignt & to_code_assign(const goto_instruction_codet &code)
const code_declt & to_code_decl(const goto_instruction_codet &code)
const code_returnt & to_code_return(const goto_instruction_codet &code)
const irept & get_nil_irep()
const std::string & id2string(const irep_idt &d)
json_objectt & to_json_object(jsont &json)
json_arrayt & to_json_array(jsont &json)
static goto_instruction_codet try_get_code(const json_objectt &json)
Return code at "code" key in a JSON object, if any.
goto_functiont goto_function_from_json(const json_objectt &json)
Deserialize a goto_functiont from JSON.
static exprt try_get_guard(const json_objectt &json)
Return expression at "guard" key in a JSON object, if any.
static goto_programt goto_program_from_json(const jsont &json)
Deserialize a goto_programt from JSON.
static goto_programt::instructiont instruction_from_json(const json_objectt &json)
Deserialize a goto_programt::instructiont from JSON.
JSON goto_function deserialization.
bool try_get_bool(const jsont &in, const std::string &key)
Return boolean value for a given key if present in the json object.
source_locationt try_get_source_location(const jsont &json)
Return a source_locationt from the given JSON object.
const std::string & try_get_string(const jsont &in, const std::string &key)
Return string value for a given key if present in the json object.
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
std::optional< unsigned > string2optional_unsigned(const std::string &str, int base)
Convert string to unsigned similar to the stoul or stoull functions, return nullopt when the conversi...