☰
CTrie
CTrie
§CTrie(CTK type :hasHash CTrie.CTK, CTV type, root mutate.new (choice (Indirection_Node CTrie.CTK CTrie.CTV) (rdcss_descriptor CTrie.CTK CTrie.CTV)), read_only bool) => CTrie CTrie.CTK CTrie.CTV:Map CTrie.CTK, CTrie.CTV
§CTrie(CTK
type
:hasHash CTrie.CTK, CTV type
, root mutate.new (choice (Indirection_Node CTrie.CTK CTrie.CTV) (rdcss_descriptor CTrie.CTK CTrie.CTV)), read_only bool) =>
CTrie CTrie.CTK CTrie.CTV:
Map CTrie.CTK, CTrie.CTV§add(i Indirection_Node CTrie.CTK CTrie.CTV, k CTK, v CTV, lev u32, parent option (Indirection_Node CTrie.CTK CTrie.CTV), gen i32) => choice restart ok:Any
§add(i Indirection_Node CTrie.CTK CTrie.CTV, k CTK, v CTV, lev u32, parent option (Indirection_Node CTrie.CTK CTrie.CTV), gen i32)
=>
choice restart ok:
Any try adding an element to the ctrie
may fail and result in a restart
may fail and result in a restart
compare and swap root of the ctrie
clean an indirection node:
compress contained container node
compress contained container node
turns this: container_node -> Indirection_Node -> tomb_node -> singleton_node
into this: container_node -> singleton_node
into this: container_node -> singleton_node
§compress(cn container_node CTrie.CTK CTrie.CTV, lev u32, gen i32) => Main_Node CTrie.CTK CTrie.CTV:Any
§compress(cn container_node CTrie.CTK CTrie.CTV, lev u32, gen i32)
=>
Main_Node CTrie.CTK CTrie.CTV:
Any compress a container node
§contract(cn container_node CTrie.CTK CTrie.CTV, lev u32, gen i32) => Main_Node CTrie.CTK CTrie.CTV:Any
§contract(cn container_node CTrie.CTK CTrie.CTV, lev u32, gen i32)
=>
Main_Node CTrie.CTK CTrie.CTV:
Any contract a container node
takes two single nodes and returns either
Main_Node -> container_node -> singleton_nodes
or
Main_Node -> list_node -> singleton_nodes
or recurse
Main_Node -> container_node -> Indirection_Node -> dual x y
Main_Node -> container_node -> singleton_nodes
or
Main_Node -> list_node -> singleton_nodes
or recurse
Main_Node -> container_node -> Indirection_Node -> dual x y
find k in linked nodes
returns flag and the position in the container_node for given params
lookup an element in this ctrie via bracket syntax
a snapshot of the ctrie as sequence auf key-value tuples
try lookup key in ctrie
may fail and result in a restart
may fail and result in a restart
lookup key k
unit type to indicate when value to lookup/remove is not found
complete the double compare and swap
of the root node
of the root node
do a double compare and swap of root node
1. try compare and swap root
2. if successful complete commiting the descriptor
1. try compare and swap root
2. if successful complete commiting the descriptor
read root none abortably
read root
if root is currently a descriptor we are in the middle
of a double compare and swap.
Then (try) commiting the descriptor first
if root is currently a descriptor we are in the middle
of a double compare and swap.
Then (try) commiting the descriptor first
try remove an element from the ctrie
may fail and result in a restart
may fail and result in a restart
remove key from ctrie
NYI marking ctrie as ref see issue https://github.com/tokiwa-software/fuzion/issues/304