package bap-std

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type var
type cast =
  1. | UNSIGNED
    (*

    0-padding widening cast.

    *)
  2. | SIGNED
    (*

    Sign-extending widening cast.

    *)
  3. | HIGH
    (*

    Narrowing cast. Keeps the high bits.

    *)
  4. | LOW
    (*

    Narrowing cast. Keeps the low bits.

    *)

Different forms of casting

val bin_shape_cast : Core_kernel.Bin_prot.Shape.t
val __bin_read_cast__ : (int -> cast) Core_kernel.Bin_prot.Read.reader
val compare_cast : cast -> cast -> int
val sexp_of_cast : cast -> Sexplib0.Sexp.t
val cast_of_sexp : Sexplib0.Sexp.t -> cast
type binop =
  1. | PLUS
    (*

    Integer addition. (commutative, associative)

    *)
  2. | MINUS
    (*

    Subtract second integer from first.

    *)
  3. | TIMES
    (*

    Integer multiplication. (commutative, associative)

    *)
  4. | DIVIDE
    (*

    Unsigned integer division.

    *)
  5. | SDIVIDE
    (*

    Signed integer division.

    *)
  6. | MOD
    (*

    Unsigned modulus.

    *)
  7. | SMOD
    (*

    Signed modulus.

    *)
  8. | LSHIFT
    (*

    Left shift.

    *)
  9. | RSHIFT
    (*

    Right shift, zero padding.

    *)
  10. | ARSHIFT
    (*

    Right shift, sign extend.

    *)
  11. | AND
    (*

    Bitwise and. (commutative, associative)

    *)
  12. | OR
    (*

    Bitwise or. (commutative, associative)

    *)
  13. | XOR
    (*

    Bitwise xor. (commutative, associative)

    *)
  14. | EQ
    (*

    Equals. (commutative) (associative on booleans)

    *)
  15. | NEQ
    (*

    Not equals. (commutative) (associative on booleans)

    *)
  16. | LT
    (*

    Unsigned less than.

    *)
  17. | LE
    (*

    Unsigned less than or equal to.

    *)
  18. | SLT
    (*

    Signed less than.

    *)
  19. | SLE
    (*

    Signed less than or equal to.

    *)

Binary operations implemented in the BIL

val bin_shape_binop : Core_kernel.Bin_prot.Shape.t
val __bin_read_binop__ : (int -> binop) Core_kernel.Bin_prot.Read.reader
val compare_binop : binop -> binop -> int
val sexp_of_binop : binop -> Sexplib0.Sexp.t
val binop_of_sexp : Sexplib0.Sexp.t -> binop
type unop =
  1. | NEG
    (*

    Negate. (2's complement)

    *)
  2. | NOT
    (*

    Bitwise not.(1's complement)

    *)

Unary operations implemented in the IR

val bin_shape_unop : Core_kernel.Bin_prot.Shape.t
val __bin_read_unop__ : (int -> unop) Core_kernel.Bin_prot.Read.reader
val compare_unop : unop -> unop -> int
val sexp_of_unop : unop -> Sexplib0.Sexp.t
val unop_of_sexp : Sexplib0.Sexp.t -> unop
type exp =
  1. | Load of exp * exp * endian * size
    (*

    load from memory

    *)
  2. | Store of exp * exp * exp * endian * size
    (*

    store to memory

    *)
  3. | BinOp of binop * exp * exp
    (*

    binary operation

    *)
  4. | UnOp of unop * exp
    (*

    unary operation

    *)
  5. | Var of var
    (*

    variable

    *)
  6. | Int of word
    (*

    immediate value

    *)
  7. | Cast of cast * int * exp
    (*

    casting

    *)
  8. | Let of var * exp * exp
    (*

    let-binding

    *)
  9. | Unknown of string * typ
    (*

    unknown or undefined value

    *)
  10. | Ite of exp * exp * exp
    (*

    if-then-else expression

    *)
  11. | Extract of int * int * exp
    (*

    extract portion of word

    *)
  12. | Concat of exp * exp
    (*

    concatenate two words

    *)

BIL expression variants

and typ =
  1. | Imm of int
    (*

    Imm n - n-bit immediate

    *)
  2. | Mem of addr_size * size
    (*

    Mem (a,t) memory with a specifed addr_size

    *)
  3. | Unk
val bin_shape_exp : Core_kernel.Bin_prot.Shape.t
val bin_shape_typ : Core_kernel.Bin_prot.Shape.t
val __bin_read_exp__ : (int -> exp) Core_kernel.Bin_prot.Read.reader
val __bin_read_typ__ : (int -> typ) Core_kernel.Bin_prot.Read.reader
val compare_exp : exp -> exp -> int
val compare_typ : typ -> typ -> int
val sexp_of_exp : exp -> Sexplib0.Sexp.t
val sexp_of_typ : typ -> Sexplib0.Sexp.t
val exp_of_sexp : Sexplib0.Sexp.t -> exp
val typ_of_sexp : Sexplib0.Sexp.t -> typ
type stmt =
  1. | Move of var * exp
    (*

    assign value of expression to variable

    *)
  2. | Jmp of exp
    (*

    jump to absolute address

    *)
  3. | Special of string
    (*

    Statement with semantics not expressible in BIL

    *)
  4. | While of exp * stmt list
    (*

    while loops

    *)
  5. | If of exp * stmt list * stmt list
    (*

    if/then/else statement

    *)
  6. | CpuExn of int
    (*

    CPU exception

    *)
val bin_shape_stmt : Core_kernel.Bin_prot.Shape.t
val __bin_read_stmt__ : (int -> stmt) Core_kernel.Bin_prot.Read.reader
val compare_stmt : stmt -> stmt -> int
val sexp_of_stmt : stmt -> Sexplib0.Sexp.t
val stmt_of_sexp : Sexplib0.Sexp.t -> stmt