package plebeia
Install
Dune Dependency
Authors
Maintainers
Sources
md5=104e71a50a29b96a4b508004a539c88a
sha512=5edcd6c73dc276011c6344e121e978d294e3b8847ce6e8b28b03a2c7f3ed6bd1a860775dfb9d5b399442d66eeffcb45d9aab6f08b4accdf9287b5b7dbbf91506
doc/plebeia/Plebeia/Node/index.html
Module Plebeia.Node
Source
include module type of struct include Node_type end
2 Types
type hashed = Node_type.hashed =
| Hashed of Hash.Prefix.t
| Not_Hashed
(*Type used to prove that if a node is hashed then so are its children. The type also provides the hash as a witness.
*)
type indexed = Node_type.indexed =
| Indexed of Index.t
| Not_Indexed
(*This rule expresses the following invariant : if a node is indexed, then its children are necessarily indexed. Less trivially, if an internal node is not indexed then at least one of its children is not yet indexed. The reason is that we never construct new nodes that just point to only existing nodes. This property guarantees that when we write internal nodes on disk, at least one of the child can be written adjacent to its parent.
*)
type node = Node_type.node =
| Disk of Index.t * extender_witness
| View of view
| Hash of Hash.t
view constructors are private. Use _Internal, _Bud, _Leaf, and _Extender functions with runtime invariant checks.
2 Constructors with invariant checks
2 Accessors
2 Tools to create Not_Indexed and Not_Hashed nodes
2 Loading of nodes
2 Debug
Pretty printer
2 Mapper
Random generators
gen_bud depth
is a generator of Internal node with about depth
sides
Node reading from a context
Obtain the view of the node. If the view is not available in the memory, it is loaded from the storage.
Compute the hash of the node with its view