Skip to content

Commit 535aea7

Browse files
author
Daniel Kroening
committed
move binding_exprt to std_expr.h
This enables let_exprt to use binding_exprt.
1 parent 7ef8430 commit 535aea7

File tree

2 files changed

+44
-41
lines changed

2 files changed

+44
-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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4282,6 +4282,50 @@ 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(
4299+
ID_tuple,
4300+
(const operandst &)_variables,
4301+
typet(ID_tuple)),
4302+
_id,
4303+
std::move(_where),
4304+
std::move(_type))
4305+
{
4306+
}
4307+
4308+
variablest &variables()
4309+
{
4310+
return (variablest &)to_multi_ary_expr(op0()).operands();
4311+
}
4312+
4313+
const variablest &variables() const
4314+
{
4315+
return (variablest &)to_multi_ary_expr(op0()).operands();
4316+
}
4317+
4318+
exprt &where()
4319+
{
4320+
return op1();
4321+
}
4322+
4323+
const exprt &where() const
4324+
{
4325+
return op1();
4326+
}
4327+
};
4328+
42854329
/// \brief A let expression
42864330
class let_exprt : public ternary_exprt
42874331
{

0 commit comments

Comments
 (0)