cprover
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 
25 class goto_difft:public messaget
26 {
27 public:
29  const goto_modelt &_goto_model1,
30  const goto_modelt &_goto_model2,
31  const optionst &_options,
32  message_handlert &_message_handler)
33  : messaget(_message_handler),
34  goto_model1(_goto_model1),
35  goto_model2(_goto_model2),
36  options(_options),
37  ui(ui_message_handlert::uit::PLAIN),
39  {
40  }
41 
42  virtual bool operator()()=0;
43 
44  void set_ui(ui_message_handlert::uit _ui) { ui=_ui; }
45 
46  virtual void output_functions() const;
47 
48 protected:
51  const optionst &options;
53 
56 
58  const std::string &group_name,
59  const std::set<irep_idt> &function_group,
60  const goto_modelt &goto_model) const;
61  void output_function(
62  const irep_idt &function_name,
63  const goto_modelt &goto_model) const;
64 
67  const std::set<irep_idt> &function_group,
68  const goto_modelt &goto_model) const;
71  const irep_idt &function_name,
72  const goto_modelt &goto_model) const;
73 };
74 
75 #endif // CPROVER_GOTO_DIFF_GOTO_DIFF_H
void set_ui(ui_message_handlert::uit _ui)
Definition: goto_diff.h:44
ui_message_handlert::uit ui
Definition: goto_diff.h:52
const goto_modelt & goto_model1
Definition: goto_diff.h:49
void output_function(const irep_idt &function_name, const goto_modelt &goto_model) const
Output function information in plain text format.
const goto_modelt & goto_model2
Definition: goto_diff.h:50
goto_difft(const goto_modelt &_goto_model1, const goto_modelt &_goto_model2, const optionst &_options, message_handlert &_message_handler)
Definition: goto_diff.h:28
unsigned total_functions_count
Definition: goto_diff.h:54
virtual void output_functions() const
Output diff result.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
Definition: dstring.h:33
std::set< irep_idt > modified_functions
Definition: goto_diff.h:55
mstreamt & result() const
Definition: message.h:312
virtual bool operator()()=0
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.
void convert_function_json(json_objectt &result, const irep_idt &function_name, const goto_modelt &goto_model) const
Convert function information to JSON.
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 optionst & options
Definition: goto_diff.h:51
std::set< irep_idt > deleted_functions
Definition: goto_diff.h:55
std::set< irep_idt > new_functions
Definition: goto_diff.h:55