Function puffin::algebra::bitstrings::find_unique_match_rec

source ยท
pub fn find_unique_match_rec<PT: ProtocolTypes>(
    path_to_search: &[usize],
    eval_tree: &EvalTree,
    whole_term: &Term<PT>,
    is_to_search_in_list: bool,
) -> Result<usize, Error>
Expand description

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:

  • encoded arguments of a term can be found in this same order in the evaluation of the father node
  • there can be headers of arbitrary length
  • no trailer (no bytes added after the last argument encoding)