Add 9 enhancements to tree/grammar library (fixpoint, merge, forest traversal, union-find, thread safety, ...)#15
Open
Add 9 enhancements to tree/grammar library (fixpoint, merge, forest traversal, union-find, thread safety, ...)#15
Conversation
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fixpoint: apply rewrite rules until tree stabilisesmerge_trees: structural merge of two interned trees with a join functionannotated_forest: per-node label map + bottom-up propagation over any forestforest::traverse_backward+build_reverse_index: BFS from a node set up through parentstref_union_find: union-find over interned tree nodesgrammar::derive_all: bottom-up unit-rule closure from a seed setpattern_matcher_guarded: pattern match gated by a guard on the binding environmentshared_mutexon M() + gc_callbacks,atomic<bool>gc_enabled, hook snapshot patternankerl/unordered_dense v4.4.0available via CMakeLists FetchContent (M() stays std::unordered_map)Test plan
build/doctest_enhancements— 26 new tests, all passbuild/doctest_tree— 99 existing tests, all passbuild/doctest_tree_traversals— 11 existing tests, all passbuild/bench_enhancements— manual benchmark