Skip to content

Commit 6f1ceb9

Browse files
authored
Merge pull request #4321 from diffblue/tuple_exprt
use a tuple for function arguments
2 parents 2bb84ad + a8e67cb commit 6f1ceb9

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/util/irep_ids.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ IREP_ID_ONE(typeid)
720720
IREP_ID_TWO(C_quoted, #quoted)
721721
IREP_ID_ONE(to_member)
722722
IREP_ID_ONE(pointer_to_member)
723+
IREP_ID_ONE(tuple)
723724

724725
// Projects depending on this code base that wish to extend the list of
725726
// available ids should provide a file local_irep_ids.def in their source tree

src/util/mathematical_expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function_application_exprt::function_application_exprt(
1515
: binary_exprt(
1616
_function,
1717
ID_function_application,
18-
multi_ary_exprt(irep_idt(), std::move(_arguments), typet()),
18+
tuple_exprt(std::move(_arguments)),
1919
to_mathematical_function_type(_function.type()).codomain())
2020
{
2121
const auto &domain = to_mathematical_function_type(_function.type()).domain();

src/util/mathematical_expr.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ inline void validate_expr(const factorial_power_exprt &value)
186186
validate_operands(value, 2, "Factorial power must have two operands");
187187
}
188188

189+
class tuple_exprt : public multi_ary_exprt
190+
{
191+
public:
192+
explicit tuple_exprt(exprt::operandst operands)
193+
: multi_ary_exprt(ID_tuple, std::move(operands), typet())
194+
{
195+
}
196+
};
197+
189198
/// \brief Application of (mathematical) function
190199
class function_application_exprt : public binary_exprt
191200
{
@@ -197,9 +206,12 @@ class function_application_exprt : public binary_exprt
197206
const symbol_exprt &_function,
198207
const argumentst &_arguments,
199208
const typet &_type)
200-
: binary_exprt(_function, ID_function_application, exprt(), _type)
209+
: binary_exprt(
210+
_function,
211+
ID_function_application,
212+
tuple_exprt(_arguments),
213+
_type)
201214
{
202-
arguments() = _arguments;
203215
}
204216

205217
function_application_exprt(

0 commit comments

Comments
 (0)