pub fn detect_structural_patterns(
tree: &TreeNode,
) -> (Vec<StructuralPattern>, BTreeMap<Vec<PatternField>, String>, BTreeMap<Vec<PatternField>, String>, BTreeMap<String, PatternBaseResult>)Expand description
Detect structural patterns in the tree using a bottom-up approach.
Returns (patterns, concrete_to_pattern, concrete_to_type_param, node_bases).
Each pattern has its mode set based on analysis of all instances.
node_bases maps tree paths to their computed PatternBaseResult for use during generation.