@@ -3554,6 +3554,24 @@ std::string expr2ct::convert_bitreverse(const bitreverse_exprt &src)
35543554 return convert_norep (src, precedence);
35553555}
35563556
3557+ std::string expr2ct::convert_r_or_w_ok (const r_or_w_ok_exprt &src)
3558+ {
3559+ std::string dest = src.id () == ID_r_ok ? " R_OK"
3560+ : src.id () == ID_w_ok ? " W_OK"
3561+ : " RW_OK" ;
3562+
3563+ dest += ' (' ;
3564+
3565+ unsigned p;
3566+ dest += convert_with_precedence (src.pointer (), p);
3567+ dest += " , " ;
3568+ dest += convert_with_precedence (src.size (), p);
3569+
3570+ dest += ' )' ;
3571+
3572+ return dest;
3573+ }
3574+
35573575std::string expr2ct::convert_with_precedence (
35583576 const exprt &src,
35593577 unsigned &precedence)
@@ -3963,6 +3981,9 @@ std::string expr2ct::convert_with_precedence(
39633981 else if (src.id () == ID_bitreverse)
39643982 return convert_bitreverse (to_bitreverse_expr (src));
39653983
3984+ else if (src.id () == ID_r_ok || src.id () == ID_w_ok || src.id () == ID_rw_ok)
3985+ return convert_r_or_w_ok (to_r_or_w_ok_expr (src));
3986+
39663987 auto function_string_opt = convert_function (src);
39673988 if (function_string_opt.has_value ())
39683989 return *function_string_opt;
@@ -4018,9 +4039,6 @@ optionalt<std::string> expr2ct::convert_function(const exprt &src)
40184039 {ID_loop_entry, CPROVER_PREFIX " loop_entry" },
40194040 {ID_saturating_minus, CPROVER_PREFIX " saturating_minus" },
40204041 {ID_saturating_plus, CPROVER_PREFIX " saturating_plus" },
4021- {ID_r_ok, " R_OK" },
4022- {ID_w_ok, " W_OK" },
4023- {ID_rw_ok, " RW_OK" },
40244042 {ID_width, " WIDTH" },
40254043 };
40264044
0 commit comments