Skip to content

Commit 724efb2

Browse files
author
Daniel Kroening
committed
move binding_exprt to std_expr.h
This enables let_exprt to use binding_exprt.
1 parent f2742ba commit 724efb2

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

src/util/mathematical_expr.h

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -271,47 +271,6 @@ inline function_application_exprt &to_function_application_expr(exprt &expr)
271271
return ret;
272272
}
273273

274-
/// \brief A base class for variable bindings (quantifiers, let, lambda)
275-
class binding_exprt : public binary_exprt
276-
{
277-
public:
278-
using variablest = std::vector<symbol_exprt>;
279-
280-
/// construct the binding expression
281-
binding_exprt(
282-
irep_idt _id,
283-
const variablest &_variables,
284-
exprt _where,
285-
typet _type)
286-
: binary_exprt(
287-
tuple_exprt((const operandst &)_variables),
288-
_id,
289-
std::move(_where),
290-
std::move(_type))
291-
{
292-
}
293-
294-
variablest &variables()
295-
{
296-
return (variablest &)static_cast<tuple_exprt &>(op0()).operands();
297-
}
298-
299-
const variablest &variables() const
300-
{
301-
return (variablest &)static_cast<const tuple_exprt &>(op0()).operands();
302-
}
303-
304-
exprt &where()
305-
{
306-
return op1();
307-
}
308-
309-
const exprt &where() const
310-
{
311-
return op1();
312-
}
313-
};
314-
315274
/// \brief A base class for quantifier expressions
316275
class quantifier_exprt : public binding_exprt
317276
{

src/util/std_expr.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4282,6 +4282,47 @@ class infinity_exprt : public nullary_exprt
42824282
}
42834283
};
42844284

4285+
/// \brief A base class for variable bindings (quantifiers, let, lambda)
4286+
class binding_exprt : public binary_exprt
4287+
{
4288+
public:
4289+
using variablest = std::vector<symbol_exprt>;
4290+
4291+
/// construct the binding expression
4292+
binding_exprt(
4293+
irep_idt _id,
4294+
const variablest &_variables,
4295+
exprt _where,
4296+
typet _type)
4297+
: binary_exprt(
4298+
multi_ary_exprt(ID_tuple, (const operandst &)_variables, typet(ID_tuple)),
4299+
_id,
4300+
std::move(_where),
4301+
std::move(_type))
4302+
{
4303+
}
4304+
4305+
variablest &variables()
4306+
{
4307+
return (variablest &)to_multi_ary_expr(op0()).operands();
4308+
}
4309+
4310+
const variablest &variables() const
4311+
{
4312+
return (variablest &)to_multi_ary_expr(op0()).operands();
4313+
}
4314+
4315+
exprt &where()
4316+
{
4317+
return op1();
4318+
}
4319+
4320+
const exprt &where() const
4321+
{
4322+
return op1();
4323+
}
4324+
};
4325+
42854326
/// \brief A let expression
42864327
class let_exprt : public ternary_exprt
42874328
{

0 commit comments

Comments
 (0)