@@ -257,7 +257,7 @@ inline void validate_expr(const function_application_exprt &value)
257
257
}
258
258
259
259
// / \brief A base class for quantifier expressions
260
- class quantifier_exprt : public binary_predicate_exprt
260
+ class quantifier_exprt : public binary_predicate_exprt
261
261
{
262
262
public:
263
263
quantifier_exprt (
@@ -297,9 +297,8 @@ class quantifier_exprt : public binary_predicate_exprt
297
297
// / \return Object of type \ref quantifier_exprt
298
298
inline const quantifier_exprt &to_quantifier_expr (const exprt &expr)
299
299
{
300
- DATA_INVARIANT (
301
- expr.operands ().size () == 2 ,
302
- " quantifier expressions must have two operands" );
300
+ DATA_INVARIANT (expr.operands ().size ()==2 ,
301
+ " quantifier expressions must have two operands" );
303
302
DATA_INVARIANT (
304
303
expr.op0 ().id () == ID_symbol, " quantified variable shall be a symbol" );
305
304
return static_cast <const quantifier_exprt &>(expr);
@@ -308,27 +307,26 @@ inline const quantifier_exprt &to_quantifier_expr(const exprt &expr)
308
307
// / \copydoc to_quantifier_expr(const exprt &)
309
308
inline quantifier_exprt &to_quantifier_expr (exprt &expr)
310
309
{
311
- DATA_INVARIANT (
312
- expr.operands ().size () == 2 ,
313
- " quantifier expressions must have two operands" );
310
+ DATA_INVARIANT (expr.operands ().size ()==2 ,
311
+ " quantifier expressions must have two operands" );
314
312
DATA_INVARIANT (
315
313
expr.op0 ().id () == ID_symbol, " quantified variable shall be a symbol" );
316
314
return static_cast <quantifier_exprt &>(expr);
317
315
}
318
316
319
- template <>
320
- inline bool can_cast_expr<quantifier_exprt>(const exprt &base)
317
+ template <> inline bool can_cast_expr<quantifier_exprt>(const exprt &base)
321
318
{
322
319
return base.id () == ID_forall || base.id () == ID_exists;
323
320
}
324
321
325
322
inline void validate_expr (const quantifier_exprt &value)
326
323
{
327
- validate_operands (value, 2 , " quantifier expressions must have two operands" );
324
+ validate_operands (value, 2 ,
325
+ " quantifier expressions must have two operands" );
328
326
}
329
327
330
328
// / \brief A forall expression
331
- class forall_exprt : public quantifier_exprt
329
+ class forall_exprt : public quantifier_exprt
332
330
{
333
331
public:
334
332
forall_exprt (const symbol_exprt &_symbol, const exprt &_where)
@@ -337,8 +335,26 @@ class forall_exprt : public quantifier_exprt
337
335
}
338
336
};
339
337
338
+ inline const forall_exprt &to_forall_expr (const exprt &expr)
339
+ {
340
+ PRECONDITION (expr.id () == ID_forall);
341
+ DATA_INVARIANT (
342
+ expr.operands ().size () == 2 ,
343
+ " forall expressions have exactly two operands" );
344
+ return static_cast <const forall_exprt &>(expr);
345
+ }
346
+
347
+ inline forall_exprt &to_forall_expr (exprt &expr)
348
+ {
349
+ PRECONDITION (expr.id () == ID_forall);
350
+ DATA_INVARIANT (
351
+ expr.operands ().size () == 2 ,
352
+ " forall expressions have exactly two operands" );
353
+ return static_cast <forall_exprt &>(expr);
354
+ }
355
+
340
356
// / \brief An exists expression
341
- class exists_exprt : public quantifier_exprt
357
+ class exists_exprt : public quantifier_exprt
342
358
{
343
359
public:
344
360
exists_exprt (const symbol_exprt &_symbol, const exprt &_where)
0 commit comments