@@ -3554,6 +3554,24 @@ std::string expr2ct::convert_bitreverse(const bitreverse_exprt &src)
3554
3554
return convert_norep (src, precedence);
3555
3555
}
3556
3556
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
+
3557
3575
std::string expr2ct::convert_with_precedence (
3558
3576
const exprt &src,
3559
3577
unsigned &precedence)
@@ -3963,6 +3981,9 @@ std::string expr2ct::convert_with_precedence(
3963
3981
else if (src.id () == ID_bitreverse)
3964
3982
return convert_bitreverse (to_bitreverse_expr (src));
3965
3983
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
+
3966
3987
auto function_string_opt = convert_function (src);
3967
3988
if (function_string_opt.has_value ())
3968
3989
return *function_string_opt;
@@ -4018,9 +4039,6 @@ optionalt<std::string> expr2ct::convert_function(const exprt &src)
4018
4039
{ID_loop_entry, CPROVER_PREFIX " loop_entry" },
4019
4040
{ID_saturating_minus, CPROVER_PREFIX " saturating_minus" },
4020
4041
{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" },
4024
4042
{ID_width, " WIDTH" },
4025
4043
};
4026
4044
0 commit comments