CBMC
Loading...
Searching...
No Matches
unified_diff.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Unified diff (using LCSS) of goto functions
4
5Author: Michael Tautschnig
6
7Date: April 2016
8
9\*******************************************************************/
10
13
14#ifndef CPROVER_GOTO_DIFF_UNIFIED_DIFF_H
15#define CPROVER_GOTO_DIFF_UNIFIED_DIFF_H
16
17#include <iosfwd>
18#include <list>
19#include <map>
20#include <vector>
21
22#include <util/namespace.h>
23
25
26class goto_functionst;
27class goto_modelt;
28
30{
31public:
33
34 bool operator()();
35
36 void output(std::ostream &os) const;
37
38 enum class differencet
39 {
40 SAME,
41 DELETED,
42 NEW
43 };
44
45 typedef std::list<std::pair<goto_programt::const_targett, differencet>>
47
48 goto_program_difft get_diff(const irep_idt &function) const;
49
50private:
55
56 typedef std::vector<differencet> differencest;
57 typedef std::map<irep_idt, differencest> differences_mapt;
58
59 void unified_diff(
60 const irep_idt &identifier,
63
64 static differencest lcss(
67
72
73 void output_diff(
74 const irep_idt &identifier,
78 std::ostream &os) const;
79
80 static bool instructions_equal(
83
84 const differences_mapt &differences_map() const;
85
87};
88
89#endif // CPROVER_GOTO_DIFF_UNIFIED_DIFF_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
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.
This class represents an instruction in the GOTO intermediate representation.
A generic container class for the GOTO intermediate representation of one function.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
static bool instructions_equal(const goto_programt::instructiont &ins1, const goto_programt::instructiont &ins2)
std::map< irep_idt, differencest > differences_mapt
std::vector< differencet > differencest
const namespacet ns_old
const goto_functionst & old_goto_functions
std::list< std::pair< goto_programt::const_targett, differencet > > goto_program_difft
const goto_functionst & new_goto_functions
goto_program_difft get_diff(const irep_idt &function) const
void unified_diff(const irep_idt &identifier, const goto_programt &old_goto_program, const goto_programt &new_goto_program)
const namespacet ns_new
const differences_mapt & differences_map() const
static differencest lcss(const goto_programt &old_goto_program, const goto_programt &new_goto_program)
void output_diff(const irep_idt &identifier, const goto_programt &old_goto_program, const goto_programt &new_goto_program, const differencest &differences, std::ostream &os) const
differences_mapt differences_map_
void output(std::ostream &os) const
Concrete Goto Program.