Module bitstrings

Module bitstrings 

Source

Structs§

EvalTree
A tree of evaluated term, linked to the term structure itself. Created while evaluating a term.
PayloadContext
Payload with the context related to the term it originates from
PayloadMetadata
TermMetadata stores some metadata about terms.
Payloads
Terms are Terms equipped with optional Payloads when they no longer are treated as symbolic terms.

Constants§

THRESHOLD_RATIO 🔒
THRESHOLD_SIZE 🔒
Constants governing heuristic for finding payloads in term evaluations

Functions§

find_unique_match
Search and locate to_search := eval_tree[path_to_search].encode in root_eval:=eval_tree[vec![]].encode (=whole_term.encode(ctx)) such that the match corresponds to path_to_search (when to_search occurs multiple times). Also returns a boolean flag envcountered_get_symbol indicating whether a get symbol is between the root and the path_to_search, in which case, inconsistencies might occur.
find_unique_match_rec
Goal: locate byte position of to_search := eval_tree[path_to_search].encode in root_eval:=eval_tree[vec![]].encode (=whole_term.encode(ctx)) by traversing eval_tree until reaching node at pat_to_search. Assumptions:
first_sub_vec_unique
Return the first matching position when it is unique, and None otherwise
is_get_in_path
Checks if a get symbol is between the root and the path_to_search
last_sub_vec
Return the last matching positions, if any
replace_payloads
Operate the payloads replacements in eval_tree.encode[vec![]] and returns the modified bitstring by “splicing”. @payloads follows this order: deeper terms first, left-to-right, assuming no overlap (no two terms one being a sub-term of the other).
search_sub_vec_all
Return all the matching positions