On the Complexity of k-Piecewise Testability and the Depth of Automata Tomáš Masopust and Michaël Thomazo TU Dresden, Germany DLT 2015 1 / 24
Problems 2 / 24
Problems Problem (k-PiecewiseTestability) Input: an automaton (min. DFA or NFA) A Output: Y ES if and only if L ( A ) is k-PT Quest.: complexity Problem (Bounds on automata of k-PT languages) Input: Σ = { a 1 , a 2 ,..., a n } , n ≥ 1 , and k ≥ 1 Quest.: length of a longest word, w , such that 1. sub k ( w ) : = { u ∈ Σ ∗ | u � v , | u | ≤ k } 1 = Σ ≤ k , 2. prefixes w 1 � = w 2 of w , sub k ( w 1 ) � = sub k ( w 2 ) 1 abc � bacabbabca 3 / 24
Piecewise testable languages (PT) Definition A regular language is piecewise testable if it is a finite boolean combination of languages of the form Σ ∗ a 1 Σ ∗ a 2 Σ ∗ ··· Σ ∗ a n Σ ∗ where n ≥ 0 and a i ∈ Σ . It is k-piecewise testable (k-PT) if n ≤ k . 4 / 24
Piecewise testable languages (PT) Definition A regular language is piecewise testable if it is a finite boolean combination of languages of the form Σ ∗ a 1 Σ ∗ a 2 Σ ∗ ··· Σ ∗ a n Σ ∗ where n ≥ 0 and a i ∈ Σ . It is k-piecewise testable (k-PT) if n ≤ k . Example (PT language) Σ ∗ a 1 Σ ∗ a 2 Σ ∗ ··· Σ ∗ a n Σ ∗ � a 1 a 2 ··· a n ∈ L 4 / 24
PT recognition Σ ∗ a 1 Σ ∗ a 2 Σ ∗ ··· Σ ∗ a n Σ ∗ � � Bool 2 ) Theorem (min. DFA characterization 1. Partially ordered – acyclic, but with self-loops 2. Confluent – ∀ q ∈ Q , ∀ a , b ∈ Σ , ∃ w ∈ { a , b } ∗ s.t. ( qa ) w = ( qb ) w p a , b c a c b q 2 Version by Klíma + Polák 2013 5 / 24
PT recognition Σ ∗ a 1 Σ ∗ a 2 Σ ∗ ··· Σ ∗ a n Σ ∗ � � Bool 2 ) Theorem (min. DFA characterization 1. Partially ordered – acyclic, but with self-loops 2. Confluent – ∀ q ∈ Q , ∀ a , b ∈ Σ , ∃ w ∈ { a , b } ∗ s.t. ( qa ) w = ( qb ) w p w ∈ { a , b } ∗ a , b c a a c b b w q 2 Version by Klíma + Polák 2013 5 / 24
What do we know about PT languages? 6 / 24
What do we know about PT languages? ◮ Simon 1975 piecewise testable = J -trivial 6 / 24
What do we know about PT languages? ◮ Simon 1975 piecewise testable = J -trivial ◮ Stern 1985 piecewise testability for DFAs is in PT IME , O ( n 5 ) 6 / 24
What do we know about PT languages? ◮ Simon 1975 piecewise testable = J -trivial ◮ Stern 1985 piecewise testability for DFAs is in PT IME , O ( n 5 ) ◮ Trahtman 2001 piecewise testability for DFAs in quadratic time 6 / 24
What do we know about PT languages? ◮ Simon 1975 piecewise testable = J -trivial ◮ Stern 1985 piecewise testability for DFAs is in PT IME , O ( n 5 ) ◮ Trahtman 2001 piecewise testability for DFAs in quadratic time ◮ Klíma, Polák 2013 another quadratic-time algorithm for DFAs 6 / 24
What do we know about PT languages? ◮ Simon 1975 piecewise testable = J -trivial ◮ Stern 1985 piecewise testability for DFAs is in PT IME , O ( n 5 ) ◮ Trahtman 2001 piecewise testability for DFAs in quadratic time ◮ Klíma, Polák 2013 another quadratic-time algorithm for DFAs ◮ Cho and Huynh 1991 piecewise testability for DFAs is NL-complete 6 / 24
What do we know about PT languages? ◮ Simon 1975 piecewise testable = J -trivial ◮ Stern 1985 piecewise testability for DFAs is in PT IME , O ( n 5 ) ◮ Trahtman 2001 piecewise testability for DFAs in quadratic time ◮ Klíma, Polák 2013 another quadratic-time algorithm for DFAs ◮ Cho and Huynh 1991 piecewise testability for DFAs is NL-complete ◮ Holub, M., Thomazo 2014 + piecewise testability for NFAs is PS PACE -complete 6 / 24
What do we know about PT languages? ◮ Simon 1975 piecewise testable = J -trivial ◮ Stern 1985 piecewise testability for DFAs is in PT IME , O ( n 5 ) ◮ Trahtman 2001 piecewise testability for DFAs in quadratic time ◮ Klíma, Polák 2013 another quadratic-time algorithm for DFAs ◮ Cho and Huynh 1991 piecewise testability for DFAs is NL-complete ◮ Holub, M., Thomazo 2014 + piecewise testability for NFAs is PS PACE -complete ◮ Boja´ nczyk, Segoufin, Straubing 2012 PT tree languages 6 / 24
Problem 1 7 / 24
k-PiecewiseTestability Σ ∗ a 1 Σ ∗ a 2 Σ ∗ ··· Σ ∗ a n Σ ∗ � � with n ≤ k Bool Problem (k-PiecewiseTestability) Input: An automaton (min. DFA or NFA) A Output: Y ES if and only if L ( A ) is k-PT Trivially decidable – finite number of k-PTL over Σ A 8 / 24
DFAs 9 / 24
Complexity of k-Piecewise Testability for DFAs Theorem The following problem N AME : K -P IECEWISE T ESTABILITY I NPUT : a minimal DFA A O UTPUT : Y ES if and only if L ( A ) is k-PT belongs to co- NP . 10 / 24
0-Piecewise Testability DFAs � Σ ∗ L ( A ) is 0-PT iff L ( A ) = 0 / Complexity O ( 1 ) 11 / 24
1-Piecewise Testability Theorem To decide whether a min. DFA recognizes a 1-PT language is in L OG S PACE . L ( A ) 1-PT iff the two patterns hold in every state and letter(s) a b a a a b Syntactic monoids of 1-PTL defined by equations x = x 2 and xy = yx . 3 3 Simon, Blanchet-Sadri 12 / 24
2-Piecewise Testability Theorem To decide whether a min. DFA recognizes a 2-PT language is NL -complete. A min. acyclic and confluent DFA (checked in NL); L ( A ) 2-PT iff ∀ a ∈ Σ , ∀ s ∈ Q s.t. q 0 w = s for a w ∈ Σ ∗ with | w | a ≥ 1 , sba = saba ∀ b ∈ Σ ∪{ ε } . y a b a q 0 s a a b Synt. monoids of 2-PT defined by xyzx = xyxzx and ( xy ) 2 = ( yx ) 2 (Blanchet-Sadri) y z x x q 0 s x x z 13 / 24
2-Piecewise Testability Theorem To decide whether a min. DFA recognizes a 2-PT language is NL -complete. A min. acyclic and confluent DFA (checked in NL); L ( A ) 2-PT iff ∀ a ∈ Σ , ∀ s ∈ Q s.t. q 0 w = s for a w ∈ Σ ∗ with | w | a ≥ 1 , sba = saba ∀ b ∈ Σ ∪{ ε } . y a b a q 0 s a a b Synt. monoids of 2-PT defined by xyzx = xyxzx and ( xy ) 2 = ( yx ) 2 (Blanchet-Sadri) y z x x q 0 s x x z 13 / 24
2-Piecewise Testability Theorem To decide whether a min. DFA recognizes a 2-PT language is NL -complete. A min. acyclic and confluent DFA (checked in NL); L ( A ) 2-PT iff ∀ a ∈ Σ , ∀ s ∈ Q s.t. q 0 w = s for a w ∈ Σ ∗ with | w | a ≥ 1 , sba = saba ∀ b ∈ Σ ∪{ ε } . y a b a q 0 s a a b Synt. monoids of 2-PT defined by xyzx = xyxzx and ( xy ) 2 = ( yx ) 2 (Blanchet-Sadri) y z x x q 0 s x x z 13 / 24
3-Piecewise Testability Theorem To decide whether a min. DFA recognizes a 3-PT language is NL -complete. Blachet-Sadri: Equations ( xy ) 3 = ( yx ) 3 , xzyxvxwy = xzxyxvxwy and ywxvxyzx = ywxvxyxzx 14 / 24
k-Piecewise Testability Theorem N AME : K -P IECEWISE T ESTABILITY I NPUT : a minimal DFA A O UTPUT : Y ES if and only if L ( A ) is k-PT Complexity: in co- NP ◮ O ( 1 ) for k = 0 , ◮ L OG S PACE for k = 1 , ◮ NL -complete for k = 2 , 3 , 15 / 24
k-Piecewise Testability Theorem N AME : K -P IECEWISE T ESTABILITY I NPUT : a minimal DFA A O UTPUT : Y ES if and only if L ( A ) is k-PT Complexity: in co- NP ◮ O ( 1 ) for k = 0 , ◮ L OG S PACE for k = 1 , ◮ NL -complete for k = 2 , 3 , Recently, a co-NP upper bound in terms of separability Hofman, Martens, “Separability by Short Subsequences and Subwords”, ICDT 2015 15 / 24
k-Piecewise Testability Theorem N AME : K -P IECEWISE T ESTABILITY I NPUT : a minimal DFA A O UTPUT : Y ES if and only if L ( A ) is k-PT Complexity: in co- NP ◮ O ( 1 ) for k = 0 , ◮ L OG S PACE for k = 1 , ◮ NL -complete for k = 2 , 3 , ◮ co- NP -complete for k ≥ 4 . Recently, a co-NP upper bound in terms of separability Hofman, Martens, “Separability by Short Subsequences and Subwords”, ICDT 2015 Even more recently, co-NP-completeness for k ≥ 4 Klíma, Kunc, Polák, “Deciding k -piecewise testability”, submitted, unaccessible Thanks to an anonymous reviewer and the authors 15 / 24
NFAs 16 / 24
Complexity of k-PT for NFAs Theorem The following problem N AME : K -P IECEWISE T ESTABILITY NFA I NPUT : an NFA A O UTPUT : Y ES if and only if L ( A ) is k-PT is PS PACE -complete. 17 / 24
Problem 2 18 / 24
Bounds on min. DFAs of k-PT languages Problem (Bounds on automata of k-PT languages) Input: Σ = { a 1 , a 2 ,..., a n } , n ≥ 1 , and k ≥ 1 Quest.: length of a longest word, w , s.t. 1. sub k ( w ) : = { u ∈ Σ ∗ | u � v , | u | ≤ k } 4 = Σ ≤ k , 2. prefixes w 1 � = w 2 of w , sub k ( w 1 ) � = sub k ( w 2 ) 4 abc � bacabbabca 19 / 24
Bounds on min. DFAs of k-PT languages Problem (Bounds on automata of k-PT languages) Input: Σ = { a 1 , a 2 ,..., a n } , n ≥ 1 , and k ≥ 1 Quest.: length of a longest word, w , s.t. 1. sub k ( w ) : = { u ∈ Σ ∗ | u � v , | u | ≤ k } 4 = Σ ≤ k , 2. prefixes w 1 � = w 2 of w , sub k ( w 1 ) � = sub k ( w 2 ) Solution � k + n � | w | = − 1 k 4 abc � bacabbabca 19 / 24
Consequences Theorem (Klíma + Polák 2013) Given a min. DFA recognizing a PT language. If the depth is k , then the language is k -PT. 5 depth = # states on longest simple path − 1 ; simple path = all states pairwise different 6 states are ∼ k classes: u ∼ k v iff sub k ( u ) = sub k ( v ) 20 / 24
Recommend
More recommend