English

Efficient Pattern Matching in Unordered Term Tree Patterns with Height Constraints

Data Structures and Algorithms 2026-07-02 v1 Formal Languages and Automata Theory

Abstract

Unordered trees appear in applications where the order among child vertices is insignificant, such as abstract syntax trees and chemical structures. To describe patterns in such trees, we propose unordered term tree patterns, which employ height-constrained variables that restrict trunk length and subtree height. We formalize the pattern matching problem between an unordered term tree pattern and an unordered tree, and present an O(Nmax{nD3/2,S})O(N \cdot \max\{nD^{3/2}, \mathcal{S}\})-time algorithm, where nn and NN are the numbers of vertices in the pattern and tree, DD is the maximum vertex degree, and S\mathcal{S} is the sum of trunk constraints. Computational results show that the algorithm runs efficiently in practice.

Cite

@article{arxiv.2607.01704,
  title  = {Efficient Pattern Matching in Unordered Term Tree Patterns with Height Constraints},
  author = {Shintaro Matsushita and Takayoshi Shoudai and Yusuke Suzuki},
  journal= {arXiv preprint arXiv:2607.01704},
  year   = {2026}
}

Comments

6 pages. Author preprint of a paper presented at ESKM 2025, IIAI-AAI 2025