package binsec

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t = private
  1. | Var of VarTag.t var
  2. | Load of size * Machine.endianness * t
  3. | Cst of Bitvector.t
  4. | Unary of Unary_op.t * t
  5. | Binary of Binary_op.t * t * t
  6. | Ite of t * t * t
val size_of : t -> int
val is_equal : t -> t -> bool
val is_constant : t -> bool
val var : ?tag:VarTag.t -> string -> int -> t

Constructors

val v : VarTag.t var -> t
val temporary : size:int -> string -> t
val constant : Bitvector.t -> t

constant ~region bv creates a constant expression from the bitvector bv from region region. Default region is `Constant.

Specific constants

val zeros : int -> t

zeros n creates a constant expression of value 0 with length n

val ones : int -> t

ones n creates a constant expression of value 1 with length n. I.e.; it has (n - 1) zeros in binary.

val one : t
val zero : t
val _true : t
val _false : t
val binary : Binary_op.t -> t -> t -> t

Binary expressions

val add : t -> t -> t
val sub : t -> t -> t
val mul : t -> t -> t
val smod : t -> t -> t
val umod : t -> t -> t
val udiv : t -> t -> t
val sdiv : t -> t -> t
val append : t -> t -> t
include Sigs.Comparisons with type t := t and type boolean = t
type boolean = t
val equal : t -> t -> boolean
val diff : t -> t -> boolean
val ule : t -> t -> boolean
val uge : t -> t -> boolean
val ult : t -> t -> boolean
val ugt : t -> t -> boolean
val sle : t -> t -> boolean
val sge : t -> t -> boolean
val slt : t -> t -> boolean
val sgt : t -> t -> boolean
val unary : Unary_op.t -> t -> t
val uminus : t -> t
include Sigs.EXTENDED_LOGICAL with type t := t
include Sigs.Logical with type t := t
val logand : t -> t -> t
val logor : t -> t -> t
val lognot : t -> t
val logxor : t -> t -> t
val sext : int -> t -> t

sext sz e performs a signed extension of expression e to size sz

val uext : int -> t -> t

uext sz e performs an unsigned extension expression e to size sz

val shift_left : t -> t -> t
val shift_right : t -> t -> t
val shift_right_signed : t -> t -> t

shift_(left|right) e q shifts expression e by quantity q, padding with zeroes

val rotate_left : t -> t -> t
val rotate_right : t -> t -> t

rotate_(left|right) e q rotates expression e by quantity q

val ite : t -> t -> t -> t

ite cond then_e else_e creates Dba.ExprIte(cond, then_e, else_e)

val restrict : int -> int -> t -> t

restrict lo hi e creates Dba.ExprUnary(Restrict(lo, hi), e) if hi >= lo && lo >=0 .

val bit_restrict : int -> t -> t

bit_restrict o e is restrict o o e

val load : Size.Byte.t -> Machine.endianness -> t -> t

load nbytes endianness t

val is_max : t -> bool

is_max e is true if e is

  • constant; and
  • the maximum unsigned representable for the size of this expression