@@ -8,13 +8,10 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com
8
8
9
9
#include " union_find_replace.h"
10
10
11
- // / Keeps a map of symbols to expressions, such as none of the mapped values
12
- // / exist as a key
13
- // / \param a: an expression of type char array
14
- // / \param b: an expression to map it to, which should be either a symbol
15
- // / a string_exprt, an array_exprt, an array_of_exprt or an
16
- // / if_exprt with branches of the previous kind
17
- // / \return the new mapped value
11
+ // / Merge the set containing `a` and the set containing `b`.
12
+ // / \param a: an expression
13
+ // / \param b: an expression
14
+ // / \return current representative element of the set containing `a` and `b`
18
15
exprt union_find_replacet::make_union (const exprt &a, const exprt &b)
19
16
{
20
17
const exprt &lhs_root = find (a);
@@ -24,8 +21,8 @@ exprt union_find_replacet::make_union(const exprt &a, const exprt &b)
24
21
return rhs_root;
25
22
}
26
23
27
- // / Replace subexpressions of `expr` by a canonical element of the set they
28
- // / belong to.
24
+ // / Replace subexpressions of `expr` by the representative element of the set
25
+ // / they belong to.
29
26
// / \param expr: an expression, modified in place
30
27
// / \return true if expr is left unchanged
31
28
bool union_find_replacet::replace_expr (exprt &expr) const
@@ -37,15 +34,14 @@ bool union_find_replacet::replace_expr(exprt &expr) const
37
34
}
38
35
39
36
// / \param expr: an expression
40
- // / \return canonical representation for expressions which belong to the same
41
- // / set
37
+ // / \return representative element of the set `expr` belongs to
42
38
exprt union_find_replacet::find (exprt expr) const
43
39
{
44
40
replace_expr (expr);
45
41
return expr;
46
42
}
47
43
48
- // / \return pairs of expression composed of expressions and a canonical
44
+ // / \return pairs of expression composed of expressions and a representative
49
45
// / expression for the set they below to.
50
46
std::vector<std::pair<exprt, exprt>> union_find_replacet::to_vector () const
51
47
{
0 commit comments