cs.FLOct 8, 2026

Type-Checking for Pattern-Based Tree Transformations

Authors: C. Aiswarya, Sahil Mhaskar, M. Praveen

Organizations: CNRS IRL ReLaX, India

Abstract

We introduce and study pattern-based tree transformations. As an illustrating example, consider a source pattern (x⋅y)+(x⋅z)(x \cdot y) + (x \cdot z) and a target pattern x⋅(y+z)x \cdot (y + z) as a pair. This source pattern matches any expression ee of the form (e1⋅e2)+(e1⋅e3)(e_1 \cdot e_2) + (e_1 \cdot e_3) (by substituting xx with e1e_1, yy with e2e_2, and zz with e3e_3) and the pair transforms it into the expression e1⋅(e2+e3)e_1 \cdot (e_2 + e_3) as dictated by the target pattern. Note that in this example, the set of expressions that match the source pattern is not a regular tree language. We propose a model of tree transformations given by a finite representation of a (possibly infinite) set of such (source pattern, target pattern) pairs. The expressive power of this model comes at the cost of undecidability of checking equivalence. Nevertheless, we show that the type-checking problem is decidable for our model of pattern-based tree transformations. The type-checking problem asks whether applying a given transformation to trees having a given regular property (type) preserves the property. Our decision procedure is by a reduction to the emptiness problem of alternating tree automata.

Figures & tables

Explore similar work

CardsList
  1. Algebraic Decomposition Theory for Transformer Length Generalization

    Aug 13, 2026Andy Yang, Blerta Veseli, Corentin Barloy +5TransformerLength Generalization

  2. The Inclusion Depth of Pattern Languages: An Open Problem in Algorithmic Learning Theory

    May 28, 2026Wei Luo

  3. Geometric Representations for Transformed Pattern Matching in Music

    Oct 6, 2026David MeredithMusic Information Retrieval