@ -252,11 +252,13 @@ module Symbol = struct
let compare_extra_bool _ _ = 0
(* NOTE: non_int represents the symbols that are not integer type,
so that their ranges are not used in the cost checker . * )
type t =
| OneValue of { unsigned : extra_bool ; boolean : extra_bool ; path : SymbolPath . t }
| OneValue of { unsigned : extra_bool ; non_int : extra_bool ; path : SymbolPath . t }
| BoundEnd of
{ unsigned : extra_bool
; boolean : extra_bool
; non_int : extra_bool
; path : SymbolPath . t
; bound_end : BoundEnd . t }
[ @@ deriving compare ]
@ -264,7 +266,7 @@ module Symbol = struct
let pp : F . formatter -> t -> unit =
fun fmt s ->
match s with
| OneValue { unsigned ; boolean ; path } | BoundEnd { unsigned ; boolean ; path } ->
| OneValue { unsigned ; non_int ; path } | BoundEnd { unsigned ; non_int ; path } ->
SymbolPath . pp fmt path ;
( if Config . developer_mode then
match s with
@ -273,7 +275,7 @@ module Symbol = struct
| OneValue _ ->
() ) ;
if Config . bo_debug > 1 then
F . fprintf fmt " (%c%s) " ( if unsigned then 'u' else 's' ) ( if boolean then " b " else " " )
F . fprintf fmt " (%c%s) " ( if unsigned then 'u' else 's' ) ( if non_int then " n " else " " )
let compare s1 s2 =
@ -304,21 +306,21 @@ module Symbol = struct
SymbolPath . equal path1 path2
type make_t = unsigned : bool -> ? boolean : bool -> SymbolPath . t -> t
type make_t = unsigned : bool -> ? non_int : bool -> SymbolPath . t -> t
let make_onevalue : make_t =
fun ~ unsigned ? ( boolean = false ) path -> OneValue { unsigned ; boolean ; path }
fun ~ unsigned ? ( non_int = false ) path -> OneValue { unsigned ; non_int ; path }
let make_boundend : BoundEnd . t -> make_t =
fun bound_end ~ unsigned ? ( boolean = false ) path -> BoundEnd { unsigned ; boolean ; path ; bound_end }
fun bound_end ~ unsigned ? ( non_int = false ) path -> BoundEnd { unsigned ; non_int ; path ; bound_end }
let pp_mark ~ markup = if markup then MarkupFormatter . wrap_monospaced pp else pp
let is_unsigned : t -> bool = function OneValue { unsigned } | BoundEnd { unsigned } -> unsigned
let is_ boolean : t -> bool = function OneValue { boolean} | BoundEnd { boolean } -> boolean
let is_ non_int : t -> bool = function OneValue { non_int} | BoundEnd { non_int } -> non_int
let path = function OneValue { path } | BoundEnd { path } -> path