SLIDE 1
Structurally Unambiguous Finite Automata Hing Leung Department of - - PowerPoint PPT Presentation
Structurally Unambiguous Finite Automata Hing Leung Department of - - PowerPoint PPT Presentation
Structurally Unambiguous Finite Automata Hing Leung Department of Computer Science New Mexico State University Las Cruces, NM 88003, U.S.A. hleung@cs.nmsu.edu NFA of different ambiguity Definitions of ambiguity. Given an NFA M . amb (
SLIDE 2
SLIDE 3
Generalized Structurally Unambiguous Finite Automata (GSUFA)
◮ Definition
◮ Allow more than one starting states. ◮ ∀q, q′, ∀w, there is ≤ 1 path from q to q′ processing w.
◮ SUFA and MDFA are special cases of GSUFA. ◮ Simulate a GSUFA by a SUFA
◮ Let (Q, Σ, δ, S, F) be a GSUFA where S = {s1, . . . , sk}. ◮ Define Mi = (Q, Σ, δ, si, F), 1 ≤ i ≤ k. ◮ Let M to be a nondeterministic union of Mi, 1 ≤ i ≤ k. ◮ Introduce a new start state with ǫ transitions going to Mi’s. ◮ Substitute ǫ moves with direct non-ǫ moves. ◮ Obtain a O(n2)-state SUFA equivalent to the given GSUFA.
◮ Polynomial time for checking if a given NFA is a GSUFA.
◮ Let the given NFA M be (Q = {q1, . . . , qn}, Σ, δ, S, F) ◮ M is a GSUFA iff ∀1 ≤ i, j ≤ n, Mi,j = (Q, Σ, δ, qi, qj) is a UFA ◮ (Stearns and Hunt) Poly time decidable if a given NFA is a UFA.
◮ Polynomial time for checking if a given NFA is a SUFA.
SLIDE 4
Equivalence and containment problems for SUFA
◮ Stearns and Hunt
◮ Problems for UFA are decidable in poly time. ◮ Problems for k-ambiguous NFA are decidable in poly time.
◮ Equivalence problem for SUFA is PSPACE-complete
◮ DFA intersection-emptyness problem is PSPACE-complete ◮ DFA union-universe problem is PSPACE-complete. ◮ Given an instance of DFA union-universe problem (D1, . . . , Dk) ◮ Poly time reduce to an equivalent MDFA, then to a SUFA. ◮ Ask if SUFA constructed is equivalent to a SUFA denoting Σ∗ ◮ Thus, SUFA equivalence problem is PSPACE-hard. ◮ NFA equivalence is in PSPACE. So is SUFA equivalence.
◮ Containment problem for SUFA is PSPACE-complete
◮ PSPACE-hard: reduce from equivalence problem. ◮ PSPACE: NPSPACE to test for non-containment.
◮ Problems for SUFA with k final states: poly time decidable
SLIDE 5
Language of some-register-on L
◮ Definition
◮ There are n registers. ◮ Each register holds a value of either 0 or 1 (‘off’ or ‘on’). ◮ Initially, register 1 is on. All other registers are off. ◮ Symbol Ci,j (Meaning: Copy i to j) ◮ An input string consists of a sequence of copy instructions. ◮ An input is in L if some register is on
after the sequence of copy instructions have been performed.
◮ C1,4C4,2C3,1C4,3C1,2 ∈ L
C1,4C4,2C3,2C3,1C2,4 ∈ L
◮ n-state SUFA A for L
◮ Let the state set Q = {1, 2, . . . , n}. ◮ State i is on iff register i is on. ◮ Start state is 1. All states are final. ◮ Transitions: (i, Ci,j, j) and (k, Ci,j, k) if k = j ◮ Nondeterministic move: (i, Ci,j, j) and (i, Ci,j, i) ◮ Reversal is a MDFA.
Transitions: (j, Ci,j, i) and (k, Ci,j, k) if k = j
SLIDE 6
Smallest UFA for L has 2n − 1 states, where n ≥ 3.
◮ (Schmidt) Given a regular language R and strings xi, yi for
i = 1, 2, . . . , n, let M be a matrix s.t. M[xi, yj] = 1 if xiyj ∈ R and 0 otherwise. Then any UFA for R has ≥ rank(M) states.
◮ Define xQ′ s.t. A reaches Q′ = ∅ on processing xQ′.
◮ xQ′ = C1,q1 . . . C1,qk where 1 ∈ Q′ = {q1, . . . , qk}. ◮ xQ′ = C1,q1Cq,1Cq1,q2 Cq1,q3 . . . Cq1,qk where q ∈ Q − {1, q1}.
◮ Define yQ′′ s.t. AR reaches Q′′ = ∅ on processing yR Q′′.
◮ y R
Q′′ = ǫ if Q′′ = Q.
◮ y R
Q′′ = Cq′
2,q′ 1Cq′ 3,q′ 2 . . . Cq′ h,q′ h−1Cq1,q′ h
where Q − Q′′ = {q′
1, q′ 2, . . . , q′ h}. and q1 ∈ Q′′.
◮ Thus, xQ′yQ′′ ∈ L iff Q′ ∩ Q′′ = ∅. ◮ rank(M) = 2n − 1. Smallest UFA for L has ≥ 2n − 1 states. ◮ Incompletely specificied DFA for L has ≤ 2n − 1 states. ◮ Thus, smallest UFA for L has 2n − 1 states.
SLIDE 7
The smallest MDFA for L has 2n − 1 states.
◮ Properties of L
◮ All prefixes of L are in L. ◮ S = {w | w −1L = Σ∗} is nonempty. ◮ T = {w | w −1L = ∅ } is nonempty. ◮ Smallest incompletely specified DFA D for L has 2n − 1 states. ◮ One accepting sink state in D. (reached by processing w ∈ S) ◮ ∀u ∈ Σ∗ − S − T, ∃v s.t. (uv)−1L = L ◮ Other 2n − 2 states in D are strongly conncected.
◮ Smallest MDFA for L has ≥ 2n − 2 states.
◮ Suppose the contrary. ∃ k-entry MDFA with < 2n − 2 states. ◮ Treat MDFA as a nondeterministic union of k DFA D1, . . . , Dk. ◮ We can assume every state in Di is a final state. ◮ Aim: design a string t ∈ Σ∗ − S − T such that MDFA aborts. ◮ Design w1 s.t. D1 aborts in processing w1. ◮ Design w2 (may be ǫ) s.t. D2 aborts in processing w1w2. ◮ Define t = w1w2 . . . wk.
◮ Need 2n − 2 states to handle w ∈ Σ∗ − S − T correctly. ◮ Needs one more accepting sink state for processing w ∈ S.
SLIDE 8
UFA, MDFA and reversal of MDFA are incomparable.
◮ Consider SUFA A, which is the reversal of a MDFA.
◮ reversal of MDFA exponentially more succinct than UFA ◮ reversal of MDFA exponentially more succinct than MDFA
◮ Let L′ = LR. There exists an n-state MDFA for L′
◮ Recall: L requires 2n − 1 states for MDFA to accept ◮ L′ requires 2n − 1 states for the reversal of a MDFA to accept ◮ MDFA exponentially more succinct than reversal of MDFA
◮ Modifying Veloso and Gill’s design, Leung showed
◮ MDFA exponentially more succinct than UFA ◮ n states 0, 1, . . . , n − 1. Smallest UFA has 2n − 1 states. ◮ All states are starting states. States 0, 2, 4, 6, ... are final. ◮ δ(0, 0) = 1, δ(i, 0) = i for 0 < i < n, δ(j, 1) = (j + 1) mod n
◮ Modify L. Modify SUFA A to obtain a UFA (reversal of DFA).
◮ Append a query Qi (Assert:
Register i is on)
◮ Add a new and only final state f . New transitions: (i, Qi, f ) ◮ Equivalent MDFA has ≥ 2n − 1 states. Otherwise,. . . ◮ UFA exponentially more succinct than MDFA ◮ DFA/UFA exponentially more succinct than reversal of MDFA
SLIDE 9
SUFA simultaneously exponentially more succinct than UFA, MDFA and reversal of MDFA.
◮ Define L′ = LR · b · L where b is a new symbol. ◮ Construct B of 2n states for L′ by connecting AR with A. ◮ replicate n copies of B, each with a different starting state. ◮ nondeterministic union is a SUFA of O(n2) states. ◮ Smallest MDFA for L′ has at least 2n − 1 states.
◮ Suppose the contrary. ∃ a MDFA N for L′ of < 2n − 1 states. ◮ Remove all transitions encountered before N processes b. ◮ Define starting states to be {q | (q′, a, q) is a transition of N}. ◮ Constructed a MDFA of < 2n − 1 states for L. Contradiction.
◮ Smallest reversal of MDFA for L′ has at least 2n − 1 states.
◮ Follows from previous result as (L′)R = L′.
◮ Smallest UFA for L′ has at least 2n − 1 states.
◮ Recall xQ′ and yQ′′ as defined before. ◮ Apply Schmidt’s technique, take x′
Q′ = bxQ′ and y ′ Q′′ = yQ′′.
SLIDE 10