Skip to content

Add 9 enhancements to tree/grammar library (fixpoint, merge, forest traversal, union-find, thread safety, ...)#15

Open
naturalog wants to merge 1 commit intomasterfrom
tau-kr-enhancements
Open

Add 9 enhancements to tree/grammar library (fixpoint, merge, forest traversal, union-find, thread safety, ...)#15
naturalog wants to merge 1 commit intomasterfrom
tau-kr-enhancements

Conversation

@naturalog
Copy link
Copy Markdown
Collaborator

Summary

  • fixpoint: apply rewrite rules until tree stabilises
  • merge_trees: structural merge of two interned trees with a join function
  • annotated_forest: per-node label map + bottom-up propagation over any forest
  • forest::traverse_backward + build_reverse_index: BFS from a node set up through parents
  • tref_union_find: union-find over interned tree nodes
  • grammar::derive_all: bottom-up unit-rule closure from a seed set
  • pattern_matcher_guarded: pattern match gated by a guard on the binding environment
  • Thread safety: shared_mutex on M() + gc_callbacks, atomic<bool> gc_enabled, hook snapshot pattern
  • ankerl/unordered_dense v4.4.0 available via CMakeLists FetchContent (M() stays std::unordered_map)

Test plan

  • build/doctest_enhancements — 26 new tests, all pass
  • build/doctest_tree — 99 existing tests, all pass
  • build/doctest_tree_traversals — 11 existing tests, all pass
  • build/bench_enhancements — manual benchmark

…raversal, union-find, thread safety, ...)

- fixpoint: apply rewrite rules until tree stabilises
- merge_trees: structural merge of two interned trees with a join function
- annotated_forest: per-node label map + bottom-up propagation over any forest
- forest::traverse_backward + build_reverse_index: BFS from a node set up through parents
- tref_union_find: union-find over interned tree nodes
- grammar::derive_all: bottom-up unit-rule closure from a seed set
- pattern_matcher_guarded: pattern match gated on a binding-environment guard
- Thread safety: shared_mutex on M() + gc_callbacks, atomic<bool> gc_enabled, hook snapshot pattern
- ankerl/unordered_dense v4.4.0 available via CMakeLists FetchContent (M() stays std::unordered_map)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant