ACL-OCL / Base_JSON /prefixJ /json /J02 /J02-2004.json
Benjamin Aw
Add updated pkl file v3
6fa4bc9
{
"paper_id": "J02-2004",
"header": {
"generated_with": "S2ORC 1.0.0",
"date_generated": "2023-01-19T02:44:07.959294Z"
},
"title": "Incremental Construction and Maintenance of Minimal Finite-State Automata",
"authors": [
{
"first": "Rafael",
"middle": [
"C"
],
"last": "Carrasco",
"suffix": "",
"affiliation": {},
"email": "carrasco@dlsi.ua.es"
},
{
"first": "Mikel",
"middle": [
"L"
],
"last": "Forcada",
"suffix": "",
"affiliation": {},
"email": ""
}
],
"year": "",
"venue": null,
"identifiers": {},
"abstract": "describe a method for constructing incrementally minimal, deterministic, acyclic finite-state automata (dictionaries) from sets of strings. But acyclic finite-state automata have limitations: For instance, if one wants a linguistic application to accept all possible integer numbers or Internet addresses, the corresponding finitestate automaton has to be cyclic. In this article, we describe a simple and equally efficient method for modifying any minimal finite-state automaton (be it acyclic or not) so that a string is added to or removed from the language it accepts; both operations are very important when dictionary maintenance is performed and solve the dictionary construction problem addressed by Daciuk et al. as a special case. The algorithms proposed here may be straightforwardly derived from the customary textbook constructions for the intersection and the complementation of finitestate automata; the algorithms exploit the special properties of the automata resulting from the intersection operation when one of the finite-state automata accepts a single string.",
"pdf_parse": {
"paper_id": "J02-2004",
"_pdf_hash": "",
"abstract": [
{
"text": "describe a method for constructing incrementally minimal, deterministic, acyclic finite-state automata (dictionaries) from sets of strings. But acyclic finite-state automata have limitations: For instance, if one wants a linguistic application to accept all possible integer numbers or Internet addresses, the corresponding finitestate automaton has to be cyclic. In this article, we describe a simple and equally efficient method for modifying any minimal finite-state automaton (be it acyclic or not) so that a string is added to or removed from the language it accepts; both operations are very important when dictionary maintenance is performed and solve the dictionary construction problem addressed by Daciuk et al. as a special case. The algorithms proposed here may be straightforwardly derived from the customary textbook constructions for the intersection and the complementation of finitestate automata; the algorithms exploit the special properties of the automata resulting from the intersection operation when one of the finite-state automata accepts a single string.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Abstract",
"sec_num": null
}
],
"body_text": [
{
"text": "In a recent paper in this journal, Daciuk et al. (2000) describe two methods for constructing incrementally minimal, deterministic, acyclic finite-state automata (dictionaries) from sets of strings: The first method adds strings in dictionary order, and the second one is for unsorted data. Adding an entry is an important dictionary maintenance operation, but so is removing an entry from the dictionary, for example, if it is found to be incorrect. Since ordering cannot obviously be expected in the removal case, we will focus on the second, more general problem (a solution for which has already been sketched by Revuz [2000] ).",
"cite_spans": [
{
"start": 35,
"end": 55,
"text": "Daciuk et al. (2000)",
"ref_id": "BIBREF0"
},
{
"start": 617,
"end": 629,
"text": "Revuz [2000]",
"ref_id": "BIBREF5"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1."
},
{
"text": "But dictionaries or acyclic finite automata have limitations: For instance, if one wants an application to accept all possible integer numbers or Internet addresses, the corresponding finite-state automaton has to be cyclic. In this article, we show a simple and equally efficient method for modifying any minimal finite-state automaton (be it acyclic or not) so that a string is added to or removed from the language it accepts. The algorithm may be straightforwardly derived from customary textbook constructions for the intersection and the complementation of finite-state automata; the resulting algorithm solves the dictionary construction problem addressed by Daciuk et al.'s (2000) second algorithm as a special case.",
"cite_spans": [
{
"start": 666,
"end": 688,
"text": "Daciuk et al.'s (2000)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1."
},
{
"text": "This article has the following parts. In Section 2, we give some necessary mathematical preliminaries. The minimal automata resulting from adding or removing a string are described in detail in Section 3; the algorithms are described in Section 4. In Section 5, one addition and one removal example are explained in detail, and some closing remarks are given in Section 6.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1."
},
{
"text": "As in Daciuk et al. (2000) , we will define a deterministic finite-state automaton as M = (Q, \u03a3, \u03b4, q 0 , F), where Q is a finite set of states, q 0 \u2208 Q is the start state, F \u2286 Q is a set of accepting states, \u03a3 is a finite set of symbols called the alphabet, and \u03b4: Q \u00d7 \u03a3 \u2192 Q is the next-state mapping. In this article, we will define \u03b4 as a total mapping; the corresponding finite-state automaton will be called complete (Revuz 2000) . This involves no loss of generality, as any finite-state automaton may be made complete by adding a new absorption state \u22a5 to Q, so that all undefined transitions point to it and \u03b4(\u22a5, a) = \u22a5 for all a \u2208 \u03a3. Using complete finite-state automata is convenient for the theoretical discussion presented in this article; real implementations of automata and the corresponding algorithms need not contain an explicit representation of the absorption state and its incoming and outgoing transitions.",
"cite_spans": [
{
"start": 6,
"end": 26,
"text": "Daciuk et al. (2000)",
"ref_id": "BIBREF0"
},
{
"start": 422,
"end": 434,
"text": "(Revuz 2000)",
"ref_id": "BIBREF5"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Finite-State Automata and Languages",
"sec_num": "2.1"
},
{
"text": "For complete finite-state automata, the extended mapping \u03b4 * : Q \u00d7 \u03a3 * \u2192 Q (the extension of \u03b4 for strings) is defined simply as",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Finite-State Automata and Languages",
"sec_num": "2.1"
},
{
"text": "EQUATION",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [
{
"start": 0,
"end": 8,
"text": "EQUATION",
"ref_id": "EQREF",
"raw_str": "\u03b4 * (q, ) = q \u03b4 * (q, ax ) = \u03b4 * (\u03b4(q, a), x)",
"eq_num": "(1)"
}
],
"section": "Finite-State Automata and Languages",
"sec_num": "2.1"
},
{
"text": "for all a \u2208 \u03a3 and x \u2208 \u03a3 * , with the empty or null string. The language accepted by automaton M",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Finite-State Automata and Languages",
"sec_num": "2.1"
},
{
"text": "EQUATION",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [
{
"start": 0,
"end": 8,
"text": "EQUATION",
"ref_id": "EQREF",
"raw_str": "L(M) = {w \u2208 \u03a3 * : \u03b4 * (q 0 , w) \u2208 F}",
"eq_num": "(2)"
}
],
"section": "Finite-State Automata and Languages",
"sec_num": "2.1"
},
{
"text": "and the right language of state q",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Finite-State Automata and Languages",
"sec_num": "2.1"
},
{
"text": "L(q) = {x \u2208 \u03a3 * : \u03b4 * (q, x) \u2208 F} (3)",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Finite-State Automata and Languages",
"sec_num": "2.1"
},
{
"text": "are defined as in Daciuk et al. (2000) .",
"cite_spans": [
{
"start": 18,
"end": 38,
"text": "Daciuk et al. (2000)",
"ref_id": "BIBREF0"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Finite-State Automata and Languages",
"sec_num": "2.1"
},
{
"text": "We also find it convenient to define the (complete) single-string automaton for string w, denoted",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Single-String Automaton",
"sec_num": "2.2"
},
{
"text": "M w = (Q w , \u03a3, \u03b4 w , q 0w , F w ), such that L(M w ) = {w}. This automaton has Q w = Pr(w) \u222a {\u22a5 w },",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Single-String Automaton",
"sec_num": "2.2"
},
{
"text": "where Pr(w) is the set of all prefixes of w and \u22a5 w is the absorption state, F w = {w}, and q 0w = (note that nonabsorption states in Q w will be named after the corresponding prefix of w). The next-state function is defined as follows",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Single-String Automaton",
"sec_num": "2.2"
},
{
"text": "\u03b4(x, a) = xa if x , xa \u2208 Pr(w) \u22a5 w otherwise (4)",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Single-String Automaton",
"sec_num": "2.2"
},
{
"text": "Note that the single-string automaton for a string w has |Q w | = |w| + 2 states. ",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Single-String Automaton",
"sec_num": "2.2"
},
{
"text": "L(M) = L(M 1 ) \u2229 L(M 2 )",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Operations with",
"sec_num": "2.3"
},
{
"text": ". This construction is found in formal language theory textbooks (Hopcroft and Ullman 1979, page 59) and is referred to as standard in papers (Karakostas, Viglas, and Lipton 2000) . The (complete) intersection automaton has Q = Q 1 \u00d7 Q 2 , q 0 = (q 01 , q 02 ), F = F 1 \u00d7 F 2 , and \u03b4((q 1 , q 2 ), a) = (\u03b4 1 (q 1 , a), \u03b4 2 (q 2 , a)) for all a \u2208 \u03a3, q 1 \u2208 Q 1 and q 2 \u2208 Q 2 . ",
"cite_spans": [
{
"start": 65,
"end": 100,
"text": "(Hopcroft and Ullman 1979, page 59)",
"ref_id": null
},
{
"start": 142,
"end": 179,
"text": "(Karakostas, Viglas, and Lipton 2000)",
"ref_id": "BIBREF4"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Operations with",
"sec_num": "2.3"
},
{
"text": ") union automaton M such that L(M) = L(M 1 ) \u222a L(M 2 )",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Complementary",
"sec_num": "2.3.2"
},
{
"text": ". It suffices to consider that, for any two languages on",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Complementary",
"sec_num": "2.3.2"
},
{
"text": "\u03a3 * , L 1 \u222a L 2 = \u03a3 * \u2212 (\u03a3 * \u2212 L 1 ) \u2229 (\u03a3 * \u2212 L 2 ).",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Complementary",
"sec_num": "2.3.2"
},
{
"text": "The resulting automaton M is identical to the intersection automaton defined above except that",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Complementary",
"sec_num": "2.3.2"
},
{
"text": "F = (F 1 \u00d7 Q 2 ) \u222a (Q 1 \u00d7 F 2 ).",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Complementary",
"sec_num": "2.3.2"
},
{
"text": "Given a (possibly cyclic) minimal complete finite-state automaton M, it is easy to build a new complete automaton M accepting L(M ) = L(M) \u222a {w} by applying the union construct defined above to M and the single-string automaton M w . The resulting automaton M = (Q , \u03a3, \u03b4 , q 0 , F ), which may be minimized very easily (see below), has four kinds of states in Q :",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "3.1"
},
{
"text": "\u2022 States of the form (q, \u22a5 w ) with q \u2208 Q \u2212 {\u22a5}, equivalent to those nonabsorption states of M that are not reached by any prefix of w; they will be called intact states, because they have the same transition structure as their counterparts in M (that is, if \u03b4(q, a) = q , then \u03b4 ((q, \u22a5 w ), a) = (q , \u22a5 w )) and belong to F if q \u2208 F. As a result, they have exactly the same right languages, L((q, \u22a5 w )) = L(q), because all of their outgoing transitions go to other intact states. Furthermore, each state (q, \u22a5 w ) has a different right language; therefore, no two intact states will ever be merged into one by minimization (intact states may, however, be eliminated, if they become unreachable, as we will describe below). For large automata (dictionaries) M, these are the great majority of states (the number of intact states ranges between |Q| \u2212 |w| \u2212 1 and |Q|); therefore, it will be convenient in practice to consider M as a modified version of M, and it will be treated as such in the algorithms found in this article.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "3.1"
},
{
"text": "\u2022 States of the form (q, x) with q \u2208 Q \u2212 {\u22a5} and x \u2208 Pr(w), such that \u03b4 * (q 0 , x) = q; they will be called cloned states, inspired by the terminology in Daciuk et al. (2000) ; the remaining states in (Q \u2212 {\u22a5}) \u00d7 Pr(w)-the great majority of states in Q \u00d7 Q w -may safely be discarded because they are unreachable from the new start state q 0 = (q 0 , ), which itself is a cloned state. Cloned states are modified versions of the original states q \u2208 Q \u2212 {\u22a5}: All of their outgoing transitions point to the corresponding intact states in Q , that is, (\u03b4(q, a), \u22a5 w ), except for the transition with symbol a : xa \u2208 Pr(w), which now points to the corresponding cloned state (\u03b4(q, a), xa), that is,",
"cite_spans": [
{
"start": 155,
"end": 175,
"text": "Daciuk et al. (2000)",
"ref_id": "BIBREF0"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "3.1"
},
{
"text": "\u03b4 ((q, x), a) = (\u03b4(q, a), xa) if xa \u2208 Pr(w) (\u03b4(q, a), \u22a5 w ) otherwise (5)",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "3.1"
},
{
"text": "Cloned states are in F if the corresponding original states are in F; in addition, if there is a cloned state of the form (q, w), then it is in F . There are at most |w| + 1 cloned states.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "3.1"
},
{
"text": "\u2022 States of the form (\u22a5, x), with x \u2208 Pr(w). These states will be called queue states; states of this form appear when the string w is not in L(M) (the pertinent case, because we are adding it) and only if in the original automaton \u03b4 * (q 0 , x) = \u22a5 for some x \u2208 Pr(w). Only the final queue state (\u22a5, w)-if it exists-is in F . There are at most |w| queue states.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "3.1"
},
{
"text": "\u2022 The new absorption state",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "3.1"
},
{
"text": "\u22a5 = (\u22a5, \u22a5 w ) / \u2208 F.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "3.1"
},
{
"text": "This automaton has to be minimized; because of the nature of the construction algorithm, however, minimization may be accomplished in a small number of operations. It is not difficult to show that minimization may be performed by initializing a list R called the register (Daciuk et al. 2000) with all of the intact states and then testing, one by one, queue and cloned states (starting with the last queue state (\u22a5, w) or, if it does not exist, the last clone state (q, w), and descending in Pr(w)) against states in the register and adding them to the register if they are not found to be equivalent to a state in R. (Performing this check backwards avoids having to test the equivalence of states by visiting their descendants recursively: see the end of Section 4.1.) Minimization (including the elimination of unreachable states in M ) appears in Section 4 as part of the string addition and removal algorithms.",
"cite_spans": [
{
"start": 272,
"end": 292,
"text": "(Daciuk et al. 2000)",
"ref_id": "BIBREF0"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "3.1"
},
{
"text": "Again, given a (possibly cyclic) minimal complete finite-state automaton M, it is easy to build a new complete automaton",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Removing a String",
"sec_num": "3.2"
},
{
"text": "M accepting L(M ) = L(M) \u2212 {w} = L(M) \u2229 (\u03a3 * \u2212 {w})",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Removing a String",
"sec_num": "3.2"
},
{
"text": "by applying the intersection construct defined above to M and M \u2212w . The resulting automaton has the same sets of reachable states in Q as in the case of adding string w and therefore the same close-to-minimality properties; since w is supposed to be in L(M), however, no queue states will be formed. (Note that, if w / \u2208 L(M), a nonaccepting queue with all states eventually equivalent to \u22a5 = (\u22a5, \u22a5 w ) may be formed.) The accepting states in F are intact states (q, \u22a5 w ) and cloned states (q, x) with q \u2208 F, except for state (q, w). Minimization may be performed analogously to the string addition case. Figure 1 shows the algorithm that may be used to add a string to an existing automaton, which follows the construction in Section 3.1. The resulting automaton is viewed as a modification of the original one: Therefore, intact states are not created; instead, unreachable intact states are eliminated later. The register R of states not needing minimization is initialized with Q. The algorithm has three parts:",
"cite_spans": [],
"ref_spans": [
{
"start": 607,
"end": 615,
"text": "Figure 1",
"ref_id": null
}
],
"eq_spans": [],
"section": "Removing a String",
"sec_num": "3.2"
},
{
"text": "\u2022 First, the cloned and queue states are built and added to Q by using function clone() for all prefixes of w. The function returns a cloned state (with all transitions created), if the argument is a nonabsorption state in Q \u2212 {\u22a5}, or a queue state, if it operates on the absorption state \u22a5 \u2208 Q.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "4.1"
},
{
"text": "\u2022 Second, those intact states that have become unreachable as a result of designating the cloned state q 0 as the new start state are removed from Q and R, and the start state is replaced by its clone. Unreachable states are simply those having no incoming transitions as constructed by the algorithm or as a consequence of the removal of other unreachable states; therefore, function unreachable() simply has to check for the absence of incoming transitions. Note that only intact states (q, \u22a5 w ) corresponding to q such that \u03b4 * (q 0 , x) = q for some x \u2208 Pr(w) may become unreachable as a result of having been cloned.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "4.1"
},
{
"text": "\u2022 Third, the queue and cloned states are checked (starting with the last state) against the register using function replace or register(), which is essentially the same as the nonrecursive version in the second algorithm in Daciuk et al. (2000) and is shown in Figure 2 . If argument state q is found to be equivalent to a state p in the register R, function merge(p, q) is called to redirect into p those transitions coming into q; if not, argument state q is simply added to the register. Equivalence is checked by function equiv(), shown in Figure 3 , which checks for the equivalence of states by comparing (1) whether both states are accepting or not, and (2) whether the corresponding outgoing transitions lead to the same state in R. Note that outgoing transitions cannot lead to equivalent states, as there are no pairs of different equivalent states in the register (\u2200p, q \u2208 R, equiv(p, q) \u21d2 p = q) and backwards minimization guarantees that the state has no transitions to unregister states.",
"cite_spans": [
{
"start": 224,
"end": 244,
"text": "Daciuk et al. (2000)",
"ref_id": "BIBREF0"
}
],
"ref_spans": [
{
"start": 261,
"end": 269,
"text": "Figure 2",
"ref_id": null
},
{
"start": 544,
"end": 552,
"text": "Figure 3",
"ref_id": null
}
],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "4.1"
},
{
"text": "Finally, the new (minimal) automaton is returned. In real implementations, absorption states are not explicitly stored; this results in small differences in the implementations of the functions clone() and equiv().",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "4.1"
},
{
"text": "The algorithm for removing a string from the language accepted by an automaton M differs from the previous algorithm only in that the line",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Removing a String",
"sec_num": "4.2"
},
{
"text": "F \u2190 F \u2212 {q last }",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Removing a String",
"sec_num": "4.2"
},
{
"text": "has to be added after the first end for. Since the string removal algorithm will usually be asked to remove a string that was in L(M), function clone() will usually generate only cloned states and no queue states (see Section 3.2 for the special case w / \u2208 L(M)).",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Removing a String",
"sec_num": "4.2"
},
{
"text": "Assume that we want to add the string bra to the automaton in Figure 4 , which accepts the set of strings (ba) + \u222a {bar} (for clarity, in all automata, the absorption state and all transitions leading to it will not be drawn). The single-string automaton for string bra is shown in Figure 5 . Application of the first stages of the string addition algorithm leads to the (unminimized) automaton in Figure 6 . The automaton has, in addition to the set of intact states {(0, \u22a5 w ), . . . , (5, \u22a5 w )}, two cloned states ((0, ) and (1, b)) and two queue states ((\u22a5, br) and (\u22a5, bra)). As a consequence of the designation of (0, ) as the algorithm addstring Input:",
"cite_spans": [],
"ref_spans": [
{
"start": 62,
"end": 70,
"text": "Figure 4",
"ref_id": "FIGREF0"
},
{
"start": 282,
"end": 290,
"text": "Figure 5",
"ref_id": null
},
{
"start": 398,
"end": 406,
"text": "Figure 6",
"ref_id": null
}
],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "5.1"
},
{
"text": "M = (Q, \u03a3, \u03b4, q 0 , F) (minimal, complete), w \u2208 \u03a3 * Output: M =(Q , \u03a3, \u03b4 , q 0 , F ) minimal, complete, and such that L(M )=L(M)\u222a{w} R \u2190 Q [initialize register] q 0 \u2190 clone(q 0 ) [clone start state] q last \u2190 q 0 for i = 1 to |w| q \u2190 clone(\u03b4 * (q 0 , w 1 \u2022 \u2022 \u2022 w i ))",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "5.1"
},
{
"text": "[create cloned and queue states; add clones of accepting states to F] ",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "5.1"
},
{
"text": "\u03b4(q last , w i ) \u2190 q q last \u2190 q end for i \u2190 1 q current \u2190 q 0 while(i \u2264 |w| and unreachable(q current )) q next \u2190 \u03b4(q current , w i ) Q \u2190 Q \u2212",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "5.1"
},
{
"text": "i \u2190 i + 1 end while if unreachable(q current ) Q \u2190 Q \u2212 {q current } R \u2190 R \u2212 {q current } end if q 0 \u2190 q 0 [replace start state] for i = |w| downto 1 replace or register(\u03b4 * (q 0 , w 1 \u2022 \u2022 \u2022 w i ))",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "5.1"
},
{
"text": "[check queue and cloned states one by one] end for return M = (Q, \u03a3, \u03b4, q 0 , F) end algorithm",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Adding a String",
"sec_num": "5.1"
},
{
"text": "Algorithm to add a string w to the language accepted by a finite-state automaton while keeping it minimal.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Figure 1",
"sec_num": null
},
{
"text": "if \u2203p \u2208 R : equiv(p, q) then merge(p, q) else R \u2190 R \u222a {q} end if end function",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "function replace or register(q)",
"sec_num": null
},
{
"text": "The function replace or register().",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Figure 2",
"sec_num": null
},
{
"text": "function equiv(p, q) if (p \u2208 F \u2227 q / \u2208 F) \u2228 (p / \u2208 F \u2227 q \u2208 F)",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Figure 2",
"sec_num": null
},
{
"text": "return false for all symbols a \u2208 \u03a3 if \u03b4(p, a) = \u03b4(q, a) return false end for return true end function",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Figure 2",
"sec_num": null
},
{
"text": "The function equiv(p, q). new start state, shadowed states (0, \u22a5 w ) and (1, \u22a5 w ) become unreachable (have no incoming transitions) and are eliminated in precisely that order in the second stage of the algorithm. The final stage of the algorithm puts intact states into the register and tests queue and cloned states for equivalence with states in the register. The first state tested is (\u22a5, bra), which is found to be equivalent to (3, \u22a5 w ); therefore, transitions coming into (\u22a5, bra) are made to point to (3, \u22a5 w ). Then, states (\u22a5, br), (1, b) and (0, ) are tested in order, found to have no equivalent in the register, and added to it. The resulting minimal automaton, after a convenient renumbering of states, is shown in Figure 7 .",
"cite_spans": [],
"ref_spans": [
{
"start": 730,
"end": 738,
"text": "Figure 7",
"ref_id": "FIGREF2"
}
],
"eq_spans": [],
"section": "Figure 3",
"sec_num": null
},
{
"text": "Now let us consider the case in which we want to remove string baba from the language accepted by the automaton in Figure 7 (the single-string automaton for baba is shown in Figure 8 ). The automaton resulting from the application of the initial (construction) stages of the automaton is shown in Figure 9 . Note that state (6, baba) is marked as nonaccepting, because we are removing a string. Again, as a consequence of the designation of (0, ) as the new start state, shadowed states (0, \u22a5 w ), (1, \u22a5 w ), Incremental Construction of Minimal FSA and (2, \u22a5 w ) become unreachable (have no incoming transitions) and are eliminated in precisely that order in the second stage of the algorithm. The last stage of the algorithm puts all intact states into the register, checks cloned states (6, baba), (4, bab), (2, ba), (1, b) and (0, ) (no queue states, since baba is accepted by the automaton in Figure 7) , and finds none of them to be equivalent to those in the register, to which they are added. The resulting minimal automaton is shown in Figure 10 .",
"cite_spans": [],
"ref_spans": [
{
"start": 115,
"end": 123,
"text": "Figure 7",
"ref_id": "FIGREF2"
},
{
"start": 174,
"end": 182,
"text": "Figure 8",
"ref_id": null
},
{
"start": 297,
"end": 305,
"text": "Figure 9",
"ref_id": null
},
{
"start": 897,
"end": 906,
"text": "Figure 7)",
"ref_id": "FIGREF2"
},
{
"start": 1044,
"end": 1053,
"text": "Figure 10",
"ref_id": null
}
],
"eq_spans": [],
"section": "Removing a String",
"sec_num": "5.2"
},
{
"text": "We have derived, from basic results of language and automata theory, a simple method for modifying a minimal (possibly cyclic) finite-state automaton so that it recognizes one string more or one string less while keeping the finite-state automaton minimal. These two operations may be applied to dictionary construction and maintenance and generalize the result in Daciuk et al.'s (2000) second algorithm (incremental construction of acyclic finite-state automata from unsorted strings) in two respects, with interesting practical implications:",
"cite_spans": [
{
"start": 365,
"end": 387,
"text": "Daciuk et al.'s (2000)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Concluding Remarks",
"sec_num": "6."
},
{
"text": "\u2022 The method described here allows for the addition of strings to the languages of cyclic automata (in practice, it may be convenient to have cycles in dictionaries if we want them to accept, for example, all possible integer numbers or Internet addresses). In this respect, the algorithm presented also generalizes the string removal method sketched by Revuz (2000) for acyclic automata.",
"cite_spans": [
{
"start": 354,
"end": 366,
"text": "Revuz (2000)",
"ref_id": "BIBREF5"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Concluding Remarks",
"sec_num": "6."
},
{
"text": "\u2022 Removal of strings is as easy as addition. This means that, for example, the detection of an erroneous entry in the dictionary does not imply having to rebuild the dictionary completely.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Concluding Remarks",
"sec_num": "6."
},
{
"text": "The asymptotic time complexity of the algorithms is in the same class (O(|Q||w|)) as that in Daciuk et al. (2000) , because the slowest part of the algorithm (the last one) checks all queue and cloned states (O(|w|)) against all states of the register (O(|Q|)). As suggested by one of the reviewers of this article, an improvement in efficiency may be obtained by realizing that, in many cases, cloned states corresponding to the shortest prefixes of string w are not affected by minimization, because their intact equivalents have become unreachable and therefore have been removed from the register; the solution lies in identifying these states and not cloning them (for example, Daciuk et al.'s [2000] and Revuz's [2000] algorithms do not clone them).",
"cite_spans": [
{
"start": 93,
"end": 113,
"text": "Daciuk et al. (2000)",
"ref_id": "BIBREF0"
},
{
"start": 683,
"end": 705,
"text": "Daciuk et al.'s [2000]",
"ref_id": null
},
{
"start": 710,
"end": 724,
"text": "Revuz's [2000]",
"ref_id": "BIBREF5"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Concluding Remarks",
"sec_num": "6."
},
{
"text": "As for the future, we are working on an adaptation of this algorithm for the maintenance of morphological analyzers and generators using finite-state nondeterministic letter transducers (Roche and Schabes 1997; Garrido et al. 1999) .",
"cite_spans": [
{
"start": 186,
"end": 210,
"text": "(Roche and Schabes 1997;",
"ref_id": "BIBREF6"
},
{
"start": 211,
"end": 231,
"text": "Garrido et al. 1999)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Concluding Remarks",
"sec_num": "6."
}
],
"back_matter": [
{
"text": "The work reported in this article has been funded by the Spanish Comisi\u00f3n Interministerial de Ciencia y Tecnolog\u00eda through grant TIC2000-1599. We thank the two reviewers for their suggestions and Colin de la Higuera for his comments on the manuscript.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Acknowledgments",
"sec_num": null
}
],
"bib_entries": {
"BIBREF0": {
"ref_id": "b0",
"title": "Incremental construction of minimal acyclic finite-state automata",
"authors": [
{
"first": "Jan",
"middle": [],
"last": "Daciuk",
"suffix": ""
},
{
"first": "Stoyan",
"middle": [],
"last": "Mihov",
"suffix": ""
},
{
"first": "Bruce",
"middle": [
"W"
],
"last": "Watson",
"suffix": ""
},
{
"first": "Richard",
"middle": [
"E"
],
"last": "Watson",
"suffix": ""
}
],
"year": 2000,
"venue": "Computational Linguistics",
"volume": "26",
"issue": "1",
"pages": "3--16",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Daciuk, Jan, Stoyan Mihov, Bruce W. Watson, and Richard E. Watson. 2000. Incremental construction of minimal acyclic finite-state automata. Computational Linguistics, 26(1):3-16.",
"links": null
},
"BIBREF1": {
"ref_id": "b1",
"title": "Herm\u00ednia Pastor, and Mikel L. Forcada. 1999. A compiler for morphological analysers and generators based on finite-state transducers",
"authors": [
{
"first": "Alicia",
"middle": [],
"last": "Garrido",
"suffix": ""
},
{
"first": "Amaia",
"middle": [],
"last": "Iturraspe",
"suffix": ""
}
],
"year": null,
"venue": "",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Garrido, Alicia, Amaia Iturraspe, Sandra Montserrat, Herm\u00ednia Pastor, and Mikel L. Forcada. 1999. A compiler for morphological analysers and generators based on finite-state transducers.",
"links": null
},
"BIBREF3": {
"ref_id": "b3",
"title": "Introduction to Automata Theory, Languages, and Computation",
"authors": [
{
"first": "John",
"middle": [
"E"
],
"last": "Hopcroft",
"suffix": ""
},
{
"first": "Jeffrey",
"middle": [
"D"
],
"last": "Ullman",
"suffix": ""
}
],
"year": 1979,
"venue": "",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Hopcroft, John E. and Jeffrey D. Ullman. 1979. Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, Reading, MA.",
"links": null
},
"BIBREF4": {
"ref_id": "b4",
"title": "On the complexity of intersecting finite state automata",
"authors": [
{
"first": "George",
"middle": [],
"last": "Karakostas",
"suffix": ""
},
{
"first": "Anastasios",
"middle": [],
"last": "Viglas",
"suffix": ""
},
{
"first": "Richard",
"middle": [
"J"
],
"last": "Lipton",
"suffix": ""
}
],
"year": 2000,
"venue": "Proceedings of the 15th Annual IEEE Conference on Computational Complexity (CoCo'00)",
"volume": "",
"issue": "",
"pages": "229--234",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Karakostas, George, Anastasios Viglas, and Richard J. Lipton. 2000. On the complexity of intersecting finite state automata. In Proceedings of the 15th Annual IEEE Conference on Computational Complexity (CoCo'00), pages 229-234.",
"links": null
},
"BIBREF5": {
"ref_id": "b5",
"title": "Dynamic acyclic minimal automaton",
"authors": [
{
"first": "Dominique",
"middle": [],
"last": "Revuz",
"suffix": ""
}
],
"year": 2000,
"venue": "Preproceedings of CIAA 2000: Fifth International Conference on Implementation and Application of Automata",
"volume": "",
"issue": "",
"pages": "226--232",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Revuz, Dominique. 2000. Dynamic acyclic minimal automaton. In Preproceedings of CIAA 2000: Fifth International Conference on Implementation and Application of Automata, pages 226-232, London, Ontario, July 24-25.",
"links": null
},
"BIBREF6": {
"ref_id": "b6",
"title": "Introduction",
"authors": [
{
"first": "Emmanuel",
"middle": [],
"last": "Roche",
"suffix": ""
},
{
"first": "Yves",
"middle": [],
"last": "Schabes",
"suffix": ""
}
],
"year": 1997,
"venue": "Finite-State Language Processing",
"volume": "",
"issue": "",
"pages": "1--65",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Roche, Emmanuel and Yves Schabes. 1997. Introduction. In Emmanuel Roche and Yves Schabes, editors, Finite-State Language Processing. MIT Press, pages 1-65.",
"links": null
}
},
"ref_entries": {
"FIGREF0": {
"type_str": "figure",
"uris": null,
"text": "Minimal automaton accepting the set of strings (ba) + \u222a {bar}.",
"num": null
},
"FIGREF1": {
"type_str": "figure",
"uris": null,
"text": "Unminimized automaton accepting the set (ba) + \u222a {bar} \u222a {bra}. Shadowed states (0, \u22a5w) and (1, \u22a5w) have become unreachable (have no incoming transitions) and are eliminated in precisely that order.",
"num": null
},
"FIGREF2": {
"type_str": "figure",
"uris": null,
"text": "Minimal automaton accepting the set (ba) + \u222a {bar} \u222a {bra}. Unminimized automaton accepting the set (ba) + \u222a {bar} \u222a {bra} \u2212 {baba}. Shadowed states (0, \u22a5w), (1, \u22a5w), and (2, \u22a5w) have become unreachable (have no incoming transitions) and are eliminated in precisely that order.",
"num": null
},
"FIGREF3": {
"type_str": "figure",
"uris": null,
"text": "Minimal automaton accepting the set (ba) + \u222a {bar} \u222a {bra} \u2212 {baba}.",
"num": null
},
"TABREF0": {
"content": "<table/>",
"text": "",
"num": null,
"type_str": "table",
"html": null
},
"TABREF2": {
"content": "<table/>",
"text": "{q current } [remove unreachable state from Q and update transitions in \u03b4] R \u2190 R \u2212 {q current } [remove also from register] q current \u2190 q next",
"num": null,
"type_str": "table",
"html": null
}
}
}
}