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
- #include < goto-symex/symex_target_equation.h>
18
-
19
- #include < langapi/language_util.h>
20
- #include < langapi/mode.h>
21
-
19
+ #include < util/format_expr.h>
22
20
#include < util/json.h>
23
21
#include < util/json_expr.h>
24
22
#include < util/ui_message.h>
@@ -45,10 +43,10 @@ void show_vcc_plain(
45
43
out << ' \n ' ;
46
44
47
45
if (s_it->source .pc ->source_location .is_not_nil ())
48
- out << s_it->source .pc ->source_location << " \n " ;
46
+ out << s_it->source .pc ->source_location << ' \n ' ;
49
47
50
48
if (s_it->comment != " " )
51
- out << s_it->comment << " \n " ;
49
+ out << s_it->comment << ' \n ' ;
52
50
53
51
symex_target_equationt::SSA_stepst::const_iterator p_it =
54
52
equation.SSA_steps .begin ();
@@ -62,14 +60,11 @@ void show_vcc_plain(
62
60
{
63
61
if (!p_it->ignore )
64
62
{
65
- std::string string_value =
66
- from_expr (ns, p_it->source .pc ->function , p_it->cond_expr );
67
- out << " {-" << count << " } " << string_value << " \n " ;
63
+ out << " {-" << count << " } " << format (p_it->cond_expr ) << ' \n ' ;
68
64
69
65
#if 0
70
- languages.from_expr(p_it->guard_expr, string_value);
71
- out << "GUARD: " << string_value << "\n";
72
- out << "\n";
66
+ out << "GUARD: " << format(p_it->guard_expr) << '\n';
67
+ out << '\n';
73
68
#endif
74
69
75
70
count++;
@@ -82,9 +77,7 @@ void show_vcc_plain(
82
77
out << u8" \u2500 " ;
83
78
out << ' \n ' ;
84
79
85
- std::string string_value =
86
- from_expr (ns, s_it->source .pc ->function , s_it->cond_expr );
87
- out << " {" << 1 << " } " << string_value << " \n " ;
80
+ out << ' {' << 1 << " } " << format (s_it->cond_expr ) << ' \n ' ;
88
81
}
89
82
}
90
83
@@ -133,15 +126,15 @@ void show_vcc_json(
133
126
(p_it->is_assume () || p_it->is_assignment () || p_it->is_constraint ()) &&
134
127
!p_it->ignore )
135
128
{
136
- std::string string_value =
137
- from_expr (ns, p_it-> source . pc -> function , p_it->cond_expr );
138
- json_constraints.push_back (json_stringt (string_value));
129
+ std::ostringstream string_value;
130
+ string_value << format ( p_it->cond_expr );
131
+ json_constraints.push_back (json_stringt (string_value. str () ));
139
132
}
140
133
}
141
134
142
- std::string string_value =
143
- from_expr (ns, s_it-> source . pc -> function , s_it->cond_expr );
144
- object[" expression" ] = json_stringt (string_value);
135
+ std::ostringstream string_value;
136
+ string_value << format ( s_it->cond_expr );
137
+ object[" expression" ] = json_stringt (string_value. str () );
145
138
}
146
139
147
140
out << " ,\n " << json_result;
0 commit comments