@@ -20,11 +20,11 @@ Author: Romain Brenguier, romain.brenguier@diffblue.com
20
20
#ifndef CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_H
21
21
#define CPROVER_SOLVERS_REFINEMENT_STRING_CONSTRAINT_H
22
22
23
- #include < solvers/refinement/bv_refinement.h>
24
- #include < solvers/refinement/string_refinement_invariant.h>
23
+ #include " bv_refinement.h"
24
+ #include " string_refinement_invariant.h"
25
+
25
26
#include < util/refined_string_type.h>
26
27
#include < util/string_expr.h>
27
- #include < langapi/language_util.h>
28
28
29
29
// / ### Universally quantified string constraint
30
30
// /
@@ -151,11 +151,11 @@ inline std::string from_expr(
151
151
const irep_idt &identifier,
152
152
const string_constraintt &expr)
153
153
{
154
- return " forall " + from_expr (ns, identifier, expr. univ_var ())+ " in [ " +
155
- from_expr (ns, identifier, expr.lower_bound ())+ " , " +
156
- from_expr (ns, identifier, expr.upper_bound ())+ " ). " +
157
- from_expr (ns, identifier, expr.premise ())+ " => " +
158
- from_expr (ns, identifier, expr. body () );
154
+ std::ostringstream out;
155
+ out << " forall " << format ( expr.univ_var ()) << " in [ "
156
+ << format ( expr.lower_bound ()) << " , " << format (expr. upper_bound ())
157
+ << " ). " << format ( expr.premise ()) << " => " << format (expr. body ());
158
+ return out. str ( );
159
159
}
160
160
161
161
// / Constraints to encode non containement of strings.
@@ -226,14 +226,14 @@ inline std::string from_expr(
226
226
const irep_idt &identifier,
227
227
const string_not_contains_constraintt &expr)
228
228
{
229
- return " forall x in [ " +
230
- from_expr (ns, identifier, expr.univ_lower_bound ())+ " , " +
231
- from_expr (ns, identifier, expr.univ_upper_bound ())+ " ). " +
232
- from_expr (ns, identifier, expr. premise ())+ " => (" +
233
- " exists y in [" + from_expr (ns, identifier, expr.exists_lower_bound ())+ " , " +
234
- from_expr (ns, identifier, expr.exists_upper_bound ())+ " ). " +
235
- from_expr (ns, identifier, expr. s0 ())+ " [x+y] != " +
236
- from_expr (ns, identifier, expr. s1 ())+ " [y]) " ;
229
+ std::ostringstream out;
230
+ out << " forall x in [ " << format ( expr.univ_lower_bound ()) << " , "
231
+ << format ( expr.univ_upper_bound ()) << " ). " << format (expr. premise ())
232
+ << " => ("
233
+ << " exists y in [" << format ( expr.exists_lower_bound ()) << " , "
234
+ << format ( expr.exists_upper_bound ()) << " ). " << format (expr. s0 ())
235
+ << " [x+y] != " << format (expr. s1 ()) << " [y]) " ;
236
+ return out. str () ;
237
237
}
238
238
239
239
inline const string_not_contains_constraintt
0 commit comments