Efficient Pattern Matching in Unordered Term Tree Patterns with Height Constraints

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(N · \nD3/2, S\)-time algorithm, where n and N are the numbers of vertices in the pattern and tree, D is the maximum vertex degree, and S is the sum of trunk constraints. Computational results show that the algorithm runs efficiently in practice.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…