Skip to content

Commit 15e5493

Browse files
author
svorenova
committed
Add a constant for the default max-nondet-string-length
1 parent 1e821fd commit 15e5493

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/solvers/strings/string_refinement.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Author: Alberto Griggio, [email protected]
2121
#define CPROVER_SOLVERS_REFINEMENT_STRING_REFINEMENT_H
2222

2323
#include <limits>
24+
#include <util/magic.h>
2425
#include <util/replace_expr.h>
2526
#include <util/string_expr.h>
2627
#include <util/union_find_replace.h>
@@ -46,7 +47,7 @@ Author: Alberto Griggio, [email protected]
4647
" the switch can be used multiple times to give\n" /* NOLINT(*) */ \
4748
" several strings\n" /* NOLINT(*) */ \
4849
" --max-nondet-string-length n bound the length of nondet (e.g. input) strings;\n" /* NOLINT(*) */ \
49-
" set to 10000 by default\n" /* NOLINT(*) */
50+
" set to " + std::to_string(MAX_NONDET_STRING_LENGTH_DEFAULT) + " by default\n" /* NOLINT(*) */
5051

5152
// The integration of the string solver into CBMC is incomplete. Therefore,
5253
// it is not turned on by default and not all options are available.

src/util/magic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ const std::size_t MAX_CONCRETE_STRING_SIZE = 1 << 26;
1616
// The top end of the range of integers for which dstrings are precomputed
1717
constexpr std::size_t DSTRING_NUMBERS_MAX = 64;
1818

19+
const int MAX_NONDET_STRING_LENGTH_DEFAULT = 10000;
20+
1921
#endif

src/util/object_factory_parameters.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ Author: Diffblue Ltd
88

99
#include "object_factory_parameters.h"
1010

11-
#include <util/cmdline.h>
12-
#include <util/options.h>
11+
#include "cmdline.h"
12+
#include "magic.h"
13+
#include "options.h"
1314

1415
void object_factory_parameterst::set(const optionst &options)
1516
{
@@ -68,6 +69,7 @@ void parse_object_factory_options(const cmdlinet &cmdline, optionst &options)
6869
options.set_option(
6970
"min-null-tree-depth", cmdline.get_value("min-null-tree-depth"));
7071
}
72+
7173
if(cmdline.isset("max-nondet-string-length"))
7274
{
7375
options.set_option(
@@ -76,8 +78,10 @@ void parse_object_factory_options(const cmdlinet &cmdline, optionst &options)
7678
}
7779
else if(!cmdline.isset("no-refine-strings"))
7880
{
79-
options.set_option("max-nondet-string-length", 10000);
81+
options.set_option(
82+
"max-nondet-string-length", MAX_NONDET_STRING_LENGTH_DEFAULT);
8083
}
84+
8185
if(cmdline.isset("string-printable"))
8286
{
8387
options.set_option("string-printable", true);

0 commit comments

Comments
 (0)