Papers
Topics
Authors
Recent
Search
2000 character limit reached

Anagram-Agnostic Data Types (AADTs)

Updated 10 July 2026
  • AADTs are data types where any two legal sequential anagrams yield equivalent states, ensuring uniform legal continuations.
  • They collapse multiple linearizations into a single semantic class, reducing complexity in monitoring concurrent histories.
  • AADTs support fixed-parameter tractable algorithms and extend to permutation-invariant type systems for efficient state representation.

Searching arXiv for the cited papers and closely related work to ground the article. Anagram-agnostic data types (AADTs) are data types whose legal sequential executions are insensitive, in a precise behavioral sense, to permutation of the same multiset of operations. In the formal framework introduced for linearizability monitoring, a data type DD is an AADT when any two legal sequential histories that are anagrams are state-equivalent, meaning that they admit exactly the same legal continuations (Han et al., 6 Sep 2025). This notion is consequential because it collapses many distinct linearizations of a concurrent history into a single semantic class. Related work does not usually define AADTs directly, but it supplies adjacent foundations: row-typed extensible sums and products give an order-insensitive, label-indexed structural analogue of datatype presentation (Hubers et al., 2023), while explicit isomorphisms and reusable synthesis templates illustrate broader forms of representation-agnostic and presentation-agnostic computation (0808.2953, Inala et al., 2015).

1. Definition and semantic criterion

In the monitoring framework of "Fixed Parameter Tractable Linearizability Monitoring for Stack, Queue and Anagram Agnostic Data Types" (Han et al., 6 Sep 2025), a concurrent history is a finite set of operations, with each operation modeled as

o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},

where idid is a unique identifier, mMm \in M is the method, vVv \in V is the argument/return value component, tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}, and tinv<trest_{\mathit{inv}} < t_{\mathit{res}}. A history is sequential if intervals do not overlap. A linearization is an injective mapping

:HQ0\ell : H \to \mathbb{Q}_{\ge 0}

such that for each operation oHo \in H,

tinv(o)<(o)<tres(o).t_{\mathit{inv}}(o) < \ell(o) < t_{\mathit{res}}(o).

The induced abstract sequential history is

o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},0

ordered by increasing o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},1.

The defining equivalence relation for AADTs is semantic rather than syntactic. For legal sequential executions o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},2,

o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},3

Thus, two executions are equivalent exactly when they admit the same legal futures. The formal definition is: o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},4

A recurrent misconception is that an AADT must accept every permutation of a multiset of operations. The formal definition is weaker and more specific. It does not say that every permutation is legal; it says that among the permutations that are legal, all are semantically equivalent. This distinction is central. AADT semantics is therefore permutation-insensitive only after legality has been established.

2. Linearizability, partition states, and semantic collapse

The decision problem studied for AADTs is standard linearizability monitoring: given a concurrent history o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},5 and a prefix-closed sequential specification o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},6, determine whether there exists a linearization o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},7 such that o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},8 (Han et al., 6 Sep 2025). The paper organizes the search space using partition states. A subset o={id,m,v,tinv,tres},o = \{id, m, v, t_{\mathit{inv}}, t_{\mathit{res}}\},9 is a partition state if there exists a time idid0 such that completed-before-idid1 operations are included and not-yet-invoked operations are excluded: idid2

idid3

Let idid4 denote the set of partition states of idid5.

The associated frontier graph is the DAG

idid6

with edges

idid7

Each path from idid8 to idid9 corresponds to a candidate linearization order. The paper proves the bound

mMm \in M0

where mMm \in M1 and

mMm \in M2

is the maximum concurrency.

For a general ADT, the certificate of a partition state mMm \in M3, written mMm \in M4, is the set of all legal linearizations of mMm \in M5, with recurrence

mMm \in M6

In general this set can be exponentially large because different legal linearizations of the same subset may induce different future behaviors. The AADT condition removes precisely that source of blow-up. The paper’s corollary states that for a history mMm \in M7 of an AADT mMm \in M8, for all mMm \in M9, vVv \in V0, one has vVv \in V1. Consequently, one representative legal linearization, or equivalently one current simulated object state, suffices per reachable partition state.

3. Examples, non-examples, and common misunderstandings

The paper explicitly identifies the following as AADTs or representative AADTs: Counter, (Multi)Set, (Double-ended) Priority Queue, Read-modify-write register, and Size-aware stack (Han et al., 6 Sep 2025). The motivating intuition is that these objects are governed by extensional state properties such as current contents, multiplicities, priorities, or arithmetic effects, rather than by insertion order.

A canonical example is the set. The paper gives

vVv \in V2

because both executions leave the set in the same state vVv \in V3, and therefore have the same valid continuations. Priority queues are treated similarly when implemented as multisets with unique priority: legal permutations of overlapping enqueues that precede a dequeue leave the same final content with the same priority ordering.

By contrast, stacks and queues are not AADTs, because insertion order changes future behavior. For a queue,

vVv \in V4

are anagrams, but they are not equivalent under vVv \in V5; the first admits

vVv \in V6

while the second admits

vVv \in V7

Likewise,

vVv \in V8

because the top element differs.

Class Status Reason in the formal sense
Set / Multiset AADT Legal anagrams yield equivalent states
Priority queue AADT Contents and priorities, not enqueue order, determine futures
Queue Not AADT Different legal anagrams admit different dequeue suffixes
Stack Not AADT Different legal anagrams admit different pop/peek suffixes

A second misconception is that AADTs are merely “unordered containers.” The listed examples show that the class is broader: read-modify-write registers and size-aware stacks are included in the paper’s discussion. This suggests that the decisive property is not container shape but the equivalence of legal anagrams under the continuation-based state relation.

4. Structural and type-theoretic interpretations

Although "Generic Programming with Extensible Data Types; Or, Making Ad Hoc Extensible Data Types Less Ad Hoc" is not a paper about AADTs per se, it provides a typed foundation for extensible, label-indexed sums and products whose simple row theory is permutation-invariant (Hubers et al., 2023). In that setting, datatype structure is represented by rows, finite associations of labels to types, such as

vVv \in V9

From rows the system forms records tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}0 and variants tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}1. In the simple row theory tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}2, rows are commutative and labels are unique, so what matters is which labeled constructors or fields are present, not the textual order in which they were listed.

This yields a structural analogue of “anagram-agnostic” datatype presentation. For example, under tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}3,

tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}4

The paper identifies this as explicit permutation invariance. A variant such as

tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}5

is therefore a structurally labeled sum rather than a closed nominal declaration. This aligns with an AADT intuition in which constructor identity is label-based rather than position-based.

The paper’s more distinctive contribution is generic programming over rows themselves. Its operators tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}6, tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}7, and tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}8 quantify over every label/type pair in an arbitrary row. In particular, tinv,tresQ0t_{\mathit{inv}}, t_{\mathit{res}} \in \mathbb{Q}_{\ge 0}9 analyzes a whole variant tinv<trest_{\mathit{inv}} < t_{\mathit{res}}0 if one can handle any entry tinv<trest_{\mathit{inv}} < t_{\mathit{res}}1 in the row, and tinv<trest_{\mathit{inv}} < t_{\mathit{res}}2 synthesizes a whole record tinv<trest_{\mathit{inv}} < t_{\mathit{res}}3 from a uniform row-indexed producer. The resulting record/variant duality is made explicit by

tinv<trest_{\mathit{inv}} < t_{\mathit{res}}4

via reify and reflect. This provides a modular eliminator story over order-insensitive labeled constructor families.

The match with AADTs is nevertheless partial. The row-typed account handles extensible products and sums, but not a dedicated framework of recursive datatype fixpoints, induction principles, or pattern matching modulo permutation of nested constructor arguments. It also does not provide a full datatype-level equivalence theory beyond rows, nor a mechanism for globally relating or canonically renaming labels. A plausible implication is that row calculi furnish a strong substrate for the “order-insensitive labeled structure” aspect of AADTs, without yet constituting a full AADT theory.

5. Algorithmic consequences for linearizability monitoring

For AADTs, the semantic collapse of legal linearizations leads directly to a fixed-parameter tractable monitoring algorithm parameterized by maximum concurrency tinv<trest_{\mathit{inv}} < t_{\mathit{res}}5 (Han et al., 6 Sep 2025). The paper gives the explicit DFS:

oHo \in H9

Here tinv<trest_{\mathit{inv}} < t_{\mathit{res}}6 is the current partition state and tinv<trest_{\mathit{inv}} < t_{\mathit{res}}7 is a representative legal linearization of tinv<trest_{\mathit{inv}} < t_{\mathit{res}}8, or equivalently a representation of the current object state. Because all legal linearizations of the same partition state are equivalent for an AADT, the algorithm does not need to preserve multiple incomparable prefixes at the same node.

The main theorem states that given a history tinv<trest_{\mathit{inv}} < t_{\mathit{res}}9 with :HQ0\ell : H \to \mathbb{Q}_{\ge 0}0 operations of an AADT :HQ0\ell : H \to \mathbb{Q}_{\ge 0}1, where the membership of :HQ0\ell : H \to \mathbb{Q}_{\ge 0}2 can be solved in :HQ0\ell : H \to \mathbb{Q}_{\ge 0}3 time, monitoring linearizability can be solved in

:HQ0\ell : H \to \mathbb{Q}_{\ge 0}4

time. The paper also gives the same asymptotic bound when initialization of the object and each operation both updates and backtracks in :HQ0\ell : H \to \mathbb{Q}_{\ge 0}5 time. This is the central fixed-parameter tractability result.

The paper further notes concrete instantiations. If specification membership is linear, then monitoring is

:HQ0\ell : H \to \mathbb{Q}_{\ge 0}6

For priority queues implemented by balanced BSTs with :HQ0\ell : H \to \mathbb{Q}_{\ge 0}7 updates/backtracking, the bound becomes

:HQ0\ell : H \to \mathbb{Q}_{\ge 0}8

For hash-based sets and multisets, the paper gives

:HQ0\ell : H \to \mathbb{Q}_{\ge 0}9

These bounds are substantially simpler than the queue and stack cases treated in the same work: oHo \in H0 for queues, and

oHo \in H1

with a subcubic improvement

oHo \in H2

for stacks. The difference is exactly that AADTs eliminate the need to remember multiple semantically distinct legal prefixes per partition state.

6. Representation-agnostic encodings and synthesis over datatype presentations

A second line of adjacent work concerns representation-agnostic computation rather than AADT semantics strictly defined. "Declarative Combinatorics: Isomorphisms, Hylomorphisms and Hereditarily Finite Data Types in Haskell" studies explicit isomorphisms

oHo \in H3

with

oHo \in H4

implemented as Iso (a->b) (b->a) (0808.2953). Its framework is organized around a common root representation type Root = [Nat], together with with, as, borrow, and lend combinators for any-to-any conversion and transport of operations. For AADT-adjacent purposes, the most relevant examples are sets and multisets, where canonical forms are sorted strictly increasing or sorted nondecreasing sequences. This is closely related to order-insensitive content, but the paper’s framework remains fundamentally about bijections, not quotienting arbitrary syntax by permutation.

"Synthesis of Recursive ADT Transformations from Reusable Templates" addresses a different neighboring problem: how to synthesize recursive transformations while reducing dependence on concrete constructor-by-constructor templates (Inala et al., 2015). Its polymorphic synthesis constructs include polymorphic generators, flexible pattern matching switch(x){ case?: e }, field lists e.fields?, and unknown constructors new cons?(...). These constructs make templates more reusable across recursive ADTs and support a two-stage process

oHo \in H5

where type-directed expansion removes PSCs before ordinary constraint-based synthesis. The paper reports that 23 benchmarks are handled using only 4 generic templates from a library.

These two works illuminate different sides of the AADT landscape. Tarau’s isomorphism-based framework suggests how canonical forms and transport of operations can support representation-independent computation after normalization. SyntRec suggests how generic transformations can be made less brittle with respect to constructor and field organization. Neither paper defines AADTs in the continuation-equivalence sense of linearizability monitoring, but both are technically relevant to the broader goal of reducing semantic dependence on surface presentation.

7. Limitations, scope, and open directions

The formal AADT notion in the monitoring literature is deliberately strong. It depends on a prefix-closed sequential specification oHo \in H6, on equivalence defined by legal continuations, and on bounded maximum concurrency oHo \in H7 for tractable monitoring (Han et al., 6 Sep 2025). The paper is explicit that ordinary stacks, queues, and plain read/write registers do not satisfy the AADT property. It also assumes efficient membership in oHo \in H8, or efficient incremental update and backtracking, for the stated runtime bounds.

The row-typed line of work exposes a different boundary. In the simple row theory, labeled sums and products are permutation-invariant, but the theory does not supply a first-class account of recursive datatype fixpoints, induction principles, or datatype-level equivalence beyond rows (Hubers et al., 2023). It also notes limitations in relating row components, especially renaming while preserving uniqueness constraints. Likewise, folds over unordered labeled structure require algebraic laws: in a commutative row theory, the combining operator should be commutative.

The encoding and synthesis papers identify further gaps. The isomorphism framework is exact and reversible, whereas quotient-style AADTs may require many-to-one normalization from raw syntax to canonical form (0808.2953). The synthesis framework reduces dependence on presentation details but still expands against the concrete constructor inventory of a declared ADT, and its correctness guarantees are bounded rather than universal (Inala et al., 2015).

Taken together, these limitations suggest a coherent research agenda. A full AADT theory would likely need a semantic equivalence account of legal anagrams, a structural calculus for permutation-invariant labeled sums and products, a normalization discipline for presentation variants, and recursive principles for inductive or coinductive AADT families. This suggests that current work has established strong components of the subject—especially the continuation-based definition and fixed-parameter monitoring algorithm—but not yet a single unified theory spanning semantics, type structure, normalization, and synthesis.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Anagram-Agnostic Data Types (AADTs).