File Information

File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/intro/02/j02-2004_intro.xml

Size: 4,161 bytes

Last Modified: 2025-10-06 14:01:23

<?xml version="1.0" standalone="yes"?>
<Paper uid="J02-2004">
  <Title>c(c) 2002 Association for Computational Linguistics Incremental Construction and Maintenance of Minimal Finite-State Automata</Title>
  <Section position="4" start_page="211" end_page="214" type="intro">
    <SectionTitle>
5. Examples
</SectionTitle>
    <Paragraph position="0"/>
    <Section position="1" start_page="211" end_page="214" type="sub_section">
      <SectionTitle>
5.1 Adding a String
</SectionTitle>
      <Paragraph position="0"> Assume that we want to add the string bra to the automaton in Figure 4, which accepts the set of strings (ba) + [?]{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,[?]</Paragraph>
      <Paragraph position="2"> )}, two cloned states ((0, epsilon1) and (1,b)) and two queue states (([?],br) and ([?],bra)). As a consequence of the designation of (0, epsilon1) as the  Algorithm to add a string w to the language accepted by a finite-state automaton while keeping it minimal.</Paragraph>
      <Paragraph position="3"> function replace or register(q) if [?]p [?] R : equiv(p, q) then</Paragraph>
      <Paragraph position="5"> The function replace or register().</Paragraph>
      <Paragraph position="6">  Carrasco and Forcada Incremental Construction of Minimal FSA function equiv(p, q) if (p [?] F [?] q /[?] F)[?](p /[?] F [?] q [?] F) return false for all symbols a [?] S if d(p, a) negationslash= d(q, a) return false end for return true end function Figure 3 The function equiv(p, q).</Paragraph>
      <Paragraph position="7"> Figure 4 Minimal automaton accepting the set of strings (ba) + [?]{bar}.</Paragraph>
      <Paragraph position="8"> Figure 5 Single-string automaton accepting string bra.  ) have become unreachable (have no incoming transitions) and are eliminated in precisely that order.</Paragraph>
      <Paragraph position="9">  ) have become unreachable (have no incoming transitions) and are eliminated in precisely that order. new start state, shadowed states (0,[?] w ) and (1,[?] 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 ([?],bra), which is found to be equivalent to (3,[?] w ); therefore, transitions coming into ([?],bra) are made to point to (3,[?] w ). Then, states ([?],br), (1,b) and (0, epsilon1) 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.</Paragraph>
    </Section>
    <Section position="2" start_page="214" end_page="214" type="sub_section">
      <SectionTitle>
5.2 Removing a String
</SectionTitle>
      <Paragraph position="0"> 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, epsilon1) as the new start state, shadowed states (0,[?]  ) 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, epsilon1) (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.</Paragraph>
    </Section>
  </Section>
class="xml-element"></Paper>
Download Original XML