10
10
// / Output of the verification conditions (VCCs)
11
11
12
12
#include " show_vcc.h"
13
+ #include " symex_target_equation.h"
13
14
14
15
#include < fstream>
15
16
#include < iostream>
17
+ #include < sstream>
16
18
17
19
#include < goto-symex/symex_target_equation.h>
18
20
19
- #include < langapi/language_util.h>
20
- #include < langapi/mode.h>
21
-
22
21
#include < util/exception_utils.h>
22
+ #include < util/format_expr.h>
23
23
#include < util/json.h>
24
24
#include < util/json_expr.h>
25
25
#include < util/ui_message.h>
@@ -46,10 +46,10 @@ void show_vcc_plain(
46
46
out << ' \n ' ;
47
47
48
48
if (s_it->source .pc ->source_location .is_not_nil ())
49
- out << s_it->source .pc ->source_location << " \n " ;
49
+ out << s_it->source .pc ->source_location << ' \n ' ;
50
50
51
51
if (s_it->comment != " " )
52
- out << s_it->comment << " \n " ;
52
+ out << s_it->comment << ' \n ' ;
53
53
54
54
symex_target_equationt::SSA_stepst::const_iterator p_it =
55
55
equation.SSA_steps .begin ();
@@ -63,14 +63,11 @@ void show_vcc_plain(
63
63
{
64
64
if (!p_it->ignore )
65
65
{
66
- std::string string_value =
67
- from_expr (ns, p_it->source .pc ->function , p_it->cond_expr );
68
- out << " {-" << count << " } " << string_value << " \n " ;
69
-
70
- #if 0
71
- languages.from_expr(p_it->guard_expr, string_value);
72
- out << "GUARD: " << string_value << "\n";
73
- out << "\n";
66
+ out << " {-" << count << " } " << format (p_it->cond_expr ) << ' \n ' ;
67
+
68
+ #ifdef DEBUG
69
+ out << " GUARD: " << format (p_it->guard ) << ' \n ' ;
70
+ out << ' \n ' ;
74
71
#endif
75
72
76
73
count++;
@@ -94,9 +91,7 @@ void show_vcc_plain(
94
91
std::size_t count = 1 ;
95
92
for (const auto &disjunct : disjuncts)
96
93
{
97
- std::string string_value =
98
- from_expr (ns, s_it->source .pc ->function , disjunct);
99
- out << " {" << count << " } " << string_value << " \n " ;
94
+ out << ' {' << count << " } " << format (disjunct) << ' \n ' ;
100
95
count++;
101
96
}
102
97
}
@@ -147,15 +142,15 @@ void show_vcc_json(
147
142
(p_it->is_assume () || p_it->is_assignment () || p_it->is_constraint ()) &&
148
143
!p_it->ignore )
149
144
{
150
- std::string string_value =
151
- from_expr (ns, p_it-> source . pc -> function , p_it->cond_expr );
152
- json_constraints.push_back (json_stringt (string_value));
145
+ std::ostringstream string_value;
146
+ string_value << format ( p_it->cond_expr );
147
+ json_constraints.push_back (json_stringt (string_value. str () ));
153
148
}
154
149
}
155
150
156
- std::string string_value =
157
- from_expr (ns, s_it-> source . pc -> function , s_it->cond_expr );
158
- object[" expression" ] = json_stringt (string_value);
151
+ std::ostringstream string_value;
152
+ string_value << format ( s_it->cond_expr );
153
+ object[" expression" ] = json_stringt (string_value. str () );
159
154
}
160
155
161
156
out << " ,\n " << json_result;
0 commit comments