Skip to content

Commit 3069c77

Browse files
author
Daniel Kroening
authored
Merge pull request #274 from romainbrenguier/string-solver-flattening
adding a convert_function_application in the flattening that will be …
2 parents a146411 + 46b1c2f commit 3069c77

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

src/solvers/flattening/boolbv.cpp

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,7 @@ bvt boolbvt::convert_bitvector(const exprt &expr)
334334
}
335335
else if(expr.id()==ID_function_application)
336336
{
337-
// record
338-
functions.record(to_function_application_expr(expr));
339-
340-
// make it free bits
341-
return prop.new_variables(boolbv_width(expr.type()));
337+
return convert_function_application(to_function_application_expr(expr));
342338
}
343339
else if(expr.id()==ID_reduction_or || expr.id()==ID_reduction_and ||
344340
expr.id()==ID_reduction_nor || expr.id()==ID_reduction_nand ||
@@ -502,6 +498,30 @@ bvt boolbvt::convert_symbol(const exprt &expr)
502498

503499
return bv;
504500
}
501+
502+
503+
/*******************************************************************\
504+
505+
Function: boolbvt::convert_function_application
506+
507+
Inputs:
508+
509+
Outputs:
510+
511+
Purpose:
512+
513+
\*******************************************************************/
514+
515+
bvt boolbvt::convert_function_application(
516+
const function_application_exprt &expr)
517+
{
518+
// record
519+
functions.record(expr);
520+
521+
// make it free bits
522+
return prop.new_variables(boolbv_width(expr.type()));
523+
}
524+
505525

506526
/*******************************************************************\
507527

src/solvers/flattening/boolbv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class boolbvt:public arrayst
169169
virtual bvt convert_bv_reduction(const unary_exprt &expr);
170170
virtual bvt convert_not(const not_exprt &expr);
171171
virtual bvt convert_power(const binary_exprt &expr);
172+
virtual bvt convert_function_application(const function_application_exprt &expr);
172173

173174
virtual void make_bv_expr(const typet &type, const bvt &bv, exprt &dest);
174175
virtual void make_free_bv_expr(const typet &type, exprt &dest);

0 commit comments

Comments
 (0)