package binsec

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Term.BvSource

include Bitvector.Common with type t = Bitvector.t
Sourceval create : Z.t -> int -> t
Sourceval create_from_tuple : (Z.t * int) -> t
Sourceval value_of : t -> Z.t
Sourceval signed_of : t -> Z.t
Sourceval size_of : t -> int
Sourceval compare : t -> t -> int

compare t t' returns the structural comparison of t and t'.

The result is not sorted according to the values of t and t', thus, they can be of different sizes.

It is useful for key comparison for structures like `Set` or `Map`.

Sourceval ucompare : t -> t -> int

ucompare t t' returns the comparison of the unsigned values of t and t'.

It is equivalent of Z.compare (value_of t) (value_of t').

The bitvector t and t' should be of the same size.

Sourceval scompare : t -> t -> int

scompare t t' returns the comparison of the signed values of t and t'.

It is equivalent of Z.compare (signed_of t) (signed_of t').

The bitvector t and t' should be of the same size.

Sourceval hash : t -> int
Sourceval zero : t
Sourceval one : t
Sourceval zeros : int -> t
Sourceval ones : int -> t
Sourceval fill : ?lo:int -> ?hi:int -> int -> t

fill lo hi n returns a bitvector of size n where bits from lo to hi are set to one. By default, lo is equal to zero and hi is equal to n. Raise Invalid_argument if lo or hi have incoherent values.

Sourceval is_zero : t -> bool
Sourceval is_one : t -> bool

is_zero t (resp. is_one t) checks if t is equal to zero (resp. one)

Sourceval is_zeros : t -> bool
Sourceval is_ones : t -> bool
Sourceval is_fill : t -> bool

is_zeros t (resp. is_ones t) checks if it exists n such that t is equal to zeros n (resp. ones n)

Sourceval max_ubv : int -> t
Sourceval max_sbv : int -> t
Sourceval min_sbv : int -> t

max_ubv n (resp. max_sbv n) returns a bitvector of size n containing the biggest possible unsigned (resp. signed) value for its size

Sourceval is_max_ubv : t -> bool
Sourceval is_max_sbv : t -> bool
Sourceval is_min_sbv : t -> bool

is_max_ubv t (resp. is_max_sbv t) returns true if t is a bitvector containing the biggest possible unsigned (resp. signed) value for its size, or returns false otherwise

include Sigs.COMPARISON with type t := t and type boolean = bool
Sourcetype boolean = bool
Sourceval equal : t -> t -> boolean
Sourceval diff : t -> t -> boolean
Sourceval ule : t -> t -> boolean
Sourceval uge : t -> t -> boolean
Sourceval ult : t -> t -> boolean
Sourceval ugt : t -> t -> boolean
Sourceval sle : t -> t -> boolean
Sourceval sge : t -> t -> boolean
Sourceval slt : t -> t -> boolean
Sourceval sgt : t -> t -> boolean
include Sigs.ARITHMETIC with type t := t
Sourceval add : t -> t -> t
Sourceval sub : t -> t -> t
Sourceval mul : t -> t -> t
Sourceval neg : t -> t
Sourceval udiv : t -> t -> t
Sourceval umod : t -> t -> t
Sourceval urem : t -> t -> t
Sourceval sdiv : t -> t -> t
Sourceval smod : t -> t -> t
Sourceval srem : t -> t -> t
Sourceval pow : t -> t -> t
Sourceval succ : t -> t
Sourceval pred : t -> t
Sourceval add_int : t -> int -> t
Sourceval umax : t -> t -> t
Sourceval umin : t -> t -> t
Sourceval smax : t -> t -> t
Sourceval smin : t -> t -> t
Sourceval is_neg : t -> bool
Sourceval is_pos : t -> bool

is_neg t (resp. is_pos t) returns true if the signed interpretation of t is strictly negative (resp. strictly positive)

include Sigs.BITWISE with type t := t
include Sigs.EXTENDED_LOGICAL with type t := t
include Sigs.LOGICAL with type t := t
Sourceval logand : t -> t -> t
Sourceval logor : t -> t -> t
Sourceval lognot : t -> t
Sourceval logxor : t -> t -> t
include Sigs.SHIFT_ROT with type t := t and type index := int
Sourceval shift_left : t -> int -> t
Sourceval shift_right : t -> int -> t
Sourceval shift_right_signed : t -> int -> t
Sourceval rotate_left : t -> int -> t
Sourceval rotate_right : t -> int -> t
Sourceval reduce : t -> int -> t
Sourceval extend : t -> int -> t
Sourceval extend_signed : t -> int -> t
Sourceval extend_unsafe : t -> int -> t
Sourceval num_bits : t -> int
Sourceval get_bit : t -> int -> bool
Sourceval set_bit : t -> int -> t
Sourceval clear_bit : t -> int -> t
Sourceval flip_bit : t -> int -> t
Sourceval append : t -> t -> t
Sourceval concat : t list -> t

concat bv1, bv2, ..., bvn is bv1 @ bv2 @ ... @ bvn

Sourceval extract : hi:int -> lo:int -> t -> t
Sourceval unary : unary operator -> t -> t
Sourceval binary : binary operator -> t -> t -> t