13
13
14
14
#include < util/simplify_expr.h>
15
15
16
- jsont ai_domain_baset::output_json (
17
- const ai_baset &ai,
18
- const namespacet &ns) const
16
+ jsont ai_domain_baset::output_json (const ai_baset &ai, const namespacet &ns)
17
+ const
19
18
{
20
19
std::ostringstream out;
21
20
output (out, ai, ns);
22
21
json_stringt json (out.str ());
23
22
return json;
24
23
}
25
24
26
- xmlt ai_domain_baset::output_xml (
27
- const ai_baset &ai,
28
- const namespacet &ns) const
25
+ xmlt ai_domain_baset::output_xml (const ai_baset &ai, const namespacet &ns) const
29
26
{
30
27
std::ostringstream out;
31
28
output (out, ai, ns);
32
29
xmlt xml (" abstract_state" );
33
- xml.data = out.str ();
30
+ xml.data = out.str ();
34
31
return xml;
35
32
}
36
33
@@ -42,38 +39,38 @@ xmlt ai_domain_baset::output_xml(
42
39
// / \param ns: the namespace
43
40
// / \return True if condition did not change. False otherwise. condition will be
44
41
// / updated with the simplified condition if it has worked
45
- bool ai_domain_baset::ai_simplify_lhs (
46
- exprt &condition, const namespacet &ns) const
42
+ bool ai_domain_baset::ai_simplify_lhs (exprt &condition, const namespacet &ns)
43
+ const
47
44
{
48
45
// Care must be taken here to give something that is still writable
49
- if (condition.id ()== ID_index)
46
+ if (condition.id () == ID_index)
50
47
{
51
- index_exprt ie= to_index_expr (condition);
52
- bool no_simplification= ai_simplify (ie.index (), ns);
48
+ index_exprt ie = to_index_expr (condition);
49
+ bool no_simplification = ai_simplify (ie.index (), ns);
53
50
if (!no_simplification)
54
- condition= simplify_expr (ie, ns);
51
+ condition = simplify_expr (ie, ns);
55
52
56
53
return no_simplification;
57
54
}
58
- else if (condition.id ()== ID_dereference)
55
+ else if (condition.id () == ID_dereference)
59
56
{
60
- dereference_exprt de= to_dereference_expr (condition);
61
- bool no_simplification= ai_simplify (de.pointer (), ns);
57
+ dereference_exprt de = to_dereference_expr (condition);
58
+ bool no_simplification = ai_simplify (de.pointer (), ns);
62
59
if (!no_simplification)
63
- condition= simplify_expr (de, ns); // So *(&x) -> x
60
+ condition = simplify_expr (de, ns); // So *(&x) -> x
64
61
65
62
return no_simplification;
66
63
}
67
- else if (condition.id ()== ID_member)
64
+ else if (condition.id () == ID_member)
68
65
{
69
- member_exprt me= to_member_expr (condition);
66
+ member_exprt me = to_member_expr (condition);
70
67
// Since simplify_ai_lhs is required to return an addressable object
71
68
// (so remains a valid left hand side), to simplify
72
69
// `(something_simplifiable).b` we require that `something_simplifiable`
73
70
// must also be addressable
74
- bool no_simplification= ai_simplify_lhs (me.compound (), ns);
71
+ bool no_simplification = ai_simplify_lhs (me.compound (), ns);
75
72
if (!no_simplification)
76
- condition= simplify_expr (me, ns);
73
+ condition = simplify_expr (me, ns);
77
74
78
75
return no_simplification;
79
76
}
0 commit comments