---
title: Solvable Tuple Patterns (STPs)
url: https://www.emergentmind.com/topics/solvable-tuple-patterns-stps
type: topic
---

# Solvable Tuple Patterns (STPs)

Searching arXiv for recent papers on Solvable Tuple Patterns and closely related tuple-pattern formalisms.
arXiv search query: "Solvable Tuple Patterns program verification"
Solvable Tuple Patterns (STPs) are a class of tuple-pattern languages introduced to express relational invariants over list-like recursive data structures, especially invariants involving concatenation, overlap, prefix/postfix structure, and reversal. Their defining feature is that candidate invariants can be inferred efficiently from only a small number of positive samples, without negative samples, and then checked for inductiveness using an SMT solver that supports sequence theory. In the form introduced for automated program verification, STPs serve as an inference-and-checking formalism for CHC-based verification of programs manipulating lists and similar recursive data; a CHC solver incorporating STP inference won the ADT-LIN category of CHC-COMP 2025 by a big margin [2508.20365].

## 1. Formal language and solvability criterion

The basic syntax of STPs is tuple-based. Let \(\Sigma\) be a set of letters and \(V\) a countably infinite set of variables. A tuple pattern has the form
\[
t ::= (p_1,\ldots,p_k), \qquad p \in (\Sigma \cup V)^*.
\]
Each component \(p_i\) is a word over constants and variables, and the tuple pattern denotes a \(k\)-ary relation on sequences by substitution of sequence values for its variables:
\[
L(t)=\{[s_1/x_1,\ldots,s_n/x_n]t \mid s_1,\ldots,s_n\in \Sigma^*\},
\]
where \(x_1,\ldots,x_n\) are the variables occurring in \(t\) [2508.20365].

This semantics makes STPs a language of structural equalities between multiple sequences. For example, \((x,y,xy)\) denotes all triples \((s_1,s_2,s_1s_2)\); \((x_1x_2, x_2x_3, x_1x_2x_3)\) denotes triples in which the first component is a prefix of the third, the second is a postfix of the third, and the overlap is represented by \(x_2\); and \((l_1,l_2,l_1^R l_2)\) captures reverse-plus-append structure [2508.20365].

A tuple pattern is called solvable when it can be reduced to a tuple of distinct variables by a prefix-elimination system. Formally, the class \(T_k\) of solvable tuple patterns of arity \(k\) is defined by
\[
T_k = \{\, t \mid t \pred^* (x_1,\ldots,x_n),\ |t|=k \,\},
\qquad
T=\bigcup_k T_k.
\]
The reduction relation \(\pred\) is generated by three rules: removing a component prefix from another component, removing a leading constant, and deleting an empty component. The name “solvable tuple patterns” comes from the fact that if \(t=(p_1,\ldots,p_n)\in T_n\), then the solution for a system of equations \(p_1=s_1,\ldots,p_n=s_n\) can be expressed using \(s_1,\ldots,s_n\), \(\epsilon\), constants \(a\in\Sigma\), and the partial operation \(\frac{s'}{s}\), defined as the \(s_0\) such that \(ss_0=s'\) when \(s\) is a prefix of \(s'\) [2508.20365].

The following representative patterns illustrate the intended expressiveness.

| Pattern | Expressed relation | Status |
|---|---|---|
| \((x,y,xy)\) | concatenation | solvable |
| \((l_1l_2, l_2l_3, l_1l_2l_3)\) | overlap, prefix, postfix | solvable |
| \((l_1,l_2,l_1^R l_2)\) | reverse-plus-append | solvable |
| \((x_1x_2, x_2x_1)\) | cyclic swap | not solvable |

The boundary is substantive. The pattern \((x_1x_2, x_2x_1)\) is not in \(T_2\), but \((x_1x_2, x_2x_1, x_1)\in T_3\), because the additional component makes the system reducible. Solvability is therefore sensitive not only to the local shape of components but also to whether the tuple contains enough information to solve for the latent sequence variables [2508.20365].

## 2. Expressive scope, extensions, and limitations

STPs were introduced to capture structural invariants among list-like recursive data structures. The examples emphasized in the verification setting include append-like relations, overlap relations, prefix/postfix relations, reverse-plus-append invariants, and similar equalities that naturally arise as inductive invariants for recursive list programs [2508.20365].

A canonical example is the accumulator-based reverse relation
\[
Reva(l_1,l_2,l_3) \equiv l_3 = l_1^R l_2,
\]
which is naturally expressed by
\[
(l_1,l_2,l_1^R l_2).
\]
Another recurring pattern is
\[
(l_1l_2, l_2l_3, l_1l_2l_3),
\]
used to express that one component is a prefix of the third, another is a postfix, and the shared overlap is explicit [2508.20365].

The basic formalism is extended in two directions. First, postfix rules are added to infer patterns such as \((y,xy)\). Second, reverse is incorporated by extending the pattern language with
\[
p ::= a \mid x \mid p_1p_2 \mid x^R,
\]
together with
\[
a^R=a,\qquad (x^R)^R=x,\qquad (p_1p_2)^R=p_2^R p_1^R.
\]
The inference system is correspondingly enriched with reverse-prefix and reverse-postfix rules. The paper states that these extensions preserve the main properties of the basic framework [2508.20365].

The scope of the formalism is deliberately restricted. The implemented verification pipeline is currently limited to list-like recursive ADTs rather than general trees. The paper also notes that functions such as `sort`, `filter`, `map`, and `fold` often induce relations not expressible by current STPs, and that Boolean combinations of STPs are outside the core system. This is not merely an implementation issue: the paper explicitly observes that adding a sorting operator loses minimality, and not all tuple patterns are solvable even within the basic sequence language [2508.20365].

A common misconception is to treat STPs as a generic name for arbitrary tuple templates. In the verification literature, the term denotes a specific reducibility-based fragment of tuple patterns over sequences. Its strength lies in capturing many practically important list equalities while retaining learnability, minimality, and polynomial-time decision properties within that fragment [2508.20365].

## 3. Inference from positive samples

The inference procedure takes as input an \(m\times n\) matrix \(M\) of positive samples, where rows are sample tuples and columns are tuple components. The objective is to infer a tuple pattern \((p_1,\ldots,p_n)\) such that \(M \models (p_1,\ldots,p_n)\). The algorithm starts from the most general pattern
\[
((x_1,\ldots,x_n), [M/(x_1,\ldots,x_n)])
\]
and repeatedly rewrites it by exploiting whole-column prefix structure, common leading constants, and all-empty columns [2508.20365].

The rewriting rules are operationally simple. If one whole column is a prefix of another, the residual suffix is factored out with a fresh variable; if every entry in a column starts with the same constant, that constant is factored out; if a column is always empty, the corresponding variable is replaced by \(\epsilon\) and removed. The algorithm terminates because each rewrite strictly decreases the total size of the data matrix, and the paper proves that the overall runtime is polynomial in \(size(M)\) [2508.20365].

Several metatheoretic guarantees are established. The inference algorithm is sound: if the rewriting process yields \((t,\Theta)\), then the data indeed matches \(t\). It outputs only solvable patterns: if the algorithm outputs \(t\), then \(t\in T\). It is complete for solvable patterns under the stronger relation \(M \smodelst t\), introduced to rule out ambiguity from variables that are always instantiated by \(\epsilon\). Most notably, it enjoys a minimality guarantee: if the algorithm infers \(t_1\) from \(M\), and \(M\models t_0\) with \(t_0\in T\), then
\[
L(t_1)\supseteq L(t_0) \implies L(t_1)=L(t_0).
\]
This minimality is critical because the framework uses only positive data; a non-minimal undergeneralization would not be refutable by positive samples alone [2508.20365].

The paper also proves a compact characteristic-sample property. If \(t=(p_1,\ldots,p_n)\) is a solvable tuple pattern and \(|p_1\cdots p_n|=m\), then there exists a learning dataset \(M\) such that:
\[
size(M)=O((m+n)\log n),
\]
the algorithm derives \(t\) from \(M\), and any pattern derived from \(M\) has the same language as \(t\). This establishes that STPs are not merely learnable in principle; they admit polynomial-size characteristic data [2508.20365].

A flagship example is the reverse-accumulator invariant \((l_1,l_2,l_1^R l_2)\), which the paper states can be inferred from only two samples:
\[
(ab, cd, bacd), \qquad (bc, da, cbda).
\]
This illustrates both the positive-only regime and the structural bias of the language toward relational equalities over sequences [2508.20365].

## 4. SMT encoding and integration with CHC solving

Once an STP candidate has been inferred, it is checked as a candidate inductive invariant using an SMT solver with sequence theory. For a tuple pattern \(t=(p_1,\ldots,p_k)\) with pattern variables \(\vec z\), the corresponding formula is
\[
\varphi_t
=
\lambda(x_1,\ldots,x_k).\exists \vec z.\,(x_1=p_1 \land \cdots \land x_k=p_k),
\]
with \(\{x_1,\ldots,x_k\}\cap \vec z=\emptyset\). The paper states that
\[
(x_1,\ldots,x_k)\in L(t) \iff \varphi_t(x_1,\ldots,x_k).
\]
This gives a direct embedding of STPs into first-order sequence formulas over concatenation and, in the extended setting, reverse [2508.20365].

The verification target is CHC solving for list-like data structures. A CHC has the form
\[
P_1(\vec y_1)\land \cdots \land P_n(\vec y_n)\land C \Rightarrow P(\vec x)
\]
or
\[
P_1(\vec y_1)\land \cdots \land P_n(\vec y_n)\land C \Rightarrow false.
\]
The STP-based workflow alternates between sample collection, STP inference, and SMT-based checking of definite and goal clauses. In simplified form, it maintains a set \(T\) of inferred STPs, collects positive samples from the definite clauses, infers a new STP \(t\), checks whether \(T\cup\{t\}\models D\), and then checks whether \(T\models G\). Multiple inferred STPs are combined by intersecting their denotations [2508.20365].

The `reva` benchmark is the paper’s main running example. The process first infers
\[
(\epsilon,l,l),
\]
corresponding to \(l_1=\epsilon \land l_2=l_3\), then
\[
(l_1,l_2,l_1l_2),
\]
and finally
\[
(l_1,l_2,l_1^R l_2),
\]
which is inductive and sufficient for the goal. The corresponding verification conditions reduce to sequence-theoretic formulas such as
\[
\forall x,l_1',l_2,l_3.\; l_3 = (l_1')^R (x\cdot l_2) \Rightarrow l_3 = (x\cdot l_1')^R l_2,
\]
and the paper reports that CVC5 can solve such checks quickly [2508.20365].

A relative completeness theorem is given for the abstract solve procedure. If STP inference is fair over reducible STPs, sample collection eventually returns every sample in the least model, and there exists an STP \(t\) such that the least model satisfies \(t\) and \(L(t)\) itself is a model of the CHCs, then the procedure eventually returns SAT. This is completeness within the STP fragment rather than full completeness for arbitrary list invariants [2508.20365].

## 5. Applications, empirical results, and practical profile

The empirical evaluation uses 445 instances from the CHC-COMP 2025 ADT-LIN category, restricted to those whose ADTs are only list-like data structures. The reported environment is an AMD Ryzen 9 5900X with 32GB RAM, 3-minute CPU and wall-clock limits, 8GB memory, and 4 CPU cores. Two tools are central: **TupInf**, the STP inference engine, and **CHoCoL**, the CHC solver using STPs [2508.20365].

The main solver comparison reported in the paper is as follows.

| Solver | Solved (SAT) | Solved (UNSAT) | Solved (all) |
|---|---:|---:|---:|
| CHoCoL | 167 (84) | 80 (0) | 247 (84) |
| RInGen | 64 (23) | 37 (4) | 101 (27) |
| Spacer | 20 (2) | 90 (0) | 110 (2) |
| Eldarica | 20 (0) | 84 (0) | 104 (0) |
| HoIce | 24 (6) | 43 (0) | 67 (6) |
| Catalia | 87 (12) | 87 (0) | 174 (12) |
| CHoCoL+Catalia | 188 | 84 | 272 |

The numbers in parentheses are uniquely solved instances. CHoCoL solves the most total instances among individual solvers, and its main advantage is on satisfiable problems: it solves 167 SAT instances and uniquely solves 84 satisfiable instances. The paper emphasizes these uniquely solved SAT cases as evidence that STPs capture list equalities that size-based or finite abstractions miss [2508.20365].

The mode breakdown further clarifies the practical role of STPs. CHoCoL’s list mode solves 89 SAT instances with 50 uniquely solved; set/multiset mode solves 9 with 5 uniquely solved; list-len mode solves 65 with 29 uniquely solved; and the refutation mode solves 4. This supports a modular picture in which raw STP reasoning is already strong on list equalities, while length reasoning and multiset extensions add complementary power [2508.20365].

The strengths and limitations are sharply delineated. The strengths are positive-only inference, small sample requirements, polynomial-time inference and decision procedures within the fragment, and direct expression of append/prefix/postfix/reverse equalities. The limitations are equally explicit: the implementation is restricted to list-like ADTs, not general trees; Boolean combinations of STPs are absent; the refutation procedure is currently naive and does not exploit STPs deeply; and the solver is substantially stronger on SAT than on UNSAT instances [2508.20365].

## 6. Related tuple-pattern traditions and conceptual neighborhood

The term **Solvable Tuple Patterns** is specific to the program-verification setting just described, but several earlier research lines study structurally related notions of tuple patterns, tuple solvability, or tuple-based tractability. These works do not use the term in the same sense, yet they clarify the broader conceptual landscape.

In pattern mining, interval tuple patterns were studied in the FCA/pattern-structure framework, where the main problem is efficient search under nonmonotonic constraints such as stability and \(\Delta\). The paper introduces **projection-antimonotonicity** and the \(\theta\)-Sofia algorithm, showing how closed interval tuple patterns can be searched efficiently along a chain of projections rather than by standard anti-monotone specialization order. This suggests a different notion of “solvable tuple patterns”: a tuple-pattern class is practically searchable when its refinement structure supports pruning by projection-based monotonicity [1506.01071].

In aspect-based sentiment analysis, tuple prediction is recast as a two-step **element-to-tuple** completion problem: first predict elements, then generate schema-valid tuples anchored at those elements. The paper does not use STP terminology, but it operationalizes tuple solving as anchored completion under typed schema and decoding constraints. A plausible implication is that “solvability” in that setting refers to whether a partial assignment can be completed into a valid sentiment tuple under prompt-induced structure, rather than to reducibility of sequence equations [2405.06454].

In the pattern lambda-calculus with pair patterns, solvability is characterized by **typability plus inhabitation**. There the basic tuple-pattern fragment is binary pair patterns, and a term is solvable when some head context makes it reduce to a pair. The result is closely related in spirit—both frameworks isolate a restricted tuple-pattern fragment with a precise solvability criterion—but the objects are lambda terms with explicit matching rather than relational invariants over sequences [1812.06009].

Other adjacent literatures examine tuple solvability from still different angles. Shattering bounds for tuple systems study when all \(q\)-ary assignments on a coordinate subset can be realized by tuples from a system, giving an expressiveness bound for full realizability rather than an invariant language [1512.00999]. The TP/TN completion literature studies patterns of specified and unspecified matrix entries, where a pattern is “solvable” when all admissible partial data admit a totally positive or totally nonnegative completion, using catalysis, inhibition, and atomic determinant inequalities as the decision framework [2203.04484]. Tuple interpretations for higher-order rewriting map base-type terms to tuples such as \((cost,size)\) or \((cost,length,max)\), making tuple structure a semantic device for proving finite derivation height and runtime bounds rather than a pattern language for invariants [2105.01112]. Earlier still, Tuplix Calculus provides a formal calculus of attribute–quantity tuples with tests, existential summation, and encapsulation, offering a constraint-based tuple formalism that is conceptually adjacent but semantically distinct [0712.3423].

Taken together, these works show that “tuple patterns” are a recurrent formal theme across data mining, NLP, rewriting, constraint systems, and verification. In the specific technical sense of STPs, however, the term denotes the 2025 verification formalism: a reducibility-based class of tuple patterns over sequences, learnable from positive data and checkable as inductive invariants for list-like recursive programs [2508.20365].

Source: https://www.emergentmind.com/topics/solvable-tuple-patterns-stps