Skip to content

Commit c5aa507

Browse files
Document builtin function constructors
This describes what type of arguments we expect in the argument vector.
1 parent 3ef9ec8 commit c5aa507

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/solvers/refinement/string_builtin_function.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ class string_transformation_builtin_functiont : public string_builtin_functiont
4545
std::vector<exprt> args;
4646
exprt return_code;
4747

48-
/// Constructor from arguments of a function application
48+
/// Constructor from arguments of a function application.
49+
/// The arguments in `fun_args` should be in order:
50+
/// an integer `result.length`, a character pointer `&result[0]`,
51+
/// a string `arg1` of type refined_string_typet, and potentially some
52+
/// arguments of primitive types.
4953
string_transformation_builtin_functiont(
5054
const std::vector<exprt> &fun_args,
5155
array_poolt &array_pool);
@@ -73,6 +77,10 @@ class string_concat_char_builtin_functiont
7377
: public string_transformation_builtin_functiont
7478
{
7579
public:
80+
/// Constructor from arguments of a function application.
81+
/// The arguments in `fun_args` should be in order:
82+
/// an integer `result.length`, a character pointer `&result[0]`,
83+
/// a string `arg1` of type refined_string_typet, and a character.
7684
string_concat_char_builtin_functiont(
7785
const std::vector<exprt> &fun_args,
7886
array_poolt &array_pool)
@@ -100,7 +108,12 @@ class string_insertion_builtin_functiont : public string_builtin_functiont
100108
std::vector<exprt> args;
101109
exprt return_code;
102110

103-
/// Constructor from arguments of a function application
111+
/// Constructor from arguments of a function application.
112+
/// The arguments in `fun_args` should be in order:
113+
/// an integer `result.length`, a character pointer `&result[0]`,
114+
/// a string `arg1` of type refined_string_typet,
115+
/// a string `arg2` of type refined_string_typet,
116+
/// and potentially some arguments of primitive types.
104117
string_insertion_builtin_functiont(
105118
const std::vector<exprt> &fun_args,
106119
array_poolt &array_pool);
@@ -136,6 +149,12 @@ class string_concatenation_builtin_functiont final
136149
: public string_insertion_builtin_functiont
137150
{
138151
public:
152+
/// Constructor from arguments of a function application.
153+
/// The arguments in `fun_args` should be in order:
154+
/// an integer `result.length`, a character pointer `&result[0]`,
155+
/// a string `arg1` of type refined_string_typet,
156+
/// a string `arg2` of type refined_string_typet,
157+
/// optionally followed by an integer `start` and an integer `end`.
139158
string_concatenation_builtin_functiont(
140159
const std::vector<exprt> &fun_args,
141160
array_poolt &array_pool);

0 commit comments

Comments
 (0)