CBMC
Loading...
Searching...
No Matches
contracts_wrangler.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Parse and annotate contracts from configuration files
4
5Author: Qinheping Hu
6
7Date: June 2023
8
9\*******************************************************************/
10
13
14#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_CONTRACTS_WRANGLER_H
15#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_CONTRACTS_WRANGLER_H
16
17#include <util/message.h>
18#include <util/namespace.h>
19#include <util/replace_symbol.h>
20#include <util/string_utils.h>
21
24
25#include <json/json_parser.h>
26
27#include <regex>
28
30{
31 std::string identifier;
32 std::string invariants;
33 std::string assigns;
34 std::string decreases;
36
38 std::string _identifier,
39 std::string _invariants_str,
40 std::string _assigns_str,
41 std::string _decreases_str,
43 : identifier(std::move(_identifier)),
48 {
49 }
50};
51
53{
54 std::vector<loop_contracts_clauset> loop_contracts;
55 std::string regex_str;
56};
57
58using functionst = std::list<std::pair<std::regex, functiont>>;
59
61{
62public:
65 const std::string &file_name,
67
69
70protected:
74
76
78
79 void configure_functions(const jsont &);
80
84 void mangle(
85 const loop_contracts_clauset &loop_contracts,
86 const irep_idt &function_id);
87
92 std::string function_name,
93 const std::size_t num_of_args);
94};
95
96#endif // CPROVER_GOTO_INSTRUMENT_CONTRACTS_CONTRACTS_WRANGLER_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
symbol_tablet & symbol_table
message_handlert & message_handler
goto_functionst & goto_functions
void configure_functions(const jsont &)
void add_builtin_pointer_function_symbol(std::string function_name, const std::size_t num_of_args)
Add builtin function symbol with function_name into symbol table.
void mangle(const loop_contracts_clauset &loop_contracts, const irep_idt &function_id)
Mangle loop_contracts in the function with function_id
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
A collection of goto functions.
Definition json.h:27
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
The symbol table.
std::list< std::pair< std::regex, functiont > > functionst
Goto Programs with Functions.
Symbol Table + CFG.
STL namespace.
std::string regex_str
std::vector< loop_contracts_clauset > loop_contracts
loop_contracts_clauset(std::string _identifier, std::string _invariants_str, std::string _assigns_str, std::string _decreases_str, unchecked_replace_symbolt _replace_symbol)
unchecked_replace_symbolt replace_symbol