Module puffin::algebra::bitstrings

source ·

Structs§

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

Constants§

Functions§

  • 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).
  • 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:
  • Return the first matching positions, if any
  • Return the first matching position when it us unique, and None otherwise
  • Return the last matching positions, if any
  • 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).
  • Return all the matching positions