A Congruence-based Perspective on Automata Minimization Algorithms
AA Congruence-based Perspective on AutomataMinimization Algorithms
Pierre Ganty
IMDEA Software Institute, Madrid, [email protected]
Elena Gutiérrez
IMDEA Software Institute, Madrid, SpainUniversidad Politécnica de Madrid, [email protected]
Pedro Valero
IMDEA Software Institute, Madrid, SpainUniversidad Politécnica de Madrid, [email protected]
Abstract
In this work we use a framework of finite-state automata constructions based on equivalences overwords to provide new insights on the relation between well-known methods for computing theminimal deterministic automaton of a language.
Theory of computation → Formal languages and automata theory;Theory of computation → Regular languages
Keywords and phrases
Double-Reversal Method, Minimization, Automata, Congruences, RegularLanguages
Digital Object Identifier
Funding
Pierre Ganty : Supported by the Spanish Ministry of Economy and Competitiveness projectNo. PGC2018-102210-B-I00, BOSCO - Foundations for the development, analysis and understandingof BlOck chains and Smart COntracts, by the Madrid Regional Government project No. S2018/TCS-4339, BLOQUES - Contratos inteligentes y Blockchains Escalables y Seguros mediante Verificacióny Análisis, and by a Ramón y Cajal fellowship RYC-2016-20281.
Elena Gutiérrez : Supported by BES-2016-077136 grant from the Spanish Ministry of Economy,Industry and Competitiveness.
In this paper we consider the problem of building the minimal deterministic finite-stateautomaton generating a given regular language. This is a classical issue that arises in manydifferent areas of computer science such as verification, regular expression searching andnatural language processing, to name a few.There exists a number of methods, such as Hopcroft’s [9] and Moore’s algorithms [13],that receive as input a deterministic finite-state automaton (DFA for short) generating alanguage and build the minimal DFA for that language. In general, these methods rely oncomputing a partition of the set of states of the input DFA which is then used as the set ofstates of the minimal DFA.On the other hand, Brzozowski [4] proposed the double-reversal method for building theminimal DFA for the language generated by an input non-deterministic automaton (NFA forshort). This algorithm alternates a reverse operation and a determinization operation twice,relying on the fact that, for any given NFA N , if the reverse automaton of N is determ-inistic then the determinization operation yields the minimal DFA for the language of N . © Pierre Ganty and Elena Gutiérrez and Pedro Valero;licensed under Creative Commons License CC-BY44th International Symposium on Mathematical Foundations of Computer Science (MFCS 2019).Editors: Peter Rossmanith, Pinar Heggernes, and Joost-Pieter Katoen; Article No. 50; pp. 50:1–50:22Leibniz International Proceedings in InformaticsSchloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany a r X i v : . [ c s . F L ] J un This method has been recently generalized by Brzozowski and Tamm [5]. They showedthe following necessary and sufficient condition : the determinization operation yields theminimal DFA for the language of N if and only if the reverse automaton of N is atomic .It is well-known that all these approaches to the DFA minimization problem aim tocompute Nerode’s equivalence relation for the considered language. However, the double-reversal method and its later generalization appear to be quite isolated from other methodssuch as Hopcroft’s and Moore’s algorithms. This has led to different attempts to better explainBrzozowski’s method [3] and its connection with other minimization algorithms [1, 7, 15].We use a framework of automata constructions based on equivalence classes over words togive new insights on the relation between these algorithms.In this paper we consider equivalence relations over words on an alphabet Σ that inducefinite partitions over Σ ∗ . Furthermore, we require that these partitions are well-behavedwith respect to concatenation, namely, congruences . Given a regular language L and anequivalence relation satisfying these conditions, we use well-known automata constructionsthat yield automata generating the language L [6, 12]. In this work, we consider two typesof equivalence relations over words verifying the required conditions.First, we define a language-based equivalence , relative to a regular language, that behaveswell with respect to right concatenation, also known as the right Nerode’s equivalencerelation for the language. When applying the automata construction to the right Nerode’sequivalence, we obtain the minimal DFA for the given language [6, 12]. In addition, wedefine an automata-based equivalence , relative to an NFA. When applying the automataconstruction to the automata-based equivalence we obtain a determinized version of theinput NFA.On the other hand, we also obtain counterpart automata constructions for relationsthat are well-behaved with respect to left concatenation. In this case, language-based andautomata-based equivalences yield, respectively, the minimal co-deterministic automatonand a co-deterministic NFA for the language.The relation between the automata constructions resulting from the language-basedand the automata-based congruences, together with the the duality between right and leftcongruences, allows us to relate determinization and minimization operations. As a result,we formulate a sufficient and necessary condition that guarantees that determinizing anautomaton yields the minimal DFA. This formulation evidences the relation between thedouble-reversal and the state partition refinement minimization methods.We start by giving a simple proof of Brzozowski’s double-reversal method [4], to lateraddress the generalization of Brzozowski and Tamm [5]. Furthermore, we relate the iterationsof Moore’s partition refinement algorithm, which works on the states of the input DFA, tothe iterations of the greatest fixpoint algorithm that builds the right Nerode’s partition onwords. We conclude by relating the automata constructions introduced by Brzozowski andTamm [5], named the átomaton and the partial átomaton , to the automata constructionsdescribed in this work. Structure of the paper.
After preliminaries in Section 2, we introduce in Section 3 theautomata constructions based on congruences on words and establish the duality between theseconstructions when using right and left congruences. Then, in Section 4, we define language-based and automata-based congruences and analyze the relations between the resultingautomata constructions. In Section 5, we study a collection of well-known constructions forthe minimal DFA. Finally, we give further details on related work in Section 6. For spacereasons, missing proofs are deferred to the Appendix. . Ganty and E. Gutiérrez and P.Valero 50:3
Languages.
Let Σ be a finite nonempty alphabet of symbols. Given a word w ∈ Σ ∗ , w R denotes the reverse of w . Given a language L ⊆ Σ ∗ , L R def = { w R | w ∈ L } denotes the reverselanguage of L . We denote by L c the complement of the language L . The left (resp. right)quotient of L by a word u is defined as the language u − L def = { x ∈ Σ ∗ | ux ∈ L } (resp. Lu − def = { x ∈ Σ ∗ | xu ∈ L } ). Automata. A (nondeterministic) finite-state automaton (NFA for short), or simply auto-maton , is a 5-tuple N = ( Q, Σ , δ, I, F ), where Q is a finite set of states , Σ is an alphabet, I ⊆ Q are the initial states, F ⊆ Q are the final states, and δ : Q × Σ → ℘ ( Q ) is the transition function. We denote the extended transition function from Σ to Σ ∗ by ˆ δ . Given S, T ⊆ Q , W N S,T def = { w ∈ Σ ∗ | ∃ q ∈ S, q ∈ T : q ∈ ˆ δ ( q, w ) } . In particular, when S = { q } and T = F , we define the right language of state q as W N q,F . Likewise, when S = I and T = { q } ,we define the left language of state q as W N I,q . We define post N w ( S ) def = { q ∈ Q | w ∈ W N S,q } andpre N w ( S ) def = { q ∈ Q | w ∈ W N q,S } . In general, we omit the automaton N from the superscriptwhen it is clear from the context. We say that a state q is unreachable iff W N I,q = ∅ and we saythat q is empty iff W N q,F = ∅ . Finally, note that L ( N ) = S q ∈ I W N q,F = S q ∈ F W N I,q = W N I,F .Given an NFA N = ( Q, Σ , δ, I, F ), the reverse NFA for N , denoted by N R , is defined as N R = ( Q, Σ , δ r , F, I ) where q ∈ δ r ( q , a ) iff q ∈ δ ( q, a ). Clearly, L ( N ) R = L ( N R ).A deterministic finite-state automaton (DFA for short) is an NFA such that, I = { q } ,and, for every state q ∈ Q and every symbol a ∈ Σ, there exists exactly one q ∈ Q suchthat δ ( q, a ) = q . According to this definition, DFAs are always complete , i.e., they define atransition for each state and input symbol. In general, we denote NFAs by N , using D forDFAs when the distinction is important. A co-deterministic finite-state automata (co-DFAfor short) is an NFA N such that N R is deterministic. In this case, co-DFAs are always co-complete , i.e., for each target state q and each input symbol, there exists a source state q such that δ ( q, a ) = q . Recall that, given an NFA N = ( Q, Σ , δ, I, F ), the well-known subsetconstruction builds a DFA D = ( ℘ ( Q ) , Σ , δ d , { I } , F d ) where F d = { S ∈ ℘ ( Q ) | S ∩ F = ∅} and δ d ( S, a ) = { q | ∃ q ∈ S, q ∈ δ ( q, a ) } for every a ∈ Σ, that accepts the same language as N [10]. Given an NFA N = ( Q, Σ , δ, I, F ), we denote by N D the DFA that results fromapplying the subset construction to N where only subsets (including the empty subset) thatare reachable from the initial subset of N D are used. Then, N D possibly contains emptystates but no state is unreachable. A DFA for the language L ( N ) is minimal , denoted by N DM , if it has no unreachable states and no two states have the same right language. Theminimal DFA for a regular language is unique modulo isomorphism. Equivalence Relations and Partitions.
Recall that an equivalence relation on a set X is abinary relation ∼ that is reflexive, symmetric and transitive. Every equivalence relation ∼ on X induces a partition P ∼ of X , i.e., a family P ∼ = { B i } i ∈I ⊆ ℘ ( X ) of subsets of X , with I ⊆ N , such that: (i) B i = ∅ for all i ∈ I ; (ii) B i ∩ B j = ∅ , for all i, j ∈ I with i = j ; and (iii) X = S i ∈I B i .We say that a partition is finite when I is finite. Each B i is called a block of the partition.Given u ∈ X , then P ∼ ( u ) denotes the unique block that contains u and corresponds to the equivalence class u w.r.t. ∼ , P ∼ ( u ) def = { v ∈ X | u ∼ v } . This definition can be extendedin a natural way to a set S ⊆ X as P ∼ ( S ) def = S u ∈ S P ∼ ( u ). We say that the partition P ∼ M F C S 2 0 1 9 represents precisely S iff P ∼ ( S ) = S . An equivalence relation ∼ is of finite index iff ∼ defines a finite number of equivalence classes, i.e., the induced partition P ∼ is finite. In thefollowing, we will always consider equivalence relations of finite index, i.e., finite partitions.Finally, denote P art ( X ) the set of partitions of X . We use the standard refinementordering (cid:22) between partitions: let P , P ∈ P art ( X ), then P (cid:22) P iff for every B ∈ P thereexists B ∈ P such that B ⊆ B . Then, we say that P is finer than P (or equivalently, P is coarser than P ). Given P , P ∈ P art ( X ), define the coarsest common refinement ,denoted by P (cid:102) P , as the coarsest partition P ∈ P art ( X ) that is finer than both P and P .Likewise, define the finest common coarsening , denoted by P (cid:103) P , as the finest partition P that is coarser than both P and P . Recall that ( P art ( X ) , (cid:22) , (cid:103) , (cid:102) ) is a complete latticewhere the top (coarsest) element is { X } and the bottom (finest) element is {{ x } | x ∈ X } . We will consider equivalence relations on Σ ∗ (and their corresponding partitions) with goodproperties w.r.t. concatenation. An equivalence relation ∼ is a right (resp. left) congruence iff for all u, v ∈ Σ ∗ , we have that u ∼ v ⇒ ua ∼ va , for all a ∈ Σ (resp. u ∼ v ⇒ au ∼ av ).We will denote right congruences (resp. left congruences) by ∼ r (resp. ∼ ‘ ). The followinglemma gives a characterization of right and left congruences. (cid:73) Lemma 1.
The following properties hold: ∼ r is a right congruence iff P ∼ r ( v ) u ⊆ P ∼ r ( vu ) , for all u, v ∈ Σ ∗ . ∼ ‘ is a left congruence iff uP ∼ ‘ ( v ) ⊆ P ∼ ‘ ( uv ) , for all u, v ∈ Σ ∗ . Given a right congruence ∼ r and a regular language L ⊆ Σ ∗ such that P ∼ r representsprecisely L , i.e., P ∼ r ( L ) = L , the following automata construction recognizes exactly thelanguage L [12]. (cid:73) Definition 2 (Automata construction H r ( ∼ r , L ) ) . Let ∼ r be a right congruence and let P ∼ r be the partition induced by ∼ r . Let L ⊆ Σ ∗ be a language. Define the automaton H r ( ∼ r , L ) =( Q, Σ , δ, I, F ) where Q = { P ∼ r ( u ) | u ∈ Σ ∗ } , I = { P ∼ r ( ε ) } , F = { P ∼ r ( u ) | u ∈ L } , and δ ( P ∼ r ( u ) , a ) = P ∼ r ( v ) iff P ∼ r ( u ) a ⊆ P ∼ r ( v ) , for all u, v ∈ Σ ∗ and a ∈ Σ . (cid:73) Remark 3.
Note that H r ( ∼ r , L ) is finite since we assume ∼ r is of finite index. Note alsothat H r ( ∼ r , L ) is a complete deterministic finite-state automaton since, for each u ∈ Σ ∗ and a ∈ Σ, there exists exactly one block P ∼ r ( v ) such that P ∼ r ( u ) a ⊆ P ∼ r ( v ), which is P ∼ r ( ua ).Finally, observe that H r ( ∼ r , L ) possibly contains empty states but no state is unreachable. (cid:73) Lemma 4.
Let ∼ r be a right congruence and let L ⊆ Σ ∗ be a language such that P ∼ r ( L ) = L .Then L ( H r ( ∼ r , L )) = L . Due to the left-right duality between ∼ ‘ and ∼ r , we can give a similar automata con-struction such that, given a left congruence ∼ ‘ and a language L ⊆ Σ ∗ with P ∼ ‘ ( L ) = L ,recognizes exactly the language L . (cid:73) Definition 5 (Automata construction H ‘ ( ∼ ‘ , L ) ) . Let ∼ ‘ be a left congruence and let P ∼ ‘ be the partition induced by ∼ ‘ . Let L ⊆ Σ ∗ be a language. Define the automaton H ‘ ( ∼ ‘ , L ) =( Q, Σ , δ, I, F ) where Q = { P ∼ ‘ ( u ) | u ∈ Σ ∗ } , I = { P ∼ ‘ ( u ) | u ∈ L } , F = { P ∼ ‘ ( ε ) } , and P ∼ ‘ ( v ) ∈ δ ( P ∼ ‘ ( u ) , a ) iff aP ∼ ‘ ( v ) ⊆ P ∼ ‘ ( u ) , for all u, v ∈ Σ ∗ and a ∈ Σ . (cid:73) Remark 6.
In this case, H ‘ ( ∼ ‘ , L ) is a co-complete co-deterministic finite-state auto-maton since, for each v ∈ Σ ∗ and a ∈ Σ, there exists exactly one block P ∼ ‘ ( u ) such that . Ganty and E. Gutiérrez and P.Valero 50:5 aP ∼ ‘ ( v ) ⊆ P ∼ ‘ ( u ), which is P ∼ ‘ ( av ). Finally, observe that H ‘ ( ∼ ‘ , L ) possibly containsunreachable states but no state is empty. (cid:73) Lemma 7.
Let ∼ ‘ be a left congruence and let L ⊆ Σ ∗ be a language such that P ∼ ‘ ( L ) = L .Then L ( H ‘ ( ∼ ‘ , L )) = L . Lemma 8 shows that H ‘ and H r inherit the left-right duality between ∼ ‘ and ∼ r . (cid:73) Lemma 8.
Let ∼ r and ∼ ‘ be a right and left congruence respectively, and let L ⊆ Σ ∗ be alanguage. If the following property holds u ∼ r v ⇔ u R ∼ ‘ v R (1) then H r ( ∼ r , L ) is isomorphic to (cid:0) H ‘ ( ∼ ‘ , L R ) (cid:1) R . Given a language L ⊆ Σ ∗ , we recall the following equivalence relations on Σ ∗ , which areoften denoted as Nerode’s equivalence relations (e.g., see [12]). (cid:73)
Definition 9 (Language-based Equivalences) . Let u, v ∈ Σ ∗ and let L ⊆ Σ ∗ be a language.Define: u ∼ rL v ⇔ u − L = v − L Right- language-based Equivalence (2) u ∼ ‘L v ⇔ Lu − = Lv − Left- language-based Equivalence (3)Note that the right and left language-based equivalences defined above are, respectively,right and left congruences (for a proof, see Lemma 32 in the Appendix). Furthermore, when L is a regular language, ∼ rL and ∼ ‘L are of finite index [6, 12]. Since we are interested incongruences of finite index (or equivalently, finite partitions), we will always assume that L is a regular language over Σ.The following result states that, given a language L , the right Nerode’s equivalenceinduces the coarsest partition of Σ ∗ which is a right congruence and precisely represents L . (cid:73) Lemma 10 (de Luca and Varricchio [8]) . Let L ⊆ Σ ∗ be a regular language. Then, P ∼ rL = (cid:106) { P ∼ r | ∼ r is a right congruence and P ∼ r ( L ) = L } . In a similar way, one can prove that the same property holds for the left Nerode’sequivalence. Therefore, as we shall see, applying the construction H to these equivalencesyields minimal automata. However, computing them becomes unpractical since languagesare possibly infinite, even if they are regular. Thus, we will consider congruences based onthe states of the NFA-representation of the language which induce finer partitions of Σ ∗ than Nerode’s equivalences. In this sense, we say that the automata-based equivalences approximate Nerode’s equivalences. (cid:73)
Definition 11 (Automata-based Equivalences) . Let u, v ∈ Σ ∗ and let N = ( Q, Σ , δ, I, F ) bean NFA. Define: u ∼ r N v ⇔ post N u ( I ) = post N v ( I ) Right- automata-based Equivalence (4) u ∼ ‘ N v ⇔ pre N u ( F ) = pre N v ( F ) Left- automata-based Equivalence (5) M F C S 2 0 1 9
Note that the right and left automata-based equivalences defined above are, respectively,right and left congruences (for a proof, see Lemma 33 in the Appendix). Furthermore, theyare of finite index since each equivalence class is represented by a subset of states of N .The following result gives a sufficient and necessary condition for the language-based(Definition 9) and the automata-based equivalences (Definition 11) to coincide. (cid:73) Lemma 12.
Let N = ( Q, Σ , δ, I, F ) be an automaton with L = L ( N ) . Then, ∼ rL = ∼ r N iff ∀ u, v ∈ Σ ∗ , W N post N u ( I ) ,F = W N post N v ( I ) ,F ⇔ post N u ( I ) = post N v ( I ) . (6) In what follows, we will use
Min and
Det to denote the construction H when applied,respectively, to the language-based congruences induced by a regular language and theautomata-based congruences induced by an NFA. (cid:73) Definition 13.
Let N be an NFA generating the language L = L ( N ) . Define: Min r ( L ) def = H r ( ∼ rL , L ) Det r ( N ) def = H r ( ∼ r N , L ) Min ‘ ( L ) def = H ‘ ( ∼ ‘L , L ) Det ‘ ( N ) def = H ‘ ( ∼ ‘ N , L ) . Given an NFA N generating the language L = L ( N ), all constructions in the abovedefinition yield automata generating L . However, while the constructions using the rightcongruences result in DFAs, the constructions relying on left congruences result in co-DFAs. Furthermore, since the pairs of relations (2)-(3) and (4)-(5), from Definition 9 and 11respectively, are dual, i.e., they satisfy the hypothesis of Lemma 8, it follows that Min ‘ ( L ) isisomorphic to ( Min r ( L R )) R and Det ‘ ( N ) is isomorphic to ( Det r ( N R )) R .On the other hand, since Min r relies on the language-based congruences, the resultingDFA is minimal, which is not guaranteed to occur with Det r . This easily follows from thefact that the states of the automata constructions are the equivalence classes of the givencongruences and there is no right congruence (representing L precisely) that is coarser thanthe right Nerode’s equivalence (see Lemma 10).Finally, since every co-deterministic automaton satisfies the right-hand side of Equa-tion (6), it follows that determinizing ( Det r ) a co-deterministic automaton ( Det ‘ ( N )) resultsin the minimal DFA ( Min r ( L ( N ))), as already proved by Sakarovitch [14, Proposition 3.13].We formalize all these notions in Theorem 14. Finally, Figure 1 summarizes all thesewell-known connections between the automata constructions given in Definition 13. (cid:73) Theorem 14.
Let N be an NFA generating language L = L ( N ) . Then the followingproperties hold: (a) L ( Min r ( L )) = L ( Min ‘ ( L )) = L = L ( Det r ( N )) = L ( Det ‘ ( N )) . (b) Min r ( L ) is isomorphic to the minimal deterministic automaton for L . (c) Det r ( N ) is isomorphic to N D . (d) Min ‘ ( L ) is isomorphic to ( Min r ( L R )) R . (e) Det ‘ ( N ) is isomorphic to ( Det r ( N R )) R . (f) Det r ( Det ‘ ( N )) is isomorphic to Min r ( L ) . We can find in the literature several well-known independent techniques for the constructionof minimal DFAs. Some of these techniques are based on refining a state partition of an input . Ganty and E. Gutiérrez and P.Valero 50:7 N Det ‘ ( N ) Det r ( Det ‘ ( N )) N R Det r ( N R ) Det ‘ ( Det r ( N R )) R Det ‘ Min r R Det r R Det r Min ‘ Det ‘ The upper part of the diagram follows fromTheorem 14 (f). Both squares of the diagramfollow from Theorem 14 (e), which statesthat
Det ‘ ( N ) is isomorphic to ( Det r ( N R )) R .Finally, the bottom curved arc follows fromTheorem 14 (d). Incidentally, the diagramshows a new relation which follows from theleft-right dualities between ∼ ‘L and ∼ rL , and ∼ ‘ N and ∼ r N : Min ‘ ( L ( N R )) is isomorphic to Det ‘ ( Det r ( N R )). Figure 1
Relations between the constructions
Det ‘ , Det r , Min ‘ and Min r . Note that constructions Min r and Min ‘ are applied to the language generated by the automaton in the origin of the labeledarrow, while constructions Det r and Det ‘ are applied directly to the automaton. DFA, such as Moore’s algorithm [13], while others directly manipulate an input NFA, suchas the double-reversal method [4]. Now, we establish a connection between these algorithmsthrough Theorem 16, which gives a necessary and sufficient condition on an NFA so thatdeterminizing it yields the minimal DFA. (cid:73)
Lemma 15.
Let N = ( Q, Σ , δ, I, F ) be an NFA with L = L ( N ) and ∼ rL = ∼ r N . Then ∀ q ∈ Q, P ∼ rL ( W N I,q ) = W N I,q . Proof. P ∼ rL ( W N I,q ) = [By definition of P ∼ rL ] { w ∈ Σ ∗ | ∃ u ∈ W N I,q , w − L = u − L } = [Since ∼ rL = ∼ r N ] { w ∈ Σ ∗ | ∃ u ∈ W N I,q , post N w ( I ) = post N u ( I ) } ⊆ [ u ∈ W N I,q ⇐⇒ q ∈ post N u ( I )] { w ∈ Σ ∗ | q ∈ post N w ( I ) } = [By definition of W N I,q ] W N I,q . By reflexivity of ∼ rL , we conclude that P ∼ rL ( W N I,q ) = W N I,q . (cid:74)(cid:73) Theorem 16.
Let N = ( Q, Σ , δ, I, F ) be an NFA with L = L ( N ) . Then Det r ( N ) is theminimal DFA for L iff ∀ q ∈ Q, P ∼ rL ( W N I,q ) = W N I,q . Proof.
Assume
Det r ( N ) is minimal. Then P ∼ r N ( u ) = P ∼ rL ( u ) for all u ∈ Σ ∗ , i.e. ∼ rL = ∼ r N .It follows from Lemma 15 that P ∼ rL ( W N I,q ) = W N I,q .Now, assume that P ∼ rL ( W N I,q ) = W N I,q , for each q ∈ Q . Then, for every u ∈ Σ ∗ , P ∼ r N ( u ) = \ q ∈ post N u ( I ) W N I,q ∩ \ q / ∈ post N u ( I ) ( W N I,q ) c = \ q ∈ post N u ( I ) P ∼ rL ( W N I,q ) ∩ \ q / ∈ post N u ( I ) ( P ∼ rL ( W N I,q )) c where the first equality follows by rewriting P ∼ r N ( u ) = { v ∈ Σ ∗ | post N u ( I ) = post N v ( I ) } with universal quantifiers, hence intersections, and the last equality follows from the initialassumption P ∼ rL ( W N I,q ) = W N I,q .It follows that P ∼ r N ( u ) is a union of blocks of P ∼ rL . Recall that ∼ rL induces the coarsestright congruence such that P ∼ rL ( L ) = L (Lemma 10). Since ∼ r N is a right congruencesatisfying P ∼ r N ( L ) = L then P ∼ r N (cid:52) P ∼ rL . Therefore, P ∼ r N ( u ) necessarily corresponds to onesingle block of P ∼ rL , namely, P ∼ rL ( u ). Since P ∼ r N ( u ) = P ∼ rL ( u ) for each u ∈ Σ ∗ , we concludethat Det r ( N ) = Min r ( L ). (cid:74) M F C S 2 0 1 9
In this section we give a simple proof of the well-known double-reversal minimization algorithmof Brzozowski [4] using Theorem 16. Note that, since
Det r ( N ) is isomorphic to N D byTheorem 14 (c), the following result coincides with that of Brzozowski. (cid:73) Theorem 17 ([4]) . Let N be an NFA. Then Det r (( Det r ( N R )) R ) is isomorphic to theminimal DFA for L ( N ) . Proof.
Let L = L ( N ). By definition, N = ( Det r ( N R )) R is a co-DFA and, therefore, satisfiesthe condition on the right-hand side of Equation (6). It follows from Lemma 12 that ∼ rL = ∼ r N which, by Lemma 15 and Theorem 16, implies that Det r ( N ) is minimal. (cid:74) Note that Theorem 17 can be inferred from Figure 1 by following the path starting at N ,labeled with R − Det r − R − Det r and ending in Min r ( L ( N )). Brzozowski and Tamm [5] generalized the double-reversal algorithm by defining a necessaryand sufficient condition on an NFA which guarantees that the determinized automaton isminimal. They introduced the notion of atomic
NFA and showed that N D is minimal iff N R is atomic. We shall show that this result is equivalent to Theorem 16 due to the left-rightduality between the language-based equivalences (Lemma 8). (cid:73) Definition 18 (Atom [5]) . Let L be a regular language L . Let { K i | ≤ i ≤ n − } be the setof left quotients of L . An atom is any non-empty intersection of the form f K ∩ f K ∩ . . . ∩ (cid:94) K n − ,where each f K i is either K i or K ci . This notion of atom coincides with that of equivalence class for the left language-basedcongruence ∼ ‘L . This was first noticed by Iván [11]. (cid:73) Lemma 19.
Let L be a regular language. Then for every u ∈ Σ ∗ , P ∼ ‘L ( u ) = \ u ∈ w − Lw ∈ Σ ∗ w − L ∩ \ u/ ∈ w − Lw ∈ Σ ∗ ( w − L ) c . (cid:73) Definition 20 (Atomic NFA [5]) . An NFA N = ( Q, Σ , δ, I, F ) is atomic iff for every state q ∈ Q , the right language W N q,F is a union of atoms of L ( N ) . It follows from Lemma 19 that the set of atoms of a language L corresponds to the partition P ∼ ‘L . Therefore, a set S ⊆ Σ ∗ is a union of atoms iff P ∼ ‘L ( S ) = S . This property, togetherwith Definition 20, shows that an NFA N = ( Q, Σ , δ, I, F ) with L = L ( N ) is atomic iff ∀ q ∈ Q, P ∼ ‘L ( W N q,F ) = W N q,F . (7)We are now in condition to give an alternative proof of the generalization of Brzozowskiand Tamm [5] relying on Theorem 16. (cid:73) Lemma 21.
Let N = ( Q, Σ , δ, I, F ) be an NFA with L = L ( N ) . Then N R is atomic iff Det r ( N ) is the minimal DFA for L . . Ganty and E. Gutiérrez and P.Valero 50:9 Proof.
Let N R = ( Q, Σ , δ r , F, I ) and L R = L ( N R ). Then, ∀ q ∈ Q, P ∼ ‘LR ( W N R q,I ) = W N R q,I ⇐⇒ [By A = B ⇔ A R = B R ] ∀ q ∈ Q, (cid:16) P ∼ ‘LR ( W N R q,I ) (cid:17) R = (cid:16) W N R q,I (cid:17) R ⇐⇒ [By u ∼ ‘L v ⇔ u R ∼ rL R v R ] ∀ q ∈ Q, P ∼ rL (cid:18)(cid:16) W N R q,I (cid:17) R (cid:19) = (cid:16) W N R q,I (cid:17) R ⇐⇒ [By (cid:16) W N R q,I (cid:17) R = W N I,q ] ∀ q ∈ Q, P ∼ rL ( W N I,q ) = W N I,q . It follows from Theorem 16 that
Det r ( N ) is minimal. (cid:74) We conclude this section by collecting all the conditions described so far that guaranteethat determinizing an automaton yields the minimal DFA. (cid:73)
Corollary 22.
Let N = ( Q, Σ , δ, I, F ) be an NFA with L = L ( N ) . The following areequivalent: (a) Det r ( N ) is minimal. (b) ∼ r N = ∼ rL . (c) ∀ u, v ∈ Σ ∗ , W N post N u ( I ) ,F = W N post N v ( I ) ,F ⇔ post N u ( I ) = post N v ( I ) . (d) ∀ q ∈ Q, P ∼ rL ( W N I,q ) = W N I,q . (e) N R is atomic. Given a DFA D , Moore [13] builds the minimal DFA for the language L = L ( D ) by removingunreachable states from D and then performing a stepwise refinement of an initial partitionof the set of reachable states of D . Since we are interested in the refinement step, in whatfollows we assume that all DFAs have no unreachable states. In this section, we will describeMoore’s state-partition Q D and the right-language-based partition P ∼ rL as greatest fixpointcomputations and show that there exists an isomorphism between the two at each step ofthe fixpoint computation. In fact, this isomorphism shows that Moore’s DFA M satisfies P ∼ rL ( W MI,q ) = W MI,q for every state q . Thus, by Theorem 16, M is isomorphic to Min r ( L ( D )).First, we give Moore’s algorithm which computes the state-partition that is later used todefine Moore’s DFA. Moore’s Algorithm:
Algorithm for constructing Moore’s partition.
Data:
DFA D = h Q, Σ , δ, I, F i with L = L ( D ). Result: Q D ∈ P art ( Q ). Q D := { F, F c } , Q := ∅ ; while Q D = Q do Q := Q D ; forall a ∈ Σ do Q a := (cid:99) p ∈Q D { pre D a ( p ) , (pre D a ( p )) c } ; Q D := Q D (cid:102) (cid:99) a ∈ Σ Q a ; return Q D ; (cid:73) Definition 23 (Moore’s DFA) . Let D = ( Q, Σ , δ, I, F ) be a DFA, and let Q D be the partitionof Q built by using Moore’s algorithm. Moore’s DFA for L ( D ) is M = ( Q M , Σ , δ M , I M , F M ) where Q M = Q D , I M = {Q D ( q ) | q ∈ I } , F M = {Q D ( q ) | q ∈ F } and, for each S, S ∈ Q M and a ∈ Σ , we have that δ M ( S, a ) = S iff ∃ q ∈ S, q ∈ S with δ ( q, a ) = q . M F C S 2 0 1 9
Next, we describe Moore’s state-partition Q D and the right-language-based partition P ∼ rL as greatest fixpoint computations and show that there exists an isomorphism betweenthe two at each step of the fixpoint computation. (cid:73) Definition 24 (Moore’s state-partition) . Let D = ( Q, Σ , δ, I, F ) be a DFA. Define Moore’sstate-partition w.r.t. D , denoted by Q D , as follows. Q D def = gfp( λX. (cid:107) a ∈ Σ ,S ∈ X { pre a ( S ) , (pre a ( S )) c } (cid:102) { F, F c } ) . On the other hand, by Theorem 14 (b), each state of the minimal DFA for L correspondsto an equivalence class of ∼ rL . These equivalence classes can be defined in terms of non-emptyintersections of complemented or uncomplemented right quotients of L . (cid:73) Lemma 25.
Let L be a regular language. Then, for every u ∈ Σ ∗ , P ∼ rL ( u ) = \ u ∈ Lw − w ∈ Σ ∗ Lw − ∩ \ u/ ∈ Lw − w ∈ Σ ∗ ( Lw − ) c . It follows from Lemma 25 that P ∼ rL = (cid:99) w ∈ Σ ∗ { Lw − , ( Lw − ) c } , for every regular language L . Thus, P ∼ rL can also be obtained as a greatest fixpoint computation as follows. (cid:73) Lemma 26.
Let L be a regular language. Then P ∼ rL = gfp( λX. (cid:107) a ∈ Σ ,B ∈ X { Ba − , ( Ba − ) c } (cid:102) { L, L c } ) . (8)The following result shows that, given a DFA D with L = L ( D ), there exists a partitionisomorphism between Q D and P ∼ rL at each step of the fixpoint computations given inDefinition 24 and Lemma 26 respectively. (cid:73) Theorem 27.
Let D = ( Q, Σ , δ, I, F ) be a DFA with L = L ( D ) and let ϕ : ℘ ( Q ) → ℘ (Σ ∗ ) be a function defined by ϕ ( S ) def = W D I,S . Let Q D ( n ) and P ( n ) ∼ rL be the n -th step of the fixpointcomputation of Q D (Definition 24) and P ∼ rL (Lemma 26), respectively. Then, ϕ is anisomorphism between Q D ( n ) and P ( n ) ∼ rL for each n ≥ . Proof.
In order to show that ϕ is a partition isomorphism, it suffices to prove that ϕ is abijective mapping between the partitions. We first show that ϕ ( Q D ( n ) ) = P ( n ) ∼ rL , for every n ≥
0. Thus, the mapping ϕ is surjective. Secondly, we show that ϕ is an injective mappingfrom Q D ( n ) to P ( n ) ∼ rL . Therefore, we conclude that ϕ is a bijection.To show that ϕ ( Q D ( n ) ) = P ( n ) ∼ rL , for each n ≥
0, we proceed by induction.
Base case:
By definition, Q D (0) = { F, F c } and P (0) ∼ rL = { L, L c } . Since D is deterministic(and complete), it follows that ϕ ( F ) = W D I,F = L and ϕ ( F c ) = W D I,F c = L c . Inductive step:
Before proceeding with the inductive step, we show that the followingequations hold for each a, b ∈ Σ and
S, S i , S j ∈ Q D ( n ) with n ≥ ϕ (pre a ( S ) c ) = (( W D I,S ) a − ) c (9) ϕ (pre a ( S i ) ∩ pre b ( S j )) = ( W D I,S i ) a − ∩ ( W D I,S j ) b − . (10) . Ganty and E. Gutiérrez and P.Valero 50:11 For each S ∈ Q D ( n ) and a ∈ Σ we have that: ϕ (pre a ( S ) c ) = [By definition of ϕ ] W D I, pre a ( S ) c = [ I = { q } and def. of W D I, pre a ( S ) c ] { w ∈ Σ ∗ | ∃ q ∈ pre a ( S ) c , q = ˆ δ ( q , w ) } = [ D is deterministic and complete] { w ∈ Σ ∗ | ∃ q ∈ pre a ( S ) , q = ˆ δ ( q , w ) } c = [By definition of pre a ( S )] { w ∈ Σ ∗ | ∃ q ∈ S, q = ˆ δ ( q , wa ) } c = [By definition of ( W D I,S ) a − ](( W D I,S ) a − ) c . Therefore Equation (9) holds at each step of the fixpoint computation. Consider nowEquation (10). Let S i , S j ∈ Q D ( n ) . Then, ϕ (pre a ( S i ) ∩ pre b ( S j )) = [By Def. ϕ ] W D I, (pre a ( S i ) ∩ pre b ( S j )) = [ I = { q } and def. W I,S ] { w ∈ Σ ∗ | ∃ q ∈ pre a ( S i ) ∩ pre b ( S j ) , q = ˆ δ ( q , w ) } = [By Def. of ∩ ] { w ∈ Σ ∗ | ∃ q ∈ pre a ( S i ) , q ∈ pre b ( S j ) , q = ˆ δ ( q , w ) } = [ D is deterministic] W D I, pre a ( S i ) ∩ W D I, pre b ( S j ) = [By Def. of ( W D I,S ) a − ]( W D I,S i ) a − ∩ ( W I,S j ) b − . Therefore Equation (10) holds at each step of the fixpoint computation.Let us assume that ϕ (cid:0) Q D ( n ) (cid:1) = P ( n ) ∼ rL for every n ≤ k with k >
0. Then, ϕ (cid:0) Q D ( k +1) (cid:1) = [By Def. 24 with X = Q D ( k ) ] ϕ (cid:0) (cid:107) a ∈ Σ ,S ∈ X { pre a ( S ) , pre a ( S ) c } (cid:102) { F, F c } (cid:1) = [By Eqs. (9), (10) and def. of (cid:107) ] (cid:107) a ∈ Σ ϕ ( S ) ∈ ϕ ( X ) { ( W D I,S ) a − , (( W D I,S ) a − ) c } (cid:102) { L, L c } = [By induction hypothesis, ϕ ( X ) = P ( k ) ∼ rL ] (cid:107) a ∈ Σ ,B ∈ X { Ba − , ( Ba − ) c } (cid:102) { L, L c } = [By Lemma 26 with X = P ( k ) ∼ rL ] P ( k +1) ∼ rL . Finally, since D is a DFA then, for each S i , S j ∈ Q D ( n ) ( n ≥
0) with S i = S j we have that W D I,S i = W D I,S j , i.e., ϕ ( S i ) = ϕ ( S j ). Therefore, ϕ is an injective mapping. (cid:74)(cid:73) Corollary 28.
Let D be a DFA with L = L ( D ) . Let Q D ( n ) and P ( n ) ∼ rL be the n -th step ofthe fixpoint computation of Q D and P ∼ rL respectively. Then, for each n ≥ , P ( n ) ∼ rL ( W D I,S ) = W D I,S , for each S ∈ Q D ( n ) . It follows that Moore’s DFA M , whose set of states corresponds to the state-partition at theend of the execution of Moore’s algorithm, satisfies that ∀ q ∈ Q M , P ∼ rL ( W MI,q ) = W MI,q with L = L ( M ). By Theorem 16, we have that Det r ( M )(= M , since M is a DFA) is minimal. (cid:73) Theorem 29.
Let D be a DFA and M be Moore’s DFA for L ( D ) as in Definition 23.Then, M is isomorphic to Min r ( L ( D )) . M F C S 2 0 1 9
Finally, recall that Hopcroft [9] defined a DFA minimization algorithm which offers betterperformance than Moore’s. The ideas used by Hopcroft can be adapted to our framework todevise a new algorithm from computing P ∼ rL . However, by doing so, we could not derive abetter explanation than the one provided by Berstel et al. [2]. Brzozowski and Tamm [5] showed that every regular language defines a unique NFA, whichthey call átomaton . The átomaton is built upon the minimal DFA N DM for the language,defining its states as non-empty intersections of complemented or uncomplemented rightlanguages of N DM , i.e., the atoms of the language. They also observed that the atomscorrespond to intersections of complemented or uncomplemented left quotients of the language.Then they proved that the átomaton is isomorphic to the reverse automaton of the minimaldeterministic DFA for the reverse language.Intuitively, the construction of the átomaton based on the right languages of the minimalDFA corresponds to Det ‘ ( N DM ), while its construction based on left quotients of the languagecorresponds to Min ‘ ( L ( N )). (cid:73) Corollary 30.
Let N DM be the minimal DFA for a regular language L . Then, (a) Det ‘ ( N DM ) is isomorphic to the átomaton of L . (b) Min ‘ ( L ) is isomorphic to the átomaton of L . In the same paper, they also defined the notion of partial átomaton which is built uponan NFA N . Each state of the partial atomaton is a non-empty intersection of complementedor uncomplemented right languages of N , i.e., union of atoms of the language. Intuitively,the construction of the partial átomaton corresponds to Det ‘ ( N ). (cid:73) Corollary 31.
Let N be an NFA. Then, Det ‘ ( N ) is isomorphic to the partial átomaton of N . Finally, they also presented a number of results [5, Theorem 3] related to the átomaton A of a minimal DFA D with L = L ( D ): A is isomorphic to D RDR . A R is the minimal DFA for L R A D is the minimal DFA for L . A is isomorphic to N RDMR for every NFA N accepting L .All these relations can be inferred from Figure 2 which connects all the automata con-structions described in this paper together with the constructions introduced by Brzozowskiand Tamm. For instance, property 1 corresponds to the path starting at N DM (the minimalDFA for L ( N )), labeled with R − Det r − R , and ending in the átomaton of L ( N ). On theother hand, property 4 corresponds to the path starting at N , labeled with R − Min r − R andending in the átomaton of L ( N ). Finally, the path starting at N , labeled with R − Det r − R and ending in the partial átomaton of N shows that the later is isomorphic to N RDR .In conclusion, we establish a connection between well-known independent minimizationmethods through Theorem 16. Given a DFA, the left languages of its states form a partitionon words, P , and thus, each left language is identified by a state. Intuitively, Moore’salgorithm merges states to enforce the condition of Theorem 16, which results in mergingblocks of P that belong to the same Nerode’s equivalence class. Note that Hopcroft’s partitionrefinement method [9] achieves the same goal at the end of its execution though, stepwise,the partition computed may differ from Moore’s. On the other hand, any co-deterministic . Ganty and E. Gutiérrez and P.Valero 50:13 N Partial átomatonof N N DM Átomatonof L ( N ) N R N RD Átomatonof L ( N R ) N RDM
Det ‘ ; C. R Min r ; T. b ) Min ‘ ; T. d ) Det r ; T. c ) R R
Det ‘ ; C. a ) R Det r ; T. f ) Det r ; T. c ) Min r ; T. b ) Min ‘ ; C. b ) Det ‘ ; T. e ) Det r ; T. c ) Det ‘ ; C. a ) Figure 2
Extension of the diagram of Figure 1 including the átomaton and the partial átomaton.Recall that N DM is the minimal DFA for L ( N ). The results referenced in the labels are thosejustifying the output of the operation. NFA satisfies the right-hand side of Equation (6) hence, by Lemma 15, satisfies the conditionof Theorem 16. Therefore, the double-reversal method, which essentially determinizes aco-determinized NFA, yields the minimal DFA. Finally, the left-right duality (Lemma 8) ofthe language-based equivalences shows that the condition of Theorem 16 is equivalent tothat of Brzozowski and Tamm [5].Some of these connections have already been studied in order to offer a better under-standing of Brzozowski’s double-reversal method [1, 3, 7, 15]. In particular, Adámek et al. [1]and Bonchi et al. [3] offer an alternative view of minimization and determinization methodsin a uniform way from a category-theoretical perspective. In contrast, our work revisits thesewell-known minimization techniques relying on simple language-theoretical notions.
References Jirí Adámek, Filippo Bonchi, Mathias Hülsbusch, Barbara König, Stefan Milius, and AlexandraSilva. A coalgebraic perspective on minimization and determinization. In
FoSSaCS , volume7213 of
Lecture Notes in Computer Science , pages 58–73. Springer, 2012. Jean Berstel, Luc Boasson, Olivier Carton, and Isabelle Fagnot. Minimization of automata,2010. arXiv:1010.5318 . Filippo Bonchi, Marcello M. Bonsangue, Helle Hvid Hansen, Prakash Panangaden, Jan J.M. M. Rutten, and Alexandra Silva. Algebra-coalgebra duality in Brzozowski’s minimizationalgorithm.
ACM Trans. Comput. Log. , 15(1):3:1–3:29, 2014. Janusz A. Brzozowski. Canonical regular expressions and minimal state graphs for definiteevents.
Mathematical Theory of Automata , 12(6):529–561, 1962. Janusz A. Brzozowski and Hellis Tamm. Theory of átomata.
Theor. Comput. Sci. , 539:13–27,2014. Julius R. Büchi.
Finite Automata, their Algebras and Grammars - Towards a Theory ofFormal Expressions . Springer, 1989. Jean-Marc Champarnaud, Ahmed Khorsi, and Thomas Paranthoën. Split and join forminimizing: Brzozowski’s algorithm. In
Stringology , pages 96–104. Department of ComputerScience and Engineering, Faculty of Electrical Engineering, Czech Technical University, 2002. Aldo de Luca and Stefano Varricchio.
Finiteness and Regularity in Semigroups and FormalLanguages . Springer Publishing Company, Incorporated, 1st edition, 2011. John E. Hopcroft. An n log n algorithm for minimizing states in a finite automaton. In
Theoryof machines and computations , pages 189–196. Elsevier, 1971.
M F C S 2 0 1 9 John E. Hopcroft, Rajeev Motwani, and Jeffrey D. Ullman.
Introduction to Automata Theory,Languages, and Computation - (2. ed.) . Addison-Wesley-Longman, 2001. Szabolcs Iván. Complexity of atoms, combinatorially.
Inf. Process. Lett. , 116(5):356–360, 2016. Bakhadyr Khoussainov and Anil Nerode.
Automata Theory and Its Applications . BirkhauserBoston, Inc., Secaucus, NJ, USA, 2001. Edward F. Moore. Gedanken-experiments on sequential machines.
Automata studies ,23(1):60–60, 1956. Jacques Sakarovitch.
Elements of Automata Theory . Cambridge University Press, 2009. Manuel Vázquez de Parga, Pedro García, and Damián López. A polynomial double reversalminimization algorithm for deterministic finite automata.
Theor. Comput. Sci. , 487:17–22,2013.
A Deferred Proofs (cid:73)
Lemma 1.
The following properties hold: ∼ r is a right congruence iff P ∼ r ( v ) u ⊆ P ∼ r ( vu ) , for all u, v ∈ Σ ∗ . ∼ ‘ is a left congruence iff uP ∼ ‘ ( v ) ⊆ P ∼ ‘ ( uv ) , for all u, v ∈ Σ ∗ . Proof.1. ∼ r is a right congruence iff P ∼ r ( v ) u ⊆ P ∼ r ( vu ), for all u, v ∈ Σ ∗ .To simplify the notation, we denote P ∼ r , the partition induced by ∼ r , simply by P .( ⇒ ). Let x ∈ P ( v ) u , i.e., x = ˜ vu with P (˜ v ) = P ( v ) (hence v ∼ r ˜ v ). Since ∼ r is a rightcongruence and v ∼ r ˜ v then vu ∼ r ˜ vu . Therefore x ∈ P ( vu ).( ⇐ ). By hypothesis, for each u, v ∈ Σ ∗ and ˜ v ∈ P ( v ), ˜ vu ∈ P ( vu ). Therefore, v ∼ r ˜ v ⇒ ˜ vu ∼ r vu . ∼ ‘ is a left congruence iff uP ∼ ‘ ( v ) ⊆ P ∼ ‘ ( uv ), for all u, v ∈ Σ ∗ .To simplify the notation, we denote P ∼ ‘ , the partition induced by ∼ ‘ simply by P .( ⇒ ). Let x ∈ uP ( v ), i.e., x = u ˜ v with P (˜ v ) = P ( v ) (hence v ∼ ‘ ˜ v ). Since ∼ ‘ is a leftcongruence and v ∼ ‘ ˜ v then uv ∼ ‘ u ˜ v . Therefore x ∈ P ( uv ).( ⇐ ). By hypothesis, for each u, v ∈ Σ ∗ and ˜ v ∈ P ( v ), u ˜ v ∈ P ( uv ), for all u ∈ Σ ∗ .Therefore v ∼ ‘ ˜ v ⇒ u ˜ v ∼ ‘ uv . (cid:74)(cid:73) Lemma 4.
Let ∼ r be a right congruence and let L ⊆ Σ ∗ be a language such that P ∼ r ( L ) = L .Then L ( H r ( ∼ r , L )) = L . Proof.
To simplify the notation, we denote P ∼ r , the partition induced by ∼ r , simply by P .Let H = H r ( ∼ r , L ) = ( Q, Σ , δ, I, F ). First, we prove that W H I,P ( u ) = P ( u ) , for each u ∈ Σ ∗ . (11)( ⊆ ). We show that, for all w ∈ Σ ∗ , w ∈ W H I,P ( u ) ⇒ w ∈ P ( u ). The proof goes byinduction on length of w . Base case:
Let w = ε and ε ∈ W H I,P ( u ) . Note that the only initial state of H is P ( ε ).Then, P ( u ) = δ ( P ( ε ) , ε ) and thus, P ( u ) = P ( ε ). Hence, ε ∈ P ( u ).Let w = a with a ∈ Σ and a ∈ W H I,P ( u ) . Then, P ( u ) = δ ( P ( ε ) , a ). By Definition 2, P ( ε ) a ⊆ P ( u ). Therefore, a ∈ P ( u ). Inductive step:
Now we assume by hypothesis of induction that, if | w | = n ( n >
1) then w ∈ W H I,P ( u ) ⇒ w ∈ P ( u ). Let | w | = n + 1 and w ∈ W H I,P ( u ) . Assume w.l.o.g. that w = xa with x ∈ Σ ∗ and a ∈ Σ. Then, there exists a state q ∈ Q such that x ∈ W H I,q and P ( u ) = δ ( q, a ). Since x satisfies the induction hypothesis, we have that x ∈ q , i.e., q denotes the state P ( x ). On the other hand, by Definition 2, we have that P ( x ) a ⊆ P ( u ).Therefore, xa ∈ P ( u ). . Ganty and E. Gutiérrez and P.Valero 50:15 ( ⊇ ). We show that, for all w ∈ Σ ∗ , w ∈ P ( u ) ⇒ w ∈ W H I,P ( u ) . Again, the proof goes byinduction on length of w . Base case:
Let w = ε and ε ∈ P ( u ). Then, P ( u ) = P ( ε ). By Definition 2, P ( ε ) is theinitial state of H . Then, ε ∈ W H I,P ( ε ) .Let w = a with a ∈ Σ and a ∈ P ( u ). Then P ( u ) = P ( a ). Since P is a partition induced bya right congruence, by Lemma 1, we have that P ( ε ) a ⊆ P ( a ). Therefore, by Definition 2, P ( a ) = δ ( P ( ε ) , a ). Since P ( ε ) is the initial state of H , we have that a ∈ W H I,P ( a ) , i.e., w ∈ W H I,P ( u ) . Inductive step:
Now we assume by hypothesis of induction that, if | w | = n ( n >
1) then w ∈ P ( u ) ⇒ w ∈ W H I,P ( u ) . Let | w | = n + 1 and w ∈ P ( u ). Assume w.l.o.g. that w = xa with x ∈ Σ ∗ and a ∈ Σ. Then P ( xa ) = P ( u ). Since P is a partition induced by a rightcongruence, by Lemma 1, we have that P ( x ) a ⊆ P ( xa ). Since x ∈ P ( x ), by inductionhypothesis, x ∈ W H I,P ( x ) . On the other hand, by Definition 2, P ( xa ) = δ ( P ( x ) , a ). Hence xa ∈ W H I,P ( xa ) , i.e., w ∈ W H I,P ( u ) .We conclude this proof by showing that L ( H ) = L . L ( H ) = [By definition of L ( H )] [ q ∈ F W H I,q = [By Definition 2] [ P ( w ) ∈ Qw ∈ L W H I,P ( w ) = [By Equation (11)] [ w ∈ L P ( w ) = [By hypothesis, P ( L ) = L ] L . (cid:74)(cid:73)
Lemma 7.
Let ∼ ‘ be a left congruence and let L ⊆ Σ ∗ be a language such that P ∼ ‘ ( L ) = L .Then L ( H ‘ ( ∼ ‘ , L )) = L . Proof.
To simplify the notation, we denote P ∼ ‘ , the partition induced by ∼ ‘ , simply by P .Let H = H ‘ ( ∼ ‘ , L ) = ( Q, Σ , δ, I, F ). First, we prove that W H P ( u ) ,F = P ( u ) , for each u ∈ Σ ∗ . (12)( ⊆ ). We show that, for all w ∈ Σ ∗ , w ∈ W H P ( u ) ,F ⇒ w ∈ P ( u ). The proof goes byinduction on length of w . Base case:
Let w = ε and ε ∈ W H P ( u ) ,F . Note that the only final state of H is P ( ε ). Then, P ( ε ) ∈ δ ( P ( u ) , ε ) and thus, P ( u ) = P ( ε ). Hence, ε ∈ P ( u ).Let w = a with a ∈ Σ and a ∈ W H P ( u ) ,F . Then, P ( ε ) ∈ δ ( P ( u ) , a ). By Definition 5, aP ( ε ) ⊆ P ( u ). Therefore, a ∈ P ( u ). Inductive step:
Now we assume by hypothesis of induction that, if | w | = n ( n >
1) then w ∈ W H P ( u ) ,F ⇒ w ∈ P ( u ). Let | w | = n + 1 and w ∈ W H P ( u ) ,F . Assume w.l.o.g. that w = ax with a ∈ Σ and x ∈ Σ ∗ . Then, there exists a state q ∈ Q such that x ∈ W H q,F and q ∈ δ ( P ( u ) , a ). Since x satisfies the induction hypothesis, we have that x ∈ q , i.e., q denotes the state P ( x ). On the other hand, by Definition 5, we have that aP ( x ) ⊆ P ( u ).Therefore, ax ∈ P ( u ). M F C S 2 0 1 9 ( ⊇ ). We show that, for all w ∈ Σ ∗ , w ∈ P ( u ) ⇒ w ∈ W H P ( u ) ,F . Again, the proof goes byinduction on length of w . Base case:
Let w = ε and ε ∈ P ( u ). Then, P ( u ) = P ( ε ). By Definition 2, P ( ε ) is thefinal state of H . Then, ε ∈ W H P ( u ) ,F .Let w = a with a ∈ Σ and a ∈ P ( u ). Then P ( u ) = P ( a ). Since P is a partition inducedby a left congruence, by Lemma 1, we have that aP ( ε ) ⊆ P ( a ). Therefore, by Definition 5, P ( ε ) ∈ δ ( P ( a ) , a ). Since P ( ε ) is the final state of H , we have that a ∈ W H P ( a ) ,F , i.e., w ∈ W H P ( u ) ,F . Inductive step:
Now we assume by hypothesis of induction that, if | w | = n ( n >
1) then w ∈ P ( u ) ⇒ w ∈ W H P ( u ) ,F . Let | w | = n + 1 and w ∈ P ( u ). Assume w.l.o.g. that w = ax with a ∈ Σ and x ∈ Σ ∗ . Then P ( ax ) = P ( u ). Since P is a partition induced by a leftcongruence, by Lemma 1, we have that aP ( x ) ⊆ P ( ax ). Since x ∈ P ( x ), by inductionhypothesis, x ∈ W H P ( x ) ,F . On the other hand, by Definition 5, P ( x ) ∈ δ ( P ( ax ) , a ). Hence ax ∈ W H P ( ax ) ,F , i.e., w ∈ W H P ( u ) ,F .We conclude this proof by showing that L ( H ) = L . L ( H ) = [By definition of L ( H )] [ q ∈ I W H q,F = [By Definition 2] [ P ( w ) ∈ Qw ∈ L W H P ( w ) ,F = [By Equation (12)] [ w ∈ L P ( w ) = [By hypothesis, P ( L ) = L ] L . (cid:74)(cid:73)
Lemma 8.
Let ∼ r and ∼ ‘ be a right and left congruence respectively, and let L ⊆ Σ ∗ be alanguage. If the following property holds u ∼ r v ⇔ u R ∼ ‘ v R (1) then H r ( ∼ r , L ) is isomorphic to (cid:0) H ‘ ( ∼ ‘ , L R ) (cid:1) R . Proof.
Let H r ( ∼ r , L ) = ( Q, Σ , δ, I, F ) and ( H ‘ ( ∼ ‘ , L R )) R = ( e Q, Σ , e δ, e I, e F ). We will showthat H r ( ∼ r , L ) is isomorphic to ( H ‘ ( ∼ ‘ , L R )) R .Let ϕ : Q → e Q be a mapping assigning to each state P ∼ r ( u ) ∈ Q with u ∈ Σ ∗ , the state P ∼ ‘ ( u R ) ∈ e Q . We show that ϕ is an NFA isomorphism between H r ( ∼ r , L ) and ( H ‘ ( ∼ ‘ , L R )) R .The initial state P ∼ r ( ε ) of H r ( ∼ r , L ) is mapped to P ∼ ‘ ( ε ) which is the final state of H ‘ ( ∼ ‘ , L R ), i.e., the initial state of ( H ‘ ( ∼ ‘ , L R )) R .Each final state P ∼ r ( u ) of H r ( ∼ r , L ) with u ∈ L is mapped to P ∼ ‘ ( u R ), where u R ∈ L R .Therefore, P ∼ ‘ ( u R ) is an initial state of H ‘ ( ∼ ‘ , L R ), i.e., a final state of ( H ‘ ( ∼ ‘ , L R )) R .Now, note that, by Definition 5, H ‘ ( ∼ ‘ , L R ) is a co-DFA, therefore ( H ‘ ( ∼ ‘ , L R )) R is aDFA. Let us show that q = δ ( q, a ) if and only if ϕ ( q ) = e δ ( ϕ ( q ) , a ), for all q, q ∈ Q and a ∈ Σ.Assume that q = P ∼ r ( u ) for some u ∈ Σ ∗ , and q = δ ( q, a ) with a ∈ Σ. By Definition 2, wehave that q = P ∼ r ( ua ). Then, ϕ ( q ) = P ∼ ‘ ( u R ) and ϕ ( q ) = P ∼ ‘ ( au R ). Since ∼ ‘ is a leftcongruence, using Lemma 1 we have that aP ∼ ‘ ( u R ) ⊆ P ∼ ‘ ( au R ). Then, there is a transition . Ganty and E. Gutiérrez and P.Valero 50:17 in H ‘ ( ∼ ‘ , L R ) from state ϕ ( q ) = P ∼ ‘ ( au R ) to state ϕ ( q ) = P ∼ ‘ ( u R ) reading a . Hence, thereexists the reverse transition in ( H ‘ ( ∼ ‘ , L R )) R , i.e., ϕ ( q ) = e δ ( ϕ ( q ) , a ).Assume now that e q = P ∼ ‘ ( u R ) for some u ∈ Σ ∗ , and e q = e δ ( e q, a ) with a ∈ Σ. ByDefinition 5, we have that e q = P ∼ ‘ ( au R ). Consider a state q ∈ Q such that ϕ ( q ) = e q , then q is of the form P ∼ r ( u ). Likewise, consider a state q ∈ Q such that ϕ ( q ) = e q , then q is ofthe form P ∼ r ( ua ). Since P ∼ r is a partition induced by a right congruence, using Lemma 1,we have that P ∼ r ( u ) a ⊆ P ∼ r ( ua ) and thus, q = δ ( q, a ). (cid:74)(cid:73) Lemma 12.
Let N = ( Q, Σ , δ, I, F ) be an automaton with L = L ( N ) . Then, ∼ rL = ∼ r N iff ∀ u, v ∈ Σ ∗ , W N post N u ( I ) ,F = W N post N v ( I ) ,F ⇔ post N u ( I ) = post N v ( I ) . (6) Proof.
For each u, v ∈ Σ ∗ , u ∼ rL v ⇔ u ∼ r N v ⇐⇒ [By (2) and (4)] u − L = v − L ⇔ post N u ( I ) = post N v ( I ) ⇐⇒ [Definition of quotient of L ] W N post N u ( I ) ,F = W N post N v ( I ) ,F ⇔ post N u ( I ) = post N v ( I ) . (cid:74)(cid:73) Theorem 14.
Let N be an NFA generating language L = L ( N ) . Then the followingproperties hold: (a) L ( Min r ( L )) = L ( Min ‘ ( L )) = L = L ( Det r ( N )) = L ( Det ‘ ( N )) . (b) Min r ( L ) is isomorphic to the minimal deterministic automaton for L . (c) Det r ( N ) is isomorphic to N D . (d) Min ‘ ( L ) is isomorphic to ( Min r ( L R )) R . (e) Det ‘ ( N ) is isomorphic to ( Det r ( N R )) R . (f) Det r ( Det ‘ ( N )) is isomorphic to Min r ( L ) . Proof.(a) L ( Min r ( L )) = L ( Min ‘ ( L )) = L = L ( Det r ( N )) = L ( Det ‘ ( N )).By Definition 13, Min r ( L ) = H r ( ∼ rL , L ) and Det r ( N ) = H r ( ∼ r N , L ). By Lemma 4, L ( H r ( ∼ rL , L )) = L = L ( H r ( ∼ r N , L )). Therefore, L ( Min r ( L )) = Det r ( N ) = L . The proofof L ( Min ‘ ( L )) = L = L ( Det ‘ ( N )) goes similarly using Lemma 7. (b) Min r ( L ) is isomorphic to the minimal deterministic automaton for L .Let P be the partition induced by ∼ rL . Recall that the automaton Min r ( L ) = ( Q, Σ , δ, I, F )is a complete DFA (see Remark 3). Recall also that the quotient DFA of L , definedas D = ( e Q, Σ , η, e q , e F ) where e Q = { u − L | u ∈ Σ ∗ } , η ( u − L, a ) = a − ( u − L ) for each a ∈ Σ, e q = ε − L = L and e F = { u − L | ε ∈ u − L } , is the minimal DFA for L . We willshow that Min r ( L ) is isomorphic to D .Let ϕ : e Q → Q be the mapping assigning to each state e q i ∈ e Q of the form u − L , thestate P ( u ) ∈ Q , with u ∈ Σ ∗ . Note that, in particular, if e q i ∈ e Q is the empty set, then ϕ maps e q i to the block in P that contains all the words that are not prefixes of L . Weshow that ϕ is a DFA isomorphism between D and Min r ( L ).The initial state e q = ε − L of D is mapped to the state P ( ε ) which, by definition, is theunique initial state of Min r ( L ). Each final state u − L ∈ e F is mapped to the state P ( u )with u ∈ L which, by definition, is a final state of Min r ( L ).We now show that e q j = η ( e q i , a ) if and only if ϕ ( e q j ) = δ ( ϕ ( e q i ) , a ), for all e q i , e q j ∈ e Q, a ∈ Σ.Assume that e q i = u − L for some u ∈ Σ ∗ and e q j = η ( e q i , a ) where e q j = a − ( u − L )and a ∈ Σ. Note that a − ( u − L ) = { x ∈ Σ ∗ | uax ∈ L } . Then, ϕ ( e q i ) = P ( u ) and ϕ ( e q j ) = P ( ua ). Since P is a partition induced by a right congruence, using Lemma 1,we have that P ( u ) a ⊆ P ( ua ). Therefore, ϕ ( e q j ) = δ ( ϕ ( e q i ) , a ). M F C S 2 0 1 9
Assume now that P ( ua ) = δ ( P ( u ) , a ) for some u ∈ Σ ∗ and a ∈ Σ. Consider e q i ∈ e Q suchthat ϕ ( e q i ) = P ( u ), then e q i = u − L . Likewise, consider e q j ∈ e Q such that ϕ ( e q j ) = P ( ua ),then e q j = ( ua ) − L = a − ( u − ) L . Therefore, e q j = η ( e q i , a ). (c) Det r ( N ) is isomorphic to N D .Recall that, given N = ( Q, Σ , δ, I, F ), N D denotes the DFA that results from applyingthe subset construction to N and removing all states that are not reachable. Thus N D possibly contains empty states but no state is unreachable. Let N D = ( Q d , Σ , δ d , { I } , F d )and let Det r ( N ) = ( e Q, Σ , e δ, e I, e F ). Let P be the partition induced by ∼ r N and let ϕ : e Q → Q d be the mapping assigning to each state P ( u ) ∈ e Q , the set post N u ( I ) ∈ Q d with u ∈ Σ ∗ . Note that if u ∈ Σ ∗ is not a prefix of L ( N ), then ϕ maps P ( u ) topost N u ( I ) = ∅ . We show that ϕ is a DFA isomorphism between Det r ( N ) and N D .The initial state of Det r ( N ), P ( ε ), is mapped to post N ε ( I ) = { I } . Therefore, ϕ mapsthe initial state of Det r ( N ) to the initial state of N D . Each final state of Det r ( N ), P ( u )with u ∈ L , is mapped to post N u ( I ). Since post N u ( I ) ∩ F = ∅ , post N u ( I ) ∈ e F .Now note that, by Remark 3, Det r ( N ) is a complete DFA, and by construction, so is N D .Let us show that e q = e δ ( e q, a ) iff ϕ ( e q ) = δ d ( ϕ ( e q ) , a ), for all e q, e q ∈ e Q and a ∈ Σ. Assumethat e q = P ( u ), for some u ∈ Σ ∗ , and e q = e δ ( e q, a ), with a ∈ Σ. By Definition 2, we havethat e q = P ( ua ). Then, ϕ ( e q ) = post N u ( I ) and ϕ ( e q ) = post N ua ( I ) = post N a (post N u ( I )).Therefore, ϕ ( e q ) = δ d ( ϕ ( e q ) , a ).Assume now that δ d (post N u ( I ) , a ) = post N ua ( I ). Consider e q ∈ e Q such that ϕ ( e q ) =post N u ( I ), then e q = P ( u ). Likewise, consider e q ∈ e Q such that ϕ ( e q ) = post N ua ( I ), then e q = P ( ua ). Since P is a partition induced by a right congruence, using Lemma 1, wehave that P ( u ) a ⊆ P ( ua ). Therefore, e q = e δ ( e q, a ). (d) Min ‘ ( L ) is isomorphic to ( Min r ( L R )) R Observe that, for each u ∈ Σ ∗ :( u − L ) R = { x R ∈ Σ ∗ | ux ∈ L } = { x R ∈ Σ ∗ | x R u R ∈ L R } = { x ∈ Σ ∗ | x u R ∈ L R } = L R ( u R ) − . (13)Therefore, u ∼ ‘L v ⇔ [By Definition (3)] u − L = v − L ⇔ [ x = y ⇔ x R = y R ]( u − L ) R = ( v − L ) R ⇔ [By Equation (13)] L R ( u R ) − = L R ( v R ) − ⇔ [By Definition (2)] u R ∼ rL R v R . Finally, it follows from Lemma 8 that
Min ‘ ( L ) is isomorphic to ( Min r ( L R )) R . (e) Det ‘ ( N ) is isomorphic to ( Det r ( N R )) R .For each u, v ∈ Σ ∗ : u ∼ ‘ N R v ⇔ [By Defintion 11]pre N R u ( F ) = pre N R v ( F ) ⇔ [ q ∈ pre N R x ( F ) iff q ∈ post N x R ( I )]post N u R ( I ) = post N v R ( I ) ⇔ [By Definition 11] u R ∼ ‘ N v R . It follows from Lemma 8 that
Det ‘ ( N ) is isomorphic to Det r ( N R )) R . . Ganty and E. Gutiérrez and P.Valero 50:19 (f) Det r ( Det ‘ ( N )) is isomorphic to Min r ( L ).By Theorem 14 (a), Det ‘ ( N ) is a co-deterministic automaton generating the language L ( N ). Since Det ‘ ( N ) is co-deterministic, it satisfies Equation (6) from Theorem 12.Therefore, Det r ( Det ‘ ( N )) is isomorphic to Min r ( L ( Det ‘ ( N ))) = Min r ( L ( N )). (cid:74)(cid:73) Lemma 19.
Let L be a regular language. Then for every u ∈ Σ ∗ , P ∼ ‘L ( u ) = \ u ∈ w − Lw ∈ Σ ∗ w − L ∩ \ u/ ∈ w − Lw ∈ Σ ∗ ( w − L ) c . Proof.
For each u ∈ Σ ∗ , define L u = T u ∈ w − Lw ∈ Σ ∗ w − L T u/ ∈ w − Lw ∈ Σ ∗ ( w − L ) c . First, we show that P ∼ ‘L ( u ) ⊆ L u , for each u ∈ Σ ∗ . Let v ∈ P ∼ ‘L ( u ), i.e., Lu − = Lv − . Then, for each w ∈ Σ ∗ , u ∈ w − L ⇔ wu ∈ L ⇔ w ∈ Lu − ⇔ w ∈ Lv − ⇔ v ∈ w − L . Therefore, ∀ v ∈ P ∼ ‘L ( u ) , v ∈ L u and thus, P ∼ ‘L ( u ) ⊆ L u .Next, we show that L u ⊆ P ∼ ‘L ( u ). Let v ∈ L u . Then, ∀ w ∈ Σ ∗ , u ∈ w − L ⇔ v ∈ w − L .It follows that w ∈ Lu − ⇔ w ∈ Lv − and, therefore, v ∈ P ∼ ‘L ( u ). (cid:74)(cid:73) Lemma 25.
Let L be a regular language. Then, for every u ∈ Σ ∗ , P ∼ rL ( u ) = \ u ∈ Lw − w ∈ Σ ∗ Lw − ∩ \ u/ ∈ Lw − w ∈ Σ ∗ ( Lw − ) c . Proof.
For each u ∈ Σ ∗ , define L u = T u ∈ Lw − w ∈ Σ ∗ Lw − T u/ ∈ Lw − w ∈ Σ ∗ ( Lw − ) c . First, we show that P ∼ rL ( u ) ⊆ L u , for each u ∈ Σ ∗ . Let v ∈ P ∼ rL ( u ), i.e., u − L = v − L . Then, for each w ∈ Σ ∗ , u ∈ Lw − ⇔ uw ∈ L ⇔ w ∈ u − L ⇔ w ∈ v − L ⇔ v ∈ Lw − . Therefore, ∀ v ∈ P ∼ rL ( u ) , v ∈ L u and thus, P ∼ rL ( u ) ⊆ L u .Next, we show that L u ⊆ P ∼ rL ( u ). Let v ∈ L u . Then, ∀ w ∈ Σ ∗ , u ∈ Lw − ⇔ v ∈ Lw − .It follows that w ∈ u − L ⇔ w ∈ v − L and, therefore, v ∈ P ∼ rL ( u ). (cid:74)(cid:73) Lemma 26.
Let L be a regular language. Then P ∼ rL = gfp( λX. (cid:107) a ∈ Σ ,B ∈ X { Ba − , ( Ba − ) c } (cid:102) { L, L c } ) . (8) Proof.
Let Σ ≤ n (resp. Σ n ) denote the set of words with length up to n (resp. exactly n ), i.e.,Σ ≤ n def = { w ∈ Σ ∗ | | w | ≤ n } (resp. Σ n def = { w ∈ Σ ∗ | | w | = n } ). Let us denote X n , the n -thiteration of the greatest fixpoint computation of Equation (8). We will prove by inductionon n that the following equation holds for each n ≥ X n +1 = (cid:107) a ∈ Σ ,B ∈ X n { Ba − , ( Ba − ) c } (cid:102) { L, L c } = (cid:107) w ∈ Σ ≤ n { Lw − , ( Lw − ) c } . (14) M F C S 2 0 1 9
Base case:
Let n = 0. It is easy to see that the Equation (14) holds since { L, L c } = { Lε − , ( Lε − ) c } . Now, let n = 1. Then, (cid:107) a ∈ Σ ,B ∈ X { Ba − , ( Ba − ) c } (cid:102) { L, L c } = [ X = { L, L c } ] (cid:107) a ∈ Σ (cid:0) { La − , ( La − ) c } (cid:102) { ( L c ) a − , (( L c ) a − ) c } (cid:1) (cid:102) { L, L c } = [( La − ) c = L c a − ] (cid:107) a ∈ Σ { La − , ( La − ) c } (cid:102) { L, L c } = [Σ ≤ = { ε } ∪ Σ] (cid:107) a ∈ Σ ,w ∈ Σ ≤ { Lw − , ( Lw − ) c } . Inductive Step:
Let us assume that Equation (14) holds for each n ≤ k . We will provethat it holds for n = k + 1. Note that, using the inductive hypothesis twice, we have that: X k +1 = (cid:107) w ∈ Σ ≤ k { Lw − , ( Lw − ) c } = (cid:107) w ∈ Σ ≤ k − { Lw − , ( Lw − ) c } (cid:102) (cid:107) a ∈ Σ ,w ∈ Σ k − { Lw − a − , ( Lw − a − ) c } = X k (cid:102) (cid:107) w ∈ Σ k { Lw − , ( Lw − ) c } . (15)Using Equation (15), the identities ( La − ) c = L c a − and Ba − ∩ e Ba − = ( B ∩ e B ) a − and the induction hypothesis, it follows that: X k +2 = (cid:107) a ∈ Σ ,B ∈ X k +1 { Ba − , ( Ba − ) c } (cid:102) { L, L c } = (cid:107) a ∈ Σ ,B ∈ X k { Ba − , ( Ba − ) c } (cid:102) (cid:107) a ∈ Σ ,B ∈ (cid:99) w ∈ Σ k { Lw − , ( Lw − ) c } { Ba − , ( Ba − ) c } (cid:102) { L, L c } = (cid:107) w ∈ Σ ≤ k { Lw − , ( Lw − ) c } (cid:102) (cid:107) w ∈ Σ k +1 { Lw − , ( Lw − ) c } (cid:102) { L, L c } = (cid:107) w ∈ Σ ≤ k +1 { Lw − , ( Lw − ) c } . We conclude that P ∼ rL = gfp( λX. (cid:99) a ∈ Σ ,B ∈ X { Ba − , ( Ba − ) c } (cid:102) { L, L c } ). (cid:74)(cid:73) Theorem 29.
Let D be a DFA and M be Moore’s DFA for L ( D ) as in Definition 23.Then, M is isomorphic to Min r ( L ( D )) . Proof.
Let D = ( Q , Σ , δ , I , F ). Recall that Moore’s minimal DFA is defined as M =( Q, Σ , δ, I, F ) where the set of states corresponds to Moore’s state-partition w.r.t. D , i.e., Q = Q D ; I = {Q D ( q ) | q ∈ I } ; F = {Q D ( q ) | q ∈ F } and S = δ ( S, a ) iff ∃ q ∈ S, q ∈ S : q = δ ( q, a ), for each S, S ∈ Q and a ∈ Σ. Let
Min r ( L ( D )) = ( e Q, Σ , e δ, e I, e F ) be described asin Definition 13. Finally, let L denote L ( D ), for simplicity. By Theorem 27, the mapping ϕ : ℘ ( Q ) → ℘ (Σ ∗ ) defined as ϕ ( S ) = W D I ,S , for each S ∈ Q D , is a partition isomorphismbetween Q D and P ∼ rL . Note that, by construction of M , W MI,S = W D I ,S , for each S ∈ Q D .Thus, the mapping ψ : Q → e Q defined as ψ ( S ) = W MI,S , for each S ∈ Q , is also a partition . Ganty and E. Gutiérrez and P.Valero 50:21 isomorphism between Q D and P ∼ rL . In fact, we will show that ψ is a DFA morphism between M and Min r ( L ).The initial state I of M is mapped to ψ ( I ) = W MI,I = P ( ε ), since ε ∈ W MI,I . Therefore, ψ maps the initial state of M with the initial state of Min r ( L ). Note that each final state S in F is such that S ⊆ F . Therefore, ψ ( S ) = W MI,S = P ( u ) with u ∈ L , i.e., ψ maps each finalstate of M to a final state of Min r ( L ).We also have to show that S = δ ( S, a ) iff ψ ( S ) = e δ ( ψ ( S ) , a ), for all S, S ∈ Q and a ∈ Σ.Assume that S = δ ( S, a ), for some
S, S ∈ Q and a ∈ Σ. Therefore, there exists q, q ∈ Q such that q ∈ S, q ∈ S and q = δ ( q, a ). Then, ψ ( S ) = W MI,S and ψ ( S ) = W MI,S and thereexists u ∈ W I,S ( M ) such that ua ∈ W MI,S (recall that M is a DFA and therefore complete).Then, ψ ( S ) = P ( u ) and ψ ( S ) = P ( ua ). Since P is a partition induced by a right congruencethen, using Lemma 1, P ( u ) a ⊆ P ( ua ). Therefore, ψ ( S ) = e δ ( ψ ( S ) , a ). Assume now that, P ( ua ) = e δ ( P ( u ) , a ) for some u ∈ Σ ∗ and a ∈ Σ. Consider S ∈ Q such that ψ ( S ) = P ( u ),then u belongs to the left language of S , i.e., u ∈ W MI,S . Likewise, consider S ∈ Q such that ψ ( S ) = P ( ua ), then ua ∈ W MI,S . Therefore, there exists q, q ∈ Q such that q ∈ S, q ∈ S and q = δ ( q, a ). Thus, S = δ ( S, a ). (cid:74) Finally we prove the next two results related to Definitions 9 and 11 in Section 4. (cid:73)
Lemma 32.
Let L ⊆ Σ ∗ be a regular language. Then, the following holds: (i) ∼ rL is a right congruence; (ii) ∼ ‘L is a left congruence; and (iii) P ∼ rL ( L ) = L = P ∼ ‘L ( L ) . Proof.
Let us prove that ∼ rL is a right congruence. Assume u ∼ rL v , i.e., u − L = v − L .Given x ∈ Σ ∗ , we have that,( ux ) − L = x − ( u − L ) = x − ( v − L ) = ( vx ) − L .
Therefore, ux ∼ rL vx .Now, let us prove that ∼ ‘L is a left congruence. Assume u ∼ ‘L v , i.e., Lu − = Lv − .Given x ∈ Σ ∗ , we have that, L ( xu ) − = ( Lu − ) x − = ( Lv − ) x − = L ( xv ) − . Therefore, xu ∼ rL xv .Finally, let P ∼ rL be the finite partition induced by ∼ rL . We show that P ∼ rL ( L ) = L . Firstnote that L ⊆ P ∼ rL ( L ) by the reflexivity of the equivalence relation ∼ rL . On the other hand,we prove that for every u ∈ Σ ∗ , if u ∈ P ∼ rL ( L ) then u ∈ L . By hypothesis, there exists v ∈ L such that u ∼ rL v , i.e., u − L = v − L . Since v ∈ L then ε ∈ v − L . Therefore, ε ∈ u − L andwe conclude that u ∈ L .The proof of P ∼ ‘L ( L ) = L goes similarly. (cid:74)(cid:73) Lemma 33.
Let N be an NFA. Then, the following holds: (i) ∼ r N is a right congruence; (ii) ∼ ‘ N is a left congruence; and (iii) P ∼ r N ( L ( N )) = L ( N ) = P ∼ ‘ N ( L ( N )) . Proof.
Let us prove that ∼ r N is a right congruence. Assume u ∼ r N v , i.e., post N u ( I ) =post N v ( I ). Given x ∈ Σ ∗ , we have that,post N ux ( I ) = post N x (post N u ( I )) = post N x (post N v ( I )) = post N vx ( I ) . M F C S 2 0 1 9
Therefore, ux ∼ r N vx .Now, let us prove that ∼ ‘ N is a left congruence. Assume u ∼ ‘ N v , i.e., pre N u ( F ) = pre N v ( F ).Given x ∈ Σ ∗ , we have that,pre N xu ( F ) = pre N u (pre N x ( F )) = pre N v (pre N x ( F )) = pre N xv ( F ) . Therefore, xu ∼ r N xv .Finally, P ∼ r N , the finite partition induced by ∼ r N . We show that P ∼ r N ( L ( N )) = L ( N ).First note that L ⊆ P ∼ r N ( L ( N )) by the reflexivity of the equivalence relation ∼ r N . Onthe other hand, we prove that for every u ∈ Σ ∗ , if u ∈ P ∼ r N ( L ( N )) then u ∈ L ( N ). Byhypothesis, there exists v ∈ L ( N ) such that u ∼ r N v , i.e., post N u ( I ) = post N v ( I ). Since v ∈ L ( N ) then post N v ∩ F = ∅ . Therefore, post N u ∩ F = ∅ and we conclude that u ∈ L .The proof of P ∼ ‘ N ( L ) = L goes similarly.goes similarly.