CBMC
goto_diff.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: GOTO-DIFF Base Class
4 
5 Author: Peter Schrammel
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_DIFF_GOTO_DIFF_H
13 #define CPROVER_GOTO_DIFF_GOTO_DIFF_H
14 
15 #include <util/ui_message.h>
16 
17 #include <iosfwd>
18 #include <set>
19 
20 class goto_modelt;
21 class json_arrayt;
22 class json_objectt;
23 class optionst;
24 
26 {
27 public:
29  const goto_modelt &_goto_model1,
30  const goto_modelt &_goto_model2,
31  const optionst &_options,
32  ui_message_handlert &_message_handler)
33  : message_handler(_message_handler),
34  goto_model1(_goto_model1),
35  goto_model2(_goto_model2),
36  options(_options),
38  {
39  }
40 
41  virtual ~goto_difft() = default;
42 
43  virtual bool operator()()=0;
44 
45  virtual void output_functions() const;
46 
47 protected:
51  const optionst &options;
52 
55 
57  const std::string &group_name,
58  const std::set<irep_idt> &function_group,
59  const goto_modelt &goto_model) const;
60  void output_function(
61  const irep_idt &function_name,
62  const goto_modelt &goto_model) const;
63 
65  json_arrayt &result,
66  const std::set<irep_idt> &function_group,
67  const goto_modelt &goto_model) const;
69  json_objectt &result,
70  const irep_idt &function_name,
71  const goto_modelt &goto_model) const;
72 };
73 
74 #endif // CPROVER_GOTO_DIFF_GOTO_DIFF_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
const optionst & options
Definition: goto_diff.h:51
virtual ~goto_difft()=default
void output_function(const irep_idt &function_name, const goto_modelt &goto_model) const
Output function information in plain text format.
std::set< irep_idt > modified_functions
Definition: goto_diff.h:54
void convert_function_group_json(json_arrayt &result, const std::set< irep_idt > &function_group, const goto_modelt &goto_model) const
Convert a function group to JSON.
const goto_modelt & goto_model1
Definition: goto_diff.h:49
virtual void output_functions() const
Output diff result.
void convert_function_json(json_objectt &result, const irep_idt &function_name, const goto_modelt &goto_model) const
Convert function information to JSON.
std::set< irep_idt > new_functions
Definition: goto_diff.h:54
void output_function_group(const std::string &group_name, const std::set< irep_idt > &function_group, const goto_modelt &goto_model) const
Output group of functions in plain text format.
goto_difft(const goto_modelt &_goto_model1, const goto_modelt &_goto_model2, const optionst &_options, ui_message_handlert &_message_handler)
Definition: goto_diff.h:28
unsigned total_functions_count
Definition: goto_diff.h:53
virtual bool operator()()=0
std::set< irep_idt > deleted_functions
Definition: goto_diff.h:54
const goto_modelt & goto_model2
Definition: goto_diff.h:50
ui_message_handlert & message_handler
Definition: goto_diff.h:48