arXiv:2610.39156cs.LOOct 2026

Manuscript Offprint

arXiv:2610.39156

Learning Erasing Equal-Length Relational Pattern Languages in the Limit from Positive Data over Binary Alphabets

S. Mahmoud Mousawi, Sandra Zilles

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Relational pattern languages generalize Angluin's pattern languages by requiring the strings substituted for repeated occurrences of a variable to stand in a given relation, rather than to be identical. We study erasing pattern languages under the equal-length relation, where all occurrences of a variable must be replaced by strings of the same length. Over alphabets with at least three letters, this class is known to be learnable in the limit from positive data. We show that over a binary alphabet it is not, which resolves an open question from earlier work. Our proof reveals that non-learnability already holds for the restricted subclass of languages generated by patterns that have exactly three maximal substrings of variables. We then show that patterns with at most two maximal substrings of variables are learnable in the limit from positive data for every alphabet of size at least two. If the target pattern is known to have at most one maximal substring of variables, this can even be achieved by an iterative learner, which updates its hypothesis using only the current example and its previous hypothesis.

1 Introduction

Pattern languages, introduced by Angluin [1], have been an object of study in algorithmic learning theory for decades. A pattern is a finite string of terminal symbols and variables. Its language consists of all words obtained by replacing each variable with a string over the terminal alphabet, where all occurrences of the same variable are replaced by the same string. The literature distinguishes non-erasing pattern languages [1], in which variables cannot be replaced with the empty string, from erasing pattern languages, where empty substitutions are allowed [2]. Both variants have been studied extensively in Gold's model of learning in the limit from positive data [3], where a learner is gradually presented with a sequence of all strings in an unknown target language LL and must eventually settle on a correct description for LL. The class of non-erasing pattern languages is learnable in this model [1], even by an iterative learner, which updates its hypothesis based only on the previous hypothesis and the current example [4]. By contrast, erasing pattern languages are not learnable in the limit from positive data, when the underlying alphabet has size 2, 3, or 4 [5, 6].

Relational pattern languages [7] are a generalization of the notion of pattern language, in which repeated variables need not be replaced by the same string, but instead by strings that are in a specified relation. Natural choices for this relation are, for example, equality, reversal, equal length, or abelian equivalence [8–10]; the equality relation here recovers the original notion of pattern language.

The equal-length relation is arguably the simplest of the relations considered in the literature [8, 9]. All occurrences of a variable must be replaced by strings of the same length, but the strings themselves can be chosen independently. As a result, the language generated by a pattern under this relation depends only on its terminal symbols and on the admissible lengths of the strings between them. Non-erasing equal-length relational pattern languages are trivially learnable in the limit from positive data; moreover it is known that they can be distinguished by small sets of short strings when the alphabet size is at least three [8]. In the erasing case, it was observed that the positive learnability result for alphabets with at least three letters carries over from the non-erasing case [9]. However, binary alphabets posed a challenge. It was shown that many specific forms of patterns generate erasing equal-length relational languages that have so-called telltales even for binary alphabets [9]. A telltale of a language LL with respect to a family L\mathcal{L} of languages is a finite subset of LL that is not contained in any language L′∈LL' \in \mathcal{L} with L′⊂LL' \subset L. The uniform enumerability of a system of telltales is a necessary and sufficient condition for the learnability of a family L\mathcal{L} with uniformly decidable membership [11]. Despite numerous results on the existence of telltales for subclasses of erasing equal-length relational pattern languages, it was left open whether the full class εLlen\varepsilon \mathcal{L}_{len} of erasing equal-length relational pattern languages has telltales and thus whether it is learnable in the limit from positive data, given a binary alphabet.

We resolve this open question by presenting a pattern p∗p^* whose erasing equal-length relational language εLlen(p∗)\varepsilon L_{len}(p^*) over a binary alphabet does not have a telltale with respect to εLlen\varepsilon \mathcal{L}_{len}. Consequently, for alphabets of only two letters, the class εLlen\varepsilon \mathcal{L}_{len} is not learnable in the limit from positive data. We complement this result with positive learnability results for languages generated by patterns with a small number of maximal substrings of variables.

The first technical ingredient is to represent every language εLlen(p)∈εLlen\varepsilon L_{len}(p) \in \varepsilon \mathcal{L}_{len} by the sequence of terminals in the underlying pattern pp and by a finitely generated monoid of gap vectors.¹ Roughly speaking, a word belongs to εLlen(p)\varepsilon L_{len}(p) if it can be cut around the terminals of pp so that the lengths of the pieces form a vector of the monoid. Suppose a learning algorithm is presented with positive examples only, i.e., words in the language εLlen(p)\varepsilon L_{len}(p), and has to identify pp. Any single positive example shows a word, but not where it has to be cut. The question we study is how much of the monoid can nevertheless be recovered from the examples. Over an alphabet of three or more letters, every gap vector has a word that can be cut in only one way, so that positive examples reveal the monoid and we obtain learnability in the limit from positive examples. Our focus is the binary alphabet case. The main results of our paper are:

  • Over a binary alphabet, a word can sometimes be cut differently, when shifting two equal adjacent terminals by one position. This allows one variable of a pattern to be “imitated” by other variables, and learning from positive data becomes impossible (Section 3). We prove this by providing a pattern pp such that εLlen(p)\varepsilon L_{len}(p) does not possess a telltale with respect to the class εLlen\varepsilon \mathcal{L}_{len}.

  • The pattern pp, as well as all the patterns that witness the fact that pp does not have a telltale, have exactly three variable blocks, i.e., they can be factored into substrings of only terminal symbols and substrings of only variable symbols, such that exactly three substrings of variable symbols are used. We therefore obtain the corollary that the patterns with exactly three variable blocks generate a class of erasing equal-length relational pattern languages that is not learnable in the limit from positive data, when the alphabet size is 2.

  • We contrast this by showing that the corresponding class is learnable in the limit from positive data, when the underlying patterns contain at most two variable blocks, regardless of the alphabet size (Section 4).

  • If it is known that the underlying pattern pp has at most one variable block, we obtain an even stronger positive learnability result, again regardless of the alphabet size. Learning in the limit from positive data can then even be achieved by an iterative learner, which updates its hypothesis based only on the previous hypothesis and the most recently seen word, ignoring all previously collected data (Section 5).