Module Isa_btree

Isabelle B-tree definitions, as an OCaml lib

include Isa_btree__.Summary

Assertion checking etc

include Isa_export_wrapper.Isa_export_assert_flag
val enable_isa_checks : unit -> unit
val disable_isa_checks : unit -> unit

Code exported from Isabelle, and a wrapper

module Isa_export : sig ... end

This file is exported from Isabelle, and lightly patched (eg to include this comment!). The OCaml interfaces wrap this basic functionality.

module Isa_export_wrapper : sig ... end

Constants

type constants = Constants.constants = {
min_leaf_size : int;
max_leaf_size : int;
min_node_keys : int;
max_node_keys : int;
}
module Constants : sig ... end

B-tree constants: minimum leaf size etc. These constants should be chosen so that nodes and leaves fit in a block. Clearly this depends on the block size, the size of keys and values, the on-disk format etc.

Main types and interfaces

module Isa_btree_intf : sig ... end

Jane Street-style interface file

type ('node, 'leaf) dnode = ('node'leaf) Isa_btree_intf.Dnode_type.dnode
module Store_ops = Isa_btree_intf.Store_ops
type ('r, 'dnode, 't) store_ops = ('r'dnode't) Store_ops.store_ops
type ('k, 'v, 'leaf) leaf_ops = ('k'v'leaf) Isa_btree_intf.leaf_ops
type ('k, 'r, 'node) node_ops = ('k'r'node) Isa_btree_intf.node_ops
type ('k, 'v, 'r, 'ls, 't) leaf_stream_ops = ('k'v'r'ls't) Isa_btree_intf.leaf_stream_ops
type ('k, 'v, 'r, 'leaf, 'frame, 't) pre_map_ops = ('k'v'r'leaf'frame't) Isa_btree_intf.pre_map_ops
type ('k, 'v, 'r, 't, 'leaf, 'node, 'ls) pre_btree_ops = ('k'v'r't'leaf'node'ls) Isa_btree_intf.pre_btree_ops

Main functionality: make a B-tree

module Make : sig ... end

This functor takes various types and constants (including, in particular, the type of keys and the value for the comparison on keys) and generates extra types leaf,node,leaf_stream... for the map implementations. Then there is a function make_btree_ops which takes a store_ops and returns the B-tree operations.

Internal interfaces

module Comparator_to_map_ops = Isa_btree_util.Comparator_to_map_ops
val make_with_k_maps : monad_ops:'a Tjr_monad.monad_ops -> cs:Isa_btree__.Constants_type.constants -> k_cmp:('b -> 'b -> int) -> k_map:('b'c'd) Isa_btree_intf.Leaf_node_frame_map_ops_type.map_ops -> kopt_map:('b option'e'f) Isa_btree_intf.Leaf_node_frame_map_ops_type.map_ops -> dbg_tree_at_r:('e -> (unit, 'a) Tjr_monad.m) -> ('b'c'e'a'd'f('e'd('b'e'f) Isa_btree_intf.frame) Isa_btree__Isa_btree_intf.Internal_leaf_stream_impl_t._t('e('f'd) Isa_btree_intf.dnode'a) Isa_btree_intf.store_ops) Isa_export_wrapper.t2

This is the "most general" interface

module Make_with_first_class_module : sig ... end
module Leaf_node_frame_impls : sig ... end
module Isa_btree_util : sig ... end

Given a value k_cmp, construct the corresponding map_ops, with keys: k, k option

module Profilers : sig ... end

Various profilers.