88 if(
pos!=std::string::npos)
99 if(c_pos!=std::string::npos &&
100 dest.rfind(
"::")==c_pos)
101 dest.erase(0, c_pos+2);
102 else if(c_pos!=std::string::npos)
122 for(
const auto &symbol_id : symbols)
133 func = func.substr(0, func.rfind(
"::"));
143 if(!
shorthands.insert(std::make_pair(symbol_id, sh)).second)
147 for(
const auto &symbol_id : symbols)
163 has_collision=!
ns.
lookup(sh, symbol);
184 const std::string symbol_str =
id2string(symbol_id);
185 const std::string func = symbol_str.substr(0, symbol_str.find(
"::"));
191 const auto func_type =
192 type_checked_cast<code_typet>(func_symbol->
type);
193 const auto params = func_type.parameters();
194 for(
const auto ¶m : params)
196 const auto param_id = param.get_identifier();
197 if(param_id != symbol_id && sh ==
id_shorthand(param_id))
199 has_collision =
true;
210 shorthands.insert(std::make_pair(symbol_id, sh));
222 const std::string &declarator)
224 std::unique_ptr<qualifierst> clone = qualifiers.
clone();
226 new_qualifiers.
read(src);
228 std::string q=new_qualifiers.
as_string();
230 std::string d = declarator.empty() ? declarator :
" " + declarator;
237 if(src.
id()==ID_bool)
241 else if(src.
id()==ID_c_bool)
245 else if(src.
id()==ID_string)
249 else if(src.
id()==ID_natural ||
250 src.
id()==ID_integer ||
251 src.
id()==ID_rational)
255 else if(src.
id()==ID_empty)
259 else if(src.
id()==ID_complex)
264 else if(src.
id()==ID_floatbv)
273 return q+
"long double"+d;
278 return q +
CPROVER_PREFIX +
"floatbv[" + swidth +
"][" + fwidth +
"]";
281 else if(src.
id()==ID_fixedbv)
289 else if(src.
id()==ID_c_bit_field)
294 else if(src.
id()==ID_signedbv ||
295 src.
id()==ID_unsignedbv)
301 if(c_type==ID_char &&
304 if(src.
id()==ID_signedbv)
305 return q+
"signed char"+d;
307 return q+
"unsigned char"+d;
309 else if(c_type!=ID_wchar_t && !c_type_str.
empty())
310 return q+c_type_str+d;
317 std::string sign_str=
is_signed?
"signed ":
"unsigned ";
323 return q+sign_str+
"int"+d;
329 return q+sign_str+
"long int"+d;
334 return q+sign_str+
"char"+d;
340 return q+sign_str+
"short int"+d;
346 return q+sign_str+
"long long int"+d;
352 return q + sign_str +
"__int128" + d;
360 else if(src.
id()==ID_struct)
364 else if(src.
id()==ID_union)
368 std::string dest=q+
"union";
392 else if(src.
id()==ID_c_enum)
423 for(c_enum_typet::memberst::const_iterator it = members.begin();
429 if(it != members.begin())
432 result +=
id2string(it->get_base_name());
443 else if(src.
id()==ID_c_enum_tag)
447 std::string result=q+
"enum";
452 else if(src.
id()==ID_pointer)
459 std::string new_declarator=
"*";
461 if(!q.empty() && (!declarator.empty() || subtype.
id() == ID_pointer))
463 new_declarator+=
" "+q;
466 new_declarator+=declarator;
470 subtype.
id() == ID_code ||
473 new_declarator=
"("+new_declarator+
")";
476 return convert_rec(subtype, sub_qualifiers, new_declarator);
478 else if(src.
id()==ID_array)
482 else if(src.
id()==ID_struct_tag)
487 std::string dest=q+
"struct";
495 else if(src.
id()==ID_union_tag)
500 std::string dest=q+
"union";
508 else if(src.
id()==ID_code)
514 std::string dest=declarator+
"(";
518 if(parameters.empty())
525 for(code_typet::parameterst::const_iterator
526 it=parameters.begin();
527 it!=parameters.end();
530 if(it!=parameters.begin())
533 if(it->get_identifier().empty())
537 std::string arg_declarator=
562 const typet *non_ptr_type = &return_type;
563 while(non_ptr_type->
id()==ID_pointer)
564 non_ptr_type = &(non_ptr_type->
subtype());
566 if(non_ptr_type->
id()==ID_code ||
567 non_ptr_type->
id()==ID_array)
568 dest=
convert_rec(return_type, ret_qualifiers, dest);
570 dest=
convert_rec(return_type, ret_qualifiers,
"")+
" "+dest;
576 if(dest[dest.size()-1]==
' ')
577 dest.resize(dest.size()-1);
583 dest +=
" [[requires " +
convert(requires) +
"]]";
588 dest +=
" [[assigns " +
594 dest +=
" [[ensures " +
convert(ensures) +
"]]";
599 else if(src.
id()==ID_vector)
603 const mp_integer size_int = numeric_cast_v<mp_integer>(vector_type.
size());
608 if(tmp==
"signed char" || tmp==
"char")
610 else if(tmp==
"signed short int")
612 else if(tmp==
"signed int")
614 else if(tmp==
"signed long long int")
616 else if(tmp==
"float")
618 else if(tmp==
"double")
624 dest+=
" __attribute__((vector_size (";
626 dest+=
"*sizeof("+subtype+
"))))";
631 else if(src.
id()==ID_constructor ||
632 src.
id()==ID_destructor)
634 return q+
"__attribute__(("+
id2string(src.
id())+
")) void"+d;
655 const std::string &qualifiers_str,
656 const std::string &declarator_str)
678 const std::string &qualifiers,
679 const std::string &declarator,
680 bool inc_struct_body,
681 bool inc_padding_components)
686 assert(inc_struct_body || !inc_padding_components);
690 std::string dest=qualifiers+
"struct";
703 if(
component.get_is_padding() && !inc_padding_components)
733 const std::string &declarator_str)
750 const std::string &declarator_str,
751 bool inc_size_if_possible)
754 std::string array_suffix;
756 if(
to_array_type(src).size().is_nil() || !inc_size_if_possible)
764 src.
subtype(), qualifiers, declarator_str+array_suffix);
769 unsigned &precedence)
779 if(to_type.
id()==ID_c_bool &&
783 if(to_type.
id()==ID_bool &&
787 std::string dest =
"(" +
convert(to_type) +
")";
803 const std::string &symbol1,
804 const std::string &symbol2,
850 const std::string &symbol,
862 std::string dest=symbol+
" { ";
892 for(
size_t i=1; i<src.
operands().size(); i+=2)
894 std::string op1, op2;
900 if(src.
operands()[i].id()==ID_member_name)
903 src.
operands()[i].get(ID_component_name);
918 display_component_name=component_name;
922 op1=
"."+
id2string(display_component_name);
950 std::string dest=
"LET ";
967 std::string op0, op1, op2;
981 const exprt &designator = src.
op1();
1001 unsigned precedence)
1006 bool condition=
true;
1008 std::string dest=
"cond {\n";
1025 condition=!condition;
1035 const std::string &symbol,
1036 unsigned precedence,
1037 bool full_parentheses)
1056 bool use_parentheses0=
1058 (precedence==p0 && full_parentheses) ||
1059 (precedence==p0 && src.
id()!=op0.
id());
1061 if(use_parentheses0)
1064 if(use_parentheses0)
1071 bool use_parentheses1=
1073 (precedence==p1 && full_parentheses) ||
1074 (precedence==p1 && src.
id()!=op1.
id());
1076 if(use_parentheses1)
1079 if(use_parentheses1)
1087 const std::string &symbol,
1088 unsigned precedence,
1089 bool full_parentheses)
1119 bool use_parentheses=
1121 (precedence==p && full_parentheses) ||
1122 (precedence==p && src.
id()!=it->id());
1136 const std::string &symbol,
1137 unsigned precedence)
1142 std::string dest=symbol;
1165 std::string dest =
"ALLOCATE";
1168 if(src.
type().
id()==ID_pointer &&
1175 dest += op0 +
", " + op1;
1183 unsigned &precedence)
1193 unsigned &precedence)
1208 unsigned &precedence)
1223 unsigned &precedence)
1226 return "PROB_UNIFORM(" +
convert(src.
type()) +
"," +
1234 std::string dest=name;
1255 unsigned precedence)
1262 if(*op0.rbegin()==
';')
1263 op0.resize(op0.size()-1);
1267 if(*op1.rbegin()==
';')
1268 op1.resize(op1.size()-1);
1270 std::string dest=op0;
1279 unsigned precedence)
1308 std::string dest=name;
1329 unsigned precedence)
1339 unsigned precedence)
1390 const std::string &symbol,
1391 unsigned precedence)
1412 unsigned precedence)
1435 const exprt &src,
unsigned &precedence)
1440 std::string dest=
"POINTER_ARITHMETIC(";
1472 const exprt &src,
unsigned &precedence)
1479 std::string dest=
"POINTER_DIFFERENCE(";
1484 op =
convert(binary_expr.op0().type());
1512 unsigned precedence;
1517 return "."+src.
get_string(ID_component_name);
1522 unsigned precedence;
1532 unsigned precedence)
1534 const auto &compound = src.
compound();
1539 if(compound.id() == ID_dereference)
1545 if(precedence > p || pointer.id() == ID_typecast)
1548 if(precedence > p || pointer.id() == ID_typecast)
1557 if(precedence > p || compound.id() == ID_typecast)
1560 if(precedence > p || compound.id() == ID_typecast)
1568 if(full_type.
id()!=ID_struct &&
1569 full_type.
id()!=ID_union)
1577 if(!component_name.
empty())
1584 if(!comp_expr.
get(ID_pretty_name).
empty())
1606 unsigned precedence)
1616 unsigned precedence)
1626 unsigned &precedence)
1642 to_unary_expr(src).op().
id() == ID_predicate_passive_symbol)
1648 std::unordered_map<irep_idt, irep_idt>::const_iterator entry =
1672 if(src.
id()==ID_next_symbol)
1673 dest=
"NEXT("+dest+
")";
1681 return "nondet_symbol("+
id2string(
id)+
")";
1686 const std::string &
id=src.
get_string(ID_identifier);
1687 return "ps("+
id+
")";
1692 const std::string &
id=src.
get_string(ID_identifier);
1693 return "pns("+
id+
")";
1698 const std::string &
id=src.
get_string(ID_identifier);
1699 return "pps("+
id+
")";
1704 const std::string &
id=src.
get_string(ID_identifier);
1710 return "nondet_bool()";
1715 unsigned &precedence)
1720 std::string result=
"<";
1739 unsigned &precedence)
1746 if(type.
id()==ID_integer ||
1747 type.
id()==ID_natural ||
1748 type.
id()==ID_rational)
1752 else if(type.
id()==ID_c_enum ||
1753 type.
id()==ID_c_enum_tag)
1759 if(c_enum_type.
id()!=ID_c_enum)
1767 for(
const auto &member : members)
1769 if(member.get_value() == value)
1770 return "/*enum*/" +
id2string(member.get_base_name());
1778 std::string value_as_string =
1782 return value_as_string;
1784 return "/*enum*/" + value_as_string;
1786 else if(type.
id()==ID_rational)
1788 else if(type.
id()==ID_bv)
1793 else if(type.
id()==ID_bool)
1797 else if(type.
id()==ID_unsignedbv ||
1798 type.
id()==ID_signedbv ||
1799 type.
id()==ID_c_bit_field ||
1800 type.
id()==ID_c_bool)
1808 type.
id()==ID_c_bit_field?type.
subtype().
get(ID_C_c_type):
1809 type.
get(ID_C_c_type);
1811 if(type.
id()==ID_c_bool)
1821 else if(int_value==
'\r')
1823 else if(int_value==
'\t')
1825 else if(int_value==
'\'')
1827 else if(int_value==
'\\')
1829 else if(int_value>=
' ' && int_value<126)
1832 dest += numeric_cast_v<char>(int_value);
1849 if(c_type==ID_unsigned_int)
1851 else if(c_type==ID_unsigned_long_int)
1853 else if(c_type==ID_signed_long_int)
1855 else if(c_type==ID_unsigned_long_long_int)
1857 else if(c_type==ID_signed_long_long_int)
1863 const auto sizeof_expr_opt =
1866 if(sizeof_expr_opt.has_value())
1869 dest =
convert(sizeof_expr_opt.value()) +
" /*" + dest +
"*/ ";
1875 else if(type.
id()==ID_floatbv)
1879 if(!dest.empty() && isdigit(dest[dest.size() - 1]))
1881 if(dest.find(
'.')==std::string::npos)
1891 else if(dest.size()==4 &&
1892 (dest[0]==
'+' || dest[0]==
'-'))
1898 else if(dest ==
"-inf")
1900 else if(dest ==
"+NaN")
1902 else if(dest ==
"-NaN")
1908 std::string suffix =
"";
1919 dest =
"(1.0" + suffix +
"/0.0" + suffix +
")";
1920 else if(dest ==
"-inf")
1921 dest =
"(-1.0" + suffix +
"/0.0" + suffix +
")";
1922 else if(dest ==
"+NaN")
1923 dest =
"(0.0" + suffix +
"/0.0" + suffix +
")";
1924 else if(dest ==
"-NaN")
1925 dest =
"(-0.0" + suffix +
"/0.0" + suffix +
")";
1929 else if(type.
id()==ID_fixedbv)
1933 if(!dest.empty() && isdigit(dest[dest.size() - 1]))
1941 else if(type.
id() == ID_array)
1945 else if(type.
id()==ID_pointer)
1956 dest=
"(("+
convert(type)+
")"+dest+
")";
1958 else if(src.
operands().size() == 1)
1962 if(annotation.id() == ID_constant)
1966 if(op_value==
"INVALID" ||
1968 op_value==
"NULL+offset")
1983 else if(type.
id()==ID_string)
2007 unsigned &precedence)
2023 unsigned &precedence,
2024 bool include_padding_components)
2028 if(full_type.
id()!=ID_struct)
2037 if(components.size()!=src.
operands().size())
2040 std::string dest=
"{ ";
2042 exprt::operandst::const_iterator o_it=src.
operands().begin();
2050 if(o_it->type().id()==ID_code)
2053 if(
component.get_is_padding() && !include_padding_components)
2071 std::string tmp=
convert(*o_it);
2073 if(last_size+40<dest.size())
2076 last_size=dest.size();
2096 unsigned &precedence)
2100 if(type.
id() != ID_vector)
2103 std::string dest=
"{ ";
2125 if(last_size+40<dest.size())
2128 last_size=dest.size();
2143 unsigned &precedence)
2145 std::string dest=
"{ ";
2169 bool all_constant=
true;
2172 if(!it->is_constant())
2175 if(src.
get_bool(ID_C_string_constant) &&
2186 dest.reserve(dest.size()+1+src.
operands().size());
2188 bool last_was_hex=
false;
2209 case '\n': dest+=
"\\n";
break;
2210 case '\t': dest+=
"\\t";
break;
2211 case '\v': dest+=
"\\v";
break;
2212 case '\b': dest+=
"\\b";
break;
2213 case '\r': dest+=
"\\r";
break;
2214 case '\f': dest+=
"\\f";
break;
2215 case '\a': dest+=
"\\a";
break;
2216 case '\\': dest+=
"\\\\";
break;
2217 case '"': dest+=
"\\\"";
break;
2220 if(ch>=
' ' && ch!=127 && ch<0xff)
2221 dest+=
static_cast<char>(ch);
2224 std::ostringstream oss;
2225 oss <<
"\\x" << std::hex << ch;
2243 if(it->is_not_nil())
2263 unsigned &precedence)
2265 std::string dest=
"{ ";
2272 std::string tmp1=
convert(*it);
2276 std::string tmp2=
convert(*it);
2278 std::string tmp=
"["+tmp1+
"]="+tmp2;
2298 if(src.
id()!=ID_compound_literal)
2315 if(src.
id()!=ID_compound_literal)
2354 const auto complement_width_expr =
2359 if(src.
id() == ID_rol)
2362 lhs_expr =
shl_exprt(op0, distance_modulo_width);
2364 rhs_expr =
ashr_exprt(op0, complement_width_expr);
2366 else if(src.
id() == ID_ror)
2369 lhs_expr =
ashr_exprt(op0, distance_modulo_width);
2371 rhs_expr =
shl_exprt(op0, complement_width_expr);
2385 unsigned precedence;
2391 const exprt &designator =
static_cast<const exprt &
>(src.
find(ID_designator));
2392 if(designator.
operands().size() != 1)
2394 unsigned precedence;
2402 if(designator_id.
id() == ID_member)
2404 dest =
"." +
id2string(designator_id.
get(ID_component_name));
2407 designator_id.
id() == ID_index && designator_id.
operands().size() == 1)
2413 unsigned precedence;
2483 unsigned &precedence)
2487 std::string dest=
"overflow(\"";
2514 return std::string(indent,
' ');
2529 if(!src.
operands()[1].operands().empty() ||
2530 !src.
operands()[2].operands().empty() ||
2531 !src.
operands()[3].operands().empty() ||
2532 !src.
operands()[4].operands().empty())
2540 if(it->operands().size()==2)
2555 if(it->operands().size()==2)
2572 if(it->id()==ID_gcc_asm_clobbered_register)
2601 unsigned precedence;
2627 unsigned precedence;
2656 unsigned precedence;
2693 unsigned precedence;
2735 unsigned precedence;
2751 const exprt &op=*it;
2753 if(op.
get(ID_statement)!=ID_block)
2755 unsigned precedence;
2789 unsigned precedence;
2797 const symbolt *symbol=
nullptr;
2808 dest +=
"__declspec(dllexport) ";
2811 if(symbol->
type.
id()==ID_code &&
2833 unsigned precedence;
2846 unsigned precedence;
2884 for(
const auto &statement : src.
statements())
2886 if(statement.get_statement() == ID_label)
2921 std::string expr_str;
2926 unsigned precedence;
2931 if(dest.empty() || *dest.rbegin()!=
';')
2941 static bool comment_done=
false;
2956 std::ostringstream oss;
2964 [](
const std::pair<irep_idt, irept> &p) { return p.first; });
2975 if(statement==ID_expression)
2978 if(statement==ID_block)
2981 if(statement==ID_switch)
2984 if(statement==ID_for)
2987 if(statement==ID_while)
2990 if(statement==ID_asm)
2993 if(statement==ID_skip)
2996 if(statement==ID_dowhile)
2999 if(statement==ID_ifthenelse)
3002 if(statement==ID_return)
3005 if(statement==ID_goto)
3008 if(statement==ID_printf)
3011 if(statement==ID_fence)
3020 if(statement==ID_assume)
3023 if(statement==ID_assert)
3026 if(statement==ID_break)
3029 if(statement==ID_continue)
3032 if(statement==ID_decl)
3035 if(statement==ID_decl_block)
3038 if(statement==ID_dead)
3041 if(statement==ID_assign)
3044 if(statement==
"lock")
3047 if(statement==
"unlock")
3050 if(statement==ID_atomic_begin)
3053 if(statement==ID_atomic_end)
3056 if(statement==ID_function_call)
3059 if(statement==ID_label)
3062 if(statement==ID_switch_case)
3065 if(statement==ID_array_set)
3068 if(statement==ID_array_copy)
3071 if(statement==ID_array_replace)
3074 if(statement == ID_set_may || statement == ID_set_must)
3078 unsigned precedence;
3096 unsigned precedence;
3109 unsigned precedence;
3122 unsigned precedence;
3153 if(it!=arguments.begin())
3168 std::string dest=
indent_str(indent)+
"printf(";
3190 std::string dest=
indent_str(indent)+
"FENCE(";
3193 { ID_WRfence, ID_RRfence, ID_RWfence, ID_WWfence,
3194 ID_RRcumul, ID_RWcumul, ID_WWcumul, ID_WRcumul,
3199 for(
unsigned i=0; !att[i].
empty(); i++)
3220 std::string dest=
indent_str(indent)+
"INPUT(";
3242 std::string dest=
indent_str(indent)+
"OUTPUT(";
3263 std::string dest=
indent_str(indent)+
"ARRAY_SET(";
3285 std::string dest=
indent_str(indent)+
"ARRAY_COPY(";
3307 std::string dest=
indent_str(indent)+
"ARRAY_REPLACE(";
3330 unsigned precedence;
3343 unsigned precedence;
3355 std::string labels_string;
3359 labels_string+=
"\n";
3362 labels_string+=
":\n";
3366 return labels_string+tmp;
3373 std::string labels_string;
3377 labels_string+=
"\n";
3379 labels_string+=
"default:\n";
3383 labels_string+=
"\n";
3385 labels_string+=
"case ";
3387 labels_string+=
":\n";
3390 unsigned next_indent=indent;
3396 return labels_string+tmp;
3406 unsigned precedence;
3414 static_cast<const codet &
>(src.
find(ID_code));
3416 std::string dest=
"\n";
3421 std::string assumption_str=
convert(assumption);
3423 dest+=assumption_str;
3436 std::string assertion_str=
convert(assertion);
3438 dest+=assertion_str;
3473 unsigned &precedence)
3478 std::string dest=
"sizeof(";
3487 unsigned &precedence)
3491 if(src.
id()==ID_plus)
3494 else if(src.
id()==ID_minus)
3497 else if(src.
id()==ID_unary_minus)
3500 else if(src.
id()==ID_unary_plus)
3503 else if(src.
id()==ID_floatbv_typecast)
3507 std::string dest=
"FLOAT_TYPECAST(";
3536 else if(src.
id()==ID_sign)
3544 else if(src.
id()==ID_popcount)
3552 else if(src.
id()==
"pointer_arithmetic")
3555 else if(src.
id()==
"pointer_difference")
3558 else if(src.
id() == ID_null_object)
3559 return "NULL-object";
3561 else if(src.
id()==ID_integer_address ||
3562 src.
id()==ID_integer_address_object ||
3563 src.
id()==ID_stack_object ||
3564 src.
id()==ID_static_object)
3569 else if(src.
id()==
"builtin-function")
3572 else if(src.
id()==ID_array_of)
3575 else if(src.
id()==ID_bswap)
3587 else if(src.
id()==ID_address_of)
3591 if(
object.
id() == ID_label)
3592 return "&&" +
object.
get_string(ID_identifier);
3593 else if(
object.
id() == ID_index &&
to_index_expr(
object).index().is_zero())
3601 else if(src.
id()==ID_dereference)
3605 if(src.
type().
id() == ID_code)
3608 pointer.id() == ID_plus && pointer.operands().size() == 2 &&
3619 else if(src.
id()==ID_index)
3622 else if(src.
id()==ID_member)
3625 else if(src.
id()==
"array-member-value")
3628 else if(src.
id()==
"struct-member-value")
3631 else if(src.
id()==ID_function_application)
3634 else if(src.
id()==ID_side_effect)
3637 if(statement==ID_preincrement)
3639 else if(statement==ID_predecrement)
3641 else if(statement==ID_postincrement)
3643 else if(statement==ID_postdecrement)
3645 else if(statement==ID_assign_plus)
3647 else if(statement==ID_assign_minus)
3649 else if(statement==ID_assign_mult)
3651 else if(statement==ID_assign_div)
3653 else if(statement==ID_assign_mod)
3655 else if(statement==ID_assign_shl)
3657 else if(statement==ID_assign_shr)
3659 else if(statement==ID_assign_bitand)
3661 else if(statement==ID_assign_bitxor)
3663 else if(statement==ID_assign_bitor)
3665 else if(statement==ID_assign)
3667 else if(statement==ID_function_call)
3670 else if(statement == ID_allocate)
3672 else if(statement==ID_printf)
3674 else if(statement==ID_nondet)
3676 else if(statement==
"prob_coin")
3678 else if(statement==
"prob_unif")
3680 else if(statement==ID_statement_expression)
3682 else if(statement == ID_va_start)
3688 else if(src.
id()==ID_literal)
3691 else if(src.
id()==ID_not)
3694 else if(src.
id()==ID_bitnot)
3697 else if(src.
id()==ID_mult)
3700 else if(src.
id()==ID_div)
3703 else if(src.
id()==ID_mod)
3706 else if(src.
id()==ID_shl)
3709 else if(src.
id()==ID_ashr || src.
id()==ID_lshr)
3712 else if(src.
id()==ID_lt || src.
id()==ID_gt ||
3713 src.
id()==ID_le || src.
id()==ID_ge)
3719 else if(src.
id()==ID_notequal)
3722 else if(src.
id()==ID_equal)
3725 else if(src.
id()==ID_complex)
3728 else if(src.
id()==ID_bitand)
3731 else if(src.
id()==ID_bitxor)
3734 else if(src.
id()==ID_bitor)
3737 else if(src.
id()==ID_and)
3740 else if(src.
id()==ID_or)
3743 else if(src.
id()==ID_xor)
3746 else if(src.
id()==ID_implies)
3749 else if(src.
id()==ID_if)
3752 else if(src.
id()==ID_forall)
3756 else if(src.
id()==ID_exists)
3760 else if(src.
id()==ID_lambda)
3764 else if(src.
id()==ID_with)
3767 else if(src.
id()==ID_update)
3770 else if(src.
id()==ID_member_designator)
3773 else if(src.
id()==ID_index_designator)
3776 else if(src.
id()==ID_symbol)
3779 else if(src.
id()==ID_next_symbol)
3782 else if(src.
id()==ID_nondet_symbol)
3785 else if(src.
id()==ID_predicate_symbol)
3788 else if(src.
id()==ID_predicate_next_symbol)
3791 else if(src.
id()==ID_predicate_passive_symbol)
3794 else if(src.
id()==
"quant_symbol")
3797 else if(src.
id()==ID_nondet_bool)
3800 else if(src.
id()==ID_object_descriptor)
3803 else if(src.
id()==
"Hoare")
3806 else if(src.
id()==ID_code)
3809 else if(src.
id()==ID_constant)
3812 else if(src.
id()==ID_string_constant)
3816 else if(src.
id()==ID_struct)
3819 else if(src.
id()==ID_vector)
3822 else if(src.
id()==ID_union)
3825 else if(src.
id()==ID_array)
3828 else if(src.
id() == ID_array_list)
3831 else if(src.
id()==ID_typecast)
3834 else if(src.
id()==ID_comma)
3837 else if(src.
id()==ID_ptr_object)
3838 return "PTR_OBJECT("+
id2string(src.
get(ID_identifier))+
")";
3840 else if(src.
id()==ID_cond)
3844 src.
id() == ID_overflow_unary_minus || src.
id() == ID_overflow_minus ||
3845 src.
id() == ID_overflow_mult || src.
id() == ID_overflow_plus ||
3846 src.
id() == ID_overflow_shl)
3851 else if(src.
id()==ID_unknown)
3854 else if(src.
id()==ID_invalid)
3857 else if(src.
id()==ID_extractbit)
3860 else if(src.
id()==ID_extractbits)
3863 else if(src.
id()==ID_initializer_list ||
3864 src.
id()==ID_compound_literal)
3870 else if(src.
id()==ID_designated_initializer)
3876 else if(src.
id()==ID_sizeof)
3879 else if(src.
id()==ID_let)
3882 else if(src.
id()==ID_type)
3885 else if(src.
id() == ID_rol || src.
id() == ID_ror)
3889 if(function_string_opt.has_value())
3890 return *function_string_opt;
3898 static const std::map<irep_idt, std::string> function_names = {
3899 {
"buffer_size",
"BUFFER_SIZE"},
3900 {
"is_zero_string",
"IS_ZERO_STRING"},
3901 {
"object_value",
"OBJECT_VALUE"},
3902 {
"pointer_base",
"POINTER_BASE"},
3903 {
"pointer_cons",
"POINTER_CONS"},
3904 {
"zero_string",
"ZERO_STRING"},
3905 {
"zero_string_length",
"ZERO_STRING_LENGTH"},
3907 {ID_alignof,
"alignof"},
3908 {ID_builtin_offsetof,
"builtin_offsetof"},
3909 {ID_complex_imag,
"__imag__"},
3910 {ID_complex_real,
"__real__"},
3911 {ID_concatenation,
"CONCATENATION"},
3912 {ID_count_leading_zeros,
"__builtin_clz"},
3913 {ID_count_trailing_zeros,
"__builtin_ctz"},
3914 {ID_dynamic_object,
"DYNAMIC_OBJECT"},
3915 {ID_floatbv_div,
"FLOAT/"},
3916 {ID_floatbv_minus,
"FLOAT-"},
3917 {ID_floatbv_mult,
"FLOAT*"},
3918 {ID_floatbv_plus,
"FLOAT+"},
3919 {ID_floatbv_rem,
"FLOAT%"},
3920 {ID_gcc_builtin_va_arg,
"gcc_builtin_va_arg"},
3923 {ID_good_pointer,
"GOOD_POINTER"},
3924 {ID_ieee_float_equal,
"IEEE_FLOAT_EQUAL"},
3925 {ID_ieee_float_notequal,
"IEEE_FLOAT_NOTEQUAL"},
3926 {ID_infinity,
"INFINITY"},
3927 {ID_is_dynamic_object,
"IS_DYNAMIC_OBJECT"},
3928 {ID_is_invalid_pointer,
"IS_INVALID_POINTER"},
3930 {ID_isfinite,
"isfinite"},
3931 {ID_isinf,
"isinf"},
3932 {ID_isnan,
"isnan"},
3933 {ID_isnormal,
"isnormal"},
3934 {ID_object_size,
"OBJECT_SIZE"},
3935 {ID_pointer_object,
"POINTER_OBJECT"},
3936 {ID_pointer_offset,
"POINTER_OFFSET"},
3939 {ID_rw_ok,
"RW_OK"},
3940 {ID_width,
"WIDTH"},
3943 const auto function_entry = function_names.find(src.
id());
3944 if(function_entry == function_names.end())
3952 unsigned precedence;
3963 const std::string &identifier)
3975 expr2c.get_shorthands(expr);
3976 return expr2c.convert(expr);
3991 return expr2c.convert(type);
4001 const std::string &identifier,
4006 return expr2c.convert_with_identifier(type, identifier);
const shift_exprt & to_shift_expr(const exprt &expr)
Cast an exprt to a shift_exprt.
const extractbit_exprt & to_extractbit_expr(const exprt &expr)
Cast an exprt to an extractbit_exprt.
const extractbits_exprt & to_extractbits_expr(const exprt &expr)
Cast an exprt to an extractbits_exprt.
const bitnot_exprt & to_bitnot_expr(const exprt &expr)
Cast an exprt to a bitnot_exprt.
const shl_exprt & to_shl_expr(const exprt &expr)
Cast an exprt to a shl_exprt.
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a typet to a floatbv_typet.
const signedbv_typet & to_signedbv_type(const typet &type)
Cast a typet to a signedbv_typet.
bool can_cast_type< signedbv_typet >(const typet &type)
Check whether a reference to a typet is a signedbv_typet.
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a typet to a bitvector_typet.
const fixedbv_typet & to_fixedbv_type(const typet &type)
Cast a typet to a fixedbv_typet.
bool can_cast_type< unsignedbv_typet >(const typet &type)
Check whether a reference to a typet is a unsignedbv_typet.
const unsignedbv_typet & to_unsignedbv_type(const typet &type)
Cast a typet to an unsignedbv_typet.
const byte_update_exprt & to_byte_update_expr(const exprt &expr)
const byte_extract_exprt & to_byte_extract_expr(const exprt &expr)
std::string MetaString(const std::string &in)
floatbv_typet float_type()
unsignedbv_typet unsigned_int_type()
unsignedbv_typet size_type()
std::string c_type_as_string(const irep_idt &c_type)
signedbv_typet signed_int_type()
bitvector_typet char_type()
bitvector_typet wchar_t_type()
floatbv_typet long_double_type()
floatbv_typet double_type()
const c_enum_typet & to_c_enum_type(const typet &type)
Cast a typet to a c_enum_typet.
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
const c_bit_field_typet & to_c_bit_field_type(const typet &type)
Cast a typet to a c_bit_field_typet.
const code_with_contract_typet & to_code_with_contract_type(const typet &type)
Cast a typet to a code_with_contract_typet.
const union_typet & to_union_type(const typet &type)
Cast a typet to a union_typet.
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a typet to a c_enum_tag_typet.
A base class for binary expressions.
std::size_t get_width() const
Expression corresponding to op() where the bytes starting at position offset (given in number of byte...
C enum tag type, i.e., c_enum_typet with an identifier.
const memberst & members() const
std::vector< c_enum_membert > memberst
virtual std::string as_string() const override
virtual void read(const typet &src) override
codet representation of an inline assembler statement.
const irep_idt & get_flavor() const
A codet representing an assignment in the program.
A codet representing sequential composition of program statements.
code_operandst & statements()
codet representation of a do while statement.
const exprt & cond() const
const codet & body() const
codet representation of a for statement.
const exprt & init() const
const exprt & iter() const
const exprt & cond() const
const codet & body() const
codet representation of a function call statement.
codet representation of an if-then-else statement.
const codet & then_case() const
const exprt & cond() const
const codet & else_case() const
codet representation of a label for branch targets.
const irep_idt & get_label() const
codet representation of a switch-case, i.e. a case statement within a switch.
const exprt & case_op() const
std::vector< parametert > parameterst
const typet & return_type() const
bool has_ellipsis() const
const parameterst & parameters() const
codet representing a while statement.
const exprt & cond() const
const codet & body() const
Data structure for representing an arbitrary statement in a program.
const irep_idt & get_statement() const
struct configt::ansi_ct ansi_c
A constant literal expression.
const irep_idt & get_value() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const char * c_str() const
optionalt< std::string > convert_function(const exprt &src)
Returns a string if src is a function with a known conversion, else returns nullopt.
std::string convert_nondet(const exprt &src, unsigned &precedence)
std::string convert_literal(const exprt &src)
std::string convert_code_continue(unsigned indent)
std::string convert_code_switch_case(const code_switch_caset &src, unsigned indent)
virtual std::string convert_symbol(const exprt &src)
std::string convert_typecast(const typecast_exprt &src, unsigned &precedence)
std::string convert_comma(const exprt &src, unsigned precedence)
std::string convert_code_assert(const codet &src, unsigned indent)
std::string convert_quantifier(const quantifier_exprt &, const std::string &symbol, unsigned precedence)
std::string convert_union(const exprt &src, unsigned &precedence)
std::string convert_code_expression(const codet &src, unsigned indent)
std::string convert_code_goto(const codet &src, unsigned indent)
std::string convert_code_switch(const codet &src, unsigned indent)
std::string convert_initializer_list(const exprt &src)
std::string convert_quantified_symbol(const exprt &src)
std::string convert_function_application(const function_application_exprt &src)
std::string convert_code_unlock(const codet &src, unsigned indent)
std::string convert_code_decl_block(const codet &src, unsigned indent)
std::string convert_byte_update(const byte_update_exprt &, unsigned precedence)
std::string convert_code(const codet &src)
std::string convert_pointer_arithmetic(const exprt &src, unsigned &precedence)
std::string convert_let(const let_exprt &, unsigned precedence)
std::string convert_nondet_bool()
std::string convert_norep(const exprt &src, unsigned &precedence)
const expr2c_configurationt & configuration
std::unordered_map< irep_idt, std::unordered_set< irep_idt > > ns_collision
std::string convert_code_output(const codet &src, unsigned indent)
std::string convert_code_while(const code_whilet &src, unsigned indent)
virtual std::string convert_array_type(const typet &src, const qualifierst &qualifiers, const std::string &declarator_str)
std::string convert_index_designator(const exprt &src)
std::string convert_pointer_difference(const exprt &src, unsigned &precedence)
std::string convert_code_block(const code_blockt &src, unsigned indent)
std::string convert_code_asm(const code_asmt &src, unsigned indent)
std::string convert_allocate(const exprt &src, unsigned &precedence)
std::string convert_Hoare(const exprt &src)
std::string convert_sizeof(const exprt &src, unsigned &precedence)
std::string convert_code_lock(const codet &src, unsigned indent)
virtual std::string convert_struct(const exprt &src, unsigned &precedence)
std::string convert_code_dowhile(const code_dowhilet &src, unsigned indent)
irep_idt id_shorthand(const irep_idt &identifier) const
std::string convert_cond(const exprt &src, unsigned precedence)
std::string convert_side_effect_expr_function_call(const side_effect_expr_function_callt &src)
std::string convert_overflow(const exprt &src, unsigned &precedence)
std::string convert_member(const member_exprt &src, unsigned precedence)
void get_shorthands(const exprt &expr)
std::string convert_code_for(const code_fort &src, unsigned indent)
std::string convert_with_identifier(const typet &src, const std::string &identifier)
std::string convert_extractbits(const extractbits_exprt &src, unsigned precedence)
std::string convert_code_decl(const codet &src, unsigned indent)
std::string convert_trinary(const ternary_exprt &src, const std::string &symbol1, const std::string &symbol2, unsigned precedence)
virtual std::string convert_constant(const constant_exprt &src, unsigned &precedence)
std::string convert_prob_coin(const exprt &src, unsigned &precedence)
std::string convert_update(const update_exprt &, unsigned precedence)
std::string convert_nondet_symbol(const nondet_symbol_exprt &)
std::string convert_code_printf(const codet &src, unsigned indent)
std::string convert_unary(const unary_exprt &, const std::string &symbol, unsigned precedence)
std::string convert_code_ifthenelse(const code_ifthenelset &src, unsigned indent)
std::string convert_member_designator(const exprt &src)
virtual std::string convert_struct_type(const typet &src, const std::string &qualifiers_str, const std::string &declarator_str)
virtual std::string convert_rec(const typet &src, const qualifierst &qualifiers, const std::string &declarator)
static std::string indent_str(unsigned indent)
std::string convert_byte_extract(const byte_extract_exprt &, unsigned precedence)
std::string convert_code_label(const code_labelt &src, unsigned indent)
std::string convert_code_array_copy(const codet &src, unsigned indent)
virtual std::string convert_constant_bool(bool boolean_value)
std::string convert_statement_expression(const exprt &src, unsigned &precendence)
std::string convert_struct_member_value(const exprt &src, unsigned precedence)
std::string convert_code_dead(const codet &src, unsigned indent)
std::string convert_rox(const shift_exprt &src, unsigned precedence)
Conversion function from rol/ror expressions to C code strings Note that this constructs a complex ex...
std::string convert_designated_initializer(const exprt &src)
std::string convert_vector(const exprt &src, unsigned &precedence)
std::string convert_multi_ary(const exprt &src, const std::string &symbol, unsigned precedence, bool full_parentheses)
std::string convert_array_member_value(const exprt &src, unsigned precedence)
std::string convert_unary_post(const exprt &src, const std::string &symbol, unsigned precedence)
std::unordered_map< irep_idt, irep_idt > shorthands
std::string convert_complex(const exprt &src, unsigned precedence)
std::string convert_code_assign(const code_assignt &src, unsigned indent)
std::string convert_code_function_call(const code_function_callt &src, unsigned indent)
std::string convert_code_fence(const codet &src, unsigned indent)
virtual std::string convert(const typet &src)
std::string convert_code_return(const codet &src, unsigned indent)
std::string convert_code_break(unsigned indent)
std::string convert_with(const exprt &src, unsigned precedence)
std::string convert_object_descriptor(const exprt &src, unsigned &precedence)
std::string convert_predicate_passive_symbol(const exprt &src)
std::string convert_array_list(const exprt &src, unsigned &precedence)
std::string convert_array_of(const exprt &src, unsigned precedence)
std::string convert_code_array_replace(const codet &src, unsigned indent)
std::string convert_index(const exprt &src, unsigned precedence)
std::string convert_code_assume(const codet &src, unsigned indent)
std::string convert_code_input(const codet &src, unsigned indent)
std::string convert_extractbit(const extractbit_exprt &, unsigned precedence)
std::string convert_predicate_next_symbol(const exprt &src)
virtual std::string convert_with_precedence(const exprt &src, unsigned &precedence)
std::string convert_code_array_set(const codet &src, unsigned indent)
std::string convert_binary(const binary_exprt &, const std::string &symbol, unsigned precedence, bool full_parentheses)
std::string convert_predicate_symbol(const exprt &src)
std::string convert_array(const exprt &src)
std::string convert_prob_uniform(const exprt &src, unsigned &precedence)
Base class for all expressions.
std::vector< exprt > operandst
bool has_operands() const
Return true if there is at least one operand.
bool is_true() const
Return whether the expression is a constant representing true.
const source_locationt & source_location() const
typet & type()
Return the type of the expression.
std::size_t get_fraction_bits() const
std::string to_ansi_c_string() const
Application of (mathematical) function.
std::string to_ansi_c_string() const
There are a large number of kinds of tree structured or tree-like data in CPROVER.
const std::string & get_string(const irep_namet &name) const
bool get_bool(const irep_namet &name) const
const irept & find(const irep_namet &name) const
const std::string & id_string() const
const irep_idt & id() const
const irep_idt & get(const irep_namet &name) const
exprt & where()
convenience accessor for binding().where()
symbol_exprt & symbol()
convenience accessor for the symbol of a single binding
exprt & value()
convenience accessor for the value of a single binding
std::string expr2string() const
Extract member of struct or union.
const exprt & compound() const
irep_idt get_component_name() const
std::size_t get_component_number() const
Modulo defined as lhs-(rhs * truncate(lhs/rhs)).
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
Expression to hold a nondeterministic choice.
const irep_idt & get_identifier() const
virtual std::unique_ptr< qualifierst > clone() const =0
A base class for quantifier expressions.
A base class for shift and rotate operators.
A side_effect_exprt representation of a function call side effect.
exprt::operandst & arguments()
const irep_idt & get_function() const
const irep_idt & get_comment() const
const irept::named_subt & get_pragmas() const
A struct tag type, i.e., struct_typet with an identifier.
Structure type, corresponds to C style structs.
const irep_idt & get_pretty_name() const
Base type for structs and unions.
const componentt & get_component(const irep_idt &component_name) const
Get the reference to a component with given name.
bool is_incomplete() const
A struct/union may be incomplete.
const componentst & components() const
std::vector< componentt > componentst
Expression to hold a symbol (variable)
const irep_idt & get_identifier() const
irep_idt base_name
Base (non-scoped) name.
source_locationt location
Source code location of definition of symbol.
typet type
Type of symbol.
An expression with three operands.
Semantic type conversion.
The type of an expression, extends irept.
const typet & subtype() const
Generic base class for unary expressions.
A union tag type, i.e., union_typet with an identifier.
Fixed-width bit-vector with unsigned binary interpretation.
Operator to update elements in structs and arrays.
const constant_exprt & size() const
bool has_prefix(const std::string &s, const std::string &prefix)
static std::string clean_identifier(const irep_idt &id)
std::string type2c(const typet &type, const namespacet &ns)
std::string expr2c(const exprt &expr, const namespacet &ns)
#define forall_operands(it, expr)
#define forall_expr(it, expr)
std::unordered_set< irep_idt > find_symbol_identifiers(const exprt &src)
Find identifiers of the sub expressions with id ID_symbol.
API to expression classes for floating-point arithmetic.
const floatbv_typecast_exprt & to_floatbv_typecast_expr(const exprt &expr)
Cast an exprt to a floatbv_typecast_exprt.
const std::string & id2string(const irep_idt &d)
std::string from_type(const namespacet &ns, const irep_idt &identifier, const typet &type)
void irep2lisp(const irept &src, lispexprt &dest)
const function_application_exprt & to_function_application_expr(const exprt &expr)
Cast an exprt to a function_application_exprt.
const quantifier_exprt & to_quantifier_expr(const exprt &expr)
Cast an exprt to a quantifier_exprt.
const std::string integer2string(const mp_integer &n, unsigned base)
nonstd::optional< T > optionalt
API to expression classes for Pointers.
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
optionalt< exprt > build_sizeof_expr(const constant_exprt &expr, const namespacet &ns)
optionalt< mp_integer > pointer_offset_bits(const typet &type, const namespacet &ns)
#define SYMEX_DYNAMIC_PREFIX
#define UNREACHABLE
This should be used to mark dead code.
const code_ifthenelset & to_code_ifthenelse(const codet &code)
const code_returnt & to_code_return(const codet &code)
bool can_cast_expr< code_inputt >(const exprt &base)
const code_whilet & to_code_while(const codet &code)
const code_switch_caset & to_code_switch_case(const codet &code)
bool can_cast_expr< code_outputt >(const exprt &base)
const code_labelt & to_code_label(const codet &code)
side_effect_expr_function_callt & to_side_effect_expr_function_call(exprt &expr)
const codet & to_code(const exprt &expr)
const code_dowhilet & to_code_dowhile(const codet &code)
const code_blockt & to_code_block(const codet &code)
const code_fort & to_code_for(const codet &code)
const code_function_callt & to_code_function_call(const codet &code)
code_asmt & to_code_asm(codet &code)
const code_assignt & to_code_assign(const codet &code)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
const notequal_exprt & to_notequal_expr(const exprt &expr)
Cast an exprt to an notequal_exprt.
const if_exprt & to_if_expr(const exprt &expr)
Cast an exprt to an if_exprt.
const update_exprt & to_update_expr(const exprt &expr)
Cast an exprt to an update_exprt.
const let_exprt & to_let_expr(const exprt &expr)
Cast an exprt to a let_exprt.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const mod_exprt & to_mod_expr(const exprt &expr)
Cast an exprt to a mod_exprt.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const not_exprt & to_not_expr(const exprt &expr)
Cast an exprt to an not_exprt.
const union_exprt & to_union_expr(const exprt &expr)
Cast an exprt to a union_exprt.
const div_exprt & to_div_expr(const exprt &expr)
Cast an exprt to a div_exprt.
const multi_ary_exprt & to_multi_ary_expr(const exprt &expr)
Cast an exprt to a multi_ary_exprt.
const with_exprt & to_with_expr(const exprt &expr)
Cast an exprt to a with_exprt.
const binary_exprt & to_binary_expr(const exprt &expr)
Cast an exprt to a binary_exprt.
const equal_exprt & to_equal_expr(const exprt &expr)
Cast an exprt to an equal_exprt.
const plus_exprt & to_plus_expr(const exprt &expr)
Cast an exprt to a plus_exprt.
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
const unary_exprt & to_unary_expr(const exprt &expr)
Cast an exprt to a unary_exprt.
const nondet_symbol_exprt & to_nondet_symbol_expr(const exprt &expr)
Cast an exprt to a nondet_symbol_exprt.
const implies_exprt & to_implies_expr(const exprt &expr)
Cast an exprt to a implies_exprt.
const binary_relation_exprt & to_binary_relation_expr(const exprt &expr)
Cast an exprt to a binary_relation_exprt.
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
const vector_typet & to_vector_type(const typet &type)
Cast a typet to a vector_typet.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
bool can_cast_type< code_typet >(const typet &type)
Check whether a reference to a typet is a code_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
const string_constantt & to_string_constant(const exprt &expr)
void replace(const union_find_replacet &replace_map, string_not_contains_constraintt &constraint)
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
Stream & join_strings(Stream &&os, const It b, const It e, const Delimiter &delimiter, TransformFunc &&transform_func)
Prints items to an stream, separated by a constant delimiter.
std::size_t long_double_width
std::size_t long_long_int_width
std::size_t long_int_width
std::size_t short_int_width
Used for configuring the behaviour of expr2c and type2c.
bool print_enum_int_value
When printing an enum-typed constant, print the integer representation.
static expr2c_configurationt clean_configuration
This prints compilable C that loses some of the internal details of the GOTO program.
bool expand_typedef
Print the expanded type instead of a typedef name, even when a typedef is present.
static expr2c_configurationt default_configuration
This prints a human readable C like syntax that closely mirrors the internals of the GOTO program.
std::string true_string
This is the string that will be printed for the true boolean expression.
bool print_struct_body_in_type
When printing a struct_typet, should the components of the struct be printed inline.
bool use_library_macros
This is the string that will be printed for null pointers.
bool include_struct_padding_components
When printing struct_typet or struct_exprt, include the artificial padding components introduced to k...
std::string false_string
This is the string that will be printed for the false boolean expression.
bool include_array_size
When printing array_typet, should the size of the array be printed.
bool has_suffix(const std::string &s, const std::string &suffix)
bool is_signed(const typet &t)
Convenience function – is the type signed?