Residual Nominal Automata Joshua Moerman RTWH Aachen University, Germany Matteo Sammartino Royal Holloway University of London, UK University College London, UK Abstract We are motivated by the following question: which nominal languages admit an active learning algorithm? This question was left open in previous work, and is particularly challenging for languages recognised by nondeterministic automata. To answer it, we develop the theory of residual nominal automata, a subclass of nondeterministic nominal automata. We prove that this class has canonical representatives, which can always be constructed via a finite number of observations. This property enables active learning algorithms, and makes up for the fact that residuality – a semantic property – is undecidable for nominal automata. Our construction for canonical residual automata is based on a machine-independent characterisation of residual languages, for which we develop new results in nominal lattice theory. Studying residuality in the context of nominal languages is a step towards a better understanding of learnability of automata with some sort of nondeterminism. 2012 ACM Subject Classification Theory of computation → Automata over infinite objects; Theory of computation → Automated reasoning Keywords and phrases nominal automata, residual automata, derivative language, decidability, closure, exact learning, lattice theory Digital Object Identifier 10.4230/LIPIcs.CONCUR.2020.44 Related Version Full version at https://arxiv.org/abs/1910.11666. Funding ERC AdG project 787914 FRAPPANT, EPSRC Standard Grant CLeVer (EP/S028641/1). Acknowledgements We would like to thank Gerco van Heerdt for providing examples similar to that of Lr in the context of probabilistic automata. We thank Borja Balle for references on residual probabilistic languages, and Henning Urbat for discussions on nominal lattice theory. Lastly, we thank the reviewers of a previous version of this paper for their interesting questions and suggestions. 1 Introduction Formal languages over infinite alphabets have received considerable attention recently. They include data languages for reasoning about XML databases [32], trace languages for analysis of programs with resource allocation [18], and behaviour of programs with data flows [19]. Typically, these languages are accepted by register automata, first introduced in the seminal paper [20]. Another appealing model is that of nominal automata [6]. While nominal automata are as expressive as register automata, they enjoy convenient properties. For example, the deterministic ones admit canonical minimal models, and the theory of formal languages and many textbook algorithms generalise smoothly. In this paper, we investigate the properties of so-called residual nominal automata. An automaton accepting a language L is residual whenever the language of each state is a derivative of L. In the context of regular languages over finite alphabets, residual finite state automata (RFSAs) are a subclass of nondeterministic finite automata (NFAs) introduced by Denis et al. [14] as a solution to the well-known problem of NFAs not having unique minimal representatives. They show that every regular language L admits a unique canonical RFSA. © Joshua Moerman and Matteo Sammartino; licensed under Creative Commons License CC-BY 31st International Conference on Concurrency Theory (CONCUR 2020). Editors: Igor Konnov and Laura Kovács; Article No. 44; pp. 44:1–44:21 Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany 44:2 Residual Nominal Automata Nondeterministic Residual Nondeterministic− Residual− Deterministic Figure 1 Relationship between classes of nominal languages. Edges are strict inclusions. With ·− we denote classes where automata are not allowed to guess values, i.e., to store symbols in registers without explicitly reading them. Residual automata play a key role in the context of exact learning 1 , in which one computes an automaton representation of an unknown language via a finite number of observations. The defining property of residual automata allows one to (eventually) observe the semantics of each state independently. In the finite-alphabet setting, residuality underlies the seminal algorithm L? for learning deterministic automata [1] (deterministic automata are always residual), and enables efficient algorithms for learning nondeterministic [8] and alternating automata [2, 3]. Residuality has also been studied for learning probabilistic automata [13]. Existence of canonical residual automata is crucial for the convergence of these algorithms. Our investigation of residuality in the nominal setting is motivated by the following question: which nominal languages admit an exact learning algorithm? In previous work [28], we have shown that the L? algorithm generalises smoothly to nominal languages, meaning that deterministic nominal automata can be learned. However, the general non-deterministic case proved to be significantly more challenging. In fact, in stark contrast with the finite-alphabet case, nondeterministic nominal automata are strictly more expressive than deterministic ones, thus residual automata are not just succinct representations of deterministic languages. As a consequence, our attempt to generalise the NL? algorithm for nondeterministic finite automata to the nominal setting did not fully succeed: we could only prove that it works for deterministic languages, leaving the nondeterministic case open. By investigating residual languages, and how they relate to deterministic and nondeterministic ones, we are finally able to settle this case. In summary, our contributions are as follows: Section 3: We refine nominal languages as depicted in Figure 1, by giving separating languages for each class. Section 4: We develop new results of nominal lattice theory, and we provide the main characterisation theorem (Theorem 4.10), showing that the class of residual languages allow for canonical automata which: a) are minimal in their respective class and unique (up to isomorphism); b) can be constructed via a finite number of observations of the language. Both properties are crucial for learning. We prove this important result by a machine-independent characterisation of those classes of languages. We also give an analogous result for non-guessing languages (Theorem 4.16). Section 5: We study decidability and closure properties. Many decision problems, such as equivalence and universality, are known to be undecidable for nondeterministic nominal automata. For residual automata, we show that universality becomes decidable. However, the problem of whether an automaton is residual is undecidable. 1 Exact learning is also known as query learning or active (automata) learning [1]. J. Moerman and M. Sammartino 44:3 Section 6: We settle important open questions about exact learning of nominal languages. We show that residuality does not imply convergence of existing algorithms, and we give a (modified) NL? -style algorithm that works precisely for residual languages. This research mirrors that of residual probabilistic automata [13]. There, too, one has distinct classes of which the deterministic and residual ones admit canonical automata and have an algebraic characterisation. We believe that our results contribute to a better understanding of learnability of automata with some sort of nondeterminism. 2 Preliminaries We recall the notions of nominal sets [33] and nominal automata [6]. Let A be a countably infinite set of atoms 2 and let Perm(A) be the set of permutations on A, i.e., the bijective functions π : A → A. Permutations form a group where the unit is given by the identity function, the inverse by functional inverse, and multiplication by function composition. A nominal set is a set X equipped with a function · : Perm(A) × X → X, interpreting permutations over X. This function must be a group action of Perm(A), i.e., it must satisfy id ·x = x and π · (π 0 · x) = (π ◦ π 0 ) · x. We say that a set A ⊂ A supports x ∈ X whenever π · x = x for all π fixing A, i.e., such that π|A = idA . We require for nominal sets that each element x has a finite support. We denote by supp(x) the smallest finite set supporting x. The orbit orb(x) of x ∈ X is the set of elements in X reachable from x via permutations: orb(x) := {π · x | π ∈ Perm(A)}. X is orbit-finite whenever it is a finite union of orbits. Orbit-finite sets are finitely-representable, hence algorithmically tractable [5]. Given a nominal set X, a subset Y ⊆ X is equivariant if it is preserved by permutations, i.e., π · Y = Y , for all π ∈ Perm(A), where π acts element-wise. This definition extends to relations and functions. For instance, a function f : X → Y between nominal sets is equivariant whenever π · f (x) = f (π · x). Given a nominal set X, the nominal power set is defined as Pfs (X) := {U ⊆ X | U is finitely supported}. We recall the notion of nominal automaton from [6]. The theory of nominal automata seamlessly extends classical automata theory by having orbit-finite nominal sets and equivariant functions in place of finite sets and functions. I Definition 2.1. A (nondeterministic) nominal automaton A consists of: an orbit-finite nominal set Σ, the alphabet; an orbit-finite nominal set of states Q; equivariant subsets I, F ⊆ Q of initial and final states; and an equivariant subset δ ⊆ Q × Σ × Q of transitions. The usual notions of acceptance and language apply. We denote the language of A by L(A), and the language accepted by a state q ∈ Q by L(q). Note that the language L(A) ∈ Pfs (Σ∗ ) is equivariant, and that L(q) ∈ Pfs (Σ∗ ) need not be equivariant, but it is supported by supp(q). We recall the notion of derivative language [14].3 I Definition 2.2. Given a language L and a word u ∈ Σ∗ , we define the derivative of L w.r.t. u as u−1 L := {w | uw ∈ L} and the set of all derivatives as Der(L) := u−1 L | u ∈ Σ∗ . These definitions seamlessly extend to the nominal setting. Note that w−1 L is finitely supported whenever L is. 2 3 Sometimes these are called data values. This is sometimes called a residual language or left quotient. We do not use the term residual language here, because residual language will mean a language accepted by a residual automaton. CONCUR 2020 44:4 Residual Nominal Automata Of special interest are the deterministic, residual, and non-guessing nominal automata, which we introduce next. I Definition 2.3. A nominal automaton A is: Deterministic if I = {q0 }, and for each q ∈ Q and a ∈ Σ there is a unique q 0 such that (q, a, q 0 ) ∈ δ. In this case, the relation is in fact functional δ : Q × Σ → Q. Residual if each state q ∈ Q accepts a derivative of L(A), formally: L(q) = w−1 L(A) for some word w ∈ Σ∗ . The words w such that L(q) = w−1 L(A) are called characterising words for the state q. Non-guessing if supp(q0 ) = ∅, for each q0 ∈ I, and supp(q 0 ) ⊆ supp(q) ∪ supp(a), for each (q, a, q 0 ) ∈ δ. Observe that the transition function of a deterministic automaton preserves supports (i.e., if C supports (q, a) then C also supports δ(q, a)). Consequently, all deterministic automata are non-guessing. For the sake of succinctness, in the following we drop the qualifier “nominal” when referring to these classes of nominal automata. For many examples, it is useful to define the notion of an anchor. Given a state q, a word w is an anchor if δ(I, w) = {q}, that is, the word w leads to q and no other state. Every anchor for q is also a characterising word for q (but not vice versa). Finally, we recall the Myhill-Nerode theorem for nominal automata. I Theorem 2.4 ([6, Theorem 5.2]). Let L be a language. Then L is accepted by a deterministic automaton if and only if Der(L) is orbit-finite. 3 Separating languages Deterministic, nondeterministic and residual automata have the same expressive power when dealing with finite alphabets. The situation is more nuanced in the nominal setting. We now give one language for each class in Figure 1. For the sake of simplicity, we will use the one-orbit nominal set of atoms A as alphabet. These languages separate the different classes, meaning that they belong to the respective class, but not to the classes below or beside it. For each example language L, we depict: a nominal automaton recognising L (on the left); the set of derivatives Der(L) (on the right). We make explicit the poset structure of Der(L): grey rectangles represent orbits of derivatives, and lines stand for set inclusions (we grey out irrelevant ones). This poset may not be orbit-finite, in which case we depict a small, indicative part. Observing the poset structure of Der(L) explicitly is important for later, where we show that the existence of residual automata depends on it. We write aa−1 L to mean (aa)−1 L. Variables a, b, . . . are always atoms and u, w, . . . are always words. Deterministic: First symbol equals last symbol Consider the language Ld := {awa | a ∈ A, w ∈ A∗ }. This is accepted by the following deterministic nominal automaton. The automaton is actually infinite-state, but we represent it symbolically using a register-like notation, where we annotate each state with the current 6= a a a Ad = a a a 6= a aa−1 Ld bb−1 Ld ··· a−1 Ld b−1 Ld ··· Ld Figure 2 A deterministic automaton accepting Ld , and the poset Der(Ld ). J. Moerman and M. Sammartino 44:5 value of a register. Note that the derivatives a−1 Ld , b−1 Ld , . . . are in the same orbit. In total Der(Ld ) has three orbits, which correspond to the three orbits of states in the deterministic automaton. The derivative awa−1 Ld , for example, equals aa−1 Ld . Non-guessing residual: Some atom occurs twice The language is Lng,r := {uavaw | u, v, w ∈ A∗ , a ∈ A}. The poset Der(Lng,r ) is not orbit-finite, so by the nominal Myhill-Nerode theorem there is no deterministic automaton accepting Lng,r . However, derivatives of the form ab−1 Lng,r can be written as a union ab−1 Lng,r = a−1 Lng,r ∪ b−1 Lng,r . In fact, we only need an orbit-finite set of derivatives to recover Der(Lng,r ). These orbits are highlighted in the diagram on the right. Selecting the “right” derivatives is the key idea behind constructing residual automata in Theorem 4.10. aa−1 Lng,r A a Ang,r = A A a ··· abc−1 Lng,r ··· ··· ab−1 Lng,r ··· a a−1 Lng,r · · · b−1 Lng,r Lng,r Figure 3 A (nonresidual) nondeterministic automaton accepting Lng,r , and the poset Der(Lng,r ). Nondeterministic: Last letter is unique The language is Ln := {wa | a not in w} ∪ {}. Derivatives a−1 Ln are again unions of smaller S languages: a−1 Ln = b6=a ab−1 Ln . (We have omitted languages like aa−1 Ln , as they only differ from a−1 Ln on the empty word.) However, the poset Der(L) has an infinite descending chain of languages (with an increasing support), namely a−1 L ⊃ ab−1 L ⊃ abc−1 L ⊃ . . . The existence of a such a chain implies that Ln cannot be accepted by a residual automaton. This is a consequence of Theorem 4.10, as we shall see later. Ln a−1 Ln 6= a An = guess a a a ··· b−1 Ln ··· ab−1 Ln ··· ··· abc−1 Ln ··· Figure 4 A nondeterministic automaton accepting Ln , and the poset Der(Ln ). CONCUR 2020 44:6 Residual Nominal Automata Residual: Last letter is unique but anchored Consider the alphabet Σ = A ∪ {Anc(a) | a ∈ A}, where Anc is nothing more than a label. We add the transitions (a, Anc(a), a) to the automaton in the previous example. We obtain the language Lr = L(Ar ). Here, we have forced the automaton to be residual, by adding an anchor to the first state. Nevertheless, guessing is still necessary. In the poset, we note that all elements in the descending chain can now be obtained as unions of Anc(a)−1 Lr . For instance, S a−1 Lr = b6=a Anc(b)−1 Lr . Note that Anc(a)Anc(b)−1 Lr = ∅ and Anc(a)a−1 Lr = {}. Lr a−1 Lr 6= a guess a Ar = a a b−1 Lr ··· ··· ab−1 Lr ··· ··· abc−1 Lr ··· Anc(a) Anc(c)−1 Lr Anc(a)a−1 Lr Anc(c)Anc(d)−1 Lr Figure 5 A residual automaton accepting Lr , and the poset Der(Lr ). Non-guessing nondeterministic: Repeated atom with different successor The language is Lng := {uabvac | u, v ∈ A∗ , a, b, c ∈ A, b 6= a}. (We allow a = b or a = c.) This is a language which can be accepted by a non-guessing automaton. However, there is no residual automaton for this language. The poset structure of Der(Lng ) is very complicated. We will return to this example after Theorem 4.10. A aba−1 Lng a Ang = a cba−1 Lng b aa−1 Lng ba−1 Lng A ab a b 6= b a−1 Lng b−1 Lng Lng Figure 6 A deterministic automaton accepting Lng , and the poset Der(Lng ). ab−1 Lng J. Moerman and M. Sammartino 4 44:7 Canonical Residual Nominal Automata In this section we will give a characterisation of canonical residual automata. We will first introduce notions of nominal lattice theory, then we will state our main result (Theorem 4.10). We conclude the section by providing similar results for non-guessing automata. 4.1 Nominal lattice theory We abstract away from words and languages and consider the set Pfs (Z) for an arbitrary nominal set Z. This is a Boolean algebra of which the operations ∧, ∨, ¬ are all equivariant maps [17]. Moreover, the finitely supported union _ : Pfs (Pfs (Z)) → Pfs (Z) is also equivariant. We note that this is more general than a binary union, but it is not a complete join semi-lattice. Hereafter, we shall denote set inclusion by ≤ (< when strict). I Definition 4.1. Given a nominal set Z and X ⊆ Pfs (Z) equivariant4 , we define the set generated by X as n_ o hXi := x | x ⊆ X finitely supported ⊆ Pfs (Z). W I Remark 4.2. The set hXi is closed under the operation , and moreover is the smallest W equivariant set closed under containing X. In other words, h−i defines a closure operator. We will often say “X generates Y ”, by which we mean Y ⊆ hXi. I Definition 4.3. Let X ⊆ Pfs (Z) equivariant and x ∈ X, we say that x is join-irreducible W in X if it is non-empty and x = x =⇒ x ∈ x, for every finitely supported x ⊆ X. The set of all join-irreducible elements is denoted by JI(X) := {x ∈ X | x join-irreducible in X} . This is again an equivariant set. I Remark 4.4. In lattice and order theory, join-irreducible elements are usually defined only for a lattice (see, e.g., [11]). However, we define them for arbitrary subsets of a lattice. (Note that a subset of a lattice is merely a poset.) This generalisation will be needed later, when we consider the poset Der(L) which is not a lattice, but is contained in the lattice Pfs (Σ∗ ). I Remark 4.5. The notion of join-irreducible, as we have defined here, corresponds to the notion of prime in [8, 14, 28]. Unfortunately, the word prime has a slightly different meaning in lattice theory. We stick to the terminology of lattice theory. If a set Y is well-behaved, then its join-irreducible elements will actually generate the set Y . This is normally proven with a descending chain condition. We first restrict our attention to orbit-finite sets. The following Lemma extends [11, Lemma 2.45] to the nominal setting. I Lemma 4.6. Let X ⊆ Pfs (Z) be an orbit-finite and equivariant set. 1. Let a ∈ X, b ∈ Pfs (Z) and a 6≤ b. Then there is a join-irreducible x ∈ X such that x ≤ a and x 6≤ b. W 2. Let a ∈ X, then a = {x ∈ X | x join-irreducible in X and x ≤ a}. 4 A similar definition could be given for finitely supported X. In fact, all results in this section generalise to finitely supported. But we use equivariance for convenience. CONCUR 2020 44:8 Residual Nominal Automata I Corollary 4.7. Let X ⊆ Pfs (Z) be an orbit-finite equivariant subset. The join-irreducibles of X generate X, i.e., X ⊆ hJI(X)i. So far, we have defined join-irreducible elements relative to some fixed set. We will now show that these elements remain join-irreducible when considering them in a bigger set, as long as the bigger set is generated by the smaller one. This will later allow us to talk about the join-irreducible elements. I Lemma 4.8. Let Y ⊆ X ⊆ Pfs (Z) equivariant and suppose that X ⊆ hJI(Y )i. Then JI(Y ) = JI(X). In other words, the join-irreducibles of X are the smallest set generating X. I Corollary 4.9. If an orbit-finite set Y generates X, then JI(X) ⊆ Y . 4.2 Characterising Residual Languages We are now ready to state and prove the main theorem of this paper. We fix the alphabet Σ. Recall that the nominal Myhill-Nerode theorem tells us that a language is accepted by a deterministic automaton if and only if Der(L) is orbit-finite. Here, we give a similar characterisation for languages accepted by residual automata. Moreover, the following result gives a canonical construction. I Theorem 4.10. Given a language L ∈ Pfs (Σ∗ ), the following are equivalent: 1. L is accepted by a residual automaton. 2. There is some orbit-finite set J ⊆ Der(L) which generates Der(L). 3. The set JI(Der(L)) is orbit-finite and generates Der(L). Proof. We prove three implications: (1 ⇒ 2) Take the set of languages accepted by the states: J := {L(q) | q ∈ A}. This is clearly orbit-finite, since Q is. Moreover, each derivative is generated as follows: W w−1 L = {L(q) | q ∈ δ(I, w)}. (2 ⇒ 3) We can apply Lemma 4.8 with Y = J and X = Der(L). Now it follows that JI(Der(L)) is orbit-finite (since it is a subset of J) and generates Der(L). (3 ⇒ 1) We can construct the following residual automaton, whose language is exactly L: Q := JI(Der(L))  I := w−1 L ∈ Q | w−1 L ≤ L  F := w−1 L ∈ Q |  ∈ w−1 L  δ(w−1 L, a) := v −1 L ∈ Q | v −1 L ≤ wa−1 L First, note that A := (Σ, Q, I, F, δ) is a well-defined nominal automaton. In fact, all the components are orbit-finite, and equivariance of ≤ implies equivariance of δ. Second, we show by induction on words that each state q = w−1 L accepts its corresponding language, namely L(q) = w−1 L.  ∈ L(w−1 L) ⇐⇒ w−1 L ∈ F ⇐⇒  ∈ w−1 L  au ∈ L(w−1 L) ⇐⇒ u ∈ L δ(w−1 L, a)   ⇐⇒ u ∈ L v −1 L ∈ Q | v −1 L ≤ wa−1 L _ (i) ⇐⇒ u ∈ v −1 L ∈ Q | v −1 L ≤ wa−1 L ⇐⇒ ∃v −1 L ∈ Q with v −1 L ≤ wa−1 L and u ∈ v −1 L (ii) ⇐⇒ u ∈ wa−1 L ⇐⇒ au ∈ w−1 L J. Moerman and M. Sammartino 44:9 At step (i) we have used the induction hypothesis (u is a shorter word than au) and the fact that L(−) preserves unions. At step (ii, right-to-left) we have used that v −1 L is join-irreducible. The other steps are unfolding definitions. W  −1 w L | w−1 L ≤ L , since the join-irreducible languages generFinally, note that L = ate all languages. In particular, the initial states (together) accept L. J I Corollary 4.11. The construction above defines a canonical residual automaton with the following uniqueness property: it has the minimal number of orbits of states and the maximal number of orbits of transitions. For finite alphabets, the classes of languages accepted by DFAs and NFAs are the same (by determinising an NFA). This means that Der(L) is always finite if L is accepted by an NFA, and we can always construct the canonical RFSA. Here, this is not the case, that is why we need to stipulate (in Theorem 4.10) that the set JI(Der(L)) is orbit-finite and actually generates Der(L). Either condition may fail, as we will see in Example 4.13. I Example 4.12. In this example we show that residual automata can also be used to compress deterministic automata. The language L := {abb . . . b | a = 6 b} can be accepted by a deterministic automaton of 4 orbits, and this is minimal. (A zero amount of bs is also accepted in L.) The minimal residual automaton, however, has only 2 orbits, given by the join-irreducible languages: −1 L = {abb . . . b | a 6= b} ab−1 L = {bb . . . b} (a, b ∈ A distinct) The trick in defining the automaton is that the a-transition from −1 L to ab−1 L guesses the value b. In the next section (Section 4.3), we will define the canonical non-guessing residual automaton, which has 3 orbits. I Example 4.13. We return to the examples Ln and Lng from Section 3. We claim that neither language can be accepted by a residual automaton. For Ln we note that there is an infinite descending chain of derivatives Ln > a−1 Ln > ab−1 Ln > abc−1 Ln > · · · Each of these languages can be written as a union of smaller derivatives. For instance, S a−1 Ln = b6=a ab−1 Ln . This means that JI(Der(Ln )) = ∅, hence it does not generate Der(Ln ) and by Theorem 4.10 there is no residual automaton. In the case of Lng , we have an infinite ascending chain Lng < a−1 Lng < ba−1 Lng < cba−1 Lng < · · · This in itself is not a problem: the language Lng,r also has an infinite ascending chain. However, for Lng , none of the languages in this chain are a union of smaller derivatives. Put differently: all the languages in this chain are join-irreducible (see appendix for the details). So the set JI(Der(Lng )) is not orbit-finite. By Theorem 4.10, we conclude that there is no residual automaton accepting Lng . I Remark 4.14. For arbitrary (nondeterministic) languages there is also a characterisation in the style of Theorem 4.10. Namely, L is accepted by an automaton iff there is an orbit-finite set Y ⊆ Pfs (Σ∗ ) which generates the derivatives. However, note that the set Y need not be a subset of the set of derivatives. In these cases, we do not have a canonical construction for the automaton. Different choices for Y define different automata and there is no way to pick Y naturally. CONCUR 2020 44:10 Residual Nominal Automata 4.3 Automata without guessing We reconsider the above results for non-guessing automata. Nondeterminism in nominal automata allows naturally for guessing, meaning that the automaton may store symbols in registers without explicitly reading them. However, the original definition of register automata in [20] does not allow for guessing, and non-guessing automata remain actively researched [29]. Register automata with guessing were introduced in [21], because it was realised that non-guessing automata are not closed under reversal. To adapt to non-guessing automata, we redefine join-irreducible elements. As we would like to remove states which can be written as a “non-guessing” union of other states, we only consider joins of sets of elements where all elements are supported by the same support. I Definition 4.15. Let X ⊆ Pfs (Z) be equivariant and x ∈ X, we say that x is joinW irreducible− in X if x = x =⇒ x ∈ x, for every finitely supported x ⊆ X such that supp(x0 ) ⊆ supp(x), for each x0 ∈ x. The set of all join-irreducible− elements is denoted by  JI− (X) := x ∈ X | x join-irreducible− in X . The only change required is an additional condition on the elements and supports in x. In particular, the sets x are uniformly supported sets. Unions of such sets are called uniformly supported unions. All the lemmas from the previous section are proven similarly. We state the main result for non-guessing automata. I Theorem 4.16. Given a language L ∈ Pfs (Σ∗ ), the following are equivalent: 1. L is accepted by a non-guessing residual automaton. 2. There is some orbit-finite set J ⊆ Der(L) which generates Der(L) by uniformly supported unions. 3. The set JI− (Der(L)) is orbit-finite and generates Der(L) by uniformly supported unions. Proof. The proof is similar to that of Theorem 4.10. However, we need a slightly different definition of the canonical automaton. It is defined as follows. Q := JI− (Der(L))  I := w−1 L ∈ Q | w−1 L ≤ L, supp(w−1 L) ⊆ supp(L)  F := w−1 L ∈ Q |  ∈ w−1 L  δ(w−1 L, a) := v −1 L ∈ Q | v −1 L ≤ wa−1 L, supp(v −1 L) ⊆ supp(wa−1 L) Note that, in particular, the initial states have empty support since L is equivariant. This means that the automaton cannot guess any values at the start. Similarly, the transition relation does not allow for guessing. J To better understand the structure of the canonical non-guessing residual automaton, we recall the following fact (see [33] for details) and its consequence on non-guessing automata. I Lemma 4.17. Let X be an orbit-finite nominal set and A ⊂ A be a finite set of atoms. The set {x ∈ X | A supports x} is finite. I Corollary 4.18. The transition relation δ of non-guessing automata can be equivalently be described as a function δ : Q × Σ → Pfin (Q), where Pfin (Q) is the set of finite subsets of Q. In particular, this shows that the canonical non-guessing residual automaton has finite nondeterminism. It also shows that it is sufficient to consider finite unions in Theorem 4.16, instead of uniformly supported unions. J. Moerman and M. Sammartino 5 44:11 Decidability and Closure Results In this section we investigate decidability and closure properties. First, a positive result: universality is decidable for residual automata. This is in contrast to the nondeterministic case, where universality is undecidable, even for non-guessing automata [4]. I Proposition 5.1. Universality for residual nominal automata is decidable. Formally: given a residual automaton A, it is decidable whether L(A) = Σ∗ . Second, a negative result: determining whether an automaton is residual is undecidable. In other words, residuality cannot be characterised as a syntactic property. This adds value to learning techniques, as they are able to provide automata that are residual by construction, thus “getting around” this undecidability issue. I Proposition 5.2. The problem of determining whether a given nondeterministic nominal automaton is residual is undecidable. The above result is obtained by reducing the universality problem for general nondeterministic nominal automata to the residuality problem. Given an automaton A, we construct another automaton A0 which is residual if and only if A is universal (see appendix for details). This result also holds for the subclass of non-guessing automata, as the construction of A0 does not introduce any guessing and universality for non-guessing nondeterministic nominal automata is undecidable. I Remark 5.3. Equivalence between residual nominal automata is still an open problem. The usual proof of undecidability of equivalence is via a reduction from universality. This proof does not work anymore, because universality for residual automata is decidable (Proposition 5.1). We conjecture that equivalence remains undecidable for residual automata. Closure properties We will now show that several closure properties fail for residual languages. Interestingly, this parallels the situation for probabilistic languages: residual ones are not even closed under convex sums. We emphasise that residual automata were devised for learning purposes, where closure properties play no significant role. In fact, one typically exploits closure properties of the wider class of nondeterministic models, e.g., for automata-based verification. The following results show that in our setting this is indeed unavoidable. Consider the alphabet Σ = A ∪ {Anc(a) | a ∈ A} and the residual language Lr from Section 3. We consider a second language L2 = A∗ which can be accepted by a deterministic (hence residual) automaton. We have the following non-closure results: Union: The language L = Lr ∪ L2 cannot be accepted by a residual automaton. In fact, although derivatives of the form Anc(a)−1 L are still join-irreducible (see Section 3, residual case), they have no summand A∗ , which means that they cannot generate S a−1 L = A∗ ∪ b6=a Anc(b)−1 L. By Theorem 4.10(3) it follows that L is not residual. Intersection: The language L = Lr ∩ L2 = Ln cannot be accepted by a residual automaton, as we have seen in Section 3. Concatenation: The language L = L2 · Lr cannot be accepted by a residual automaton, for similar reasons as the union. Reversal: The language {aw | a not in w} is residual (even deterministic), but its reverse language is Ln and cannot be accepted by a residual automaton. Complement: Consider the language Lng,r of words where some atom occurs twice. Its complement Lng,r is the language of all fresh atoms, which cannot even be recognised by a nondeterministic nominal automaton [6]. Closure under Kleene star is yet to be settled. CONCUR 2020 44:12 Residual Nominal Automata 6 Exact learning In our previous paper on learning nominal automata [28], we provided an exact learning algorithm for nominal deterministic languages. Moreover, we observed by experimentations that the algorithm was also able to learn specific nondeterministic languages. However, several questions on nominal languages remained open, most importantly: Which nominal languages can be characterised via a finite set of observations? Which nominal languages admit an Angluin-style learning algorithm? In this section we will answer these questions using the theory developed in the previous sections. 6.1 Angluin-style learning We briefly review the classical automata learning algorithms L? by Angluin [1] for deterministic automata, and NL? by Bollig et al. [8] for residual automata. Then we discuss convergence in the nominal setting. Both algorithms can be seen as a game between two players: the learner and the teacher. The learner aims to construct the minimal automaton for an unknown language L over a finite alphabet Σ. In order to do this, it may ask the teacher, who knows about the language, two types of queries: Membership query: Is a given word w in the target language, i.e., w ∈ L? Equivalence query: Does a given hypothesis automaton H recognise the target language, i.e., L = L(H)? If the teacher replies yes to an equivalence query, then the algorithm terminates, as the hypothesis H is correct. Otherwise, the teacher must supply a counterexample, that is a word in the symmetric difference of L and L(H). Availability of equivalence queries may seem like a strong assumption, and in fact it is often weakened by allowing only random sampling (see [22] or [35] for details). Observations about the language made by the learner via queries are stored in an observation table T . This is a table where rows and columns range over two finite sets of words S, E ⊆ Σ? respectively, and T (u, v) = 1 if and only if uv ∈ L. Intuitively, each row of T approximates a derivative of L, in fact we have T (u) ⊆ u−1 L. However, the information contained in T may be incomplete: some derivatives w−1 L are not reached yet because no membership queries for w have been posed, and some pairs of rows T (u), T (v) may seem equal to the learner, because no word has been seen yet which distinguishes them. The learning algorithm will add new words to S when new derivatives are discovered, and to E when words distinguishing two previously identical derivatives are discovered. The table T is closed whenever one-letter extensions of derivatives are already in the table, i.e., T has a row for ua−1 L, for all u ∈ S, a ∈ Σ. If the table is closed,5 L? is able to construct an automaton from T , where states are distinct rows (i.e., derivatives). The construction follows the classical one for the canonical automaton of a language from its derivatives [31]. The NL? algorithm uses a modified notion of closedness, where one is allowed to take unions (i.e., a one-letter extension can be written as unions of rows in T ), and hence is able to learn a RFSA accepting the target language. 5 L? also needs the table to be consistent. We do not need that in our discussion here. J. Moerman and M. Sammartino 44:13 When the table is not closed, then a derivative is missing, and a corresponding row needs to be added. Once an automaton is constructed, it is submitted in an equivalence query. If a counterexample is returned, then again the table is extended6 , after which the process is repeated iteratively. 6.2 The nominal case In [28] we have given nominal versions of L? and NL? , called νL? and νNL? respectively. They seamlessly extend the original algorithms by operating on orbit-finite sets. The algorithm νL? always terminates for deterministic languages, because distinct derivatives, and hence distinct rows in the observation table, are orbit-finitely many (see Theorem 2.4). However, it will never terminate for languages not accepted by deterministic automata (such as residual or nondeterministic languages). I Theorem 6.1 ([27]). νL? converges if and only if Der(L) is orbit-finite, in which case it outputs the canonical deterministic automaton accepting L. Moreover, at most O(nk) equivalence queries are needed, where n is the number of orbits of the minimal deterministic automaton, and k is the maximum support size of its states. The nondeterministic case is more interesting. Using Theorem 4.10, we can finally establish which nondeterministic languages can be characterised via orbit-finitely-many observations. I Corollary 6.2 (of Theorem 4.10). Let L be a nondeterministic nominal language. Then L can be represented via an observation table with orbit-finitely-many rows and columns if and only if L is residual. Rows of this table correspond to join-irreducible derivatives. This explains why in [28] νNL? was able to learn some residual nondeterministic automata: an orbit-finite observation table exists, which allows νNL? to construct the canonical residual automaton. Unfortunately, the current νNL? algorithm does not guarantee that it finds this orbit-finite observation table. We only have that guarantee for deterministic languages. The following example shows that νNL? may indeed diverge when trying to close the table. I Example 6.3. Suppose νNL? tries to learn the residual language L accepted by the automaton below over the alphabet Σ = A ∪ {Anc(a) | a ∈ A}. This is a slight modification of the residual language of Section 3. 6= a guess a Anc(a) Anc(6= a) a 6= a a a Anc(a) a The algorithm starts by considering the row for the empty word , and its one-letter extensions  · a = a and  · Anc(a) = Anc(a). These rows correspond to the derivatives −1 L = L, a−1 L and Anc(a)−1 L. Column labels are initialised to the empty word . At this point a−1 L and Anc(a)−1 L appear identical, as the only column  does not distinguish them. However, they appear different from −1 L, so the algorithm will add the row for either a or Anc(a) in order 6 L? and NL? adopt different counterexample-handling strategies: the former adds a new row, the latter a new column. Both result in a new derivative being detected. CONCUR 2020 44:14 Residual Nominal Automata to close the table. Suppose the algorithm decides to add a. Then it will consider one-letter extensions ab, abc, abcd, etc... Since these correspond to different derivatives – each strictly smaller than the previous one – the algorithm will get stuck in an attempt to close the table. At no point it will try to close the table with the word Anc(a), since it stays equivalent to a. So in this case νNL? will not terminate. However, if the algorithm instead adds Anc(a) to the row labels, it will then also add Anc(a)Anc(b), which is a characterising word for the initial state. In that case, νNL? will terminate. While there is no hope of convergence in the non-residual case, as no orbit-finite observation table exists characterising derivatives, we now propose a modification of νNL? which guarantees termination for residual languages. I Theorem 6.4. There is an algorithm which query learns residual nominal languages. Proof (Sketch). When the algorithm adds a word w to the set of rows, then it also adds all other words of length |w|.7 Since all words of bounded length are added, the algorithm will eventually find all words that are characterising for states of the canonical residual automaton, and it will therefore be able to reconstruct this automaton. See appendix for details. J Unfortunately, considering all words bounded by a certain length requires many membership queries. In fact, characterising words can be exponential in length [14], meaning that this algorithm may need doubly exponentially many membership queries. I Remark 6.5. We note that nondeterministic automata can be enumerated, and hence can be learned via equivalence queries only. This would result in a highly inefficient algorithm. This parallels the current understanding of learning probabilistic languages. Although efficient (learning in the limit) learning algorithms for deterministic and residual languages exist [12], the general case is still open. 7 Conclusions, related and future work In this paper we have investigated a subclass of nondeterministic automata over infinite alphabets. This class naturally arises in the context of query learning, where automata have to be constructed from finitely many observations. Although there are many classes of data languages, we have shown that our class of residual languages admit canonical automata. The states of these automata correspond to join-irreducible elements. In the context of learning, we show that convergence of standard Angluin-style algorithms is not guaranteed, even for residual languages. We propose a modified algorithm which guarantees convergence at the expense of an increase in the number of observations. We emphasise that, unlike other algorithms based on residuality such as NL? [8] and ? AL [2], our algorithm does not depend on the size, or even the existence, of the minimal deterministic automaton for the target language. This is a crucial difference, since dependence on the minimal deterministic automaton hinders generalisation to nondeterministic nominal automata, which are strictly more expressive. Ideally, in the residual case, one would like an algorithm for which the complexity depends only on the length of characterising words, which is an intrinsic feature of residual automata. To the best of our knowledge, no such algorithm exists in the finite setting. 7 The set {w ∈ Σ∗ | |w| = k} is orbit-finite, for any fixed k ∈ N. J. Moerman and M. Sammartino 44:15 We also show that universality is decidable for residual automata, in contrast to undecidability in the general nondeterministic case. As future work, we plan to attack the language inclusion/equivalence problem for residual automata. This is a well-known and challenging problem for data languages, which has been answered for specific subclasses [9, 10, 29, 34]. Of special interest is the subclass of unambiguous automata [10, 29]. We note that residual languages are orthogonal to unambiguous languages. For instance, the language Ln is unambiguous but not residual, whereas Lng,r is residual but ambiguous. Moreover, their intersection has neither property, and every deterministic language has both properties. One interesting fact is that if a canonical residual automaton is unambiguous, then the join-irreducibles form an anti-chain. Other related work are nominal languages/expressions with an explicit notion of binding [15, 25, 26, 34]. Although these are sub-classes of nominal languages, binding is an important construct, e.g., to represent resource-allocation. Availability of a notion of derivatives [25] suggests that residuality may prove beneficial for learning these languages. Residual automata over finite alphabets also have a categorical characterisation [30]. We see no obstructions in generalising those results to nominal sets. This would amount to finding the right notion of nominal (complete) join-semilattice, with either finitely or uniformly supported joins. Finally, in [16, 17] aspects of nominal lattices and Boolean algebras are investigated. To the best of our knowledge, our results of nominal lattice theory, especially those on join-irreducibles, are new. Omitted proofs W I Remark 4.2. The set hXi is closed under the operation , and moreover is the smallest W equivariant set closed under containing X. In other words, h−i defines a closure operator. We will often say “X generates Y ”, by which we mean Y ⊆ hXi. W Proof. Take any x ⊆ hXi finitely supported. All x ∈ x are of the form yx , for some yx ⊆ X finitely supported. Consider the finitely supported set T = {y | y ∈ yx , x ∈ x} ⊆ X. Then W W W we see that x = T ∈ hXi, meaning that hXi is closed under . The second part of the W claim is easy: any set closed under and containing X must also contain hXi. J I Lemma 4.6. Let X ⊆ Pfs (Z) be an orbit-finite and equivariant set. 1. Let a ∈ X, b ∈ Pfs (Z) and a 6≤ b. Then there is a join-irreducible x ∈ X such that x ≤ a and x 6≤ b. W 2. Let a ∈ X, then a = {x ∈ X | x join-irreducible in X and x ≤ a}. Proof. In this proof we need a technicality. Let P be a finitely supported, non-empty poset (i.e., both P and ≤ are supported by a finite A ⊂ A). If P is A-orbit-finite then P has a minimal element, as we can consider the finite poset of A-orbits and find a minimal A-orbit. Here we use the notion of an A-orbit, i.e., an orbit defined over permutations that fix A. (See [33, Chapter 5] for details.) Ad 1. Consider the set S = {x ∈ X | x ≤ a, x 6≤ b}. This is a finitely supported and supp(S)-orbit-finite set, hence it has some minimal element m ∈ S. We shall prove that m is join-irreducible in X. Let x ⊆ X finitely supported and assume that x0 < m for each x0 ∈ x. Note that x0 < m ≤ a and so that x0 ∈ / S (otherwise m was not minimal). Hence x0 ≤ b (by W W W W definition of S). So x ≤ b and so x ∈ / S, which concludes that x 6= m, and so x < m as required. Ad 2. Consider the set T = {x ∈ JI(X) | x ≤ a}. This set is finitely supported, so we W may define the element b = T ∈ Pfs (Z). It is clear that b ≤ a, we shall prove equality by contradiction. Suppose a 6≤ b, then by (1.), there is a join-irreducible x such that x ≤ a and W y 6≤ b. By the first property of x we have x ∈ T , so that x 6≤ b = T is a contradiction. We W conclude that a = b, i.e. a = T as required. J I Lemma 4.8. Let Y ⊆ X ⊆ Pfs (Z) equivariant and suppose that X ⊆ hJI(Y )i. Then JI(Y ) = JI(X). W Proof. (⊇) Let x ∈ X be join-irreducible in X. Suppose that x = y for some finitely supported y ⊆ Y . Note that also y ⊆ X Then x = y0 for some y0 ∈ y, and so x is join-irreducible in Y . W (⊆) Let y ∈ Y be join-irreducible in Y . Suppose that y = x for some finitely supported x ⊆ X. Note that every element x ∈ x is a union of elements in JI(Y ) (by the assumption W X ⊆ hJI(Y0 )i). Take yx = {y ∈ JI(Y ) | y ≤ x}, then we have x = yx and y= _ x= _ n_ o _ yx | x ∈ x = {y0 | y0 ∈ yx , x ∈ x} . The last set is a finitely supported subset of Y , and so there is a y0 in it such that y = y0 . Moreover, this y0 is below some x0 ∈ x, which gives y0 ≤ x0 ≤ y. We conclude that y = x0 for some x0 ∈ x. J CONCUR 2020 44:18 Residual Nominal Automata I Corollary 4.11. The construction above defines a canonical residual automaton with the following uniqueness property: it has the minimal number of orbits of states and the maximal number of orbits of transitions. Proof. State minimality follows from Corollary 4.9, where we note that the states of any residual automata accepting L form a generating subset of Der(L). Maximality of transitions follows from the fact that it is saturated, meaning that no transitions can be added without changing the language. J I Example 4.13. All the languages in the following ascending chain are join-irreducible. Lng < a−1 Lng < ba−1 Lng < cba−1 Lng < · · · Proof. Consider the word w = ak . . . a1 a0 with k ≥ 1 and all ai distinct atoms. We will prove that w−1 Lng is join-irreducible in Der(Lng ), by considering all u−1 Lng ⊆ w−1 Lng . Observe that if u is a suffix of w, then u−1 Lng ⊆ w−1 Lng . This is easily seen from the given automaton, since it may skip any prefix. We now show that u being a suffix of w is also a necessary condition. First, suppose that u contains an atom a different from all ai . If it is the last symbol of u, then aaa0 ∈ u−1 Lng , but aaa0 ∈ / w−1 Lng . If a is succeeded by b (not necessarily distinct), −1 then either aa or aa0 is in u Lng . But neither aa nor aa0 is in w−1 Lng . This shows that for u−1 Lng ⊆ w−1 Lng , we necessarily have that u ∈ {a0 , . . . , ak }∗ . (This also means that automatically supp(u−1 Lng ) ⊆ supp(w−1 Lng ).) Second, when u = , we have u−1 Lng ⊆ w−1 Lng . And for |u| = 1, if u = a0 , then −1 u Lng ⊆ w−1 Lng . If u = ai with i > 0, then ai ai ai−1 ∈ u−1 Lng , but that word is not in w−1 Lng . This shows that for u−1 Lng ⊆ w−1 Lng with |u| ≤ 1, we necessarily have that u is a suffix of w. Third, we prove the same for |u| ≤ 2. We first consider which bigrams may occur in u. Suppose that u contains a bigram ai aj with i > 0 and j 6= i − 1. Then ai ai−1 is in u−1 Lng , but not in w−1 Lng . Suppose that u contains a0 ai (i > 0) or a0 a0 , then u−1 Lng contains either a0 a0 or a0 a1 respectively. Neither of these words are in w−1 Lng . This shows that u−1 Lng ⊆ w−1 Lng implies that u may only contain the bigrams ai ai−1 . In particular, these bigrams compose in a unique way. So u is a (contiguous) subword of w, whenever u−1 Lng ⊆ w−1 Lng . Continuing, suppose that u ends in the bigram ai+1 ai with i > 0. Then we have ai ai ai−1 in u−1 Lng , but not in w−1 Lng . This shows that u has to end in a1 a0 . That is, for u−1 Lng ⊆ w−1 Lng with |u| ≥ 2, we necessarily have that u is a suffix of w. So far, we have shown that {u | u−1 Lng ⊆ w−1 Lng } = {u | u is a suffix of w}. W To see that w−1 Lng is indeed join-irreducible, we consider the join X = {u−1 Lng | u is a strict suffix of w}. Note that ak ak ∈ / X, but ak ak ∈ w−1 Lng . We conclude that W −1 −1 −1 −1 w Lng 6= {u Lng | u Lng $ w Lng } as required. J I Proposition 5.1. Universality for residual nominal automata is decidable. Formally: given a residual automaton A, it is decidable whether L(A) = Σ∗ . Proof. In the constructions below, we use computation with atoms. This is a computation paradigm which allow algorithmic manipulation of infinite – but orbit-finite – nominal sets. For instance, it allows looping over such a set in finite time. Important here is that this paradigm is equivalent to regular computability (see [7]) and implementations exist to compute with atoms [23, 24]. J. Moerman and M. Sammartino 44:19 We will sketch an algorithm that, given a residual automaton A, answers whether L(A) = Σ∗ . The algorithm decides negatively in the following cases: I = ∅. In this case the language accepted by A is empty. Suppose there is a q ∈ Q with q ∈ / F . By residuality we have L(q) = w−1 L(A) for some w. Note that q is not accepting, so that  ∈ / w−1 L(A). Put differently: w ∈ / L(A). (We note that w is not used by the algorithm. It is only needed for the correctness.) Suppose there is a q ∈ Q and a ∈ Σ such that δ(q, a) = ∅. Again L(q) = w−1 L(A) for some w. Note that a is not in L(q). This means that wa is not in the language. When none of these three cases hold, the algorithm decides positively. We shall prove that this is indeed the correct decision. If none of the above conditions hold, then I 6= ∅, Q = F , and for all q ∈ Q, a ∈ Σ we have δ(q, a) 6= ∅. Here we can prove that the language of each state is L(q) = Σ∗ . Given that there is an initial state, the automaton accepts Σ∗ . Note that the operations on sets performed in the above cases all terminate, because all involve orbit-finite sets. J I Proposition 5.2. The problem of determining whether a given nondeterministic nominal automaton is residual is undecidable. Proof. The construction is inspired by [14, Proposition 8.4].8 We show undecidability by reducing the universality problem for nominal automata to the residuality problem. Let A = (Σ, Q, I, F, δ) be a nominal (nondeterministic) automaton on the alphabet Σ. We first extend the alphabet:  Σ0 = Σ ∪ q | q ∈ Q ∪ {q | q ∈ Q} ∪ {$, #} , where we assume the new symbols to be disjoint from Σ. We define A0 = (Σ0 , Q0 , I 0 , F 0 , δ 0 ) by  Q0 = {q | q ∈ Q} ∪ q | q ∈ Q ∪ {>, x, y}  I 0 = q | q ∈ Q ∪ {x, y} F 0 = {q | q ∈ F } ∪ {>}   δ 0 = {(q, a, q 0 | (q, a, q 0 ) ∈ δ} ∪ (q, q, q) | q ∈ Q ∪ (q, q, q) | q ∈ Q  ∪ {(x, $, >), (x, #, x), (y, #, y)}∪ {(>, a, >) | a ∈ Σ} ∪ (y, $, i) | i ∈ I See Figure 7 for a sketch of the automaton A0 . The blue part is a copy of the original automaton. The red part forces the original states to be residual, by providing anchors to each state. Finally the orange part is the interesting part. The key players are states x and y with their languages L(y) ⊆ L(x). Note that their languages are equal if and only if A is universal. Before we assume anything about A, let us analyse A0 . In particular, let us consider whether the residuality property holds for each state. For the original states of A the property holds, as we can provide anchors: All the states q and q are anchored by the words q and q respectively. Then we consider the states x and >, their languages are L(>) = Σ∗ = $−1 L(A0 ) and L(x) = #−1 L(A0 ) (see Figure 7). The only remaining state for which we do not yet know whether the residuality property holds is state y. If L(A) = Σ∗ (i.e. the original automaton is universal), then we note that L(y) = L(x). In this case, L(y) = #−1 L(A0 ). So, in this case, A0 is residual. 8 They prove that checking residuality for NFAs is PSpace-complete via a reduction from universality. Instead of using NFAs, they use a union of n DFAs. This would not work in the nominal setting. CONCUR 2020 44:20 Residual Nominal Automata # # x y q A $ $ q q q p $ > p Σ p p Figure 7 Sketch of the automaton A0 constructed in the proof of Proposition 5.2. Suppose that A0 is residual. Then L(y) = w−1 L0 for some word w. Provided that L(A) is not empty, there is some u ∈ L(A). So we know that $u ∈ L(y). This means that word w cannot start with a ∈ Σ, q, q for q ∈ Q, or $ as their derivatives do not contain $u. The only possibility is that w = #k for some k > 0. This implies L(y) = L(x), meaning that the language of A is universal. This proves that A is universal iff A0 is residual. Moreover, the construction A 7→ A0 is effective, as it performs computations with orbit-finite sets. J I Theorem 6.4. There is an algorithm which query learns residual nominal languages. Proof. As explained in the text, we modify the νNL? algorithm from [28]: When the table is not closed, we not only add the missing words, but all the words of the same length. This guarantees that the algorithm finds rows for all join-irreducible derivatives, i.e., all states of the canonical residual automaton. The pseudocode is given in Algorithm 1, where the modifications to νNL? are highlighted in red. We briefly explain the notation. An observation table T is defined by a set of row (resp. column) indices S (resp. E). The value T (s, e) is given by L(se) (we may do this via membership queries). We denote the set of rows by Rows(S, E) := {row(s) | s ∈ SΣ ∪ S}, Algorithm 1 Modified nominal NL? algorithm for Theorem 6.4. Modified νNL? learner 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 S, E = {} repeat while (S, E) is not residually-closed or not residually-consistent if (S, E) is not residually-closed find s ∈ S, a ∈ A such that row(sa) ∈ JI(Rows(S, E)) \ Rows> (S, E) k = length of the word sa S = S ∪ Σ≤k if (S, E) is not residually-consistent find s1 , s2 ∈ S, a ∈ A, and e ∈ E such that row(s1 ) v row(s2 ) and L(s1 ae) = 1, L(s2 ae) = 0 E = E ∪ orb(ae) Make the conjecture N (S, E) if the Teacher replies no, with a counter-example t E = E ∪ {orb(t0 ) | t0 is a suffix of t} until the Teacher replies yes to the conjecture N (S, E). return N (S, E) J. Moerman and M. Sammartino 44:21 where row(s)(e) = T (s, e). Note that Rows(S, E) also includes rows for one-letter extensions. The set of rows labelled by S is denoted by Rows> (S, E) := {row(s) | s ∈ S}. The set Rows(S, E) is a poset, ordered by r1 v r2 iff r1 (e) ≤ r2 (e) for all e ∈ E. To construct a hypothesis N (S, E), we use the construction from Theorem 4.10, where Rows(S, E) plays the role of Der(L). We can give a bound to the number of equivalence queries. Given an orbit-finite nominal set X, let |X| be the number of its orbit. Then equivalence queries are bounded by O(m + |Σ≤m+1 | × k), where m is the length of the longest characterising word and k is the maximum support size of the canonical residual automaton. Intuitively, each of the rows in the table could be a separate state, and for each state there is some work to be done, concerning learning the right support and local symmetries (see [27] for details on this). J CONCUR 2020