package mopsa
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=37966e98ffeebcedc09bd6e9b2b81f69
sha512=40d4d826c25f680766c07eccbabdf5e8a4fa023016e8a164e4e4f6b3781c8484dc4df437055721dfd19b9db8fb7fe3b61236c4833186d346fc7204a68d01eaaa
doc/mopsa.mopsa_utils/Mopsa_utils/Bitfields/IntBitfields/index.html
Module Bitfields.IntBitfields
Bitfields - Sequences of bits that can be set, cleared, or unknown
We rely on Zarith for arithmetic operations.
Types
type t_with_bot = t Core.Bot.with_botThe type of possibly empty bitfields.
module I = ItvUtils.IntItvmodule B = ItvUtils.IntBoundmodule C = CongUtils.IntCongval is_valid : t -> boolEvery bit in a bitfield must be set, cleared, or both.
Constructors
val of_z_bot : Z.t -> Z.t -> t_with_botval cst_int : int -> tval cst_int64 : int64 -> tval zero : t0
val one : t1
val mone : t-1
val zero_one : t0,1
val minf_inf : tAll integers. Indistiguishable from 0,+∞.
val unsigned : int -> tBitfields of unsigned integers with the specified bitsize.
val unsigned8 : tval unsigned16 : tval unsigned32 : tval unsigned64 : tval of_range_bot : Z.t -> Z.t -> t Core.Bot.with_botBitfield enclosing the range lo,hi.
val of_bound_bot : B.t -> B.t -> t Core.Bot.with_botBitfield enclosing the range lo,hi.
Bitfield enclosing the range lo,hi. Fails with invalid_arg if the range is empty.
Bitfield enclosing the range lo,hi. Fails with invalid_arg if the range is empty.
Predicates
val equal_bot : t_with_bot -> t_with_bot -> boolval included_bot : t_with_bot -> t_with_bot -> boolval intersect_bot : t_with_bot -> t_with_bot -> boolA total ordering on bitfields, returning -1, 0, or 1. Can be used as compare for sets, maps, etc.
val compare_bot : t Core.Bot.with_bot -> t Core.Bot.with_bot -> intTotal ordering on possibly empty bitfields.
val contains_zero : t -> boolWhether the bifield contains zero.
val contains_one : t -> boolWhether the bifield contains one.
val contains_nonzero : t -> boolWhether the bifield contains a non-zero value.
val is_zero : t -> boolval is_positive : t -> boolval is_positive_strict : t -> boolval is_negative_strict : t -> boolval is_negative : t -> boolval is_nonzero : t -> boolContains only non-zero elements.
val is_minf_inf : t -> boolThe bitfield represents -∞,+∞.
val is_singleton : t -> boolWhether the bitfield contains a single element.
val is_bounded : t -> boolWhether the bitfield contains a finite number of elements.
Printing
val to_string : t -> stringval print : out_channel -> t -> unitval fprint : Format.formatter -> t -> unitval to_string_bot : t Core.Bot.with_bot -> stringval print_bot : out_channel -> t Core.Bot.with_bot -> unitval fprint_bot : Format.formatter -> t Core.Bot.with_bot -> unitval bprint_bot : Buffer.t -> t Core.Bot.with_bot -> unitEnumeration
val size : t -> intNumber of elements. Raises an invalid argument if it is unbounded.
List of elements, in increasing order. Raises an invalid argument if it is unbounded.
Set operations
val join_bot : t_with_bot -> t_with_bot -> t_with_botval join_list : t list -> t_with_botval meet : t -> t -> t_with_botAbstract intersection.
val meet_bot : t_with_bot -> t_with_bot -> t_with_botval meet_list : t list -> t_with_botForward operations
val to_bool : bool -> bool -> tConversion from integer to boolean in 0,1: maps 0 to 0 (false) and non-zero to 1 (true).
Logical negation. Logical operation use the C semantics: they accept 0 and non-0 respectively as false and true, but they always return 0 and 1 respectively for false and true.
C comparison tests. Returns an interval included in 0,1 (a boolean)
C comparison tests. Returns a boolean if the test may succeed
Unsigned bitshift right: division by a power of 2 with truncation.
Filters
Given two interval aruments, return the arguments assuming that the predicate holds.
val filter_eq : t -> t -> (t * t) Core.Bot.with_botval filter_neq : t -> t -> (t * t) Core.Bot.with_botval filter_leq : t -> t -> (t * t) Core.Bot.with_botval filter_geq : t -> t -> (t * t) Core.Bot.with_botval filter_lt : t -> t -> (t * t) Core.Bot.with_botval filter_gt : t -> t -> (t * t) Core.Bot.with_botReduction
val meet_inter : t -> I.t -> (t * I.t) Core.Bot.with_botIntersects a bitfield with an interval, and returns the set represented both as a bitfield and as an interval. Useful to implement reductions.