Abstract 1 Introduction 2 Data word languages and register automata with permutations 3 Decision problems for register automata with permutations 4 Minimal register automata with permutations 5 𝚷-DRAs: pDRAs with a Fixed Permutation Policy 6 Active Learning and Minimization of 𝚷-DRAs 7 Discussion References

Register Automata with Permutations

Mrudula Balachander ORCID Université libre de Bruxelles (ULB), Belgium Emmanuel Filiot ORCID Université libre de Bruxelles (ULB), Belgium Raffaella Gentilini ORCID University of Perugia, Italy Nikos Tzevelekos ORCID Queen Mary University of London, UK
Abstract

We propose Permutation Deterministic Register Automata (pDRAs), a deterministic register automaton model where we allow permutations of registers in transitions. The model enables minimal canonical representations and pDRAs can be tested for equivalence in polynomial time. The complexity of minimization is between GI (the complexity of graph isomorphism) and NP. We then introduce a subclass of pDRAs, called register automata with fixed permutation policy, where the register permutation discipline is stipulated globally. This class generalizes the model proposed by Benedikt, Ley and Puppis in 2010, and we show that it also admits minimal and canonical representations, based on a finite-index word equivalence relation. As an application, we show that for any regular data language L, the minimal register automaton with fixed permutation policy recognizing L can be actively learned in polynomial time using oracles for membership, equivalence and data-memorability queries. We show that all the oracles can be implemented in polynomial time, and so this yields a polynomial time minimization algorithm.

Keywords and phrases:
Register automata, data words, equivalence, minimization, active learning
Funding:
Mrudula Balachander: Research Fellow at F.R.S.-FNRS
Emmanuel Filiot: Research Director at F.R.S.-FNRS. This work was partially funded by the FNRS project 40020726.
Copyright and License:
[Uncaptioned image] © Mrudula Balachander, Emmanuel Filiot, Raffaella Gentilini, and Nikos Tzevelekos; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Formal languages and automata theory
Editors:
Paweł Gawrychowski, Filip Mazowiecki, and Michał Skrzypczak

1 Introduction

Automata for words and trees over infinite alphabets have been extensively studied in the literature [9, 24, 23]. Automata operating over infinite alphabets are not as robust as finite automata (for example, non-determinism usually brings extra computational power), and that has led to introducing various models, with different expressiveness and algorithmic properties. However, register automata, introduced as finite memory automata by Kaminksi and Francez [13], are perhaps one of the most studied models of automata over infinite alphabets. They can naturally model systems processing sequences of data, which have to be stored and compared with respect to (dis)equality. Register automata (RAs) over an infinite dataset 𝒟 are finite-state automata extended with a finite set of registers. When they read a sequence of data from 𝒟, data can be stored in the registers and compared against the data already in memory. Deterministic register automata (DRAs) enjoy better algorithmic properties than their non-deterministic counterparts, such as closure under complementation and a decidable equivalence problem. The class of languages recognized by DRAs are sometimes called regular data languages. In this paper we are interested in two fundamental questions about regular data languages: (1) whether there is an effective, machine-independent representation thereof which is concise and enjoys good complexity bounds with respect to standard decision problems (such as the equivalence problem); and, in addition, (2) the representation naturally yields a canonical and minimal representative.

Register automata models come in various guises, with some formalisms giving emphasis on succinctness (i.e. ability to write a concise automaton for a given language) and others on efficiency (ability to decide standard problems efficiently). For example, allowing registers to store duplicate data enhances succinctness [8], while ensuring that registers do not contain duplicate elements and cannot be empty yields a polynomial time equivalence checking routine (for deterministic automata) [17].111(Language) Equivalence is undecidable for non-deterministic RAs [19]. For deterministic ones, the problem is coNP-C if we allow empty registers [22, 16], and PSpace-hard if we cater for duplicate register content [10]. The problem is lowered to PTime by disallowing both features [17]. One could argue that there is an antagonism between the two notions: succinctness requires flexibility in how data are manipulated, whereas efficiency benefits from a restricted set of options. Part of the contribution is to show that this is not the case, and our automata strike a balance between the two notions.

Regular languages (over finite alphabets) are characterized by having finite-index Myhill-Nerode equivalence relations on words. This machine-independent characterization naturally yields a canonical and state-minimal DFA for any regular language. Minimization of register automata presents challenges related to choosing unique representatives for states that are equivalent up to data permutation, and ensuring the operations of the automata are compatible with said choice of representatives. To the best of our knowledge, the first extension of this result to regular data languages was given in [4], using the notion of memorable data (data that need to be stored to recognize a language). Moreover, [4] introduces a class of DRAs where, in each transition, registers are permuted so that their order follows the order of the last appearance of their data. We call this class Lar-DRA. For any regular data language, there exists a canonical Lar-DRA which is both state-minimal and register-minimal. The time complexity of minimizing Lar-DRAs is known to be exponential [4].

Register automata with permutations.

In this paper, we propose a new model of register automata whose equivalence problem is in PTime like the automata in [17] (called herein MRT-automata), which admits canonical and minimal representatives like Lar-automata, and which is exponentially more succinct than both models. The model, called deterministic register automata with permutations (pDRAs), is an extension of MRT-automata with the possibility of applying permutations on the registers. No duplicate values in registers nor empty registers are allowed, although some registers can be dropped (become unavailable) in some states. When reading a datum d from the infinite alphabet 𝒟, a pDRA can test whether it is already stored in some register r, or it is fresh (not stored in any register). In the latter case, the pDRA assigns the fresh datum d to some register. In both cases, a permutation (which depends on the transition) is applied on the registers to permute their content. The content of unavailable registers is deleted.

Example 1.

Let n and

Ln={d1d2dndπ(1)dπ(2)dπ(n)ij.didjπ{𝗂𝖽,𝗋𝖾𝗏}}

where 𝗂𝖽 is the identity permutation and 𝗋𝖾𝗏={inii[1,n]} is the order-reversing permutation. It is recognizable by a pDRA (illustrated in Figure 1) with 2n+1 states and at most n available registers. By setting q0 to be accepting and redirecting the last transition towards q0 instead of qn, the modified pDRA recognizes Ln. Since q0 has no available registers, coming back to q0 has the effect of deleting the whole memory.

Outline.

We study language-related properties of pDRAs. After showing that pDRAs are exponentially more succinct than MRT-automata and Lar-DRAs, we look at generalizations of known results in the pDRA setting. We show that pDRAs have membership, emptiness, equivalence and data memorability problems in PTime.

Figure 1: A pDRA recognizing Ln (see Example 1), with set of registers {1,,n}. The available registers are indicated below each state. A transition pr,πq, for π{𝗂𝖽,𝗋𝖾𝗏}, is fired when the current datum equals the content of register r, while a transition pr,πq is fired when the current datum is different from any datum in memory, which results in storing d in register r. In both cases, the data stored in the registers are permuted according to π.

We then focus on mimimization and show that pDRAs have minimal and canonical representatives. We prove that pDRAs can be minimized in exponential time. The associated decision problem is in NP and we prove that it is as hard as the graph isomorphism problem.

The barrier in efficient minimization motivates a subclass of pDRAs, that we call pDRAs with fixed register policy. In this model, permutations applied to registers only depend on the number of available registers and the register test. Therefore, any fixed register policy Π determines a class of pDRAs, which we denote Π-DRAs. Additionally, in a Π-DRA, registers are ordered and data are required to be stored in consecutive registers. For instance, the model of [4] coincides with Lar-DRAs, where Lar is a policy ensuring that registers are ordered by last occurrence of their contents.

As an equi-expressive particular case of pDRAs, Π-DRAs inherit some of the properties of pDRAs, such as PTime equivalence (improving the exponential upper bound of [4] as a special case). Our next contribution is a Myhill-Nerode congruence for Π-DRAs, which yields canonical and minimal Π-DRAs for any regular data language. This generalizes the results of [4] with a different approach based on abstract residual languages. In some sense, compared to Lar-DRA, our result shows that the last appearance policy is not necessary to obtain a canonical and minimal model: fixing a register policy is actually sufficient.

We use the results gathered for Π-DRAs, either directly or by inheritance from pDRAs, to set up an active learning framework for regular data languages, in the spirit of L and L# algorithms for DFAs [1, 25]. We show that any regular data language L can be learned in polynomial time, using polynomially many queries (in the size of the minimal Π-DRA for L) to oracles of three types: equivalence, membership and memorability. The latter asks, given a word and a datum in that word, whether it is memorable or not. Our learning algorithm returns a minimal Π-DRA for L, and, since the oracles can be implemented in PTime, this also yields a PTime minimization algorithm for Π-DRAs, for any fixed policy Π.

In summary, we start by introducing pDRAs. After establishing standard results (beginning of Section 3), we delve into distinctive features of pDRAs and their Π-DRA subclass, and develop novel results and algorithms. Our strongest contributions include:

  • Memorability problem in PTime (Section 3). This is important for efficient minimization and learning.

  • Canonical representatives for both pDRAs (Section 4) and Π-DRAs (Section 5) based on equivalence relations on data words, in the spirit of Myhill-Nerode relations. We are able to construct automata that are minimal both in the number of states and in the number of registers. The minimal pDRA for a language is unique once the order in which data that need to be memorized has been fixed (see Remark 20).

  • Minimization in ExpTime and GI-hard for pDRAs (Section 4), and in PTime for pDRAs with a constant number of registers and for Π-DRAs (Section 6, improving prior exponential bounds [4]).

  • PTime active learning for Π-DRAs (Section 6).

Related work.

A succinct register automata model has been developed in [8], where succinctness is achieved by allowing registers to contain duplicate elements. As mentioned earlier, this comes at the cost of a PSpace-hard equivalence. A different approach to obtain a Myhill-Nerode characterisation of regular data languages was proposed in [6, 7], in terms of deterministic nominal automata, which are equi-expressive as deterministic register automata [5]. Nominal automata are finite-state automata recast within the universe of nominal sets [21], and where finiteness is generalized to orbit-finiteness. That approach offers neat generalizations of standard constructions and algorithms from finite-state automata to nominal automata (e.g. learning with L [14]). On the other hand, the inner-workings of nominal automata and their algorithms are reliant on nominal-sets reasoning, such as equivalence under data-permutation, which introduces a level of indirection. Libraries dedicated to nominal-sets reasoning are available to that effect, though in terms of theoretical complexity and practical benchmarking, direct custom-made register-automata algorithms are typically faster [18, 3]. To represent nominal automata outside nominal sets, a representation scheme akin to a register discipline is essentially needed. However, as argued in [7, Sec. 6.2], extending finite automata with registers implicitly puts a linear order on the stored data, which is incompatible with minimality in the sense of Myhill-Nerode. Adding register permutations on transitions solves this problem and it turns out that minimal orbit-finite nominal automata (with straight state sets) and minimal pDRAs have same number of states (we thank the anonymous reviewer for pointing this connection out).

The problem of minimisation of systems dealing with data coming from an infinite alphabet has been studied extensively in the setting of π-calculus processes and in particular using History-Dependent Automata (HDAs) [15, 20]. Those works can be seen as precursors of the research in register automata and nominal automata. While the focus had been on mobile processes and bisimulation, rather than language acceptance, HDAs brought up central issues inherent in minimising systems with data, namely picking a canonical order of storing data and dealing with symmetries between stored data. Moreover, HDAs first featured transitions with reassignment of registers (names, in HDA terminology), of which the permutations we use in pDRAs can be seen as a special case.

The problem of learning register automata has been previously considered in [12, 11, 2]. The learner in [2] addresses Lar-DRA and works in a passive framework, i.e. without relying on the active interaction with an oracle (but only on positive and negative samples). Within active learning, the state of the art learner in [11] (improving on [12]) addresses the model in [8] and is exponential in both the number of registers and the length of the longest counterexample provided by the teacher. We already mentioned nominal L (called νL) for learning nominal automata [14]. This has membership query complexity exponential in the number of states and registers (or longest counterexample, see loc. cit.). Note, however, that the learning algorithms above do not use a memorability oracle.

2 Data word languages and register automata with permutations

In this section we introduce our register automata model. We start with some preliminaries.

Numbers, sets, relations.

For i,j, we let [i,j] be the set {kikkj}. Note that [i,j]= when j<i. We let 𝒫(X) be the powerset of X. Given a set X, a permutation over X is a bijection from X to itself (π:XX), whereas a partial permutation over X is a bijection π:X1X2 for subsets X1,X2X (we write π:XX).
For any relation RX×Y, we define its domain as 𝖽𝗈𝗆(R)={xXy:(x,y)R} and its range as 𝗋𝗇𝗀(R)={yYx:(x,y)R}. Given X𝖽𝗈𝗆(R), we may write R|X for the restriction R(X×Y). For any two relations R1X×Y,R2Y×Z, we define their composition as R1;R2={(i,j)k.(i,k)R1(k,j)R2}. For any RX×Y and iX,jY, we define the update R[ij]={(i,j)}R({i}×X).

Data alphabet, data words and nominal sets.

We fix an infinite alphabet 𝒟 of data. Data are ranged over by d and variants, or by a,b, and variants, while sometimes we may simply use numbers 1,2,3,. A data word is a finite sequence w𝒟. We denote by ϵ the empty word, |w| the length of w, and w[i] the ith datum in w (i[1,|w|]). We sometimes see w as a function w^:[1,|w|]𝒟. A data permutation is a bijection τ:𝒟𝒟 fixing all but finitely many elements of 𝒟; we write Perm(𝒟) for the set of data permutations. Given d,d𝒟, we write (dd) for the data permutation that swaps d and d, and fixes other data.

A nominal set [21] (over 𝒟) is a set X along with a group action :Perm(𝒟)×XX, that is, for each data permutation τ and xX, we have τxX. We say that a set S𝒟 is a support of xX if, for all permutations τ, if τ(d)=d for all dS then τx=x. We stipulate that all elements of a nominal set have finite support. Finite support is closed under intersection and, hence, each element x of a nominal set X has least finite support which we denote by 𝗌𝗎𝗉𝗉(x). We say that x is equivariant if 𝗌𝗎𝗉𝗉(x)=, i.e. τx=x for all τPerm(𝒟). For a subset Y of a nominal set X and any τ, we write τY for the set obtained from Y by applying τ elementwise on it: τY={τxxY}.

The set 𝒟 of data words is a nominal set, with action τw=w^;τ. For any w𝒟, we can see that 𝗌𝗎𝗉𝗉(w)={w[i]i[1,|w|]}. Note that a set of words L𝒟 has finite support just if there is finite S𝒟 such that, for all τ, if τ(d)=d for all dS then τL=L. We write 𝗌𝗎𝗉𝗉(L) for the least finite support of L. L is called a data language if it is equivariant, that is, if it has empty support, i.e., it is closed under data permutation. Given u,v𝒟, we write uv if there exists τPerm(𝒟) such that u=τv.

Registers and register permutations.

In this paper registers are represented by natural numbers ranging over [1,r] for some r1, and register assignments are partial injective mappings ρ:[1,r]𝒟. We observe that if ρ1,ρ2:[1,r]𝒟 are two register assignments, then ρ1;ρ21 is a partial permutation over [1,r] which identifies registers holding the same data: ρ1;ρ21={(i,j)i𝖽𝗈𝗆(ρ1)j𝖽𝗈𝗆(ρ2)ρ1(i)=ρ2(j)}.

For any n, we let 𝒮n be the group of permutations on [1,n]. We write 𝗂𝖽 for the identity permutation on [1,n]. We may write permutations using sequence notation, i.e. as (π(1),,π(n)), for π𝒮n. Given a partial permutation τ:[1,n][1,n] its canonical extension is the permutation τ^𝒮n obtained by setting: τ^(x)=τ(x) if x𝖽𝗈𝗆(τ); and τ^(x)=τκ(x) if x𝗋𝗇𝗀(τ)𝖽𝗈𝗆(τ) and κ=max{κτκ(x) is defined} (τκ stands for the κ-fold composition τ1;;τ1); and, finally, τ^(x)=x if x[1,n](𝖽𝗈𝗆(τ)𝗋𝗇𝗀(τ)). Put otherwise, τ^ extends τ by closing maximal paths in τ and by being the identity everywhere else. In particular, given sequences of pairwise distinct elements i,j[1,n]k, for some kn, we write (ij) for the canonical extension to [1,n] of the map {(il,jl)l[1,k]}.

Definition 2.

A deterministic permutation register automaton (pDRA) is a tuple 𝒜=r,Q,μ,q0,F,δ, where:

  • [1,r] is a set of registers (with r0);

  • Q is a finite set of states, q0Q is the initial state, and FQ are final states;

  • μ:Q𝒫([1,r]) is an availability function, such that μ(q0)=;

  • δ=(δ=δ) is a pair of partial transition functions of types:

    • δ=:Q×RQ×𝒮r

    • δ:QQ×R×𝒮r

We write pk,πq for δ=(p,k)=(q,π), and pk,πq for δ(p)=(q,k,π). Transitions are subject to the following availability condition. Whenever px,πq:

  • if x[1,r] then xμ(p) and μ(q)π(μ(p));

  • if x=k then μ(q)π(μ(p){k}).

We say that 𝒜 is complete if δ is total and, for all pQ, it holds that 𝖽𝗈𝗆(δ=(p,))=μ(p).

 Remark 3.

Let 𝒜 be a pDRA as in the definition above. The automaton operation relies on states and registers, with each state pQ being equipped with a set of registers μ(p)[1,r] that are available at that state. During its operation, the automaton maintains a register assignment, which is an injective map from available registers to data (i.e. ρ:μ(p)1-1𝒟). Given a state pQ and assignment ρ, for any input datum d:

  • If d is stored in some available register, say d=ρ(x) with xμ(p), and δ=(p,x)=(q,π), then the automaton reads d and moves to state q. Its register assignment will be updated by applying the permutation π on its registers and discarding those registers that are not available in q (i.e. the content of registers in [1,r]μ(q) gets deleted).

  • If d is a locally fresh datum (i.e. d𝗋𝗇𝗀(ρ)) and δ(p)=(q,k,π), then the automaton reads d and moves to state q. The register assignment is updated by storing d in register k (rewriting the existing contents if k were available), then permuting registers by π and finally discarding those registers that are not available in q.

Configurations, runs and languages.

A configuration of a pDRA 𝒜 is a pair (p,ρ), where pQ and ρ:μ(p)𝒟 is a register assignment, defined as a (total) mapping from μ(p) to data. We denote by 𝒜 the set of configurations of 𝒜. Transitions between configurations are modeled as a labelled transition system 𝒜𝒜×𝒟×𝒜, whose elements are denoted by κ1𝑑𝒜κ2, for κi𝒜,d𝒟. We let (p,ρ1)𝑑𝒜(q,ρ2), when one of the following holds:

  • ρ1(k)=d, for some kμ(p), δ=(p,k)=(q,π) and ρ2=(π1;ρ1)|μ(q) (Equality)

  • d𝗋𝗇𝗀(ρ1), δ(p)=(q,k,π), and ρ2=(π1;ρ1[kd])|μ(q) (Disequality)

Note that, due to the availability condition, the assignment ρ2 is in both cases well defined.

A run of a word w=d1d2dn𝒟 on 𝒜 is a sequence of transitions κ0d1𝒜κ1d2𝒜dn𝒜κn where κi𝒜 and κ0 is the initial configuration, defined as κ0=(q0,) where is the register assignment with empty domain. The pDRA 𝒜 is deterministic in the sense that there is at most one transition per datum d𝒟: given a configuration (p,ρ1), there is at most one configuration (q,ρ2) such that (p,ρ1)𝑑𝒜(q,ρ2).

Additionally, we also note that the transitions preserve the “injectivity” of the register assignments. Indeed, the δ= transitions do not change the data stored in the registers but merely rearrange the storage or delete some values. New data are stored via δ transitions, which ensures that the new datum d differs from all existing stored values in registers.

If w is a data word and 𝒜 has a run on w from a configuration (q,ρ) to a configuration (q,ρ), then we write (q,ρ)𝑤𝒜(q,ρ). The language recognised by (q,ρ) is defined as (q,ρ)={w𝒟(q,ρ)𝑤𝒜(q,ρ) and qF}. Accordingly, the language recognised by 𝒜 is defined as (𝒜)=(κ0).

Definition 4.

We call regular data language any data language which is recognized by a pDRA. Given a data word u and a language L, the residual of L by u is the set u1L={wuwL}.

Note that while every data language L is equivariant, u1L may not necessarily be so, although 𝗌𝗎𝗉𝗉(u1L)𝗌𝗎𝗉𝗉(u).

MRT-automata [17] are the permutation-free restriction of pDRAs, i.e. only the identity permutation is used. This restriction severely affects succinctness, as witnessed e.g. by the family of languages Ln={d1dndπ(1)dπ(n)ij.didjπ𝒮n}.

Lemma 5.

pDRAs are exponentially more succinct than MRT-automata.

 Remark 6 (Deterministic).

MRT-automata are equi-expressive as (deterministic) register automata [13], and so pDRAs can recognize any language recognizable by an MRT-automaton or a register automaton. Conversely, having permutations on transitions only brings succinctness, but no additional computational power. In fact, they can be simulated by hardcoding the order of the registers in the state space, at the price of an exponential blow-up. Alternatively, the configuration graphs of pDRAs correspond to nominal automata with straight state sets, which are equivalent to orbit-finite nominal automata and register automata [5].

3 Decision problems for register automata with permutations

We now examine basic decision problems for pDRAs. We shall assume that equality and disequality tests are done in constant time. We start with a result that can be lifted directly from finite-state automata. The membership problem asks, given a pDRA 𝒜 and data word w, if w(𝒜) holds. The non-emptiness problem asks, given a pDRA 𝒜, if (𝒜).

Lemma 7.

For pDRAs, membership is in PTime, while non-emptiness is in NLogSpace.

We next look at three related notions of equivalence.

Bisimilarity

Let 𝒜 be a pDRA, and A𝒜×𝒟×𝒜 its associated labelled transition system, as defined in Section 2. A relation R𝒜×𝒜 is a bisimulation if for every (κ1,κ2)R it holds that, for each i{1,2} and κi𝑑𝒜κi, there exists κ3i𝑑𝒜κ3i such that (κ1,κ2)R. Two configurations κ1 and κ2 are bisimilar, denoted by κ1κ2, if there exists a bisimulation R where (κ1,κ2)R. The bisimilarity problem is defined as follows: given two configurations κ1,κ2 of a given pDRA 𝒜, decide if κ1κ2 holds.

Residual equivalence

This problem asks: given two pDRAs 𝒜1 and 𝒜2 and two configurations κ1,κ2 of 𝒜1 and 𝒜2 respectively, decide whether 𝒜1(κ1)=𝒜2(κ2) holds.

(Language) equivalence

Finally, for this problem, given two pDRAs 𝒜1 and 𝒜2, we need to decide whether (𝒜1)=(𝒜2) holds. This is a special case of residual equivalence.

We note that, as pDRA are deterministic, the residual equivalence problem can be reduced to checking bisimilarity κ1κ2 in a slight modification of the disjoint union of 𝒜1 and 𝒜2.

Theorem 8.

Bisimilarity, residual equivalence and (language) equivalence are all in PTime for pDRAs.

The methodology we use to prove this bound for bisimilarity is closely related to [17]. It is based on building a candidate bisimulation relation on the fly, and relying on a group-based representation of its equivalence classes to keep the representation in polynomial space, and invoking PTime-subroutines from computational group theory (e.g. for group membership). Then, the bound for residual (and plain) equivalence follows from the observation above relating this problem to bisimilarity in the deterministic setting.

In the remainder of this section we study a notion describing the data that “must be remembered” when processing data words [4].

Memorability

Given a data language L𝒟, a word uL and a datum d𝒟, we say that d is L-memorable in u if d𝗌𝗎𝗉𝗉(u1L). We let 𝗆𝖾𝗆L(u) be the set of all L-memorable data of u, i.e. 𝗆𝖾𝗆L(u)=𝗌𝗎𝗉𝗉(u1L).

Frugality

We say that a pDRA 𝒜 is frugal if, for all configurations (q,ρ), 𝗋𝗇𝗀(ρ)=𝗌𝗎𝗉𝗉((q,ρ)).

Minimality

A pDRA 𝒜 is called state-minimal if there is no 𝒜 with less states than 𝒜 such that L(𝒜)=L(𝒜). It is called minimal if it is complete, frugal and state-minimal.

We can see that frugality essentially requires that all names stored in registers inside any configuration be (𝒜)-memorable (in all words reaching said configuration).

A more useful algorithmically version of memorability is given below. We use it to show that any pDRA recognizing a language L has to store at least the L-memorable data, thereby justifying the term “memorable”. In Section 4 we show that it suffices to store only L-memorable data.

Lemma 9.

The following hold:

  1. 1.

    Let d be fresh in u. Then d is L-memorable in u iff u1L((dd)u)1L.

  2. 2.

    Let A be a pDRA recognizing a language L, and (q,ρ) be the configuration reached by A upon reading a word u. Then 𝗆𝖾𝗆L(u)𝗋𝗇𝗀(ρ).

Proof.

For 1, by nominal sets reasoning, d𝗌𝗎𝗉𝗉(u1L) iff u1L((dd)u)1L for any fresh d.
For 2, suppose there exists d𝗋𝗇𝗀(ρ) such that d𝗆𝖾𝗆L(u). By 1, u1L((dd)u)1L. However, as d is fresh in u and d is not stored in ρ, both u and (dd)u reach the same configuration (q,ρ), which implies u1L=(q,ρ)=((dd)u)1L, contradiction.

Example 10.

We can see that 𝗆𝖾𝗆𝒟(w)= for any w𝒟. Next, consider the language:

L1={abwabab𝒟w𝒟}

then, for all a𝒟 and w𝒟, 𝗆𝖾𝗆L1(ϵ)=𝗆𝖾𝗆L1(aaw)=. For all b𝒟 such that ab, 𝗆𝖾𝗆L1(abw)={a,b}, because w can always be completed by a suffix v ending by ab (so abwvL1), or by a different ending (so abwvL1).
On the other hand, consider the language of all words where the first and last element are repeated and distinct:

L2={aawbbab𝒟w𝒟}

then, for all ab𝒟 and w𝒟, we have 𝗆𝖾𝗆L2(ϵ)=𝗆𝖾𝗆L2(abw)= and 𝗆𝖾𝗆L2(a)=𝗆𝖾𝗆L2(aa)=𝗆𝖾𝗆L2(aawa)={a}. Note that a is L2-memorable in aaw, as, for instance aawbbL2, while aawaaL2. We also have 𝗆𝖾𝗆L2(aawb)={a,b}. Indeed, a is L2-memorable (as above), while for b we have aawbbL2 whereas aawbcL2 for any cb.

The memorability problem asks, given as input a pDRA 𝒜, a word u and a datum d in u, whether d is (𝒜)-memorable in u.

Theorem 11.

The memorability problem is in PTime for pDRAs. Moreover, any pDRA can be transformed, in polynomial time, into an equivalent frugal pDRA with the same number of states and transitions.

Proof.

For the first claim, following Lemma 9, take any datum d fresh in u. It suffices to compute the configurations (q,ρ) and (q,ρ) reached by the pDRA on reading u and (dd)u respectively, and check if (q,ρ)(q,ρ) holds, which is in PTime (cf. Theorem 8).
For the second claim, we only provide a proof sketch. We show that the set of registers which contain the memorable data in a configuration, only depends on the state of the configuration. This allows one to turn any pDRA into a frugal one.

4 Minimal register automata with permutations

In this section, given a data word language L, we define a Myhill-Nerode equivalence relation L on data words, which is shown to have finite index iff L is recognizable by a pDRA. Based on this equivalence relation, we show how to construct a unique and minimal pDRA. This generalizes the results of [4] to pDRAs.

For any two data words u,v𝒟, we write u=Lv whenever (uLvL) holds. Moreover, we recall that u1L={w𝒟uwL}.

Definition 12 (Data word equivalence relation).

Given a data language L𝒟 and two data words u,v, we say that u and v are L-equivalent, written uLv (or just uv if L is clear from the context), whenever there exists a data permutation τ such that u1L=(τv)1L, i.e, for all w𝒟, uw=L(τv)w.

Proposition 13.

L is an equivalence relation.

We may write uLτv to emphasize τ in the definition above, however uLτv is not an equivalence relation in general. We can immediately see the following.

Lemma 14.

If uLτv, then 𝗆𝖾𝗆L(u)=τ𝗆𝖾𝗆L(v). Hence |𝗆𝖾𝗆L(u)|=|𝗆𝖾𝗆L(v)|.

Proof.

Since uLτv, we have u1L=(τv)1L. By nominal sets reasoning (see e.g. [21, Ch. 2]), we have 𝗌𝗎𝗉𝗉(u1L)=𝗌𝗎𝗉𝗉((τv)1L)=𝗌𝗎𝗉𝗉(τ(v1L))=τ𝗌𝗎𝗉𝗉(v1L). Hence |𝗆𝖾𝗆L(u)|=|𝗆𝖾𝗆L(v)|.

We illustrate data word equivalence via a simple albeit non-trivial example. We then focus on the suitability of this relation as a Myhill-Nerode equivalence relation.

Example 15.

Consider the language L={ababab𝒟}{abbaab𝒟}. Let ab𝒟. There are six equivalence classes: [ϵ],[a],[aa],[ab],[aba],[abab]. Any non-empty word which is not a prefix of some word in L is equivalent to aa. Now, abaLτabb holds for any data permutation τ which swaps a and b. Indeed, (aba)1L={b}, and (τabb)1L=(baa)1L={b}. Finally, ababL𝗂𝖽abba as they are both in L.

Theorem 16.

A language L𝒟 is recognizable by a pDRA iff L has finite index.

Proof.

Let 𝒜 be a pDRA recognizing L. Take any state q and let u,v𝒟 be such that: (q0,)𝑢𝒜(q,ρ1) and (q0,)𝑣𝒜(q,ρ2). Since ρ1,ρ2 are injective (as by definition of pDRA, there are no duplicates in register assignments), there exists a data permutation τ such that τ|𝗋𝗇𝗀(ρ2)=ρ21;ρ1. Then, from (q0,)𝑣𝒜(q,ρ2) we get (q0,)τv𝒜(q,ρ2;τ)=(q,ρ1). Therefore, u1L=(τv)1L, i.e. uLv. This implies that L has finite index.
The other direction is based on the construction of a canonical automaton explained below.

Construction of a canonical automaton.

Let us assume that L has finite index. For each equivalence class c of L, let uc be some representative of c and ρc:[1,|𝗆𝖾𝗆L(uc)|]𝗆𝖾𝗆L(uc) a register assignment. For any word u, we hereby denote by [u] its L-equivalence class. We now construct a minimal pDRA 𝒜L recognizing L, whose states are the chosen class representatives, with the following invariant (shown in Lemma 18 below): on reading any word v, 𝒜L reaches configuration (uc,ρc;τ1) for some τ such that ucLτv. We construct the minimal pDRA 𝒜L=(QL,μL,q0,FL,δL=δ=δ) as follows:

  • the number of registers is r=max({|𝗆𝖾𝗆L(u)|u𝒟}) (it exists by Lemma 14);

  • QL={ucc𝒟/L}, μL(uc)=[1,|𝗆𝖾𝗆L(uc)|] for all ucQL, and q0=u[ϵ];

  • FL={ucucL};

  • δ= is defined as follows. Let uc be some representative and d𝗆𝖾𝗆L(uc). After a successful equality test with register k, the automaton goes to state uc where c=[ucd] and d=ρc(k). So, we add the transition δ=(uc,k)=(uc,π) for some π that we now construct. The registers need to permuted to account for the fact some data of 𝗆𝖾𝗆L(uc) may need to be deleted (if they are not memorable in ucd), and the fact that ucd and uc have equal residual languages up to some permutation τ. Let i=|𝗆𝖾𝗆L(uc)|, j=|𝗆𝖾𝗆L(uc)| and τ:𝒟𝒟 such that ucLτucd. Let π=ρc;τ;ρc1. Note that ji, 𝗋𝗇𝗀(π)=[1,j] and 𝖽𝗈𝗆(π)[1,i]. Then, π:[1,i][1,i] is defined to be a canonical extension of π to [1,i].

  • δ is defined similarly as δ=, we let δ(uc)=(uc,i+1,π) where c=[ucd] for d any fresh datum, and π is a canonical extension of π to [1,i+1], for π=ρc[i+1d];τ;ρc1. So, d is stored in the first available register (i+1), before the permutation π is applied.

Note that 𝒜L is complete. We illustrate this construction with the following example.

Figure 2: Canonical automaton 𝒜L of Example 17. Only accessible states are shown.
Example 17.

Consider again the language of Example 15, where we have defined representatives for the six equivalence classes of L. Note that, 𝗆𝖾𝗆L(ϵ)=𝗆𝖾𝗆L(abab)=, 𝗆𝖾𝗆L(a)={a}, 𝗆𝖾𝗆L(ab)={a,b} and 𝗆𝖾𝗆L(aba)={b}. We depict in Figure 2 the canonical automaton obtained for those representatives and chosen assignments ρ[a]={1a}, ρ[ab]={1a,2b}, and ρ[aba]={1b}. Looking at the transitions, consider for instance source state ab and test on register 1. The transition goes to state aba. As abaL𝗂𝖽aba, the permutation is a canonical extension on domain {1,2} of π=ρ[ab];𝗂𝖽;ρ[aba]1={21}, i.e. transposition (2 1). Consider now a test on register 2. The next state is the representative equivalent to abb, i.e. aba, as abaLτabb for any τ swapping a and b. So, the permutation is π=ρ[ab];τ;ρ[aba]1, i.e. the identity on {1,2}.

We finally prove that (𝒜L)=L and that the automaton is minimal. For this, we use the fact that runs of 𝒜L compute the L-equivalence class of the word they read.

Lemma 18.
  1. 1.

    For all words v𝒟, if 𝒜L reaches configuration (uc,ρ) on reading v then there is some τ such that: (1) ucLτv, (2) ρc=ρ;τ, and (3) 𝗋𝗇𝗀(ρ)=𝗆𝖾𝗆L(v).

  2. 2.

    (𝒜L)=L and 𝒜L is minimal.

Proof.

For space reasons, we only prove 2 here.It is immediate as a consequence of 1 that (𝒜L)=L. Indeed, v𝒜 iff the state uc reached by 𝒜L on v is accepting, iff ucL, iff ϵuc1L=(τv)1L for some τ, iff τvL, iff vL as L is equivariant.
We prove that 𝒜L is minimal. First, 𝒜L is complete by definition. It is frugal by 1, as registers contain exactly the memorable data (and it is necessary as proved by Lemma 9). If it is not state minimal, then there exists a pDRA with less states than the index of L recognizing L. Therefore, there exist two inequivalent words uLv which respectively reach two configurations (q,ρ1) and (q,ρ2) with the same state q. As shown in the proof of Theorem 16, this implies that uLv, contradiction.

Minimization of pDRAs.

Minimizing a pDRA 𝒜 recognizing a language L can be done in EXPTime. Indeed, it suffices to apply the construction of the canonical automaton 𝒜L step-by-step, starting from initial state ϵ, based on a subroutine deciding L. From a state uc with chosen assignment ρc created so far and for all data d𝗋𝗇𝗀(ρc)min(𝒟𝗋𝗇𝗀(ρc)), the algorithm checks whether ucdLuc for some existing state uc, otherwise state ucd is created, with ρ[ucd] being arbitrary. Whether u1Lu2 holds, given u1,u2 and 𝒜, can be decided in EXPTime: compute the configurations (qi,ρi) reached by 𝒜 on ui, and check if there exists a permutation τ:𝗋𝗇𝗀(ρ2)𝗋𝗇𝗀(ρ2) such that L𝒜(q1,ρ1)=L𝒜(q2,ρ2;τ). The latter can be done in PTime by Theorem 8. Note that due to the enumeration of register permutations, the minimization procedure is exponential only in the number of registers, which in turn is in PTime for a constant number of registers.

Whether we can do better than exponential time is a hard question. We can show that checking whether a complete and frugal pDRA is not minimal (called pDRA-nonMin problem) is at least as hard as the Graph Isomorphism problem (GI). GI is known to be in NP but not known to be in coNP.

Proposition 19.

pDRA-nonMin is GI-hard.

 Remark 20 (Canonicity).

As mentioned above, the construction of a canonical automaton can be used to minimize any pDRA. The construction of 𝒜L only depends on the choices of the representatives uc and register assignments ρc for the L-memorable data of those representatives. So, once these choices have been fixed, any pDRA recognizing L can be minimized into a unique pDRA 𝒜L. This justifies that 𝒜L is called canonical.

A minimal DFA recognizing a regular language is unique up to (automata) isomorphism. An interesting question is how minimal pDRAs recognizing a regular data language L relate to each other, i.e. what is the right notion of isomorphism. It turns out that minimal pDRAs are isomorphic, for a notion of isomorphism which also takes into account permutations of the registers. Due to lack of space, we do not include this notion here. This notion is not simply a bijection which puts a correspondence between states while preserving transitions, as the order in which data are stored in registers also matters. Consider the language L of words with at most two distinct data. When reading a word d1d2, with d1d2, any minimal pDRA recognizing L either stores (d1,d2) or (d2,d1). Our notion of isomorphism identifies configurations up to permutation of their registers, so that minimal pDRAs for L are considered isomorphic, no matter the order in which memorable data are stored.

5 𝚷-DRAs: pDRAs with a Fixed Permutation Policy

We next consider the model obtained by syntactically restricting pDRAs to a fixed register assignment policy. Informally, a policy Π fixes permutations depending on the size of the memory and the test on this memory, only. So, it is not state nor transition dependent. In particular, when a pDRA is in some state with a memory ρ:[1,,i]𝒟, and reads a datum d=ρ(j) for some 1ji, then it applies a permutation Π(i,j)𝒮i to its registers before possibly deleting some data (this deletion is still transition-dependent) and proceeds to the next state. The gaps created by deletion are always removed by shifting all the data to an initial segment [1,,i] for i the new memory size. Similarly, if d read is fresh, then it is stored in register i+1, and a permutation Π(i,i+1) is applied to the registers.

We let a permutation policy be a function Π that takes as input the size i of the memory and an index j[1,i+1] and returns a permutation π𝒮max(i,j). Given j and E[1,j] we let 𝖽𝖾𝗅j(E)𝒮j be the permutation that shifts the elements of E to the right, and those not in E to the left, preserving their respective order. For example, 𝖽𝖾𝗅6({2,4}) is the permutation (1,5,2,6,3,4), and 𝖽𝖾𝗅6() is the identity. Formally, 𝖽𝖾𝗅j(E)(k)=j(|E|n) if k is the nth (smallest) element of E, otherwise, when kE, 𝖽𝖾𝗅j(E)(k)=kn where n=|{eEe<k}|. We just write 𝖽𝖾𝗅(E) when j is clear from the context.

Definition 21.

Let Π be a permutation policy. A pDRA 𝒜 with r registers is said to have fixed permutation policy Π, and called a Π-DRA , if for each state q there is i s.t. μ(q)=[1,i] and, for all qx,πp there are j{i,i+1} and k with x=k or x=k, and s.t.:

  • if x=k then j=k=i+1; and otherwise x=k and j=i;

  • π is π1;π2 (canonically extended to [1,r]), where π1=Π(i,k) and π2=𝖽𝖾𝗅j(E) for some E[1,j] with |E|=j|μ(p)|.

Note that when applying transition qx,πp, all the data stored in registers E are moved to the segment [|μ(p)|+1,,i] and as a result are deleted. Also note that π only depends on Π, |μ(q)|, x and E, so when the permutation policy Π is understood from the context, we denote each transition as qx,Ep instead of qx,πp.

Example 22.

A natural example of Π-DRA is when the policy always returns the identity permutation 𝗂𝖽. An 𝗂𝖽-DRA preserves the order in which the data were stored in memory. This can model processes where the memory is a queue of bounded size. It suffices to require that a datum read as input is deleted from memory when it is equal to the first memorized datum, or when it is fresh but the queue is full (otherwise, by definition of 𝗂𝖽-DRA, the fresh datum can be stored in the last register only).

Example 23 (Lar-automata).

The model by Benedikt, Ley, Puppis in [4] is exactly a pDRA with fixed permutation policy Lar (for Last Appearance Record):

Lar(i,j)={(1,,j1,i,j,j+1,,i1) if j[1,i]𝗂𝖽 if j=i+1

In other words, a Lar-DRA saves (distinct) values in its registers ordering them according to their last appearance. In [4], the authors define a Myhill-Nerode relation for data languages allowing them to construct a minimal and canonical Lar-DRAs for any regular data language, though in exponential time. We extend and improve this by showing that pDRAs with any fixed permutation policy Π admit a canonical model and can be minimized in PTime.

For the remainder of this section, let Π be some fixed permutation policy. Given an arbitrary pDRA, we can always hardcode the permutations in the states (modulo an exponential blow-up) to turn it into a Π-DRA.

Proposition 24.

Given a pDRA 𝒜, one can construct a (possibly exponentially larger) Π-DRA such that L(𝒜)=L(). Moreover, if 𝒜 is frugal then so is .

The exponential blow-up is in general unavoidable. We can show that pDRAs are exponentially more succinct than Lar-DRAs. We conjecture the blow-up is unavoidable for any fixed permutation policy Π.

Lemma 25.

pDRAs are exponentially more succinct than Lar-DRAs.

Word of memorable data.

We introduce some notions towards an equivalence relation on data words, whose index corresponds to the minimal number of states that suffices for a Π-DRA to recognize a data language L. A key ingredient, unlike in pDRAs, is that the order in which L-memorable data are stored by a Π-DRA is canonical, i.e., it only depends on Π. Thus we can define, for any word w𝒟, a word 𝗆𝖾𝗆LΠ(w) which orders the L-memorable data of w. We illustrate it for Π=Lar. Initially, 𝗆𝖾𝗆LLar(ϵ)=ϵ. Consider a word w=1234 where 𝗆𝖾𝗆LLar(w)=1234 and 𝗆𝖾𝗆L(w2)={2,3}. Then, 𝗆𝖾𝗆LLar(w2)=32.

In general, for an arbitrary policy Π, 𝗆𝖾𝗆LΠ(w) can informally be defined as the register assignment reached by any frugal Π-DRA recognizing L and reading w (modulo considering infinite state Π-DRAs, as L is equivariant but not necessarily regular). Formally, 𝗆𝖾𝗆LΠ(ϵ)=ϵ, and 𝗆𝖾𝗆LΠ(wd) is built from m=𝗆𝖾𝗆LΠ(w) and M=𝗆𝖾𝗆L(wd) as follows. First, let m=md if d is not L-memorable in w, and m=m otherwise. Let k be such that m[k]=d. The positions of m are reordered, giving a word m′′ of same length, obtained by applying permutation Π(|m|,k) on m. Then, 𝗆𝖾𝗆LΠ(wd) is obtained by applying on m′′ the erasing morphism which replaces any datum not in M by ϵ.

Proposition 26.

The word 𝗆𝖾𝗆LΠ(w)𝒟 is an enumeration of 𝗆𝖾𝗆L(w)𝒟.

Abstract residual.

In the remainder of this section we fix a permutation policy Π. Given a sequence of distinct data a𝒟 and any object X with finite support, we define the a-abstraction of the latter as aX={τ(a,X)τ fixes 𝗌𝗎𝗉𝗉(X){a}}. Given a language L and data word u, we set uΠ1L=𝗆𝖾𝗆LΠ(u)(u1L). Note that unravelling the last part of the definition above we have uΠ1L={τ(𝗆𝖾𝗆LΠ(u),u1L)any τ}.

Example 27.

Recall language L2 from Example 10. For all a,b𝒟:

(aa)Π1L2=a((aa)1L2)={(d,{wddddw𝒟})d𝒟}=(bb)Π1L2

Canonical 𝚷-DRA.

Unlike u1L, it can be shown that uΠ1L has empty support, as it abstracts away the memorable data of u. Based on this abstract residual notion, we define the following word equivalence “up-to memorable data”.

Definition 28 (Π-equivalence).

Given a language L and data words u,v, we let LΠ be the word relation defined by uLΠv if uΠ1L=vΠ1L.

The following lemma states that LΠ refines L.

Lemma 29.

If uLΠv then there is some τ such that 𝗆𝖾𝗆LΠ(u)=τ𝗆𝖾𝗆LΠ(v)u1L=(τv)1L and, therefore, uLv.

 Remark 30.

The converse of Lemma 29 does not necessarily hold. For example, for Π=Lar, consider the language: L3={abbaab,abababab𝒟}.
Take a,b𝒟 such that ab. Then abbaL3abab because (abba)1L3=(abab)1L3={ab}. However, (abab)Lar1L3={(ab,{ab})ab𝒟} and (abba)Lar1L3={(ba,{ab})ab𝒟}, hence abbaL3Larabab.

The next lemma formalizes the intuition behind the definition of 𝗆𝖾𝗆LΠ(u).

Lemma 31.

Let 𝒜 be a frugal Π-DRA and u a word such that 𝒜 reaches configuration (q,ρ) when reading u. Then, ρ=𝗆𝖾𝗆LΠ(u).

Proof.

By Lemma 9 and frugality we have that ρ and 𝗆𝖾𝗆LΠ(u) contain the same data. Using induction on the length of u, we can show that their data are in the same order.

We finally show a Myhill-Nerode theorem for Π-DRAs involving Π. Note that we can reformulate Π so that Lar coincide with word equivalence as defined in [4]. Thus, Theorem 32 generalizes the result of [4] following an alternative route using abstract residuals.

Theorem 32.

A language L𝒟 is recognizable by a pDRA with fixed permutation policy Π iff LΠ has finite index.

Proof.

The R2L direction follows from Theorem 16, Lemma 29 and Proposition 24. In the next section (Theorem 34), we show that LΠ allows one to construct a unique minimal Π-DRA for L (up to state renaming). We prove it via an active learning algorithm.
For the L2R direction, suppose L is recognizable by a Π-DRA 𝒜. By Proposition 24, we can assume that 𝒜 is frugal. Given two words u,u suppose they reach configurations (q,ρ),(q,ρ), and say ρ=a and ρ=a. Let (aa) be the data permutation mapping a to a component-wise. Then, ρ=(aa)ρ and thus u1L=(aa)u1L. By Lemma 31, a=𝗆𝖾𝗆LΠ(u) and a=𝗆𝖾𝗆LΠ(u). We thus have that: 𝗆𝖾𝗆LΠ(u)u1L=(aa)𝗆𝖾𝗆LΠ(u)u1L=(aa)𝗆𝖾𝗆LΠ(u)((aa)u1L)=𝗆𝖾𝗆LΠ(u)u1L.

6 Active Learning and Minimization of 𝚷-DRAs

Let L be a language recognizable by a Π-DRA. We show that it is possible to learn in PTime a canonical and minimal Π-DRA for L in the active framework [1, 25], relying on the answers to (polynomially-many) queries from oracles of membership qm, language equivalence qe and data memorability qr (see Section 3 for definition). Since the involved oracles can be implemented in PTime, this yields also a PTime minimization procedure for Π-DRAs.

We give some intuition and notation concerning the learning procedure for Π-DRAs. We assume that 𝒟 has an arbitrary linear order, which we extend to 𝒟 by length-lexicographic order. The Π-DRA learner maintains in B the set of known (representatives of) distinct LΠ-classes. Initially, B={ϵ} and each data-word w=ud added to B, where uB, has the following property: either dmemL(u) or d is a fresh (minimal) value. Therefore B somehow codes a tree-shaped subgraph of the canonical Π-DRA for L. Moreover, the learner grows a sample-set S=(S+,S), where S+L and S𝒟L are sets of positive and negative samples respectively. Such sample-set S is used to guarantee the invariant B𝒟/LΠ and to forbid the completion of the tree-shaped Π-DRA coded by B with the addition of wrong transitions. A transition from uB to vB on dmemL(u) (or fresh) is forbidden by S if ud is apart from v according to S, written ud#Sv, formalized below.

Definition 33 (Apartness).

Two words u,v are said apart according to a sample-set S=(S+L,S𝒟L) for L, written u#Sv, if:

  • either |memLΠ(u)||memLΠ(v)|,

  • or u,v s.t. memLΠ(u)umemLΠ(v)v, but vvS+ iff uuS.

Recall that uv denotes that u=τv for some τPerm(𝒟), that can be checked in PTime by inspecting whether |v|=|u|=n and v[i]=v[j] iff u[i]=u[j], for all 1i,jn.

Algorithm 1 Π-DRA_Learn.

Description of the (active) learning algorithm.

We describe the learning procedure, given by Algorithm 1. The set B is initialized to {ϵ}, and S+=S to . Then the learner proceeds with the main loop consisting of three main steps.

The first step (lines 3-4) is a while-loop growing B as long as there is uB such that any transition out from u on d (where dmemL(u) or d is a fresh minimal value), towards any vB, is forbidden by S, in which case ud is added to B.

In the second step (line 5), B is used to construct a hypothesis Π-DRA. In particular, the tree-shaped Π-DRA coded by B is used to build a complete hypothesis Π-DRA 𝒜 as follows. The set of states of 𝒜 is exactly B. The membership oracle qm is used to set final states: uB is final iff uL. Let uB, dmemL(u) and x such that memLΠ(u)[x]=d. If udB, then ud is apart from any z in B, and we let u=ud. Otherwise, ud is not apart from some zB, and we let u=z (for z chosen arbitrarily). The transition ux,Ez is added to 𝒜, where E is chosen so that it ensures (u,𝗆𝖾𝗆LΠ(u))𝑑𝒜(z,𝗆𝖾𝗆LΠ(ud)) holds in the LTS of configurations. The transitions in δ for fresh values are similarly set up.

In the third step (lines 6-8), the hypothesis is submitted to the equivalence oracle qe that either accepts it, or provides a counterexample w. If qe accepts the hypothesis, the algorithm terminates and returns 𝒜. Otherwise, the algorithm calls a procedure to process the counter-example, ProcessCEX(w,B,𝒜) This procedure returns a pair of samples (w,w) witnessing that the current hypothesis 𝒜 contains a wrong transition. Adding (w,w) to S will forever forbid the latter wrong transition in future hypothesis. See the paragraph in the sequel for a more detailed description of ProcessCEX and its pseudocode. Hence, if a canonical Π-DRA for L contains n states, m transitions and k is the maximum number of available registers in any state, then the Π-DRA learner will perform at most n2(k+1)m iterations of the main loop, since this is the number of detectable wrong transitions. Finally, Theorem 34 states that Π-DRA_Learn is a correct polynomial learner for the class of Π-DRAs.

Theorem 34.

Given membership oracle qm, an equivalence oracle qe and memory oracle qr for regular data language L, Π-DRA_Learn(qm,qe,qr) learns the unique (up to state renaming) minimal Π-DRA ALΠ=(RL,QL,μL,q0,FL,δL) for L in time polynomial wrt |QL|, |δL|, |RL| and the size of the longest counterexample returned by qe.

In turn, this yields a polynomial upper bound for minimizing a given Π-DRA as the oracles qm,qe,qr can be implemented in PTime, by Lemma 7, Theorem 8 and Theorem 11.

Corollary 35.

Π-DRAs can be minimized in PTime.

Note that the above result is for a fixed policy Π. A natural problem is to find, given a Π-DRA, a minimal Π-DRA amongst all the policies Π. However, the GI-hardness proof (Proposition 19) can be slightly modified to show that this latter problem is also GI-hard.

Counter-example processing.

A key ingredient for proving Theorem 34 is the correctness of the procedure ProcessCEX. We informally describe this procedure and state its correctness.

ProcessCEX is a recursive procedure whose first step is decomposing the input counterexample as w=ur, where u is the longest prefix in B. Being uB final iff uL, r=dv. If dmemL(u) and d=min(𝒟memL(u)), then u((dd)v) is also a counterexample. Hence, we can eventually find a counterexample w=udv, with uB, udB, dmemL(u) or d=min(𝒟memL(u)): The last transition t=ux,Ez followed by 𝒜 reading ud was added (to the tree-shaped Π-DRA coded by B) by BuildHP. Let τPerm(𝒟) mapping memLΠ(ud)[i] to memLΠ(z)[i], for 1i|memL(ud)|. If udvLz(τv), then udv,z(τv) witness that t is wrong. Otherwise, z(τv) is a counterexample. Let u be the longest prefix in B of w=z(τv)=ur. Being zB, |r||τ(v)|<|r|. So, ProcessCEX terminates, returning a pair of words to prevent forever a wrong transition.

Algorithm 2 ProcessCEX Procedure.
Lemma 36.

The procedure ProcessCEX called at Line 7 terminates performing a number of recursive calls linear in the length of the input counterexample w, and returning (an ordered version of) a set of two words {vv,zz} such that:

  • v=ud, where uB, dmemL(u)min{bbmem(u)} but udB

  • ux,Ez is the last transition followed by 𝒜 upon reading the word ud=v

  • norm(memLΠ(v)v)=norm(memLΠ(z)z) but vvL iff zzL

7 Discussion

Our learning algorithm can be extended from Π-DRAs to pDRAs, modulo modifying the notion of apartness by quantifying over all permutations of memorable data. This would entail an exponential blow-up in the maximal number of memorable data. On the other hand, learning a pDRA can be done as follows: learn a Π-DRA in PTime, for some Π, and minimize it into a pDRA (in exponential time, and PTime if the maximal number of memorable data is constant). An interesting question is whether enumerating the permutations is avoidable (for minimizing pDRAs or learning them).

We have shown that minimizing pDRAs is hard for the graph isomorphism problem. It is also in NP, as pDRA equivalence can be checked in PTime. We leave this gap open.

An interesting direction is to find a register automaton model which admits polynomial time active learning without relying on a memorability oracle. All known active learning frameworks for register automata which do not rely on memorability oracles have exponential time complexity [12, 11, 14]. On the other hand, Π-DRAs can be minimized in PTime, can be checked for equivalence in PTime, have PTime memorability problem and admit passive learning in polynomial time and data (for Π=Lar[2]. The latter can be easily generalized to any fixed policy. This makes Π-DRAs a good candidate to actively learn regular data languages in polynomial time, without memorability oracles.

References

  • [1] Dana Angluin. Learning regular sets from queries and counterexamples. Information and Computation, 75(2):87–106, 1987. doi:10.1016/0890-5401(87)90052-6.
  • [2] Mrudula Balachander, Emmanuel Filiot, and Raffaella Gentilini. Passive Learning of Regular Data Languages in Polynomial Time and Data. In Rupak Majumdar and Alexandra Silva, editors, 35th International Conference on Concurrency Theory (CONCUR 2024), volume 311 of Leibniz International Proceedings in Informatics (LIPIcs), pages 10:1–10:21, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.CONCUR.2024.10.
  • [3] M. H. Bandukara and Nikos Tzevelekos. On-the-fly bisimulation equivalence checking for fresh-register automata. J. Syst. Archit., 145:103010, 2023. doi:10.1016/J.SYSARC.2023.103010.
  • [4] Michael Benedikt, Clemens Ley, and Gabriele Puppis. What you must remember when processing data words. In Alberto H. F. Laender and Laks V. S. Lakshmanan, editors, Proceedings of the 4th Alberto Mendelzon International Workshop on Foundations of Data Management, Buenos Aires, Argentina, May 17-20, 2010, volume 619 of CEUR Workshop Proceedings. CEUR-WS.org, 2010. URL: https://ceur-ws.org/Vol-619/paper11.pdf.
  • [5] Mikołaj Bojańczyk. Slightly infinite sets. Draft version, September 2019. URL: https://www.mimuw.edu.pl/˜bojan/paper/atom-book.
  • [6] Mikołaj Bojańczyk, Bartek Klin, and Sławomir Lasota. Automata with group actions. In Proceedings of the 26th Annual IEEE Symposium on Logic in Computer Science, LICS 2011, June 21-24, 2011, Toronto, Ontario, Canada, pages 355–364. IEEE Computer Society, 2011. doi:10.1109/LICS.2011.48.
  • [7] Mikołaj Bojańczyk, Bartek Klin, and Sławomir Lasota. Automata theory in nominal sets. Log. Methods Comput. Sci., 10(3), 2014. doi:10.2168/LMCS-10(3:4)2014.
  • [8] Sofia Cassel, Falk Howar, Bengt Jonsson, Maik Merten, and Bernhard Steffen. A succinct canonical register automaton model. J. Log. Algebraic Methods Program., 84(1):54–66, 2015. doi:10.1016/J.JLAMP.2014.07.004.
  • [9] Loris D’Antoni. In the maze of data languages. CoRR, abs/1208.5980, 2012. arXiv:1208.5980.
  • [10] Stéphane Demri and Ranko Lazic. LTL with the freeze quantifier and register automata. ACM Trans. Comput. Log., 10(3):16:1–16:30, 2009. doi:10.1145/1507244.1507246.
  • [11] Simon Dierl, Paul Fiterau-Brostean, Falk Howar, Bengt Jonsson, Konstantinos Sagonas, and Fredrik Tåquist. Scalable tree-based register automata learning. In Bernd Finkbeiner and Laura Kovács, editors, Tools and Algorithms for the Construction and Analysis of Systems, pages 87–108, Cham, 2024. Springer Nature Switzerland. doi:10.1007/978-3-031-57249-4_5.
  • [12] Falk Howar, Bernhard Steffen, Bengt Jonsson, and Sofia Cassel. Inferring canonical register automata. In Viktor Kuncak and Andrey Rybalchenko, editors, Verification, Model Checking, and Abstract Interpretation, pages 251–266, Berlin, Heidelberg, 2012. Springer Berlin Heidelberg. doi:10.1007/978-3-642-27940-9_17.
  • [13] Michael Kaminski and Nissim Francez. Finite-memory automata. Theoretical Computer Science, 134(2):329–363, 1994. doi:10.1016/0304-3975(94)90242-9.
  • [14] Joshua Moerman, Matteo Sammartino, Alexandra Silva, Bartek Klin, and Michal Szynwelski. Learning nominal automata. In Giuseppe Castagna and Andrew D. Gordon, editors, Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, pages 613–625. ACM, 2017. doi:10.1145/3009837.3009879.
  • [15] Ugo Montanari and Marco Pistore. An introduction to history dependent automata. In Andrew D. Gordon, Andrew M. Pitts, and Carolyn L. Talcott, editors, Second Workshop on Higher-Order Operational Techniques in Semantics, HOOTS 1997, Stanford, CA, USA, December 8-12, 1997, volume 10 of Electronic Notes in Theoretical Computer Science, pages 170–188. Elsevier, 1997. doi:10.1016/S1571-0661(05)80696-6.
  • [16] Andrzej S. Murawski, Steven J. Ramsay, and Nikos Tzevelekos. Bisimilarity in fresh-register automata. In 30th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2015, Kyoto, Japan, July 6-10, 2015, pages 156–167. IEEE Computer Society, 2015. doi:10.1109/LICS.2015.24.
  • [17] Andrzej S. Murawski, Steven J. Ramsay, and Nikos Tzevelekos. Polynomial-Time Equivalence Testing for Deterministic Fresh-Register Automata. In Igor Potapov, Paul Spirakis, and James Worrell, editors, 43rd International Symposium on Mathematical Foundations of Computer Science (MFCS 2018), volume 117 of Leibniz International Proceedings in Informatics (LIPIcs), pages 72:1–72:14, Dagstuhl, Germany, 2018. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.MFCS.2018.72.
  • [18] Andrzej S. Murawski, Steven J. Ramsay, and Nikos Tzevelekos. DEQ: equivalence checker for deterministic register automata. In Yu-Fang Chen, Chih-Hong Cheng, and Javier Esparza, editors, Automated Technology for Verification and Analysis - 17th International Symposium, ATVA 2019, Taipei, Taiwan, October 28-31, 2019, Proceedings, volume 11781 of Lecture Notes in Computer Science, pages 350–356. Springer, 2019. doi:10.1007/978-3-030-31784-3_20.
  • [19] Frank Neven, Thomas Schwentick, and Victor Vianu. Finite state machines for strings over infinite alphabets. ACM Trans. Comput. Log., 5(3):403–435, 2004. doi:10.1145/1013560.1013562.
  • [20] Marco Pistore. History dependent automata. PhD thesis, University of Pisa, March 1999.
  • [21] Andrew M. Pitts. Nominal Sets: Names and Symmetry in Computer Science. Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 2013.
  • [22] Hiroshi Sakamoto and Daisuke Ikeda. Intractability of decision problems for finite-memory automata. Theor. Comput. Sci., 231(2):297–308, 2000. doi:10.1016/S0304-3975(99)00105-X.
  • [23] Thomas Schwentick. Automata for XML - A survey. J. Comput. Syst. Sci., 73(3):289–315, 2007. doi:10.1016/J.JCSS.2006.10.003.
  • [24] Luc Segoufin. Automata and logics for words and trees over an infinite alphabet. In Zoltán Ésik, editor, Computer Science Logic, 20th International Workshop, CSL 2006, 15th Annual Conference of the EACSL, Szeged, Hungary, September 25-29, 2006, Proceedings, volume 4207 of Lecture Notes in Computer Science, pages 41–57. Springer, 2006. doi:10.1007/11874683_3.
  • [25] Frits Vaandrager, Bharat Garhewal, Jurriaan Rot, and Thorsten Wißmann. A new approach for active automata learning based on apartness. In Dana Fisman and Grigore Rosu, editors, Tools and Algorithms for the Construction and Analysis of Systems, pages 223–243, Cham, 2022. Springer International Publishing. doi:10.1007/978-3-030-99524-9_12.