File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Expand file tree Collapse file tree 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)
320320 if (cmdline.isset (" refine-strings" ))
321321 {
322322 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" ));
323328 }
324329
325330 if (cmdline.isset (" max-node-refinement" ))
@@ -1207,6 +1212,9 @@ void cbmc_parse_optionst::help()
12071212 " --z3 use Z3\n "
12081213 " --refine use refinement procedure (experimental)\n "
12091214 " --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(*)
12101218 " --outfile filename output formula to given file\n "
12111219 " --arrays-uf-never never turn arrays into uninterpreted functions\n " // NOLINT(*)
12121220 " --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;
3838 " (no-sat-preprocessor)" \
3939 " (no-pretty-names)(beautify)" \
4040 " (dimacs)(refine)(max-node-refinement):(refine-arrays)(refine-arithmetic)" \
41- " (refine-strings)" \
41+ " (refine-strings)(string-non-empty)(string-printable)(string-max-length): " \
4242 " (aig)(16)(32)(64)(LP64)(ILP64)(LLP64)(ILP32)(LP32)" \
4343 " (little-endian)(big-endian)" \
4444 " (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()
232232 string_refinementt *string_refinement=new string_refinementt (
233233 ns, *prop, MAX_NB_REFINEMENT);
234234 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+
235245 return new solvert (string_refinement, prop);
236246}
237247
You can’t perform that action at this time.
0 commit comments