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 ( w ) is the number of accepting paths for w . ◮ M is k-ambiguous if ∀ w , amb ( w ) ≤ k . ◮ M is unambiguous (UFA) if M is 1-ambiguous. ◮ M is finitely ambiguous (FNA) if M is k -ambiguous for some k . ◮ M is poly. amb. (PNA) if ∃ poly. p ∀ w , amb ( w ) ≤ p ( | w | ). ◮ M is exp. amb. (ENA) if ∃ exp. func. f ∀ w , amb ( w ) ≤ f ( | w | ). ◮ M is strictly exp. amb. if M is exp. amb. but not a PNA. ◮ M is strictly poly. amb. if M is exp. amb. but not a FNA. ◮ MDFA (DFA with multiple initial states) is a FNA SUFA (structurally unambiguous finite automata) ◮ Def: ∀ q ∀ x ∃ ≤ 1 path from q 0 (start state) to q processing x . ◮ defined in terms of the transition logic of the finite automaton ◮ definition independent of the choice of final states. ◮ UFA and reversal of MDFA are SUFA.
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 = { s 1 , . . . , s k } . ◮ Define M i = ( Q , Σ , δ, s i , F ), 1 ≤ i ≤ k . ◮ Let M to be a nondeterministic union of M i , 1 ≤ i ≤ k . ◮ Introduce a new start state with ǫ transitions going to M i ’s. ◮ Substitute ǫ moves with direct non- ǫ moves. ◮ Obtain a O ( n 2 )-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 = { q 1 , . . . , q n } , Σ , δ, S , F ) ◮ M is a GSUFA iff ∀ 1 ≤ i , j ≤ n , M i , j = ( Q , Σ , δ, q i , q j ) 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.
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 ( D 1 , . . . , D k ) ◮ 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
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 C i , 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. ◮ C 1 , 4 C 4 , 2 C 3 , 1 C 4 , 3 C 1 , 2 ∈ L C 1 , 4 C 4 , 2 C 3 , 2 C 3 , 1 C 2 , 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 , C i , j , j ) and ( k , C i , j , k ) if k � = j ◮ Nondeterministic move: ( i , C i , j , j ) and ( i , C i , j , i ) ◮ Reversal is a MDFA. Transitions: ( j , C i , j , i ) and ( k , C i , j , k ) if k � = j
Smallest UFA for L has 2 n − 1 states, where n ≥ 3. ◮ (Schmidt) Given a regular language R and strings x i , y i for i = 1 , 2 , . . . , n , let M be a matrix s.t. M [ x i , y j ] = 1 if x i y j ∈ R and 0 otherwise. Then any UFA for R has ≥ rank ( M ) states. ◮ Define x Q ′ s.t. A reaches Q ′ � = ∅ on processing x Q ′ . ◮ x Q ′ = C 1 , q 1 . . . C 1 , q k where 1 ∈ Q ′ = { q 1 , . . . , q k } . ◮ x Q ′ = C 1 , q 1 C q , 1 C q 1 , q 2 C q 1 , q 3 . . . C q 1 , q k where q ∈ Q − { 1 , q 1 } . ◮ Define y Q ′′ s.t. A R reaches Q ′′ � = ∅ on processing y R Q ′′ . Q ′′ = ǫ if Q ′′ = Q . ◮ y R ◮ y R Q ′′ = C q ′ 1 C q ′ 2 . . . C q ′ h − 1 C q 1 , q ′ 2 , q ′ 3 , q ′ h , q ′ h where Q − Q ′′ = { q ′ 1 , q ′ 2 , . . . , q ′ h } . and q 1 ∈ Q ′′ . ◮ Thus, x Q ′ y Q ′′ ∈ L iff Q ′ ∩ Q ′′ � = ∅ . ◮ rank( M ) = 2 n − 1. Smallest UFA for L has ≥ 2 n − 1 states. ◮ Incompletely specificied DFA for L has ≤ 2 n − 1 states. ◮ Thus, smallest UFA for L has 2 n − 1 states.
The smallest MDFA for L has 2 n − 1 states. ◮ Properties of L ◮ All prefixes of L are in L . ◮ S = { w | w − 1 L = Σ ∗ } is nonempty. ◮ T = { w | w − 1 L = ∅ } is nonempty. ◮ Smallest incompletely specified DFA D for L has 2 n − 1 states. ◮ One accepting sink state in D . (reached by processing w ∈ S ) ◮ ∀ u ∈ Σ ∗ − S − T , ∃ v s.t. ( uv ) − 1 L = L ◮ Other 2 n − 2 states in D are strongly conncected. ◮ Smallest MDFA for L has ≥ 2 n − 2 states. ◮ Suppose the contrary. ∃ k -entry MDFA with < 2 n − 2 states. ◮ Treat MDFA as a nondeterministic union of k DFA D 1 , . . . , D k . ◮ We can assume every state in D i is a final state. ◮ Aim: design a string t ∈ Σ ∗ − S − T such that MDFA aborts. ◮ Design w 1 s.t. D 1 aborts in processing w 1 . ◮ Design w 2 (may be ǫ ) s.t. D 2 aborts in processing w 1 w 2 . ◮ Define t = w 1 w 2 . . . w k . ◮ Need 2 n − 2 states to handle w ∈ Σ ∗ − S − T correctly. ◮ Needs one more accepting sink state for processing w ∈ S .
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 ′ = L R . There exists an n -state MDFA for L ′ ◮ Recall: L requires 2 n − 1 states for MDFA to accept ◮ L ′ requires 2 n − 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 2 n − 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 Q i ( Assert: Register i is on ) ◮ Add a new and only final state f . New transitions: ( i , Q i , f ) ◮ Equivalent MDFA has ≥ 2 n − 1 states. Otherwise, . . . ◮ UFA exponentially more succinct than MDFA ◮ DFA/UFA exponentially more succinct than reversal of MDFA
SUFA simultaneously exponentially more succinct than UFA, MDFA and reversal of MDFA. ◮ Define L ′ = L R · b · L where b is a new symbol. ◮ Construct B of 2 n states for L ′ by connecting A R with A . ◮ replicate n copies of B , each with a different starting state. ◮ nondeterministic union is a SUFA of O ( n 2 ) states. ◮ Smallest MDFA for L ′ has at least 2 n − 1 states. ◮ Suppose the contrary. ∃ a MDFA N for L ′ of < 2 n − 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 < 2 n − 1 states for L . Contradiction. ◮ Smallest reversal of MDFA for L ′ has at least 2 n − 1 states. ◮ Follows from previous result as ( L ′ ) R = L ′ . ◮ Smallest UFA for L ′ has at least 2 n − 1 states. ◮ Recall x Q ′ and y Q ′′ as defined before. ◮ Apply Schmidt’s technique, take x ′ Q ′ = bx Q ′ and y ′ Q ′′ = y Q ′′ .
Why SUFA? ◮ Efficiently implemented on sync. model of parallel computers ◮ one process thread is assigned to each state. ◮ when state is off, corresponding thread waiting to be woken up. ◮ no two messages sending to a thread at the same time. ◮ no buffer needed to hold incoming messages in sync. comp. ◮ Equivalent structural definitions for ENA, PNA and FNA ◮ M is str. ENA iff ∃ q , w s.t. ∃ ≥ 2 paths from q to q proc. w w w w ◮ M is str. PNA iff M not str. ENA and p → p , p → q , q → q ◮ M is FNA iff M is not str. ENA and not str. PNA. ◮ UFA is a semantic definition. SUFA is a structural definition. ◮ SUFA, FNA, PNA, ENA: a hierachy based on the struct. def. ◮ UFA, MDFA, Rev MDFA are incomparable w.r.t. desc. comp. ◮ UFA, MDFA, Rev MDFA contained in (separated from) SUFA Any natural-looking SUFA that is not UFA, MDFA or Rev MDFA?
Recommend
More recommend