Skip to content

Commit 2296946

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

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*******************************************************************\
2+
3+
Module: Defines the default value for max-nondet-string-length command-line
4+
option. The value was chosen based on benchmarking.
5+
6+
Author: Maria Svorenova, [email protected]
7+
8+
\*******************************************************************/
9+
10+
#ifndef CPROVER_SOLVERS_STRINGS_MAX_NONDET_STRING_LENGTH_DEFAULT_H
11+
#define CPROVER_SOLVERS_STRINGS_MAX_NONDET_STRING_LENGTH_DEFAULT_H
12+
13+
const int MAX_NONDET_STRING_LENGTH_DEFAULT = 10000;
14+
15+
#endif // CPROVER_SOLVERS_STRINGS_MAX_NONDET_STRING_LENGTH_DEFAULT_H

src/solvers/strings/string_refinement.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Author: Alberto Griggio, [email protected]
2525
#include <util/string_expr.h>
2626
#include <util/union_find_replace.h>
2727

28+
#include "max_nondet_string_length_default.h"
2829
#include "string_constraint.h"
2930
#include "string_constraint_generator.h"
3031
#include "string_refinement_invariant.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/object_factory_parameters.cpp

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

99
#include "object_factory_parameters.h"
1010

11+
#include <solvers/strings/max_nondet_string_length_default.h>
1112
#include <util/cmdline.h>
1213
#include <util/options.h>
1314

@@ -76,7 +77,8 @@ void parse_object_factory_options(const cmdlinet &cmdline, optionst &options)
7677
}
7778
else if(!cmdline.isset("no-refine-strings"))
7879
{
79-
options.set_option("max-nondet-string-length", 10000);
80+
options.set_option(
81+
"max-nondet-string-length", MAX_NONDET_STRING_LENGTH_DEFAULT);
8082
}
8183
if(cmdline.isset("string-printable"))
8284
{

0 commit comments

Comments
 (0)