Efficient Algorithms for Membership in Boolean Hierarchies of Regular Languages
The purpose of this paper is to provide efficient algorithms that decide membership for classes of several Boolean hierarchies for which efficiency (or even decidability) were previously not known. We develop new forbidden-chain characterizations for…
Authors: Christian Glasser, Heinz Schmitz, Victor Selivanov
Symposium on Theoretical Aspects of Computer Science 2008 (Bordeaux), pp. 337-348 www .stacs-conf .org EFFICI ENT ALGORITHMS F OR MEMBERSHIP IN BOOLEAN HIERAR CHIE S OF REGULAR LANGUA GES C. GLASSER 1 , H. SCHMITZ 2 , AND V. SELIV ANOV 3 1 Universit¨ at W ¨ urzburg, German y . E-mail addr ess : glasser@in formatik.uni- wuerzburg.de 2 F achhochsc hule T rier, German y . E-mail addr ess : schmitz@in formatik.fh- trier.de 3 A. P . Ershov Institute of Informatics Systems, R ussia. E-mail addr ess : vseliv@nsp u.ru Abstra ct. The purp ose of this paper is to p rovide efficient algorithms that decide mem- b ership for classes of several Boolean hierarc hies for whic h efficiency (or even decidabil ity) w ere previously not kno wn. W e dev elop new fo rbidd en-chain c haracterizations for the single levels of th ese hierarc hies and obtain th e follow ing results: • The classes of the Bo olean hierarch y o ver level Σ 1 of the dot-depth hierarch y are decidable in NL ( p reviously o nly the decidability was known). The same remains true if predicates mo d d for fixed d are allow ed. • If mo dular predicates for arbitrary d are allow ed, then the classes of the Bo olean hierarc hy o ver level Σ 1 are decidable. • F or the restricted case of a tw o-letter alphab et, th e classes of the Boolean hierarc hy o ver level Σ 2 of the Straubing-Th ´ erien hierarch y are decidable in NL. T h is is the first decidabilit y result for th is hierarc hy . • The membership problems for all mentioned Bo olean-hierarc hy classes are logspace many-one hard for NL. • The membership problems for quasi-aperiod ic languages and for d -quasi-ap eriod ic languages are logspace man y -one complete for PSP ACE. In tro duction The study of decidability and complexit y qu estions for classes of regular languages is a cen tral resea rch topic in automata theory . Its imp ortance s tems from the fact that fin ite automata are fund amen tal to man y branc hes of computer science, e.g., databases, op erating systems, ve rifi cation, hardware and softw are design. There are man y examples for decidable classes of regular la n guages (e.g., lo cally testable languages), while the decidabilit y o f other classes is still a c h allenging op en question (e.g ., Key wor ds and phr ases: automata and formal languages, compu tational complexity , dot-depth hierarc hy , Boolean hierarc hy , decidability , efficien t algorithms. This work was done during a sta y of the th ird author at the Universi ty of W¨ urzburg, supp orted by DF G Mercator program and by RFBR grant 07-01-0054 3a. c C. Glaßer, H. Schmitz, and V . Selivanov CC Creative Commons Attribution- NoDer ivs License 338 C. GLASSER, H. SCHMITZ, AN D V. SELIV ANOV dot-depth t wo , generalized star-heigh t). Moreo ve r , among the decidable classes th ere is a broad range of complexit y results. F o r some of them, e.g., the class of p iecewise testable languages, efficien t algo rith m s are kno w n that wo r k in nondeterministic l ogarithmic space (NL) and hen ce in p olynomial time. F o r other classes, a memb er s hip test n eeds more resources, e.g., deciding the mem b ership in the class of star-free languages is PSP A CE - complete. The p urp ose of this p ap er is to p r o vide e fficient algorithms that decide m em b ership for classes of several Bo olean hierarc hies f or which efficiency (or ev en decidabilit y) we re not p reviously k n o wn. Many of the kn o wn efficien t dec idab ility results for cl asses of regu- lar languages are based on so- called forbidden-p attern c haracterizations. Here a language b elongs to a class of regular languag es if and only if it s d eterministic finite automaton do es not ha ve a certain sub graph (the forbidd en p attern) in it s transition graph. Usu- ally , su c h a cond ition can b e c hec ke d efficien tly , e.g. , in nondetermin istic logarithmic space [Ste85a, CPP93, GS00a, GS00b]. Ho w eve r , for the Bo olean h ierarc hies considered in this p ap er, the design of efficien t algorithm is m ore inv olved, since h er e no forbid den-pattern c h aracterizations are kn o wn. More precisely , whereve r decidabilit y is known, it is obtained fr om a c haracterization of the corresp ondin g class in term s of forbidden alternating c hains of w ord extensions. Though the latter also is a forbidden prop erty , the known c haracterizations are not efficiently c hec k able in g eneral. (Exceptions a re the sp ecial ‘lo cal’ cases Σ 1 ( n ) and C 1 k ( n ) where decidabilit y in NL is kno wn [SW98, Sch01].) T o o ve rcome these difficulties, we first deve lop alternativ e forbidden-chain c h aracterizat ions (they essen tially ask only for certain reac habilit y cond i- tions in trans ition graphs). F rom ou r new c h aracterizations we o b tain effic ient a lgorithms for mem b ership tests in NL. F or tw o of the considered Bo olean hierarchies, these are the first decidable characte rizations at all, i.e., for the classes Σ 2 ( n ) for the alphab et A = { a, b } , and for the classes Σ τ 1 ( n )). Definitions. W e sk etc h the definitions of the Bo olean hierarc hies considered in this pap er. Σ 1 denotes the class of languages d efinable b y first-order Σ 1 -sen tences ov er the signature = {≤ , Q a , . . . } w h ere for every letter a ∈ A , Q a ( i ) is true if and only if the letter a app ears at the i -th p osition in the word. Σ 1 equals lev el 1 / 2 of th e Straubing- Th ´ e rien hierarch y (ST H for short) [Str81, T h ´ e 81, Str85, P P86]. Σ 2 is the class of languages definable by similar first-order Σ 2 -sen tences; this class equals lev el 3 / 2 of the Straubin g- Th ´ e rien hierarc h y . Let σ b e the signature obtained from by adding co ns tants for the minim u m and maxim um p ositions in w ords and adding functions that compute the s u ccessor and the predecessor of p ositions. Σ σ 1 denotes the class of languages d efinable by first-order Σ 1 -sen tences of the signatur e σ ; this class equ als leve l 1 / 2 of the d ot-depth hierarc hy (DDH for short) [CB71, Tho82]. Let τ d b e the signature obtained f rom σ by adding the unary predicates P 0 d , . . . , P d − 1 d where P j d ( i ) is true if and only if i ≡ j (mo d d ). Let τ b e the union of all τ d . Σ τ d 1 (resp., Σ τ 1 ) is the class of languag es d efi nable b y first-order Σ 1 -sen tences of the signature τ d (resp., τ ). C d k is th e generaliza tion of Σ 1 where neig hb orho o d s of k + 1 consecutiv e letters and d istances mo d ulo d are exp ressible (Definition 1.2). F or a class D (in our case one of the classes Σ 1 , Σ σ 1 , C d k , Σ τ d 1 , Σ τ 1 , and Σ 2 for | A | = 2), the Bo ole an hier ar c hy over D is the family o f classes D ( n ) d f = { L L = L 1 − ( L 2 − ( . . . − L n )) where L 1 , . . . , L n ∈ D and L 1 ⊇ L 2 ⊇ · · · ⊇ L n } . The Bo olean hierarchies consid ered in this pap er are illustrated in F igure 1 . EFFICIENT ALGORITHMS FOR BOOLEAN HIERARCHIES O F REGULAR LANGUAGES 339 { Σ 2 ( n ) } { Σ 1 ( n ) } Σ 1 BC(Σ 1 ) Π 1 Σ 0 = Π 0 Σ 2 BC(Σ 2 ) Π 2 { Σ σ 1 ( n ) } Σ σ 1 BC(Σ σ 1 ) Π σ 1 Σ σ 0 = Π σ 0 {C d k ( n ) } Σ τ d 0 = Π τ d 0 Π τ d 1 BC(Σ τ d 1 ) Σ τ d 1 BC( C d k ) C d k co C d k { Σ τ d 1 ( n ) } co C 1 k { Σ τ 1 ( n ) } Σ τ 1 BC(Σ τ 1 ) Π τ 1 Σ τ 0 = Π τ 0 C 1 k {C 1 k ( n ) } BC( C 1 k ) aperio dic DDH ( A + ) STH ( A ∗ ) for d -quasi-ap erio dic | A | = 2 quasi-ap eriodic Figure 1: Bo olean hierarc hies considered in this paper . Our Con tribution. The pap er con tributes to the u nderstand in g of Boolean hierar- c hies of reg ular languages in t wo w ays: (1) F or th e classes Σ σ 1 ( n ), Σ τ d 1 ( n ), and Σ 2 ( n ) for the alphab et A = { a, b } we prov e new c haracterizations in terms of forbidden alternating chains. In case of Σ 2 ( n ) for the alphab et A = { a, b } , this i s the first c haracterization of this c lass. (2) F or the classes Σ σ 1 ( n ), C d k ( n ), Σ τ d 1 ( n ), and Σ 2 ( n ) for the al p hab et A = { a, b } we construct the first efficien t algorithms for testing memb ership in these classes. In particular, this yields the decidabilit y of the c lasses Σ τ 1 ( n ), and of Σ 2 ( n ) for the alphab et A = { a, b } . W e also sh o w that the mem b ership prob lems for all mentio n ed Boolean-hierarc hy classes are logspace many-o ne hard for NL. An ov erv iew of th e obtained decidabilit y and complexit y results can b e found in T able 1. Moreo v er, we p ro ve that the membersh ip problems for quasi- ap erio dic languages and for d -quasi-ap erio d ic languages are logspace many-o n e complete for PSP ACE. Bo olean hierarc h ies can also b e seen as fine-grain m easur es for regular languages in terms of descrip tional c omplexity . Note that the Bo olean hierarc hies considered in this pap er do not collapse [Shu98, SS00, Sel04]. Moreo ve r , all th ese hierarchies either are known or turn out to b e decidable ( see T able 1 for the attribution of th ese results). If in addition the Bo olean closure of the base class is decidable, th en we can ev en exactly compute the Bo olean level of a giv en language. By kno wn results (sum marized in Theorem 1.1), one can do th is exact computation of the lev el for the Boolean hierarchies ov er Σ 1 , Σ 2 (for alph ab et A = { a, b } ), C 1 k , Σ σ 1 , and Σ τ 1 . T o ac hiev e the same for th e Boolean hierarc hies o v er C d k and Σ τ d 1 w e n eed the decidabilit y of their Bo olean closures whic h is not kno wn . Related W ork . Due to the man y characte rizations of regular languages there are sev eral ap p roac hes to attac k decision p roblems on sub classes of regular la ngu ages: Amon g them there is the algebraic, the automata-theoretic, and the logical ap p roac h. I n this pap er 340 C. GLASSER, H. SCHMITZ, AN D V. SELIV A NOV Bo olean hierarch y classes decidabilit y complexit y Σ 1 ( n ) [SW98] NL-complete [SW98] C 1 k ( n ) [GS01a, Sel01] NL-complete [Sc h01] Σ σ 1 ( n ) [GS01a] NL-complete [this pap er] C d k ( n ) [Sel04] NL-complete [this pap er] Σ τ d 1 ( n ) [Sel04] NL-complete [this paper] Σ τ 1 ( n ) [this pap er] no efficien t b ound known (see Remark 4.3) Σ 2 ( n ) for | A | = 2 [this pap er] NL-complete [this pap er] T able 1: Ov erview of d ecidabilit y and complexit y results. w e mainly u se the logical appr oac h whic h has a long tradition starting with th e early work of T rakhten brot [T ra58] and B ¨ uc hi [B ¨ uc60]. Decidabilit y questions for Bo olean hierarchies o ver classes of concatenati on hierarc hies w ere previously studied by [SW98, Sc h01, GS01a, Sel04]. Enric hm en ts of the fir st-order logics related to the dot-depth hierarch y and the S traubing- Th ´ e rien hierarc hy w ere consider ed in [BCST92, Str94, MPT00, Sel04, CPS06]. F or more bac kground on regular languages, starfr ee languages, concatenatio n hierarc hies, and their decidabilit y questions we refer to the survey articles [Brz76, Pin95, Pin96a, Pin96b, Y u96 , PW02, W ei04]. P ap er O ut line. After the preliminaries, we exp lain the general idea of an efficient mem b ership algorithm for the classes C d k ( n ) (section 2). This easy example s ho ws h o w a suitable c haracterization of a Bo olean h ierarc hy can b e tu r ned into an efficien t membersh ip test. The algo rithm s for the ot h er Boolean h ierarc hies are similar, but more c omp licated. Section 3 pr ovides new alternating-c hain characte rizations for the Boolean h ierarc hies ov er Σ σ 1 , Σ τ d 1 , and Σ 2 for the alphab et A = { a, b } . In section 4 w e exploit these c haracterizations and obtain efficien t algorithms for testing the memb ership in these classes. In particular, w e obtain the decidabilit y of the cla sses Σ τ 1 ( n ) and Σ 2 ( n ) f or the alphab et A = { a, b } . Finally , section 5 provides lo w er b oun d s for the complexit y of the considered decidabilit y problems. As a consequ en ce (with th e exception of Σ τ 1 ( n )) th e membersh ip problems of all considered Bo olean lev els are logspace many-o n e complete for NL. In con trast, the mem b ership problems of the general classes FO τ and F O τ d are logspace many-one complete for PSP ACE and h ence are strictly more complex. Detaile d pro ofs are av ailable in the tec h nical rep ort [GSS07]. 1. Preliminaries In this section w e recall definitions and results that are needed later in the p ap er. If not stated otherwise, A denotes some finite alphab et with | A | ≥ 2. Let A ∗ and A + b e th e sets of finite (resp., of fi nite n on-empt y) words o v er A . If not stated otherwise, v ariables range ov er the set of natural n umb ers. W e use [ m, n ] as abb reviation for the in terv al { m, m + 1 , . . . , n } . F or a deterministic finite automaton M = ( A, Z, δ, s 0 , F ) (dfa f or sh ort), the num b er of states is d enoted by | M | and the accepted language is denoted by L ( M ). Moreo v er, for w ords x and y we write x ≡ M y if and only if δ ( s 0 , x ) = δ ( s 0 , y ). F or a class of languages C , BC( C ) denotes the Bo olean closure of C , i.e., the closure und er union, in tersection, and c omplementat ion. EFFICIENT ALGORITHMS FOR BOOLEAN HIERARCHIES O F REGULAR LANGUAGES 341 All hardn ess and completeness results in this pap er are with resp ect to logspace man y- one r eductions, i.e., wh enev er w e refer to NL-complete sets (resp., PSP ACE-complete sets) then w e m ean sets that are logspace many-one complete for NL (resp., PS P A CE ). 1.1. The Logical Approac h to Regular La nguages W e relate to an arb itrary alphab et A = { a, . . . } the signatures = {≤ , Q a , . . . } and σ = {≤ , Q a , . . . , ⊥ , ⊤ , p, s } , wh ere ≤ is a b inary relation s ym b ol, Q a (for an y a ∈ A ) is a unary r elation symb ol, ⊥ an d ⊤ are constant symb ols, and p, s are unary function s ym b ols. A wo rd u = u 0 . . . u n ∈ A + ma y be considered as a structur e u = ( { 0 , . . . , n } ; ≤ , Q a , . . . ) of signature σ , where ≤ has its usual meaning, Q a ( a ∈ A ) are unary pr edicates on { 0 , . . . , n } defined by Q a ( i ) ⇔ u i = a , the symb ols ⊥ and ⊤ denote the least and th e greatest elemen ts, while p and s are resp ectiv ely the p redecessor and successor functions on { 0 , . . . , n } (with p (0) = 0 and s ( n ) = n ). Similarly , a wo r d v = v 1 . . . v n ∈ A ∗ ma y b e considered as a structure v = ( { 1 , . . . , n } ; ≤ , Q a , . . . ) of signature . F or a sentence φ of σ (resp ., ), let L φ = { u ∈ A + | u | = φ } (resp., L φ = { v ∈ A ∗ | v | = φ } ). Sent ences φ, ψ are trea ted as equiv alent when L φ = L ψ . A language is F O σ -definable (resp., FO -definable) if it is of the form L φ , where φ ranges o ver fi rst-order sen tences of σ (resp., ). W e denote b y Σ σ k (resp., Π σ k ) th e class of languages that can b e defined b y a sen tence of σ ha ving at most k − 1 quan tifier alternations, starting with an existen tial (resp ., un iversal) quanti fi er. Σ k and Π k are defined analogously . It is w ell-kno wn that the class of FO σ -definable languages (and F O -definable lan- guages) coincides with the class of r e gular ap erio dic languages whic h are also kno wn as the star-fr e e languages . Moreo ve r there is a levelwise corresp ondence to concatenation h ierar- c hies: The cla ss es Σ k , Π k , and BC(Σ k ) co incide with the classes of the Straub ing-Th ´ e rien hierarc hy [PP86], while the classes Σ σ k , Π σ k , and BC(Σ σ k ) coincide with the classes of the dot-depth hierarc hy [Tho82]. W e will consider also some enric hm ents of the signature σ . Namely , for an y p ositiv e in teger d let τ d b e th e signature σ ∪ { P 0 d , . . . , P d − 1 d } , where P r d is th e unary pr edicate true on th e p ositions of a word wh ic h are equiv alen t to r mo dulo d . By FO τ d -definable language w e mean an y language of the form L φ , w here φ is a fi rst-order sen tence of signature τ d . Note that signature τ 1 is essen tially the same as σ b ecause P 0 1 is the v alid predicate. In con trast, for d > 1 the F O τ d -definable languages need not to b e ap erio dic. E.g., the sentence P 1 2 ( ⊤ ) defines the la n gu age L consisting of all words of ev en length whic h is kno wn to b e non-aperio d ic. W e are also in terested in the signature τ = S d τ d . Ba r rington et al. [BCST92, Str94] defined quasi-ap erio dic languages and sho we d that this class coincides with t h e cl ass of F O τ -definable la ngu ages. With t h e same pro of we obtain the equalit y of the class of d -quasi-ap erio d ic languages and the class of F O τ d -definable languages [Sel04 ]. It w as observe d in the same pap er that Σ τ n = S d Σ τ d n for eac h n > 0, wher e Σ n with an upp er index denotes the class of regular languag es defined b y Σ n -sen tences of the corresp onding signature in the upp er index. Theorem 1.1. F or the fol lowing classes D i t is de cidable whether a given dfa M ac c epts a language in D : BC(Σ 1 ) [Sim75] , BC(Σ 2 ) for | A | = 2 [Str88] , BC(Σ σ 1 ) [Kn a83] , BC(Σ τ 1 ) [MPT00] . W e do not kno w the decidabilit y of BC(Σ τ d 1 ). Ho we ver, it is lik ely to b e a generalizatio n of Knast’s pro of [Kna83]. 342 C. GLASSER, H. SCHMITZ, AN D V. SELIV A NOV 1.2. Preliminaries on t he C lasses C d k ( n ) W e will also r efer to ‘lo cal’ ve r sions of the BH’s ov er Σ σ 1 and Σ τ d 1 [Ste85a, GS01a, Sel01, Sel04]. F or an y k ≥ 0 the follo win g p artial order on Σ + w as studied in [Ste85a, GS01a, Sel01]: u ≤ k v , if u = v ∈ A ≤ k or u, v ∈ A >k , p k ( u ) = p k ( v ), s k ( u ) = s k ( v ), a n d there is a k -em b edding f : u → v . Here p k ( u ) (resp., s k ( u )) is the prefix (resp., suffix) of u of length k , and t h e k -em b edding f is a monoto n e injectiv e fun ction fr om { 0 . . . . , | u | − 1 } to { 0 . . . . , | v | − 1 } suc h that u ( i ) · · · u ( i + k ) = v ( f ( i )) · · · v ( f ( i ) + k ) for all i < | u | − k . Note that ≤ 0 is the subw ord relation. Definition 1.2 ([Sel04]) . Let k ≥ 0 and d > 0. (1) W e sa y that a k -em b edd ing f : u → v is a ( k , d )-em b eddin g, if P r d ( i ) implies P r d ( f ( i )) for all i < | u | and r < d . (2) F or all u, v ∈ A + , let u ≤ d k v mean that u = v ∈ A ≤ k or u, v ∈ A >k , p k ( u ) = p k ( v ), s k ( u ) = s k ( v ), and there is a ( k , d )-em b edding f : u → v . (3) With C d k w e denote the class o f a ll upp er sets in ( A + ; ≤ d k ). Note that for d = 1 the order ≤ d k coincides with ≤ k . By an alternating ≤ d k -chain of length n for a set L we mean a sequence ( x 0 , . . . , x n ) suc h th at x 0 ≤ d k · · · ≤ d k x n and x i ∈ L ⇔ x i +1 6∈ L for ev ery i < n . The chain is called 1-alternating if x 0 ∈ L , otherwise it is called 0-alternating . Prop osition 1.3 ([GS01a, Sel01, S el04]) . F or al l L ⊆ A + and n ≥ 1 , L ∈ C d k ( n ) if and only i f L has no 1-alternating chain o f length n in ( A + ; ≤ d k ) . Moreo v er, ( A + ; ≤ d k ) is a w ell p artial order, Σ τ d 1 = S k C d k , and Σ τ 1 = S k ,d C d k [GS01a, Sel01, Sel04]. Theorem 1.4 ([Ste85a]) . It is de cidable whether a given dfa ac c epts a language in BC( C 1 k ) . F or d > 1 it is not kn o wn whether BC( C d k ) is decidable. Ho wev er, w e exp ect that this can b e sho wn b y generalizing the pr o of in [Ste85a]. 2. Efficien t A lgorithms for C d k ( n ) The main ob jectiv e of this pap er is the design of efficient algorithms d eciding mem- b ersh ip fo r particular Bo olean hierarc hies. F or this, t w o th ings are needed: first, w e need to prov e suitable charac terizations for the sin gle lev els of these hierarc hies. Th is giv es us certain criteria that can be used f or testing memb ership. Sec ond , w e need to construct algorithms that efficien tly app ly these criteria. If b oth steps are successful, then we obtain an efficien t m em b ership test. Based on kno wn ideas for mem b ership tests for C 1 0 ( n ) [SW98] 1 and C 1 k ( n ) [Sch01], in this section we exp lain the construction of a nondeterministic, logarithmic-space mem b ership algorithm for the classes C d k ( n ). This is the fi rst efficien t mem b ership test for this general case. Our explanation has an exemplary charact er, since it sh ows how a suitable c haracter- ization of a Bo olean h ierarc hy can b e tu r ned in to an efficien t mem b er s hip test. Ou r results in later sections use similar, but more complicated constructions. 1 F or all n , t he classes C 1 0 ( n ) and Σ 1 ( n ) coincide up to the empty wo rd, i.e., C 1 0 ( n ) = { L ∩ A + ˛ ˛ L ∈ Σ 1 ( n ) } . EFFICIENT ALGORITHMS FOR BOOLEAN HIERARCHIES O F REGULAR LANGUAGES 343 W e start with the easiest case k = 0 and d = 1, i.e., with the classes C 1 0 ( n ). By Prop osition 1.3, L / ∈ C 1 0 ( n ) ⇔ L h as a 1 -alternating ≤ 0 -c hain of l ength n . (2.1) W e argue that for a giv en L , repr esen ted by a finite automaton M , the condition on the righ t-hand side can b e v erified in nond eterministic logarithmic space. So we ha ve to test whether there exists a c hain w 0 ≤ 0 · · · ≤ 0 w n suc h th at w i ∈ L if and only if i is ev en. This is done by the follo wing al gorithm. 0 // On input of a deter minist ic, f inite automat on M = ( A , Z , δ, z 0 , F ) the algo rithm tests whether L ( M ) ∈ C 1 0 ( n ) . 1 let s 0 = · · · = s n = z 0 2 do 3 nondet ermin istic ally cho ose a ∈ A and j ∈ [ 0 , n ] 4 for i = j to n 5 s i = δ ( s i , a ) // stand s for the imaginary command w i := w i a 6 next i 7 until ∀ i , [ s i ∈ F ⇔ i is even ] 8 accept The algorithm guesses the w ord s w 0 , . . . , w n in parallel. How ev er, instead of construct- ing these words in the memory , it guesses the words letter by letter and stores only the states s i = δ ( z 0 , w i ). More precisely , in eac h pass of the lo op w e choose a letter a and a n umb er j , and w e int erp ret this c hoice as app end ing a to th e w ords w j , . . . , w n . Simulta- neously , we up date the states s j , . . . , s n appropriately . By doing so, we guess all p ossib le c hains w 0 ≤ 0 · · · ≤ 0 w n in suc h a w a y that w e kno w the states s i = δ ( z 0 , w i ). This allo ws us to ea sily v erify t h e righ t-hand side of (2.1) in line 7. Hence, testing non-mem b ership in C 1 0 ( n ) is in NL. By NL = coNL [Imm88, Sze87], the mem b ership test also b elongs to NL. The algo rith m can b e mo dified suc h that it works f or C d 0 ( n ) where d is arbitrary: F or this w e hav e to m ake su re that the guessed ≤ 0 -c hain is even a ≤ d 0 -c hain, i.e., the word extensions must b e su c h that th e lengths of single insertions are divisible b y d . This is done b y (i) in tro d ucing new v ariables l i that count the cur ren t length of w i mo dulo d and (ii) by making sure that l i = l i +1 whenev er j ≤ i < n (i.e., lette rs th at app ear in b oth w ords, w i and w i +1 , m ust app ear at e quiv alen t p ositions mo dulo d ). So also the member s hip test for C d 0 ( n ) b elongs to NL. Finally , we adapt the algorithm to mak e it w ork for C d k ( n ) where d and k a re arbitrary . So we ha ve to mak e sure that the guessed ≤ d 0 -c hain is ev en a ≤ d k -c hain. F or this, let us consider an extension u ≤ d k w wh ere u, w ∈ A >k . Th e ( k , d )-em b edding f that is used in the d efinition o f u ≤ d k w ensures that for all i it holds that in u at p osition i there are the same k + 1 letters as in w a t p osition f ( i ). Therefore, a word extension u ≤ d k w can b e split into a series of elementa ry extensions of the form u 1 u 2 ≤ d 0 u 1 v u 2 suc h that th e length k pr efixes of u 2 and vu 2 are equal. The la tter is ca lled the pr efix c ondition . Moreo ver, w e can alw a ys make s ure that the p ositions in u at whic h the elemen tary extensions o ccur form a strictly increasing se qu ence. This a llo ws us to guess t h e w ords in the ≤ d k -c hain lette r by letter. No w the algorithm can test the prefix condition by introd ucing new v ariables v i that con tain a guessed preview of the next k letters in w i . Eac h time a letter is app ended to w i , (i) we verify that this letter is consisten t with the preview v i and (i i) we up date v i b y remo ving the fir st letter and by app ending a new guessed letter. In th is wa y the mo d ified algorithm carries the length k previews of the w i with it and it mak es sur e that guessed 344 C. GLASSER, H. SCHMITZ, AN D V. SELIV A NOV letters are consisten t with these p reviews. Moreo ve r , w e mo dify the algorithm su ch that whenev er j ≤ i < n , then the condition v i = v i +1 is tested. The latter m ak es su re that elemen tary extensions u 1 u 2 ≤ d 0 u 1 v u 2 satisfy the prefix condition and hence the inv olv ed w ords are e ven in ≤ d k relation. T his mo difi ed algorithm sho w s the follo wing. Theorem 2.1. { M M is a det. finite automaton and L ( M ) ∈ C d k ( n ) } ∈ NL for k ≥ 0 , d ≥ 1 . W e no w explain why the a b o v e idea does not immediately lead to a nond eterministic, logarithmic-space mem b ersh ip algorithm for the classes Σ σ 1 ( n ), although an alternating c hain c haracterization for Σ σ 1 ( n ) is known from [GS01a]. Note that the describ ed algorithm for C d k ( n ) stores the follo wing t yp es of v ariables in logarithmic sp ace. (1) v ariables s i that con tain sta tes of M (2) v ariables l i that con tain n um b ers f r om [0 , d − 1] (3) v ariables v i that con tain w ords of length k Ho w eve r , th e characte rization of the classes Σ σ 1 ( n ) [GS 01a ] is unsu itable for our al- gorithm: In order to ve r if y the forbidd en -c hain condition, we ha v e to guess a c hain of so-calle d structured wo rd s and hav e to mak e sure that certain parts u in these words are M -idemp otent (i.e., δ ( s, u ) = δ ( s , uu ) for all states s ). Again we would try to guess the w ords letter b y letter, bu t no w w e hav e to mak e sure that (larger) parts u of these w ord s are M -idemp oten t. W e do not kno w ho w to v erify the latter condition in logarithmic space. In a similar wa y one observ es that the kn o wn charac terization of the classes Σ τ d 1 ( n ) [Sel04] cannot b e used for the constru ction of an efficien t memb ership test. S o new c har- acterizat ions of Σ σ 1 ( n ) and Σ τ d 1 ( n ) are n eeded in order to o btain efficient m em b ership algo- rithms. 3. New Characterizations of Bo olean-Hierarc h y Classes In this section we devel op new alternating-c hain c haracterizations that al low the con- struction of efficient algorithms deciding mem b ership for th e Boolean hierarc hies o v er Σ σ 1 , Σ τ d 1 , and Σ 2 for | A | = 2. W e b egin with th e introdu ction of marke d wor ds and r elated partial orders which turn out to b e crucial for the d esign of efficien t algo rithm s. 3.1. Mark ed W ords F or a fixed finite alph ab et A , let A d f = [ a, u ] a ∈ A, u ∈ A ∗ b e the c orr esp ond- ing mark ed alphab et. W ords o v er A are call ed mark ed w ords. F or w ∈ A ∗ with w = [ a 1 , u 1 ] · · · [ a m , u m ] let w d f = a 1 · · · a m ∈ A ∗ b e the corresp onding u nmarke d word. S ometimes w e u se the functional n otation f i ( w ) = a 1 u i 1 · · · a m u i m , i.e., f 0 ( w ) = w . Clearly , f 0 : A ∗ → A ∗ is a surjection. F or x = x 1 · · · x m ∈ A + and u ∈ A ∗ w e d efine [ x, u ] d f =[ x 1 , ε ] · · · [ x m − 1 , ε ][ x m , u ]. Next w e defin e a relation on marked words. F or w , w ′ ∈ A ∗ w e write w w ′ if and only if th ere exist m ≥ 0, mark ed w ords x i , z i ∈ A ∗ , and marked letters b i = [ a i , u i ] ∈ A where u i ∈ A + s.t. w = x 0 b 1 x 1 b 2 x 2 · · · b m x m , and w ′ = x 0 b 1 z 1 b 1 x 1 b 2 z 2 b 2 x 2 · · · b m z m b m x m . W e call b i the con text letter of the in sertion z i b i . W e write w d w ′ if w w ′ and | f 0 ( z i b i ) | ≡ 0 (mo d d ) for all i . No te that 1 coincides with and observe th at d is a transitiv e relat ion. EFFICIENT ALGORITHMS FOR BOOLEAN HIERARCHIES O F REGULAR LANGUAGES 345 F or a dfa M = ( A, Z, δ, s 0 , F ) and s, t ∈ Z w e wr ite s w − → M t , if δ ( s, w ) = t and for all i , δ ( s, a 1 · · · a i ) = δ ( s, a 1 · · · a i u i ). So s w − → M t means that th e mark ed w ord w leads from s to t in a w a y su c h that the lab els of w are consisten t with lo ops in M . W e sa y that w is M -consisten t, if for some t ∈ Z , s 0 w − → M t and denote b y B M the set of mark ed w ords that are M -consisten t. Ev ery M -consisten t w ord has the follo wing nice pr op ert y . Prop osition 3.1. F or w = [ c 1 , u 1 ] · · · [ c m , u m ] ∈ B M and al l j ≥ 0 , f 0 ( w ) ≡ M c 1 u j 1 · · · c m u j m . 3.2. New Characterization of the Classes Σ σ 1 ( n ) and Σ τ d 1 ( n ) W e extend the kno wn c haracterization of th e classes Σ τ d 1 ( n ) [S el04 ] an d add a c harac- terizatio n in terms of alternating chains on M -consisten t mark ed wo rd s. Because w e can also restrict the length of th e la b els u i , w e denote by B c M for a ny c > 0 the set of mark ed w ords [ a 0 , u 0 ] · · · [ a n , u n ] that are M -consisten t and s atisfy | u i | ≤ c for all i ≤ n . Theorem 3.2. The fol lowing is e quivalent for d, n ≥ 1 , a dfa M , c = | M | | M | , and L = L ( M ) ⊆ A + . (1) L ∈ Σ τ d 1 ( n ) (2) f − 1 0 ( L ) h as no 1-alterna ting chain of length n in ( B M ; d ) (3) f − 1 0 ( L ) h as no 1-alterna ting chain of length n in ( B c M ; d ) The case d = 1 is an alternativ e to the kn o wn c haracterization of the classes Σ σ 1 ( n ) [GS01a]. Theorem 3.3. L e t M b e a dfa, L = L ( M ) ⊆ A + and n ≥ 1 . Then L ∈ Σ σ 1 ( n ) if and only if f − 1 0 ( L ) h as no 1-alterna ting chain of length n in ( B M ; ) . W e can giv e an up p er b ou n d on d for languages in Σ τ 1 ( n ). Theorem 3.4. F or every dfa M , c = | M | | M | , and d = c ! , L ( M ) ∈ Σ τ 1 ( n ) ⇒ L ( M ) ∈ Σ τ d 1 ( n ) . 3.3. Characterization of t he Classes Σ 2 ( n ) for | A | = 2 W e obtain an alternating-c h ain characte rization for the classes of the Bo olean hierarc hy o v er Σ 2 for the case | A | = 2. T his allo ws us to prov e the fi r st decidabilit y resu lt for this hierarc hy . No te that only in case | A | = 2 deci d abilit y o f BC(Σ 2 ) [Str88] and Σ 3 [GS01b] is kno wn. F or u ∈ A ∗ let α ( u ) b e the set of letters in u . W e sa y th at a mark ed word w = [ c 1 , u 1 ] · · · [ c m , u m ] satisfies the alphab et c ondition if for all u i 6 = ǫ it holds that α ( u i ) = A . Theorem 3.5. L et A = { a, b } , n ≥ 1 and let L ( M ) ⊆ A ∗ for some dfa M su ch that L = L ( M ) is a star-fr e e language. Then L ∈ Σ 2 ( n ) if and only if f − 1 0 ( L ) has no 1- alternating cha in ( w 0 , . . . , w n ) in ( B M ; ) such that al l w i satisfy the alphab et c ondition. 346 C. GLASSER, H. SCHMITZ, AN D V. SELIV A NOV 4. Decidabilit y and Complexit y The alternating-c hain charact erizations from the last sections can b e used f or th e con- struction of efficien t algo r ith m s for testing the mem b ership in these classes. As corolla ries w e obtain new decidabilit y results: the classes Σ τ 1 ( n ) and Σ 2 ( n ) for | A | = 2 are decidable. The c haracterizations give n in Theorems 3.2 and 3.3 allo w the co ns tr uction of nond e- terministic, logarithmic-space me mb ership tests for Σ σ 1 ( n ) and Σ τ d 1 ( n ). Theorem 4.1. F or al l n ≥ 1 , { M M is a det. finite automaton and L ( M ) ∈ Σ σ 1 ( n ) } ∈ NL . Theorem 4.2. F or al l n ≥ 1 , { M M is a det. finite automaton and L ( M ) ∈ Σ τ d 1 ( n ) } ∈ NL . Remark 4.3. Unfortunately , we d o not obtain NL-decidabilit y for the c lasses Σ τ 1 ( n ). T he reason is that the d in T h eorem 3.4 is extremely b ig, i.e., we only know the upp er bou n d d ≤ ( m m )! where m is the size of the automaton. W e lea ve the question for an impr o v ed b ound op en. Note that if d can b e b ounded p olynomially in the size of the automaton, then Σ τ 1 ( n ) is decidable in NL. Although d is very large, it is still compu table fr om the automaton M whic h implies the decidability of all lev els Σ τ 1 ( n ). This settles a question left op en in [Sel04]. Theorem 4.4. F or al l n ≥ 1 , { M M is a det. finite automaton and L ( M ) ∈ Σ τ 1 ( n ) } is de cidable. Theorem 4.5. F or al l n ≥ 1 , { M M is a det. finite automaton over th e alphab et { a, b } and L ( M ) ∈ Σ 2 ( n ) } ∈ NL . 5. Exact Complexity E st imations With the exception of Σ τ 1 ( n ), the members h ip problems of all classes of Boolean hier- arc hies considered in th is pap er are NL-complete. In con trast, the mem b ership problems of the general classes FO τ and FO τ d are P S P ACE-co mp lete and h ence are strictly more complex. Prop osition 5.1. L et C b e any class of r e gular q uasi-ap erio dic languages over A with | A | ≥ 2 and ∅ ∈ C . Then it is NL -har d to de cide whether a given dfa M ac c epts a language in C . T ogether with the upp er b ounds established in the previous sections this immed iately implies the follo wing exa ct co mp lexit y e stimations. Theorem 5.2. L et k ≥ 0 , n ≥ 1 , d ≥ 1 and C is one of the classes C d k ( n ) , Σ σ 1 ( n ) , Σ τ d 1 ( n ) , or Σ 2 ( n ) for | A | = 2 . Then { M M is a det. finite automaton and L ( M ) ∈ C } is NL - c omplete. W e conclude this section w ith a corollary of the PS P A CE -completeness of deciding FO σ whic h wa s established by Stern [Ste85b] and b y Cho and Huynh [CH91]. It shows that the complexit y of deciding t h e classes F O τ and F O τ d is strictly h igher than t h e co mp lexit y of deciding the classes ment ioned in Theorem 5.2. (Note that NL is closed un d er logspace man y-one redu ctions, NL ⊆ DSP ACE(lo g 2 n ) [Sa v70] and DSP ACE(lo g 2 n ) ( PSP A CE [HS65]. Hence t h e cl asses F O τ and F O τ d can not b e decided in NL.) Theorem 5.3. The c lasses F O τ and F O τ d ar e PSP ACE -c omplete. EFFICIENT ALGORITHMS FOR BOOLEAN HIERARCHIES O F REGULAR LANGUAGES 347 6. Conclusions The resu lts of this pap er (as well as s everal previous facts that app eared in the lit era- ture) sho w that more and more decidable lev els of hierarc hies turn out to b e decidable in NL. O ne is tempted to strengthen the w ell-kno w n c hallenging conjecture o f decidabilit y of the dot-depth hierarc hy to the conjecture that all lev els of r easonable hierarc h ies of fi rst- order definable regular languages are decidable in NL. A t least, it seems in structiv e to ask this question ab out any lev el of such a h ierarch y known to b e decidable. In this pap er w e considered the complexit y of classes of regular languages only w.r.t. the rep resen tation of regular languages by dfa’s. Similar questions are pr obably op en f or other natural represen tations of r egular languages, like nond eterministic finite automata and prop ositions of monadic s econd ord er, first order or temp oral l ogics. Ac knowled gemen t s W e are grateful to Klaus W. W agner for man y h elpful d iscu ssions. W e would lik e to thank the anonymous referees f or their v aluable comments. References [BCST92] D. A. Mix Barrington, K. Compton, H. Straubing, and D. Th ´ erien. Regular languages in N C 1 . J. C omputer and System Scienc es , 44:478–49 9, 1992. [Brz76] J. A. Brzozo wski. Hierarchies of ap eriodic languages. RAIRO I nform. The or. , 10:33–49 , 1976. [B¨ uc60] J. R . B ¨ uc hi. W eak second-order arithmetic and finite automata. In Z. Math. L o gik und grund l. Math. , 6:66-92, 1960. [CH91] S. Cho and D. T. Huy nh. Finite-aut omaton ap erio dicity is PSP ACE-complete. The or et. Computer Scienc e , 88:99–116 , 1991. [CB71] R. S. Cohen and J. A. Brzozo wski. Dot-depth of star-free even ts. J. Computer and System Sci- enc es , 5:1–16, 1971. [CPP93] J. Cohen, D. Perrin, and J. E. Pin. On the exp ressiv e p o wer of t emp oral logic. J. Computer and System Scienc es , 46:271–2 94, 1993. [CPS06] L . Chaubard, J. E. Pin, and H. Straubing. First order formula s with mo du lar predicates. In Pr o c. 21th I EEE Symp osium on L o gi c in Computer Scienc e , pp. 211–220. IEEE Comp. So ciet y , 2006. [GS00a] C. G laßer and H. Schmitz. Languages of dot-depth 3/2. In Pr o c. 17th ST ACS , Lect. Notes in Comp. Science 1770 , p p. 555–56 6. Springer, 2000. [GS00b] C. Glaßer and H. Schmitz. Decidable hierarc hies of starfree languages. In Pr o c. 20th FST-TCS , Lect. Notes in Comp. S cience 1974 , pp. 503–515. S pringer, 2000. [GS01a] C. Glaßer and H. S chmitz. The b o olean structure of dot-depth one. Journal of Automata, L an- guages and Combinatorics , 6(4):437–452 , 2001. [GS01b] C. Glaßer and H. Schmitz. Level 5 / 2 of the S traubing-Th´ erien hierarc hy for tw o-letter alphab ets. In Pr epr o c e e dings 5th Confer enc e on Developments in L anguage The ory , pp. 254–265, 2001. [GSS07] C. Glaßer, H. S chmitz and V. Seliv ano v. Efficient algorithms for membership in Bo olean hierar- chie s of regular languages. ECCC Rep ort TR07-094, Octob er 2007. [HS65] J. Hartmanis and R. Stearns. O n th e computational complexity of algorithms. T r ansactions of the Americ an Mathematic al So ciety , 117:285–30 6, 1965. [Imm88] N. I mmerman. Nondeterministic space is cl osed under complemen tation. SIAM J. Comput ing , 17:935– 938, 1988. [Kna83] R. Kn ast. A semigroup chara cterization of dot-dept h one languages. RAI RO Inform. The or. , 17:321– 330, 1983. [MPT00] A . Maciel, P . P´ eladeau, and D. Th´ erien. Programs ov er semigroups of dot–dep th one. The or et. Computer Scienc e , 245:135–14 8, 2000. [Pin95] J. E. Pin. Finite semigroups and recognizable languages: an introduction. In J. F ou ntain, editor, NA TO A dvanc e d Study Institute: Semigr oups, F ormal L anguages and Gr oups , pp. 1–32. Kluw er Academic Publishers, 1995. 348 C. GLASSER, H. SCHMITZ, AN D V. SELIV A NOV [Pin96a] J. E. Pin. Logic, semigroups and automata on words. Annals of Mathematics and Artificial In- tel li genc e , 16:343–38 4, 1996. [Pin96b] J. E. Pin. S yntactic semigroups. In G. Rozenberg and A. Salomaa, editors, Handb o ok of formal languages , volume I , pp. 679–746. Springer, 1996. [PW02] J. E. Pin and P . W eil. The wreath prod uct principle for ordered semigroups. Communic ations in Algeb r a , 30:5677 –5713, 2002. [PP86] D. Perrin and J. E. Pin. First-order log ic and s tar-free sets. Journal of Computer and Sy stem Scienc es , 32:393–4 06, 1986. [Sa v 70] W. J. Savitch. Relationships b etw een nondeterministic and deterministic tap e complexities. Jour- nal of Computer and System Sci enc es , 4(2):177–19 2, 1970. [Sch01 ] H. S chmitz. The F orbidden-Patt ern Appr o ach to Conc atenation Hier ar chies . PhD th esis, F akult¨ at f¨ ur Mathematik und Informatik, U niversit¨ at W ¨ urzburg, 2001. [Sel01] V. L. Seliv anov. A logical approach to decidabilit y of hierarchies of regular star-free languages. In Pr o c. 18th ST ACS , Lect. Notes in Comp. Science 2010 , pp. 539–550. S pringer, 2001. [Sel04] V. L. Seliv ano v . Some hierarchies and red u cibilities on regular languages. T ec hn ical Rep ort 349, Inst. f¨ ur Informatik, Univ. W ¨ urzburg, 2004. [Shu98] A .G. Shukin. D ifference h ierarchies of regular languages (in russian). Computing Systems (Novosi- birsk, Institute of Mathematics) , (161):141–155 , 1998. [Sim75] I . Simon. Piecewise testable even ts. In Pr o c e e dings 2nd GI Conf er enc e , Lect. Notes in Comp. Science 33 , pp. 214–222. Springer, 1975. [SS00] V. L . Seliv anov and A. G. Shukin. On h ierarc hies of regular star-free languages. T echnical Rep ort Preprint 69, A. P . Ersho v Institute of Informatics Sy stems, Nov osibirsk, 2000. [Ste85a] J. Stern. Characterizations of some classes of regular even ts. The or et. Computer Scienc e , 35:17–4 2, 1985. [Ste85b] J. St ern. Complexit y of some p rob lems from th e theory of automata. Information and C ontr ol , 66:163– 176, 1985. [Str81] H . Straub ing. A generalization of the Sch¨ utzenberger p rod u ct of finite monoids. The or et. Com- puter Scienc e , 13:137–15 0, 1981. [Str85] H . Straubing. Finite semigroup v arieties of the form V ∗ D . J.Pur e Appl.Algebr a , 36:53–94, 1985. [Str88] H . Straubing. Semigroups and languages of dot-d epth tw o. The or et. Computer Scienc e , 58:361– 378, 1988. [Str94] H . Straubing. Finite automata, formal lo gic and cir cuit c omplexity . Birkh ¨ auser, Boston, 1994. [SW98] H. Schmitz and K. W. W agner. The Bo olean hierarc hy over level 1/2 of the Straubing-Th´ erien hierarc hy . http://arxi v.org/abs/cs.CC/9 8 09118 . [Sze87] R. S zelepcs´ enyi. The metho d of forcing for nondeterministic automata. Bul l. of the EA T C S , 33:96–1 00, 1987. [Th ´ e81] D. Th´ erien. Classification of fi nite monoids: the language approach. The or et. Computer Scienc e , 14:195– 208, 1981. [Tho82] W. Thomas. Classifying regular even ts in symbolic logic. J. Comp. and System Sci enc es , 25:360– 376, 1982. [T ra58] B. A. T rakhten brot. Synthesis of logic netw orks whose op erators are d escribed by means of single- place predicate calculus. Doklady Akad. Nauk SSSR , 118:646– 649, 1958. [W ei04] P . W eil. Algebraic recognizabilit y of languages. In Pr o c. 29th M athematic al F oundations of Com- puter Scienc e , L e ct. Notes in Comp. Scienc e 3153 , p p . 149–17 5. Springer, 2004. [Y u96] S. Y u. Regular languages. In G. Rozenb erg and A. Salomaa, editors, Handb o ok of formal languages , vol u m e I, pp. 41–110. S p ringer, 1996. This work is licensed under the Creat ive Commons Attr ibution-NoDe rivs License. T o view a copy of this license, visit http: //creativ eco mmons.org/licenses/by- n d/3.0/ .
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment