Skip to content

Instantly share code, notes, and snippets.

@maurer
Created October 16, 2014 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maurer/afeeff0dbc6d1b438caf to your computer and use it in GitHub Desktop.
Save maurer/afeeff0dbc6d1b438caf to your computer and use it in GitHub Desktop.
Sample MLI
open Core_kernel.Std
open Bap_types.Std
module type S = sig
type t
type node
val pred : t -> node -> node list
val succ : t -> node -> node list
val code : t -> node -> Bil.stmt list
val asm : t -> node -> string list
(*
val node_of_addr : t -> Bitvector.t -> node option
val add_abs_node : t -> node * t
val add_addr_node : t -> Bitvector.t -> node * t
*)
end
module type UNDET = sig
type t
include S with type t := t
val is_determined : t -> node -> bool
val determine : t -> node -> t
val add_target : t -> node -> node -> t
val add_target_addr : t -> node -> addr -> t
type disasm = {asm : string option;
bil : Bil.stmt list;
fallthrough : addr}
val create : (addr -> disasm) -> addr -> t
val fallthrough : t -> node -> addr option
val fold_undet : t -> init:'a -> f:('a -> node -> 'a) -> 'a
end
module type DET = sig
type t
include S with type t := t
end
module Undet : UNDET
module Det : DET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment