Skip to content

Commit ce4e808

Browse files
Make fields of linear_functiont private
This improves encapsulation.
1 parent 6519b6e commit ce4e808

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/solvers/strings/string_constraint_instantiation.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@ std::vector<exprt> instantiate_not_contains(
3838
/// Canonical representation of linear function, for instance, expression
3939
/// $x + x - y + 5 - 3$ would given by \c constant_coefficient 2 and
4040
/// \p coefficients: x -> 2, y -> -1
41-
struct linear_functiont
41+
class linear_functiont
4242
{
43-
mp_integer constant_coefficient;
44-
std::unordered_map<exprt, mp_integer, irep_hash> coefficients;
45-
typet type;
46-
43+
public:
4744
/// Put an expression \p f composed of additions and subtractions into
4845
/// its cannonical representation
4946
explicit linear_functiont(const exprt &f);
@@ -60,6 +57,11 @@ struct linear_functiont
6057
/// For instance, if `f` corresponds to the expression `q + x`, `solve(q,v,f)`
6158
/// returns the expression `v - x`.
6259
static exprt solve(linear_functiont f, const exprt &var, const exprt &val);
60+
61+
private:
62+
mp_integer constant_coefficient;
63+
std::unordered_map<exprt, mp_integer, irep_hash> coefficients;
64+
typet type;
6365
};
6466

6567
#endif // CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_INSTANTIATION_H

0 commit comments

Comments
 (0)