@@ -48,7 +48,7 @@ module Term = struct
4848 Expr. symbol id
4949 end
5050 end
51- | Sort , Indexed { basename; indices } -> (
51+ | Sort , Indexed { basename; indices } -> begin
5252 match (basename, indices) with
5353 | "BitVec" , [ n ] -> (
5454 match int_of_string_opt n with
@@ -62,12 +62,18 @@ module Term = struct
6262 Fmt. failwith " %acould not parse indexed sort:%a %a@." pp_loc loc
6363 Fmt. string basename
6464 (Fmt. parens (Fmt. list ~sep: Fmt. sp Fmt. string ))
65- indices )
66- | Term , Simple name -> (
65+ indices
66+ end
67+ | Term , Simple name -> begin
6768 match name with
6869 | "true" -> Expr. value True
6970 | "false" -> Expr. value False
70- | _ -> Expr. symbol id )
71+ | " roundNearestTiesToEven" | " RNE" | " roundNearestTiesToAway" | " RNA"
72+ | " roundTowardPositive" | " RTP" | " roundTowardNegative" | " RTN"
73+ | "roundTowardZero" | "RTZ" ->
74+ Expr. symbol { id with ty = Ty_roundingMode }
75+ | _ -> Expr. symbol id
76+ end
7177 | Term , Indexed { basename = base ; indices } -> begin
7278 match (base, indices) with
7379 | bv , [ numbits ] when String. starts_with ~prefix: " bv" bv -> begin
@@ -137,7 +143,7 @@ module Term = struct
137143
138144 let apply ?loc (id : t ) (args : t list ) : t =
139145 match Expr. view id with
140- | Symbol ({ namespace = Term ; name = Simple name ; _ } as symbol ) -> (
146+ | Symbol ({ namespace = Term ; name = Simple name ; _ } as symbol ) -> begin
141147 match (name, args) with
142148 | "-" , [ a ] -> Expr. raw_unop Ty_none Neg a
143149 | "not" , [ a ] -> Expr. raw_unop Ty_bool Not a
@@ -259,11 +265,12 @@ module Term = struct
259265 | "fp.eq" , [ a; b ] -> Expr. raw_relop Ty_none Eq a b
260266 | _ ->
261267 Log. debug (fun k -> k " apply: unknown %a making app" Symbol. pp symbol);
262- Expr. app symbol args )
268+ Expr. app symbol args
269+ end
263270 | Symbol ({ name = Simple _ ; namespace = Attr ; _ } as attr ) ->
264271 Log. debug (fun k -> k " apply: unknown %a making app" Symbol. pp attr);
265272 Expr. app attr args
266- | Symbol { name = Indexed { basename; indices } ; _ } -> (
273+ | Symbol { name = Indexed { basename; indices } ; _ } -> begin
267274 match (basename, indices, args) with
268275 | "extract" , [ h; l ], [ a ] ->
269276 let high =
@@ -302,7 +309,8 @@ module Term = struct
302309 ] ) ->
303310 Expr. raw_cvtop (Ty_fp 64 ) PromoteF32 a
304311 | _ ->
305- Fmt. failwith " %acould not parse indexed app: %a" pp_loc loc Expr. pp id )
312+ Fmt. failwith " %acould not parse indexed app: %a" pp_loc loc Expr. pp id
313+ end
306314 | Symbol id ->
307315 Log. debug (fun k -> k " apply: unknown %a making app" Symbol. pp id);
308316 Expr. app id args
0 commit comments