File tree 3 files changed +19
-1
lines changed
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,11 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
320
320
if (cmdline.isset (" refine-strings" ))
321
321
{
322
322
options.set_option (" refine-strings" , true );
323
+ options.set_option (" string-non-empty" , cmdline.isset (" string-non-empty" ));
324
+ options.set_option (" string-printable" , cmdline.isset (" string-printable" ));
325
+ if (cmdline.isset (" string-max-length" ))
326
+ options.set_option (
327
+ " string-max-length" , cmdline.get_value (" string-max-length" ));
323
328
}
324
329
325
330
if (cmdline.isset (" max-node-refinement" ))
@@ -1207,6 +1212,9 @@ void cbmc_parse_optionst::help()
1207
1212
" --z3 use Z3\n "
1208
1213
" --refine use refinement procedure (experimental)\n "
1209
1214
" --refine-strings use string refinement (experimental)\n "
1215
+ " --string-non-empty add constraint that strings are non empty (experimental)\n " // NOLINT(*)
1216
+ " --string-printable add constraint that strings are printable (experimental)\n " // NOLINT(*)
1217
+ " --string-max-length add constraint on the length of strings (experimental)\n " // NOLINT(*)
1210
1218
" --outfile filename output formula to given file\n "
1211
1219
" --arrays-uf-never never turn arrays into uninterpreted functions\n " // NOLINT(*)
1212
1220
" --arrays-uf-always always turn arrays into uninterpreted functions\n " // NOLINT(*)
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class optionst;
38
38
" (no-sat-preprocessor)" \
39
39
" (no-pretty-names)(beautify)" \
40
40
" (dimacs)(refine)(max-node-refinement):(refine-arrays)(refine-arithmetic)" \
41
- " (refine-strings)" \
41
+ " (refine-strings)(string-non-empty)(string-printable)(string-max-length): " \
42
42
" (aig)(16)(32)(64)(LP64)(ILP64)(LLP64)(ILP32)(LP32)" \
43
43
" (little-endian)(big-endian)" \
44
44
" (show-goto-functions)(show-loops)" \
Original file line number Diff line number Diff line change @@ -232,6 +232,16 @@ cbmc_solverst::solvert* cbmc_solverst::get_string_refinement()
232
232
string_refinementt *string_refinement=new string_refinementt (
233
233
ns, *prop, MAX_NB_REFINEMENT);
234
234
string_refinement->set_ui (ui);
235
+
236
+ string_refinement->do_concretizing =options.get_bool_option (" trace" );
237
+ if (options.get_bool_option (" string-max-length" ))
238
+ string_refinement->set_max_string_length (
239
+ options.get_signed_int_option (" string-max-length" ));
240
+ if (options.get_bool_option (" string-non-empty" ))
241
+ string_refinement->enforce_non_empty_string ();
242
+ if (options.get_bool_option (" string-printable" ))
243
+ string_refinement->enforce_printable_characters ();
244
+
235
245
return new solvert (string_refinement, prop);
236
246
}
237
247
You can’t perform that action at this time.
0 commit comments