An Application of the Feferman-Vaught Theorem to Automata and Logics for<br> Words over an Infinite Alphabet

We show that a special case of the Feferman-Vaught composition theorem gives rise to a natural notion of automata for finite words over an infinite alphabet, with good closure and decidability properties, as well as several logical characterizations.…

Authors: Alexis B`es

Logical Methods in Computer Science V ol. 4 (1:8) 2008, pp. 1–23 www .lmcs-online.org Submitted Jul. 21, 2006 Published Mar . 25 , 2008 AN APPLICA TION OF THE FE F ERMAN-V A UGHT THEOREM TO A UTOMA T A AND LOGIC S F O R WORDS O VER AN INFINITE ALPHABET ALEXIS B ` ES Lab oratoire d’Algorithmique, Complexit´ e et Logique, EA 4213, Un iversi t´ e P aris-Est e-mail addr ess : b es@univ-paris12.fr Abstra ct. W e sho w that a sp ecial case of the F eferman-V aught composition theorem giv es rise to a natural notion of automata for fin ite words ov er an infinite alphab et, with goo d cl osure and d ecidabilit y prop erties, as w ell as several logical chara cterizations. W e also co nsider a sligh t exten sion of the F eferman-V augh t formalism which allo ws to express more relations b etw een comp onent v alues (such as equalit y), and pro ve related decidabilit y results. F rom this result w e get n ew classes of decidable logics for words ov er an infinite alphab et. Introduction The problem of fi nding s u itable notions of automata for w ords o v er an infinite alph ab et has b een adressed in sev eral pap ers [1, 16, 3, 5, 10 , 24]. The motiv ations are e.g. mod - elizatio n of temp orized systems, distribu ted systems, or manipulation of semi-structured data. A common goal is to find a simp le and expressiv e mo del wh ic h preserves as m uch as p ossible the go o d p r op erties of the classical mo del. K aminski and F rancez [16] int ro- duce finite-memory automata : these are fin ite automata equipp ed with a finite n um b er of registers whic h allo w to store symb ols du ring th e run, and compare them with th e current sym b ol. The pap er [5] extends someho w this id ea by allo wing transitions whic h in vo lv e an equiv alence r elation of fin ite in dex defin ed on the set of (v ector) v alues of the registers. The pap er [24] con tin ues th e study of finite-memory automata, and also introdu ce p ebble automata, wh ic h are automata equipp ed with a fin ite set of p ebb les wh ose use is r estricted b y a stac k discipline. The automaton can test equalit y by comparing the p ebbled symb ols. The work [3] addresses decidabilit y issues for some fragmen t of first-order logic which allo w s to express prop erties of w ords o v er an infi nite alphab et, and in tro du ces a related notion of automaton. More recen tly , Choffrut and Grigorieff [10] define automata wh ose transitions are expressed as first-order form ulas (see b elo w). Let us also men tion the work [12] whic h studies v arian ts of constraint L TL o ver infinite domains. 1998 ACM Subje ct Classific ation: F.1.1, F.4.1, F.4.3. Key wor ds and phr ases: F eferman-V augh t metho d, composition th eorems, decidability , automata, infinite alphab et. LOGICAL METHODS l IN COMPUTER SCIENCE DOI:10.216 8/LMCS-4 (1:8) 2008 c  Alexis B ` es CC  Cre ative Com mons 2 ALEXIS B ` ES The aim of this pap er is to sho w that a sp ecia l case of the F eferman-V aught comp osition theorem giv es rise to a n atural n otion of automata for fin ite words o ve r an infinite alphab et, with goo d closure and decidabilit y pr op erties, as w ell as s ev eral logica l c haracterizatio ns. Building on Mosto wski’s w ork [23], F eferman and V augh t consider in [14] sev eral kind s of pro ducts of logical structures, and p r o v e that the first-order (shortly: FO) theory of a (generalized) pr o duct of structures reduces to the FO theory of the factor s tructures and the monadic second-order (shortly: MSO) theory of the index stru cture. W e r efer the interested reader to the su rv ey pap ers [21, 32] w hic h present s everal applications of these results, as w ell as extensions of the tec hniqu e; for r ecen t related results see e.g. [26, 27, 34]. An interesting sp ecia l case of the F eferman-V aught (shortly: FV) theorem is when one considers the generalized w eak p o wer of a single structur e M , and the index structur e is ( ω ; < ). In this case the domain of the resulting stru cture r ou gh ly c onsists in the set of finite words ov er the d omain of M (see n as an alphab et), and the d efinable relations can b e charact erized in terms of automata thanks to B ¨ uc hi-Elgot-T rakh ten brot results on the equiv alence b et we en definabilit y in the MSO theory of ( ω ; < ) and automata. The automata mo del and related logics w e consider can b e seen as direct reformulations of this sp ecial case. Note that the conn ection b et w een automata and pro ducts of stru ctur es was already explored in [2], wh ere it is sh o wn that automatic structures are closed und er finite pro du cts. F or the sake of readabilit y , in th e pap er we first in tro duce th e automata mod el and pro v e some of its prop erties, and then put in evidence the connection with the F eferman-V aught construction. In Section 2 w e define the automata mo d el. Giv en a str ucture M with domain Σ (finite or not), w e d efi ne M -automata as multita p e synchronous finite automata which read finite words o ver Σ, and whose transitions are lab elled b y fir s t-order form ulas in the language of M . W e s h o w that the class of relations recognizable b y such automata (which are call ed M -recogniza ble relations) are closed under b o olean and rational op erations, as w ell as pro jection, and that the emptiness problem is decidable whenever the F O theory of M is. These r esu lts are straigh tforw ard generalizations of the classical case of a finite alphab et. In Section 3 we provide tw o logical c haracterizatio ns of M -recogniza ble languages. The first one uses MSO log ic and is an easy adaptation of B ¨ uc hi’s cla ssical result [7]. F or the second one, we first introdu ce the notion of M -automatic structur es which extends the notion of au tomatic s tructures, and pro v e some basic r elated results. T hen w e extend the Eilen b erg-Elgot-Shepherdson FO formalism [13] for syn chronous r elations ov er w ords to the case of M -recognizable relatio ns. This result, and actually the automaton mo del itself, are a natural generalizati on of Ch offru t and Grigorieff results men tioned ab ov e [10]. Sev eral resu lts of Sectio n 2 and 3 are rather easy generalizatio ns or reform ulations of w ell-kno w n resu lts; therefore many pro ofs in these sections are only sketc hed. In Section 4 w e r ecall usefu l notions and results ab out pro ducts and p o we rs of structures, then sho w the close r elationship b et ween M -recognizabilit y and d efinabilit y in generalized w eak p o wers. This allo ws to revisit all pr evious results in the light of the F eferman-V aught framew ork. Section 5 pr esen ts some applications. W e first apply the previous ideas to impro v e a r ecen t r esult by Kuske and Lohrey [19] r elated to the monadic chai n logic of iteration structures; this application w as brough t to our att ent ion by W olfgang Thomas. In the second p art of the section, we p ro vide a logical charact erization of M -recogniza ble relations for the sp ecia l case where M = ( ω ; +), in terms of ordin al theories. FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 3 In terms of expressiv e p o w er, M -automata are incomparable w ith automata and logics considered in [3, 16, 24], since on one hand they allo w to express FO constraints, but on the other hand they cannot test w hether t wo p ositions in a w ord carry the same sym b ol (for instance, the language { aa | a ∈ Σ } is not M -recognizable wh enev er Σ is infinite, see Example 2.5). As sho w n e.g. in [3, 24] these kinds of tests ha v e to b e limited if one wan ts to k eep go o d decidabilit y p r op erties. In S ection 6 we pr op ose a sligh t extension of the F eferman-V aught formalism wh ic h allo ws to test wh ether an n − tup le s 1 , . . . , s n of symb ols app earing in distinct p ositions in a w ord w , satisfies a formula ϕ ( x 1 , . . . , x n ) in M . W e isolate a syn tactic fragmen t of this logic, wh ic h w e denote b y M S O + R ( L ), for whic h the satisfiabilit y problem (or in other words, the emptiness problem for related languages) still reduces to the decidabilit y of the FO theory of M . 1. Definitions and not a tions In th e s equel w e deal with finite w ords o v er some alphab et, finite or n ot. Giv en an alphab et Σ (finite or n ot) we denote by Σ ∗ (resp ectiv ely Σ ω ) the set of finite w ords (resp ec- tiv ely ω − w ords) ov er Σ. The empt y word is denoted b y ε , and the length of a finite w ord w by | w | . Giv en a w ord w ∈ Σ ∗ with length n , we denote by w [ i ] the i − th sym b ol of w (starting from i = 0). W e shall sa y that the p ositio n i c arries w [ i ]. W e consider sev eral logical formalisms. By F O we mean first-order logic w ith equalit y . W e sh all also consider Monadic Second-Ord er Logic (shortly: MSO). W e denote by F O ( M ) (resp ectiv ely M S O ( M )) the first-order (resp ectiv ely monadic second-order) theory of th e structure M . W e consider only relational s tructures. Giv en a language L and a L -structur e M , for ev ery rela tional sym b ol R of L we denote b y R M the inte rpr etation of R in M . Ho wev er, we w ill often confu se logica l symb ols w ith their interpretation. Moreo ve r we will use freely abbreviations su ch as ∃ x ∈ X ϕ . W e shall deal with multit ap e synchronous automata. As us ual, giv en n finite words ( w 1 , . . . , w n ) o ver Σ, we introdu ce a p ad d ing sym b ol #, and w e complete (if necessary) eac h w i with a su fficien t num b er of #’s in ord er to h a v e w ords of the same length. Doing this, w e obtain n words ov er Σ ∪ { # } with the same length, w h ic h can b e seen as a sin gle w ord o ver the alphab et (Σ ∪ { # } ) n (i.e. th e alphab et of n − tuples of elemen ts of Σ ∪ { # } ). This w ord will b e denoted by h w 1 , . . . , w n i . Consider a r elational language L and a L -structure M w ith domain Σ. Since w e ha v e to deal with the symb ol # we shall asso ciate to M the stru cture M # in the extended language L # = L ∪ { P # } , suc h that: • the d omain of M # is Σ ∪ { # } ; • for eve ry r elational symb ol R of L , we h a ve R M # = R M ; • P # ( x ) holds in M # if and only if x = #. 2. Definition a nd proper ties of M -automa t a In this section w e int ro d u ce the notio n of M -automata and M -rec ognizable relations, and pro ve some basic r esu lts. Let Σ denote an alphab et, fin ite or not, and let M d enote an L − str ucture with domain Σ. An M -automaton is a fi nite n − tap e synchronous non-deterministic automaton wh ic h reads finite words ov er Σ. T ransition r ules are triplets of the f orm ( q , ϕ, q ′ ), where q , q ′ are states of the automaton, and ϕ ( x 1 , . . . , x n ) is a first-order form u la in the language L # of 4 ALEXIS B ` ES M # . The transition ( q , ϕ, q ′ ) can b e executed if th e n − tuple of cu r rent symbols read b y the n heads satisfies ϕ in M # . Definition 2.1. Let Σ b e an alphab et and let M d enote an L − str ucture with domain Σ. An M -automato n is defined as a 7 − tuple A = ( Q, n, Σ , M , E , I , T ) wh ere • Q is a fin ite set (of states); • n ≥ 1 is the num b er of tap es; • E ⊆ Q × F n × Q is the set of tr ansitions, wh ere F n denotes the set of L # -form ulas with n free v ariables; • I ⊆ Q is the set of initial states; • T ⊆ Q is the set of terminal states. Giv en an n − tuple w = ( w 1 , . . . , w n ) of wo rds ov er Σ, a p ath γ in A lab ele d by h w i is a sequence of states γ = ( q 0 , . . . , q m ), such that m = |h w i| , q 0 ∈ I , and for ev ery i < m there exists a L # -form ula ϕ ( x 1 , . . . , x n ) suc h that ( q i , ϕ, q i +1 ) ∈ E and M # | = ϕ ( π 1 ( h w i )[ i ] , . . . , π n ( h w i )[ i ]) where π j ( h w i ) d en otes the j − th comp onen t of h w i . The path γ is suc c essfu l if q m ∈ T . W e sa y that w is accepted by A if h w i is the lab el of s ome successful path. W e denote b y L ( A ) the set of w ords w ∈ (Σ ∗ ) n whic h are accepted by A . Definition 2.2. L et n ≥ 1. A relation X ⊆ (Σ ∗ ) n is said to b e M -r e c o gnizable if and only if there exists an M -automaton A with n tap es suc h that X = L ( A ). Example 2.3. Let M = ( ω ; + ) w here + denotes the graph of addition. The follo w ing relations are M -recognizable: (1) the set of words ov er ω (seen as as an infi nite alphab et) of th e form (1 , 0 , ..., 0) (w e allo w the case where there is n o 0). Consider indeed the M -automaton with tw o states q 0 , q 1 , where q 0 is initial and q 1 is terminal, and wh ose set of transitions is { ( q 0 , ϕ 1 , q 1 ) , ( q 1 , ϕ 0 , q 1 ) } where ϕ 0 ( x ) is th e form ula x + x = x , and ϕ 1 ( x ) expresses that x = 1. The automaton is pictured in Figure 1. q 0 q 1 ϕ 1 ϕ 0 Figure 1: A simple M -automaton (2) the set of words o ve r ω whose symbols are alternativ ely ev en and o dd. Consider in deed the M -automat on with tw o states q 0 , q 1 , where q 0 , q 1 b oth are in itial and termin al states, and whose set of transitions is { ( q 0 , ϕ e , q 1 ) , ( q 1 , ϕ o , q 0 ) } where ϕ e ( x ) is the form ula ∃ z z + z = x , and ϕ o ( x ) = ¬ ϕ e ( x ). (3) the relation L ⊆ ω ∗ × ω ∗ × ω ∗ defined b y ( u, v , w ) ∈ L if and only if u, v , w hav e the same length, and moreo v er for eve ry i the i − th symbol o f w equals the s u m of the corresp ondin g symb ols of u and v . Consider ind eed the M -automaton w ith a single state q (which is initial and terminal) and a single tr ansition ( q , ϕ, q ) wh ere ϕ ( x, y , z ) is the form ula x + y = z . Observ e that if u, v and w do not hav e the same length then the last letter of h u, v , w i , say ( u m , v m , w m ), h as at least one comp onen t w hic h is equal FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 5 to #, whic h by th e v ery definition of M # implies M # 6| = ϕ ( u m , v m , w m ), whic h implies in turn that there is no (successful) ru n of A lab elle d b y h u, v , w i . Example 2.4. Let M = (Σ; ( P a ) a ∈ Σ ), w here P a ( x ) holds if and only if x = a . On e can sho w that if Σ is fi nite then M -recognizable relations coincide with synchronous relatio ns (as defined in [13]). Example 2.5. F or ev ery L -structure M = (Σ; ... ) suc h that Σ is infinite, the la nguage X = { aa | a ∈ Σ } is not M -recognizable. Ind eed assume for a con tradiction that there exists some M -automaton A = ( Q, n, Σ , M , E , I , T ) whic h accepts X . S ince X is infin ite and E is finite, there exists an infi nite subset of X whose elemen ts admit a common su ccessful path. More p r ecisely , there exist t wo trans itions ( q 0 , ϕ 1 , q 1 ) , ( q 1 , ϕ 2 , q 2 ) ∈ E s uc h that q 0 ∈ I , q 2 ∈ T , an d infinitely man y elemen ts a ∈ Σ satisfy M # | = ϕ 1 ( a ) and M # | = ϕ 2 ( a ). T h us there exist at least t w o distinct elemen ts a 1 6 = a 2 suc h that M # | = ϕ 1 ( a 1 ) and M # | = ϕ 2 ( a 2 ), whic h implies that a 1 a 2 is accepted b y A , and this leads to a contradict ion. The closure prop erties of synchronous relations s till h old for M -recogniza ble relations. Prop osition 2.6. The class of M -r e c o gnizable r elations is close d under (1) b o ole an op er ations; (2) cylindrific ation; (3) pr oje ction. Pr o of. (sk etc h ) (1) the closur e under union is a straigh tforw ard adaptation of the classical construction for non-deterministic automata. Let u s outline the pr o of f or the closure un der complemen tation. Ass u me that the r elation R ⊆ (Σ ∗ ) n is recognized by the M -automaton A . Let ϕ 1 , . . . , ϕ m denote th e f orm ulas whic h app ear in the transitions of A . Consider, for ev er y su bset J ⊆ { 1 , . . . , m } , the form ula ψ J : V i ∈ J ϕ i ∧ V i 6∈ J ¬ ϕ i . The M -automaton A ′ whic h is defi n ed from A by replacing ev ery transition ( q , ϕ i , q ′ ) ∈ E with all transitions of the form ( q , ψ J , q ′ ) wh ere i ∈ J , also recognizes R . Moreo v er A ′ can b e seen as a classical non-deterministic auto maton o ver th e fi nite “a lphab et” of form ulas ψ J , and thus it can b e determinized, i.e. transformed in to an equiv alen t M -automaton A ′′ whose transitions in v olv e the form ulas ψ J , and such th at for ev ery state q and every form ula ψ J there exists a single transition of A ′′ the form ( q , ψ J , q ′ ). No w one can use the usu al constru ction for complemen tation of deterministic automata, i.e. turn non-terminal states to termin al states and con v ersely , and get an M -automato n whic h r ecognizes (Σ ∗ ) n \ R . (2) is straigh tforw ard. F or (3) , in order to recognize th e pro jection of R ⊆ (Σ ∗ ) n , sa y o ver the n − 1 first comp onent s, it suffices to r eplace, in the M -automaton which recognizes R , all transi- tions ( q , ϕ ( x 1 , . . . , x n ) , q ′ ) with transitions ( q , ∃ x n ϕ ( x 1 , . . . , x n ) , q ′ ). Regarding the emp tiness p roblem for M -recognizable language s, th e main difference with the classical case is that in an M -automa ton A there can exist transitions ( q , ϕ, q ′ ) ∈ E suc h that no n − tuple of elemen ts of M # satisfies ϕ ; suc h trans itions will nev er b e executed by A . Thus one has to r emov e such transitions from E in order to apply the usual reac h ab ility algorithm for the emptiness problem; this can b e done effectiv ely if an d only if F O ( M # ) is decidable. Sin ce F O ( M # ) an d F O ( M ) are reducible to eac h other, w e get the follo wing result. Prop osition 2.7. The de cidability of the emptiness pr oblem for M -r e c o gnizable languages is e quivalent to the de cidability of F O ( M ) . 6 ALEXIS B ` ES 3. Logic an d M -a utoma t a There exist three imp ortan t logical formalisms wh ic h capture automata: • B¨ uc hi-Elgot-T rakhte nbrot MSO logic (see [7]), i.e. the w eak monadic second order theory of ( ω , < ); • the Eilenberg-Elgot-Shepherds on (shortly: EES ) formalism [13], i.e. the F O theory of S = (Σ ∗ ; E q Len g th,  , { L a } a ∈ Σ ) where - E q Leng th ( x, y ) holds if and only if x and y h a v e the same length - x  y holds if and only if x is a pr efi x of y - L a ( x ) holds if and only if a is the last lette r of x . • the so-called B ¨ uc hi Arithmetic of base k , i.e. the FO theory of the str ucture ( ω ; + , V k ) where V k ( x ) denotes the greatest p ow er of k which divides x , see [6]. In this section we extend the tw o first formalisms to the case of w ords o v er any alphab et (finite or not). In order to extend the EE S f ormalism, we introd uce the notion of M - automatic structure, whic h generaliz es the one of automatic structures. In Section 5.2 we will prov e that for M = ( ω ; +), the class of M -recog nizable relations corresp onds to the class of relations d efinable in the structure ( ω ω ; +). The latter stru cture can therefore b e seen as “B ¨ uc hi Arithmetic of base ω ”. 3.1. Monadic Second-Order Logic. B ¨ uc hi, Elgot and T rakh ten brot pro v e that languages of words defin able by MSO logic coincide with regular languages (see [33]). As an example if Σ = { a, b } then one can c h aracterize the set of words w ∈ aa ∗ b ∗ in MSO logic with the formula ∃ x ( Q a ( x ) ∧ ∀ y (( x < y → Q b ( y )) ∧ ( y < x → Q a ( y )))) where the (firs t-order) v ariables x, y are inte rpr eted as p ositions in the word, < denotes the natural ordering of p ositions, and Q s ( y ) holds if and only if the y − th p osition in the w ord carries the sym b ol s . The unary predicates Q a and Q b express prop erties related to elements of Σ. T hese prop erties are actually fi rst-order defi nable in the structure M = (Σ; P a , P b ). W e shall extend this formalism b y consid ering an y structur e M with domain Σ (finite or not) and add ing to the MSO f ormalism unary p redicates α F ( x ) whic h express that the sym b ol at p ositio n x satisfies th e form ula F in M . More formally , let M = (Σ; ... ) b e an L -structure. W e asso ciate to eve ry L # -form ula F some unary relational sy mb ol α F . W e define then M S O ( L ) as MSO o v er the language { <, ( α F ) F ∈F } wh ere F den otes th e set of (first-order) L # -form ulas with at least one free v ariable. Definition 3.1. W e say that A ⊆ (Σ ∗ ) n is M S O ( M ) -defina ble if there exists an M S O ( L )- sen tence ψ such that w = ( w 1 , . . . , w n ) ∈ A if and only if ( D , < D , ( α F ) F ∈F ) | = ψ where • D = { 0 , 1 , . . . , |h w i| − 1 } , and < D is the natural ordering relation restricted to D ; • F or every L # -form ula F with n free v ariables, and ev ery p osition x in w , the form ula α F ( x ) holds in ( D , < D , ( α F ) F ∈F ) if and only if M # | = F ( π 1 ( h w i )[ x ] , . . . , π n ( h w i )[ x ]) , where π i ( h w i ) denotes the i − th comp onent of h w i . FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 7 Example 3.2. Let M = ( ω ; +). • the set A ⊆ ω ∗ of w ords that cont ain on ly ev en sym b ols is M S O ( M )-definable by the sen tence ∀ y α F ( y ), wh ere F ( x ) : ∃ z ( z + z = x ) • the s et B ⊆ ω ∗ of w ords wh ose symb ols are alternativ ely ev en and o dd is M S O ( M )- definable by the formula ∀ x ∀ y (( x < y ∧ ¬∃ z x < z < y ) → (( α F ( x ) ↔ α ¬ F ( y )))) where F is the formula defin ed ab o ve. Example 3.3. Let M = (Σ; ( P a ) a ∈ Σ ). If Σ is finite, then M S O ( M )-definable languages coincide with languages defin ab le in B ¨ uc hi’s MSO logic. Indeed in this case it is rather easy to pro v e that an y formula F ( x 1 , . . . , x n ) in the language of M is equiv alen t to a b o olean com b ination of form u las of the form P a ( x i ), w hic h implies in tu rn that ev ery predicate α F ( y ) is equiv alent to a b o olean com bination of pr edicates Q a ( y ). W e no w generalize the equiv alence b etw een recognizabilit y and definabilit y to the case of an y alphab et Σ (finite or not). Prop osition 3.4. L et M b e a structur e with domain Σ . F or every n ≥ 1 and every r e lation R ⊆ (Σ ∗ ) n , the r elation R is M S O ( M ) -definable if and only if it is M -r e c o gnizable. Pr o of. The pro of is a simple adaptation from B ¨ uc hi’s equiv alence b et ween WMSO defin- abilit y and recognizabilit y [7]. F or the direction from recognizabilit y to d efi nabilit y one uses the B ¨ uc h i’s tec hn ique of encod ing of an accepting run of an automaton b y a formula. F or the con verse one uses the f act that the form ulas α F 1 , . . . , α F m app earing in an M S O ( L )- sen tence ψ can b e c hosen suc h that every n − tup le of elemen ts of the domain of M # satisfies exactly one formula among the F i ’s in M # , wh ic h allo ws then to see words o ve r Σ ∪ { # } as words o ver the finite alphab et { 1 , . . . , m } and then pro v e the resu lt by in d uction on the construction of ψ . 3.2. M -automatic structures and a n ext ension of the EES formalism. Automatic structures (see [15, 17, 2]) are relatio nal structures which can b e pr esen ted by finite automata o ver a finite alphab et. Definition 3.5. The stru cture N = ( N ; R 1 , . . . , R k ) is said to b e automa tic if there exist a finite alphab et Σ and an injectiv e mapping µ : N → Σ ∗ suc h that th e images by µ of N , R 1 , . . . , R k are sync hronous relations. The fund amental result ab out au tomatic s tr uctures is the follo wing. Theorem 3.6 ([15]) . If N is automatic then: (1) the image by µ of every r elation definable in N is a synchr onous r elation; (2) F O ( N ) is de cidable. W e can generalize the pr evious notions and results to the case of an infi nite alphab et. Definition 3.7. Let M = (Σ; . . . ) and N = ( N ; R 1 , . . . , R k ) b e t w o stru ctures. W e sa y that N is M -automatic if there exists an injectiv e mapping µ : N → Σ ∗ suc h that the images b y µ of N , R 1 , . . . , R k are M -recognizable relations. 8 ALEXIS B ` ES Example 3.8. Let M = ( ω ; +), and let N = ( ω \ { 0 } ; × ) where × denotes the graph of m ultiplication. The structure N (whic h is often called Skolem arithmetic ) is M -automatic. Consider indeed the function µ : ( ω \ { 0 } ) → ω ∗ whic h maps ev ery natural n um b er n > 1 whose prime decomp osition is n = p n 0 0 p n 1 1 . . . p n k k , wher e p i denotes th e i − th prime and n k 6 = 0, to the w ord µ ( n ) = n 0 n 1 . . . n k . Moreo v er let µ (1) = ε . It is not difficult to chec k that the image by µ of ω \ { 0 } and × are M -recognizable. One can pro ve rather easily th at if Σ is fi nite and M = (Σ; ( P a ) a ∈ Σ ), then M -automatic structures corresp ond to automatic structures. O n the other hand, there exist structures whic h are M -automatic b ut not automatic. F or ins tance in [2] it is pro v en th at the structure N considered in the previous example, i.e. Sk olem arithmetic, is not automatic 1 . W e can extend Theorem 3.6 in the follo wing w a y . Theorem 3.9. If N is M -automatic then: (1) the image by µ of every r elation definable in N is M -r e c o gnizable; (2) F O ( N ) r e duc es to F O ( M ) . Pr o of. (sk etc h ) This is a straigh tforwa rd adaptatio n of the pr o of of Theorem 3.6. F or (1) one pro ceeds by induction on the formulas and use the closure prop erties of M -recognizable relations as stated in P rop osition 2. 6. F or (2), one first deduces from (1) that the d ecidabilit y of F O ( N ) reduces to the decidabilit y of the emptiness p roblem for M -automata, and then uses Prop osition 2.7. Let us no w turn to the first-order c h aracterizatio n of M -recogniza bilit y . Eilen b erg, Elgot and Shepherd son p ro v e the follo win g resu lt. Theorem 3.10 ([13]) . L et Σ denote a finite alphab et with at le ast two elements. F or every n ≥ 1 , an n − ary r e lation over Σ is synchr onous if and only if it is definable in the structur e S = (Σ ∗ ; E q Len g th,  , { L a } a ∈ Σ ) wher e • E q Leng th ( x, y ) holds if and only if x and y have the same length; • x  y hold s if and only if x is a pr efix of y ; • L a ( x ) holds if and only if a i s the last letter of x . It is easy to c hec k that f or ev ery finite alphab et Σ th e structure S is automatic, and moreo ver one can d educe fr om the ab o ve theorem that every automatic structure is indeed F O − interpretable in S (see e.g. [2 ]). In [13], the authors aske d whether ther e is a n appropriate notio n of automata that captures this logic w hen Σ is infi n ite. Choffrut and Grigorieff [10] recen tly solv ed this problem (and also other questions r aised in [13]) by introducing a notion of automata with constrain ts expr essed as F O formulas. It app ears that the automata notion they consider captures exactly M -recognizable relations for the sp ecial case M = (Σ; ( P a ) a ∈ Σ ). W e can generalize the pr evious results in the follo w ing wa y . Definition 3.11. Let M = (Σ; R 1 , . . . , R k ) b e a structure. W e define the stucture S M = (Σ ∗ ; E q Len g th,  , A R 1 , . . . , A R k , A = ) 1 Note that Skolem arithmetic is tree-automatic in the sense of [2]. This comes from the fact that the structure M , i.e. Presburger arithmetic, is automatic. More generall y one can prov e that if M is an automatic structure and N is M - automatic then N is tree-automatic. FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 9 where • E q Leng th ( x, y ) holds if and only if x and y ha ve the same length; • x  y holds if and only if x is a prefix of y ; • for every i , A R i ( x 1 , . . . , x n ) holds if and only if there exist w ord s w 1 , . . . , w n ∈ Σ ∗ and sym b ols a 1 , . . . , a n ∈ Σ suc h that: - x i = w i a i for ev er y i ; - all w i ’s ha v e the same length; - ( a 1 , . . . , a n ) ∈ R M i . • A = ( x, y ) h olds if and only if x and y hav e th e same length and the same last letter. Theorem 3.12. L et M = (Σ; R 1 , . . . , R k ) b e a structur e, wher e | Σ | ≥ 2 . (1) F or every n ≥ 1 and every n − ary r elation R over Σ , the r elation R is M -r e c o gnizable if and only if it is definable in S M ; (2) F O ( S M ) r e duc es to F O ( M ) . Pr o of. (1) It is easy to c hec k that all base relations of S M are M -recogniza ble, wh ich implies that S M is M -automatic, an d thus b y Theorem 3.9 ev ery relation defin ab le in S M is M -recogniza ble. F or the con v erse one can adapt again B ¨ uchi’s tec h nique of enco ding run s of au tomata b y monadic s econd-ord er v ariables. Assume th at R ⊆ (Σ ∗ ) n is r ecognized b y some M - automaton A = ( Q, n, Σ , M , E , I , T ) w hose set of states is Q = { q 0 , . . . , q k } . W e can define R in S M b y a formula ϕ ( w 1 , . . . , w n ) whic h expr esses th e existence of a s u ccessful path of A , say ( q j 0 , q j 1 , . . . , q j m ), lab elled by h w 1 , . . . , w n i . The form ula enco d es the path with k + 2 words z 0 , z 1 , . . . , z k , y whose length is m + 1 (that is, |h w 1 , . . . , w n i| + 1), and such th at for ev ery i , the wo rd z j i is the only w ord among z 0 , z 1 , . . . , z k whose i − th sym b ol equals the i − th symb ol of y . Th at is, the v ariable y serves to iden tify z j i for ev er y p osition i (with the help of the pr edicate A = ). (2) This is an immediate consequence of Th eorem 3.9 together with the fact that S M is M -automatic . In Section 5 w e will impro v e item (2) of the ab o v e theorem by pro v in g that ev en the monadic second-order c hain logic of S M reduces to F O ( M ). 4. A spe cial case of the Fefe rman-V aught composition theor em In this section we pu t in evidence th e strong relationship b et wee n M -automata and a sp ecial case of the F eferman-V aught comp ositio n theorem. The F eferman-V aught metho d present ed in [14] generalizes Mosto wski’s work [23] ab out pro d ucts of str uctures. Let u s recall some useful notions and r esu lts from [23, 14]. Definition 4.1. Let M = (Σ; R M 1 , . . . , R M k ) b e a structure, and let I b e a n on emp t y set. The dir e ct p ower of a M w ith resp ect to I is defi n ed as the stru cture N = (Σ I ; R N 1 , . . . , R N k ) suc h that • the d omain of N is the s et Σ I of sequences f : I → Σ 10 ALEXIS B ` ES • for every j ∈ { 1 , . . . , k } , if R j is n − ary then for every n − tuple ( f 1 , . . . , f n ) of elemen ts of Σ I , w e ha v e ( f 1 , . . . , f n ) ∈ R N j if and only if ( f 1 ( i ) , . . . , f n ( i )) ∈ R M j for ev er y i ∈ I . Example 4.2. Let M = ( ω ; +), and I = ω . Th e dir ect p o wer of M w ith r esp ect to I is the structure N with d omain the set of sequen ces f : ω → ω (in other words, the set of ω − w ords o ver the alphab et ω ), and such that ( f 1 , f 2 , f 3 ) ∈ + N if and only if f 1 ( i ) + f 2 ( i ) = f 3 ( i ) for ev er y i ∈ ω . Mosto wski pro ves that the ev aluation of FO formulas in the dir ect p o wer N reduces to the ev aluation of formulas in the f actor structure M and formulas in the stru cture S = ( S ( I ); ⊆ ) (the index structur e ) where S ( I ) denotes the p o wer set of I , and ⊆ is in terpreted as the inclusion relatio n. Note that the F O theory of S is a v arian t of the MSO theory of I . Definition 4.3 . Let R b e an m − ary relatio n o v er elemen ts of Σ I . A r e duction se quenc e for R (with resp ect to the s tr uctures M , S ) is a sequence ξ = ( G, θ 1 , . . . , θ l ) suc h that • G is a formula in the language of S ; • θ 1 , . . . , θ l are form ulas in the language of M ; • for eve ry m -tuple ( f 1 , . . . , f m ) of elemen ts of Σ I , w e hav e ( f 1 , . . . , f m ) ∈ R if and on ly if S | = G ( T 1 , . . . , T l ) where T i =  x ∈ I | M | = θ i ( f 1 ( x ) , . . . , f m ( x )) } for ev ery i ∈ { 1 , . . . , l  . Example 4.2 (con t in ued). • The b ase r elation + N of N admits a reduction sequence with resp ect to M = ( ω ; +) and S = ( S ( ω ); ⊆ ). I n deed w e ha v e ( f 1 , f 2 , f 3 ) ∈ + N if and only if the set of indexes i suc h that f 1 ( i ) + f 2 ( i ) = f 3 ( i ) equals ω , that is if S | = ∀ Y Y ⊆ T where T = { i ∈ ω | M | = f 1 ( i ) + f 2 ( i ) = f 3 ( i ) } . Th us + N admits the reduction sequence ξ = ( G, θ 1 ), w here G ( X ) : ∀ Y Y ⊆ X and θ 1 ( x, y , z ) : x + y = z . More generally all b ase r elations of a d irect p o wer of a structur e M admit a reduction sequence. • Consider the f ormula F ( x ) : ∀ y 1 ∀ y 2 (( ∃ z 1 y 1 + z 1 = x ∧ ∃ z 2 y 2 + z 2 = x ) → ∃ u ( y 1 + u = y 2 ∨ y 2 + u = y 1 )) W e ha v e N | = F ( f ) if and only if f admits at most one non-n ull elemen t f ( i ), that is, if the set of elemen ts i su ch th at f ( i ) + f ( i ) 6 = f ( i ) con tains at most one element. The unary relation defined by F admits the r eduction sequence ξ = ( G, θ 1 ) where G ( x ) : ∀ Y ∀ Z (( Y ⊆ X ∧ Z ⊆ X ) → ( Y ⊆ Z ∨ Z ⊆ Y )) and θ 1 ( x ) : x + x 6 = x . Theorem 4.4 (Mosto wski [23 ]) . L et M b e a structur e, I b e a non empty set, and let N b e the dir e ct p ower of M with r esp e ct to I . Then FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 11 (1) one c an c ompute effe ctively a r e duction se quenc e for every r elation which is FO definable in N ; (2) the FO the ory of N r e duc es to the F O the ories of M and S . Mosto wski also p ro v es that F O ( S ) is d ecidable for ev ery set I (b y elimination of quan- tifiers), wh ich together with p oint (2) in the ab ov e theorem implies that for every I the F O theory of the p o wer of M with resp ect to I r educes to the F O theory of M . Example 4.2 ( con t inued). The FO theory of N is decidable, since it redu ces to the FO theory of ( ω ; +) which is d ecidable [25]. Another imp ortan t notion is the one of we ak dir e ct p ower of a stru cture. In this v arian t w e consider a s tructure M = (Σ; R M 1 , . . . , R M k , P M e ) with s ome d istinguished elemen t e ∈ Σ, and wh ere P e ( x ) holds in M if and only if x = e . Th e w eak p o we r of M w ith resp ect to I is defined in the same w a y as in Definition 4.1 bu t here the d omain of N is the set M ( I ) e of sequences f : I → Σ suc h that f ( i ) 6 = e for fi nitely many v alues of i . Mosto wski prov es that Theorem 4.4 still holds for wea k dir ect p o we rs, with the follo wing mo difications: • for the index structure S one considers the structure S f in = ( S + ( I ); ⊆ ) where S + ( I ) denotes the set of finite sub sets of I . • one considers only reduction sequences ξ = ( G, θ 1 , . . . , θ l ) suc h that M | = ¬ θ i ( e, . . . , e ) for ev er y i (this condition ensures that all sets T i in Definition 4.3 are finite). Note that S f in is a F O v arian t of the wea k MSO theory of I . I n [23] it is sho wn that F O ( S f in ) is decidable for ev ery set I . Th erefore F O ( N ) r educes to F O ( M ). Example 4.5. (Decidabilit y of S kolem arithm etic [23]) W e revisit h ere Example 3.8. Con- sider the structur e M = ( ω ; + , P 0 ) wh ere 0 is the distinguished elemen t, and I = ω . Then the wea k direct p o wer of M with resp ect to I is the structure N = ( ω ( ω ) 0 ; + , P 0 ) whose domain is th e set of sequences f : ω → ω suc h that f ( i ) 6 = 0 for fi nitely many v alues of i , + denotes the graph of addition of sequences f : ω → ω , and P 0 ( f ) holds only for f = 0. It follo ws from Mosto wski’s result that F O ( N ) is d ecidable since it reduces to F O ( M ) w h ic h is d ecidable [25]. No w observ e that the application h : ω ( ω ) 0 → ω \ { 0 } wh ic h maps ev ery sequence f ∈ ω ( ω ) 0 to the intege r h ( f ) = 2 f (0) 3 f (1) . . . , defines an isomorphism b et ween N and the structur e ( ω \ { 0 } ; × , P 1 ) where × denotes the graph of multiplica tion, and P 1 ( x ) holds if and only if x = 1. T herefore the F O theory of the latter s tructure is decidable. F eferman and V augh t [14] generalize Mosto wski’s tec hnique by allo wing index structures of the form S = ( S ( I ); ⊆ , S 1 , . . . , S m ) w here the S i ’s denote an y relations. Definition 4.6. Let M = (Σ; R M 1 , . . . , R M k ) b e a structure, I b e a set, and let S = ( S ( I ); ⊆ , S 1 , . . . , S m ) where the S i ’s denote relations. W e call gener alize d p ower 2 of M with r esp e ct to S ev ery structure of the form N = (Σ I ; P 1 , P 2 , . . . , P n ) suc h that all relations P i admit a reduction sequence with resp ect to M and S . Theorem 4.7 (F eferman-V aught [14]) . If N is a gener alize d p ower of M with r esp e ct to S , then The or em 4.4 holds for M , N and S . 2 Our definition is a sligh t mo dification of the original defi n ition. Indeed F efe rman and V augh t define the generalized p ow er of M with resp ect to S as the structure with domain Σ I and with infinitely man y relations P i , one for each relation which admits a reduction sequ ence. 12 ALEXIS B ` ES Example 4.8. Let I = ω , and let S b e the stru cture S ω = ( S ( ω ); ⊆ , ≪ ) where x ≪ y if and only if x and y are t w o singleton sets, say x = { m } and y = { n } , suc h that m < n . T his structure is a F O version of the MSO theory of ( ω ; < ), which wa s sho wn to b e decidable b y B ¨ uchi [8]. Let M = ( ω ; + ). Consider the stru ctur e N = ( ω I ; P 1 ) where P 1 ( f ) h olds in N if and only if ther e exist j ∈ ω su ch that f ( i ) = 0 f or every i > j . The structure N is a generalized p o wer of M with resp ect to S . Indeed it is easy to c hec k th at P 1 ( f ) holds in N if and only if S | = ∃ X 1 ∀ X 2 ( X 1 ≪ X 2 → X 2 ⊆ T ) where T = { i ∈ ω | M | = f ( i ) + f ( i ) = f ( i ) } . By Th eorem 4.7, the F O theory of N is d ecidable, since the F O theories of M and S ω are decidable by [25, 8]. F eferman and V aught also define the notion of gener alize d we ak p ower of a structure M = (Σ; R M 1 , . . . , R M k , P M e ) with resp ect to some index stru cture S . This notion generalizes the one of w eak p o wer by allo win g to deal with ind ex structures of the form S = ( S + ( I ); ⊆ , S 1 , . . . , S n ) where the S i ’s denote relations o ver S + ( I ). F eferman and V augh t p ro v e that Theorem 4.4 still holds for generalized w eak p o wers, with the same modifi cations as for direct w eak p o wers. Let us consider the case where S is the stru cture S <ω = ( S + ( ω ); ⊆ , ≪ ). T he F O theory of S <ω is a v ariant of the wea k MSO theory of ( ω ; < ). In this case there is a close corresp onden ce b et ween relations which adm it a reduction sequ en ce w ith resp ect to S , and M S O ( M )-definable relations, or equiv alently M -recogniza ble relations (by T heorem 3.4). Consider indeed an alph ab et Σ, and the application µ which maps ev ery finite word w o ver Σ to the ω − w ord µ ( w ) = w # ω o ver (Σ ∪ { # } ) ω . Th e w ord µ ( w ) can b e seen as an elemen t of (Σ ∪ { # } ) ( ω ) # . Giv en an n − ary relation R o v er Σ ∗ , we set µ ( R ) = { ( µ ( w 1 ) , . . . , µ ( w n )) | ( w 1 , . . . , w n ) ∈ R } . The relation µ ( R ) can b e seen as a subset of the set of sequences f : ω → ω ∪ { # } suc h that f ( i ) 6 = # for finitely many v alues of i , i.e. as a subset of (Σ ∪ { # } ) ( ω ) # . Prop osition 4.9. L et M = (Σ; . . . ) b e a structur e. F or every n ≥ 1 and every n − ary r elation R over Σ ∗ , the r elation R is M S O ( M ) -defina ble if and only if the r elation µ ( R ) admits a r e duction se quenc e with r esp e ct to M # and S <ω . W e shall illustr ate this prop ositio n by some example, and lea ve the pro of to the reader. Example 3.2 revisited . Let M = ( ω ; +), and let R den ote the set of words w o v er ω that con tain only even symb ols. The relation R is M S O ( M )- defin ab le by the sente nce ∀ y α F ( y ), where F ( x ) : ∃ z ( z + z = x ). In this case µ ( R ) corresp onds to the set of sequ ences f ∈ ( ω ∪ { # } ) ( ω ) # suc h that • the s et of indexes i suc h that f ( i ) 6 = # is an initial segment of ω ; • for eve ry i suc h that f ( i ) 6 = #, f ( i ) is ev en. This implies that µ ( R ) admits a r eduction sequence with resp ect to M # and S <ω . I ndeed w e ha v e f ∈ µ ( A ) if and only if S <ω | = ∀ X ∀ Y (( Y ⊆ T ∧ X ≪ Y ) → X ⊆ T ) ∧ ∀ Y ( Y ⊆ T → Y ⊆ T ′ ) where T = { i ∈ ω | M # | = f ( i ) 6 = # } FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 13 and T ′ = { i ∈ ω | M # | = ∃ z ( z + z = f ( i )) } The second part of th e ab o ve formula is a direct translation of the MSO sentence ∀ y α F ( y ) used to p r o v e the M S O ( M )-definabilit y of R . It is not difficu lt to pr o ve th at a similar translation is p ossible for ev ery M S O ( M )-definable relation. Recall th at by Prop osition 3.4, M S O ( M )-definabilit y and M -recognizabilit y are equiv- alen t. Prop osition 4.9 allo ws to r evisit our p revious results in terms of p o wers of structures: • The closure of M -recognizable relations u n der b o olean op eratio ns, pro jection and cylin- drification (Prop osition 2.6), could h a ve b een p r o v en as a consequence of Prop ositio n 4.9 together with the clo sure un der definabilit y of relations wh ic h admit a reduction sequence. • If N = ( N ; R 1 , . . . , R n ) is an M -automatic structur e then by Prop osition 3.4 and 4.9 the image by µ of the domain and b ase relations of N admit a reduction sequence with resp ect to M # and S <ω . Thus ev ery M -automatic structure is isomorphic to some relativized generalized wea k p ow er of M # with r esp ect to S <ω . Moreo v er by F eferman-V aught Theorem, F O ( N ) r educes to F O ( M # ) and F O ( S <ω ). Now one can redu ce F O ( M # ) to F O ( M ), and F O ( S <ω ) is d ecidable b y [7]. Finally this prov es that F O ( N ) reduces to F O ( M ), th at is, Theorem 3.9. • In the same w a y as M -automata o v er fi nite wo rds corresp ond to generalized w eak p ow ers with resp ect to the ind ex structure S <ω , one can defin e a notion of M -automata o v er ω − words and show that it corresp onds to generalized p o wers with resp ect to the ind ex structure S ω . 5. Applica tions 5.1. An application to monadic c ha in logic ov er iteration. W e apply the p revious results to impro ve a recent result of Ku sk e and Lohrey [19]. T his application w as b rought to our atten tion b y W olfgang Thomas. In [19] the authors consider decidabilit y issues relate d to mon ad ic second-order c hain logic, and applicatio ns to pu shdown systems. Giv en a structure A = ( A ; <, . . . ) w here < denotes a partial ordering, th e monadic sec ond-order c hain logic of A , whic h will b e denoted by M S O ch ( A ), is the fr agmen t of the MSO th eory of A where monadic sec ond order quantificati ons are restricted to c h ains (i.e. linearly ordered su bsets) with r esp ect to < . Th e logic M S O ch w as first in v estigated in [30 ]. Consider a L -structure M = (Σ; R 1 , . . . , R m ). The b asic iter ation of M is the s tr ucture M ∗ ba = (Σ ∗ ;  , ˆ A R 1 , . . . , ˆ A R m ) where, for ev ery relational s y mb ol R j with arit y n , ˆ A R j = { ( ua 1 , . . . , ua n ) | u ∈ Σ ∗ , ( a 1 , . . . , a n ) ∈ R M j } Kuske and Lohrey prov e the follo wing result. Theorem 5.1. [19, Theorem 4.10] F or every structur e M , the M S O ch the ory of M ∗ ba r e duc es to the F O the ory of M . W e can improv e this r esult by replacing the str ucture M ∗ ba with the structure S M whic h w e int ro d uced in Section 3.2. 14 ALEXIS B ` ES Theorem 5.2. F or every structur e M = (Σ; R 1 , . . . , R m ) , the M S O ch the ory of S M = (Σ ∗ ; E q Len g th,  , A R 1 , . . . , A R m , A = ) r e duc es to the F O the ory of M . Observe that all pr edicates ˆ A R i can b e defined in S M . Pr o of. The p ro of consists in tw o main steps . The first one is to r ed uce the M S O ch theory of S M to the F O th eory of some structure S ′ M with domain Σ ω . The tec h nique is an adaptat ion from [31, Sectio n 4]. Th e second step consists in proving that S ′ M is a generalized p o we r with resp ect to M and S ω , whic h allo ws then to use F eferm an-V augh t Theorem and the decidabilit y of F O ( S ω ) to conclude. W e first consider a v ariant of M S O ch of S M where only second-order v ariables o ccur; this can b e done by in tro du cing the inclusion predicate X 1 ⊆ X 2 , and replacing r elations b et we en elements b y the corresp onding relations b et we en singleton sets. No w every c h ain X of elemen ts of Σ ∗ can b e repr esen ted by a couple ( u, v ) of elemen ts of Σ ω in the follo w ing wa y: • u corresp onds to the “direction” of the c hain X , i.e. is suc h th at all elemen ts of X are prefixes of u (note that if X is infi nite then there exists a un ique su c h u ); • v indicates whic h prefixes of u b elong to X , in the follo w ing wa y: for ev ery intege r i , w e ha v e v [ i ] = u [ i ] if and only if the prefix of u of length i b elongs to X . According to this d efinition, an y couple ( u, v ) of elements of Σ ω represent s a single chain whic h will b e denoted by ch ( u, v ). The previous enco d ing allo ws to redu ce th e M S O ch theory of S M to the FO th eory of the structure: S ′ M = (Σ ω ; ≈ , ⊆ ′ , E q Len g th ′ ,  ′ , A ′ R 1 , . . . , A ′ R n ) where • ≈ ( u 1 , v 1 , u 2 , v 2 ) holds if and only if ch ( u 1 , v 1 ) = ch ( u 2 , v 2 ); • ⊆ ′ ( u 1 , v 1 , u 2 , v 2 ) h olds if and only if ch ( u 1 , v 1 ) ⊆ ch ( u 2 , v 2 ); • E q Leng th ′ ( u 1 , v 1 , u 2 , v 2 ) holds if and only if there exist t w o w ord s u, u ′ ∈ Σ ∗ suc h that ch ( u 1 , v 1 ) = { u } , ch ( u 2 , v 2 ) = { u ′ } , and S M | = E q Leng th ( u, u ′ ) ; •  ′ ( u 1 , v 1 , u 2 , v 2 ) holds if and only if there exist t w o w ords u, u ′ ∈ Σ ∗ suc h that ch ( u 1 , v 1 ) = { u } , ch ( u 2 , v 2 ) = { u ′ } , and S M | = u  u ′ ; • F or ev ery i , if R i is a n − ary relation, then A ′ R i ( u 1 , v 1 , u 2 , v 2 , . . . , u n , v n ) holds if and only if there exist w ords w 1 , . . . , w n ∈ Σ ∗ suc h that ch ( u j , v j ) = { w j } for ev ery j , and S M | = A R i ( w 1 , . . . , w n ). • A ′ = ( u 1 , v 1 , u 2 , v 2 ) holds if and only if there exist t wo wo rds u, u ′ ∈ Σ ∗ suc h that ch ( u 1 , v 1 ) = { u } , ch ( u 2 , v 2 ) = { u ′ } , and S M | = A = ( u, u ′ ); W e shall pr o v e that S ′ M is a generalized p o wer of M with r esp ect to S ω . T o th is aim, let us prov e that all base relations of S ′ M admit a reduction sequence with resp ect to M and S ω : • ⊆ ′ ( u 1 , v 1 , u 2 , v 2 ) h olds if and only if S ω | = T 1 ⊆ T 2 ∧ ∃ X ( I S ( X, T 3 ) ∧ T 1 ⊆ X ) where T 1 = { i ∈ ω | u 1 ( i ) = v 1 ( i ) } , T 2 = { i ∈ ω | u 2 ( i ) = v 2 ( i ) } , T 3 = { i ∈ ω | u 1 ( i ) = u 2 ( i ) } , FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 15 and I S ( X , T 3 ) is a formula w h ic h expresses th at X is the greatest initial segmen t of ω whic h is con tained in T 3 (this is expressible in S ω ); • ≈ ( u 1 , v 1 , u 2 , v 2 ) holds if and only if b oth ⊆ ′ ( u 1 , v 1 , u 2 , v 2 ) and ⊆ ′ ( u 2 , v 2 , u 1 , v 1 ) hold, from whic h we can deduce a redu ction sequence for the relation ≈ ; • E q Leng th ′ ( u 1 , v 1 , u 2 , v 2 ) holds if and only if T 1 and T 2 are singleto n sets and T 1 = T 2 , i.e. if S ω | = ∃ Y ( T 1 ≪ Y ) ∧ T 1 = T 2 (with the same notations as ab o v e); •  ′ ( u 1 , v 1 , u 2 , v 2 ) h olds if and only if S ω | = ∃ Y ( T 1 ≪ Y ) ∧ ( T 1 = T 2 ∨ T 1 ≪ T 2 ) ∧ ∃ X ( I S ( X , T 3 ) ∧ T 1 ⊆ X ); • for eve ry i , if R i is a n − ary relation, then A ′ R i ( u 1 , v 1 , u 2 , v 2 , . . . , u n , v n ) h olds if and only if all sets U j = { i ∈ ω | u j ( i ) = v j ( i ) } , j = 1 , 2 , . . . , m , are singleton sets and are equal, and are included in the set U = { i ∈ ω | M | = R j ( u 1 ( i ) , u 2 ( i ) , . . . , u n ( i )) } . These prop er ties can b e expressed in S ω . • the case of A ′ = ( u 1 , v 1 , u 2 , v 2 ) is similar to the previous case, with n = 2 and = in place of R j ; W e hav e pro v ed that S ′ M is a generalized p o wer of M with resp ect to S ω . By Theorem 4.7, F O ( S ′ M ) redu ces to the F O theories of M and S ω . No w F O ( S ω ) is decidable by B ¨ uc h i [8], thus F O ( S ′ M ) reduces to F O ( M ). 5.2. Ordinal addit ion and ( ω ; +) -recognizabilit y. W e shall fo cus no w on the case M = ( ω ; + ), where + denotes the graph of addition. I n this case w e present another log ical c h aracterizati on of M -recognizable r elations in term s of ordin al theories. This is essenti ally a reform ulation of kno wn resu lts. In the sequel w e consider structures of the f orm ( α ; +) where α is an ordinal. The domain is the s et of ordinals less than α , and + is in terpreted as the g raph of ordinal addition restricted to the domain. F eferman a nd V augh t pro v e in [14] th at for every ordinal γ the stru cture ( ω γ ; +) is isomorphic to some generalized wea k p o wer of ( ω ; +) with resp ect to ( S + ( γ ); ⊆ , ≪ ) 3 . In particular for γ = ω their resu lt, com b ined with B ¨ uchi’s resu lt, implies that via some enco ding all relations definable in ( ω ω ; +) are ( ω ; +)-recognizable, and that the theory of ( ω ω ; +) is decidable. Let u s b e more s p ecific. W e fir st recall some useful results on ord inal arithmetic; all of them can b e found e.g. in S ierpinski’s b o ok [29, chap.XIV] Prop osition 5.3 (Can tor normal form for ordinals) . Every or dinal α > 0 c an b e written uniquely as α = ω α 1 a 1 + · · · + ω α k a k wher e α 1 , α 2 , . . . , α k is a de cr e asing se quenc e of or dinals, and 0 < a i < ω . 3 As a corolla ry , the FO theory of ( ω γ ; +) reduces to th e FO theory of ( ω ; +) (Presburger Arithmetic, whic h is decidable [25]) and the w eak MSO theory of ( γ , < ). The latter was prove d to be decidable by B¨ uchi [9] a few years after F eferman-V aught’ w ork, which imp lies the decidability of the FO theory of ( ω γ ; +). 16 ALEXIS B ` ES The follo win g prop osition relates the Cantor normal form of the ord inal α + β to the one of α and β . Prop osition 5.4. L et α = ω α 1 a 1 + · · · + ω α k a k and β = ω β 1 b 1 + · · · + ω β l b l b e two or dinals > 0 in Cantor normal form. • If α 1 < β 1 then α + β = β • If α 1 ≥ β 1 and if α j = β 1 for some j , then α + β = ( ω α 1 a 1 + · · · + ω α j − 1 a j − 1 ) + ω α j ( a j + b 1 ) + ( ω β 2 b 2 + · · · + ω β l b l ) • If α 1 ≥ β 1 and if α j 6 = β 1 for every j , then α + β = ( ω α 1 a 1 + · · · + ω α m a m ) + ( ω β 1 b 1 + · · · + ω β l b l ) wher e m is the gr e atest i ndex for which α m > β 1 . Consider no w th e fun ction f : ω ω → ω ∗ whic h maps every ordinal α < ω ω , w ritten in Can tor normal form as α = P i =0 i = m ω i a i with a i < ω and a m 6 = 0, to the word c ( α ) = a 0 . . . a m o ver the alph ab et ω . Giv en n ordinals α 1 , . . . , α n , w e define c ( α 1 , . . . , α n ) as h c ( α 1 ) , . . . , c ( α n ) i , where w e c ho ose 0 as the p ad d ing sym b ol #. Example 5.5. Consid er the ordinals α = ω 6 · 5 + ω 4 · 4 + ω 3 · 3 + ω 1 · 2 + ω 0 · 11 , and β = ω 3 · 17 + ω 2 · 6 + ω 1 · 2 . Then b y Prop osition 5.4 (second case), the ord inal γ = α + β equals γ = ( ω 6 · 5 + ω 4 · 4) + ω 3 · (3 + 17) + ( ω 2 · 6 + ω 1 · 2) . W e h a ve c ( α, β , γ ) =   11 0 0     2 2 2     0 6 6     3 17 20     4 0 4     0 0 0     5 0 5   . Prop osition 5.4 is the key argumen t in F eferman-V augh t’ pr o of that ( ω γ ; +) is iso- morphic to some generalized we ak p o w er of ( ω ; +) with resp ect to ( S + ( γ ); ⊆ , ≪ ). Let u s reform ulate their ideas in term s of ( ω ; +)-automata. Prop osition 5.6. The image by c of th e g r aph of ad dition for or dinals < ω ω is ( ω ; +) - r e c o gnizable. Pr o of. A con venien t ( ω ; +)-automaton whic h recognizes the language X = { c ( α, β , γ ) | α, β , γ < ω ω , α + β = γ } is pictured in Figure 2, where • ϕ 1 ( x, y , z ) : z = y • ϕ 2 ( x, y , z ) : y 6 = 0 ∧ z = x + y • ϕ 3 ( x, y , z ) : y = 0 ∧ z = x FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 17 q 0 q 1 ϕ 1 ϕ 2 ϕ 3 Figure 2: An ( ω ; +)-automaton for ordinal ad d ition This automaton h as t w o states q 0 , q 1 . Both are initial states, and only q 1 is final. Using q 1 as th e in itial state allo ws to deal with the case β = 0; in this case we ha v e γ = α , wh ich is c h ec ked by the transition lab elle d b y ϕ 3 . Using q 0 as an initial state allo ws to deal with the case β 6 = 0. I n this case let ω β 1 denote the greatest p o wer of ω whic h app ears in the Cantor n ormal form of β . The transition lab elled b y ϕ 1 allo ws to deal with coefficient s of p o wers ω i where i < β 1 ; for these p o w ers the corresp onding co efficien ts of β and α + β m us t b e equal. The transition lab elled b y ϕ 2 corresp onds to th e p o w er ω β 1 . Then for all p o wers ω j suc h that j > β 1 , the corresp onding co efficien ts of α and α + β coincide; this corresp onds to th e transition lab elled by ϕ 3 . W e can p ro vide no w a c haracterization of M -reco gnizable relations for the case M = ( ω ; + ). Prop osition 5.7. F or every n ≥ 1 , and every n − ary r elation R over ω ω , the r elation R is definable i n ( ω ω ; +) if and only if c ( R ) is ( ω ; +) -r e c o gnizable. Pr o of. (sk etc h ) The “only if” part co mes from the fact that th e range of c , as well as the graph of ordinal add ition, are ( ω ; +)-recognizable. Thus ( ω ω ; +) is ( ω ; +)-automatic, and the result follo w s from Th eorem 3.9. F or the con ve rse one can use aga in B¨ uc hi’s encodin g technique as in Theorem 3.12 . Assume that c ( R ) is ( ω ; +)-recognizable by some ( ω ; +)-automaton A wh ose set of states is Q = { q 0 , q 1 , . . . , q m } . W e can define R in ( ω ω ; +) b y a formula ϕ ( α 1 , . . . , α n ) whic h expresses the existence of a successful path of A , say ( q j 0 , q j 2 , . . . , q j m ), lab elled by c ( α 1 , . . . , α n ). T he form ula enco des the path with an ord inal of the form γ = ω m j m + ω m − 1 j m − 1 + · · · + ω 0 j 0 . W e n eed to defin e the f ollo wing auxiliary predicates (we explain briefly ho w to define them in ( ω ω ; +)): • α < β (w e ha ve α < β if and only if there exists some non-null ordinal γ suc h that β = α + γ ); • the f unction ( x 1 , . . . , x n ) 7→ max( x 1 , . . . , x n ); • “to b e a limit ordin al less than ω ω ” (these are non-n ull ordinals which ha v e no p r edecessor with resp ect to < ); • P ow ( x ) whic h holds iff x is a p o wer of ω less than ω ω (whic h holds iff x is a limit ord inal and there do not exist limit ord inals β , γ suc h that x = β + γ and γ ≤ β ); • F or every i < ω , the relation M ul t i ( x ) w hic h h olds iff x an ordinal of th e f orm ω k · i (easily definable with the predicate P ow ( x )); • the f unction x 7→ xω (for x 6 = 0, the ordinal xω is the least p o wer of ω grea ter than x ); • App ( x, y ) wh ic h holds iff y is a p o wer of ω whic h app ears in the C antor norm al f orm of x (this holds if and only if P ow ( y ) holds and moreo v er there exist ord in als β 1 , β 2 suc h that x = β 1 + y + β 2 and β 2 < y ); 18 ALEXIS B ` ES • AddC oef ( x, y , z ) wh ic h holds if and only if there exist i, j, k ≤ ω suc h that x = ω k i , y = ω k j and z = ω k ( i + j ) – whic h is equiv alen t to s a yin g that z = x + y and there exists exactly one ordinal α such that App ( x, α ) ∧ App ( y , α ) ∧ App ( z , α ) h olds. • T er m ( x, y , z ) wh ic h h olds iff z is a p ow er of ω , sa y z = ω k , y = ω k i f or some i < ω , and y is the term w hic h corresp ond s to ω k in the Cantor normal form of x . The relation T er m ( x, y , z ) h olds if and on ly if P ow ( z ) holds, z is the only p o wer of ω w hic h app ears in the Can tor n ormal form of y , and there exist ord inals β 1 , β 2 suc h that x = β 1 + y + β 2 with β 2 < y , and z do not app ear in the Cantor n ormal forms of β 1 and β 2 . • F or ev ery formula ψ ( x 1 , . . . , x n ) in the language { + , = } one can defin e the pr edicate S ψ ( y 1 , . . . , y n , z ) wh ic h holds if and only if z is a p o wer of ω , s a y z = ω k , and if we d enote b y a 1 , . . . , a n the co efficien ts of ω k in the Canto r normal forms of y 1 , . . . , y n , resp ectiv ely , then ( ω ; +) | = ψ ( a 1 , . . . , a n ). T he p redicates S ψ can b e d efined fr om T er m and AddC oef b y induction on the construction of ψ . • C od i ( x, y ) exp resses that y is a p o wer of ω an d the co efficient of y in the Canto r n ormal form of x equ als i . This pr ed icate is easily definable from th e predicates M ul t i and T er m . Finally w e can defin e the f ormula ϕ ( α 1 , . . . , α n ) as ∃ γ  γ < max( α 1 , . . . , α n ) · ω (5.1) ∧ _ q i ∈ I C od i ( γ , ω 0 ) (5.2) ∧  ∀ β (( P ow ( β ) ∧ β ≤ max( α 1 , . . . , α n ) · ω ) − → (5.3) _ ( q i ,ψ ,q j ) ∈ E ( C od i ( γ , β ) ∧ S ψ ( α 1 , . . . , α n , β ) ∧ C od j ( γ , β ω ))  (5.4) ∧ _ q i ∈ T C od i ( γ , max( α 1 , . . . , α n ) · ω )  (5.5) Line 5.2 states that the first s tate of the sequence of states enco d ed by γ is an initial state; lines 5.3 and 5.4 that consecutiv e states in the sequence use transitions of the automaton, and line 5.5 that the last state of the s equence is terminal. Remarks 5.8. • One can prov e that the graph of x 7→ ω x is not M -recognizable, either in a direct wa y , or using the fact that by [11] the theory of ( ω ω ; + , x 7→ ω x ) is u ndecidable, while the theory of ( ω ω ; + , x 7→ xω ) is d ecidable s ince the function x 7→ xω is definable in ( ω ω ; +) which has a decidable theory . • W e could r eform ulate the ab ov e resu lts by r eplacing ( ω ω ; +) by the structur e ( ω ; × , < P ), where x < P y holds if and only if x < y and x, y are prime num b ers. In this ca se w e enco de ev er y word u = a 0 . . . a n o ver the alphab et ω by the int eger c ′ ( u ) = 2 a 0 +1 3 a 1 +1 . . . p a n +1 n where p n denotes the n − th prime num b er. W e r efer to [22] f or details ab out the lin k b et we en ( ω ω ; +) and ( ω ; × , < P ). FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 19 6. An ext ension of the Feferman-V a ught formalism The automata and logic th at we in tro duced in the previous sections do n ot allo w com- parisons b et w een sym b ols from differen t p ositions. F or instance, for ev ery stru cture M whose domain is infinite, the language { ss | s ∈ | M |} is not M S O ( M )-definable (see Ex- ample 2.5). More generally , giv en any formula ϕ ( x, y ) in the language of M , the language { s 1 s 2 | M # | = ϕ ( s 1 , s 2 ) } is not in general M S O ( M )- defin ab le. A natural wa y to add expressive p o wer is to extend MSO with pr edicates su ch as P ( x, y ) in terpreted as “ x, y are t wo p ositions in w such that w [ x ] = w [ y ]”, or more generally predicates interpreted as “ x, y are t w o p ositions in w su c h that M # | = ϕ ( w [ x ] , w [ y ])” (where ϕ is some L # -form ula). Ho wev er these extensions d o not add expressive p o wer w hen M is finite, and lead to undecidable theories in case M h as an in finite d omain (we r efer the r eader e.g. to [3] where it is sho wn that muc h wea k er related formalisms ha ve und ecidable FO theories). Th us in order to get decidabilit y r esu lts w e ha v e to restrict the use of these n ew pred - icates. Belo w we describ e a sy ntactic f r agmen t f or whic h the satisfiabilit y problem still reduces to the decidabilit y of the fi rst-order theory of M . Giv en an L -stru cture M = (Σ; . . . ), we asso ciate to ev ery L # − form ula F with m f ree v ariables some (new) m − ary relational sym b ol θ F . Definition 6.1 . W e define M S O + ( L ) as MSO o ver the language { <, ( θ F ) F ∈F } where F denotes the set of L # − form ulas with at least one f ree v ariable. The interpretation of M S O + ( L ) sentence s is similar to M S O ( L ), but for every L # - form ula F with m free v ariables the in terpretation of θ F ( x 1 , . . . , x m ) is “the p ositions x 1 , . . . , x m in the wo rd w satisfy M # | = F ( w [ x 1 ] , . . . , w [ x m ])”. Definition 6.2. W e s ay that X ⊆ Σ ∗ is M S O + ( M )-definable if there exists an M S O + ( L )- sen tence ϕ whic h defines X . Th e d efinition can b e extended easily to the case of su bsets X ⊆ (Σ ∗ ) n . Note that if one all o ws only M S O + ( L ) sen tences where the predicates θ F are unary , w e get nothing bu t M S O ( L ). Example 6.3. Let M = ( ω ; +). • The language X ⊆ ω ∗ of w ords u o ver ω such that some symbol s ∈ Σ app ears at least t w ice in u is M S O + ( M )-definable b y the M S O + ( L )-sen tence ∃ x ∃ y ( x < y ∧ θ F ( x, y )) where F ( x 1 , x 2 ) : x 1 = x 2 . • The language X ′ ⊆ ω ∗ of wo rds o v er ω of the form u = s 0 . . . s m suc h that there exists j ∈ { 0 , . . . , m } suc h that s k ≥ 2 s j whenev er k > j , is M S O + ( M )-definable by the M S O + ( L )-sen tence ∃ x ( ∃ x ′ ( x < x ′ ) ∧ ∀ y ( x < y → θ G ( x, y )) where G ( x 1 , x 2 ) : ∃ z ( x 2 = x 1 + x 1 + z ) denotes the form ula wh ic h expresses th at x 2 ≥ 2 x 1 . 20 ALEXIS B ` ES Example 6.4. Let M = (Σ ∗ ; E q Len g th,  , { L a } a ∈ Σ ) denote the EES structur e S (see Section 3.2). The set of words w = s 0 . . . s m o ver the infin ite alphab et Γ = Σ ∗ suc h that all ev en p ositions carry the same sym b ol, and all o dd p ositions carry a sy mb ol whic h is a prefix of s 0 , is M S O + ( M )-definable. In deed a con v enien t M S O + ( L )-sen tence is ∃ X [ E v enP ositions ( X ) ∧ ∧∃ x ∈ X ∀ y ∈ X θ F 1 ( x, y ) ∧ ∃ z ( ∀ t ¬ t < z ∧ ∀ y 6∈ X θ F 2 ( y , z ))] where E v enP ositions ( X ) is an MSO-form ula w hic h expr esses that X consists in the set of ev en p ositions of w , and F 1 ( v 1 , v 2 ) : v 1 = v 2 ; F 2 ( v 1 , v 2 ) : v 1  v 2 . The f ormalism M S O + ( L ) is in general to o expressive with resp ect to decidabilit y , th us w e ha v e to consider a syn tactic fragmen t of it. Definition 6.5 . W e defin e M S O + R ( L ) as the syn tactic fragmen t of M S O + ( L ) consisting in form ulas of the form ∃ x 1 . . . ∃ x n ϕ ( x 1 , . . . , x n ) where ϕ is an M S O + ( L )-form ula which satisfies the follo wing constrain t, w hic h we denote b y ( ∗ ): al l pr e dic ates of the form θ F in ϕ have the form θ F ( x 1 , . . . , x n , y ) , i.e. c ontain at most one fr e e variable distinct fr om the x ′ i s . Note that formulas considered in Examples 6.3 and 6.4 are M S O + R ( L )-form ulas. Theorem 6.6. The emptiness pr oblem for M S O + R ( M ) -definable languages r e duc es to the de cidability of the FO the ory of M . Pr o of. Let Σ b e the domain of M . T o eac h M S O + R ( L )-sen tence ψ of th e f orm ∃ x 1 . . . ∃ x n ϕ ( x 1 , . . . , x n ) where ϕ satisfies ( ∗ ) w e associate in an effectiv e w a y an M S O ( L ′ )-form ula ψ ′ where L ′ is obtained b y adding to L n ew co nstant sym b ols c 1 , . . . , c n , in o rder that for ev ery L - structure M , the s entence ψ is satisfiable by some wo rd o v er Σ if and only if there exists some L ′ − expansion M ′ of M such that the the set of words o ver Σ d efined b y ψ ′ is not empt y . The transformation pr o ceeds as follo ws . First, w e can assume that all formulas of the form θ F ( x 1 , . . . , x n , y ) wh ic h ap p ear in ϕ are suc h that y app ears fr eely in θ F : indeed if y do es not app ear in θ F then θ F ( x 1 , . . . , x n ) is equiv alent to ∃ y ( y = x n ∧ θ F ′ ( x 1 , . . . , x n − 1 , y )) where F ′ is obtained from F by substituting y for x n . W e d efine th e M S O ( L ′ )-form ula ψ ′ as ∃ x 1 . . . ∃ x n ( n ^ i =1 α F i ( x i ) ∧ ϕ ′ ( x 1 , . . . , x n )) where F i ( y ) denotes the f orm ula y = c i and ϕ ′ is obtained from ϕ by replacing every form ula θ F ( x 1 , . . . , x n , y ) by th e formula α F ′ ( y ) where F ′ is obtained fr om F b y replacing ev er y o ccurence of x i b y the constan t sym b ol c i . It is easy to c heck that for ev ery L -str u cture M , ψ is satisfiable by some w ord mod el o ver Σ if and only if there exists some L ′ − expansion M ′ of M suc h that L ( ψ ′ ) 6 = ∅ . FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 21 The form ula ψ ′ in v olv es the predicates α F 1 , . . . , α F n , and also p redicates of the form α F whic h app ear in ϕ ′ , sa y α F n +1 , . . . , α F p . By Prop osition 3.4, giv en M ′ the question of whether the language defined b y ψ ′ is empt y redu ces to decide emptiness for the corresp ond ing M ′ − automaton. Th is amounts to compute the set E M ′ of subsets I ⊆ { 1 , . . . , p } such th at there exists a ∈ Σ suc h that ( M ′ | = F i ( a ) if and only if i ∈ I ). Th us it s u ffices to compu te all p ossible sets E M ′ for all L ′ − expansions M ′ of M . This can b e done effectiv ely since for ev er y subset E of subsets of { 1 , . . . , p } , one can find an L -sen tence H E suc h that M | = H E if and only if there exists some L ′ − expansion M ′ of M su c h that E M ′ = E . Therefore w e reduced our initial problem to the qu estion of whether M satisfies some sent ence. 7. Discussion and conclus ion The pro of of Th eorem 6.6 mak es uses of B¨ uc hi’s decidabilit y resu lt for the WMSO theory of ( ω ; < ). Ho wev er the arguments are s u fficien tly general to app ly to an y decidable extension of WMSO. An int eresting example is the WMSO theory T car d of ω , without < , bu t with the pr edicate X ∼ Y in terpreted as “ X and Y ha v e the same cardinalit y”. This theory w as prov en to b e decidable b y F eferman and V augh t in [14] by reduction to Presburger Ar ithmetic (by elimination of quanti fiers, and without using the comp osition tec hn ique). F or recen t applicati ons of this d ecidabilit y result we r efer the reader to the pap ers [18, 28, 20]. One can show that Th eorem 6.6 holds with T car d , w hic h provi des a class of the- ories whic h are b oth d ecidable and quite expressive . As an example, if w e set M = (Σ ∗ ; E q Len g th,  , { L a } a ∈ Σ ) (the EE S structure, whose F O theory is decidable [13]), then the corresp onding syntac tic fragment allo ws to express p rop erties related to fi nite words w o v er the alphab et Σ ′ = Σ ∗ (that is, fi n ite sequences o f w ords o ve r Σ) such as “there exist t wo d istinct sym b ols s, s ′ app earing in w suc h that at least one third of the sym b ols in w are prefix of s , or ha v e the same length as s ′ ”. Another in teresting examp le is th e case M = ( ω ; +). In this case we obtain a decidable fragment for words o v er the alphab et ω , i.e. lists of natural num b ers. This fragmen t migh t b e an in teresting formalism for the v erification of programs which m anipulate p oint ers and linke d data str uctures. By Prop osition 3.4, M -automata capture the logic M S O ( L ). Thus a natural issue is to get an automata coun terpart for the logic M S O + R ( L ). An idea is to consider M -automata equipp ed with a fi nite num b er of “write once” registers. In add ition to the usual transitions of M -automata , these automata are allo w ed to write the current symb ol in some empty register, and test w hether th e s ym b ols current ly stored in the registers and th e current sym b ol satisfy some L # − sen tence in M # . Once a sym b ol is stored in some register, th e automaton cannot store an y other s ym b ol in this register. In order to capture the fragment M S O + R ( L ), it seems that one should also allo w non-determin istic ǫ − transitions wh er e the automaton chooses to store some sy mb ol from the inpu t alphab et in some (empt y) register. Another interesting issue w ould b e to find (more natural) extensions of the F eferman- V augh t formalism in the spirit of T heorem 6.6. The formalism M S O + ( L ) allo ws the use of predicates θ F for all L # − form ulas F , wh ic h mak es necessary to consider the fragmen t M S O + R ( L ) in order to get decidabilit y results. It w ou ld b e int eresting to fin d ot her fragmen ts of M S O + ( L ) obtained b y imp osing conditions on the L # − form ulas F . One can consider e.g the case wher e we allo w only the use of formulas F which defin e equiv alence relations in M . Note th at similar results are already prov en in the pap ers [3, 4]. 22 ALEXIS B ` ES Finally , it seems that all results in this pap er can b e extended r ather easily to the case of infinite w ords as w ell as (in)finite binary trees, by relying on classical decidabilit y r esults for MSO theories. A cknowledgements I wish to th an k W olfgang Thomas for his careful reading of a p reliminary version of the pap er, and for many imp ortant suggestions and corrections. I also th ank Lev Beklemishev, Christian Choffrut, Serge Grigorieff, An ca Muscholl, P eter Rev esz and Luc S ´ egoufin for in teresting discussions and comments. Finally I am grateful to the tw o referees for helpful suggestions to impro v e the qu alit y of th e pap er. Referen ces [1] J.M. Auteb ert, J. Beauquier, and L. Boasso n. Langages sur d es alphabets infinis. Discr ete Applie d Mathematics , 2:1–20, 1980. [2] A. Blumensath and E. Gr¨ adel. Automatic structures. In Pr o c e e dings of 15th IEEE Symp osium on L o gic in C om puter Scienc e LICS 2000 , pages 51–62, 2000. [3] M. Bo janczyk, A. Muscholl, T. Schw entic k, L. S egoufin, and C. David. Two-v ariable logic on w ords with data. In LICS , pages 7–16. IEEE Computer So ciety , 2006. [4] P . Bouyer. A logical characteriza tion of data languages. IPL , 84(2):75–85, 2002. [5] P . Bouyer, A. Petit, and D. Th´ erien. An algebraic approach to data languages and timed languages. Inf. C om put , 182(2):137–1 62, 2003. [6] V. Bruy` ere, G. Hansel, C. Michaux, and R. Villemaire. Logic and p -recognizable sets of integ ers. Bul l. Belg. M ath. So c. - Simon Stevin , 1(2):191–238, 1994. [7] J. R. B ¨ uchi. W eak second-order arithmetic and finite automata. Z. Math. L o gik und grund l. Math. , 6:66–92 , 1960. [8] J. R. B ¨ uchi. On a decision metho d in the restricted second-order arithmetic. I n Pr o c. Int. Congr ess L o gic, Metho dolo gy and Philosophy of scienc e, Berkeley 1960 , p ages 1–11. Stanford U niversit y Press, 1962. [9] J. R. B¨ uchi. T ransfinite automata recursions and w eak second order theory of ordinals. In Pr o c. Int. Congr ess L o gic, Metho dolo gy, and Philosophy of Scienc e, Jerusalem 1964 , pages 2–23. North Holland, 1965. [10] C. Choffrut and S. Grigorieff. Logic for finite w ords ov er infinite alphab ets. prep rint, 2005. [11] Christian Choffrut. Elementary theory of ordinals with addition and left translation by omega. I n W erner Kuic h, Grzego rz Rozenberg, and Arto Salomaa, editors, Development s in L anguage The ory , vol ume 2295 of L e ctur e Notes in Computer Scienc e , pages 15–20. Sp rin ger, 2001. [12] S t´ eph ane Demri, Ranko Lazi ´ c, and David Now ak. On the fre eze quantifier in constraint L TL: D ecidabil- it y and complexity . I n Pr o c e e di ngs of the 12th International Symp osium on T emp or al Re pr esentation and R e asoning (TIME’05) , pages 113–121. IEEE Computer So ciety Press, 2005. [13] S . Eilen b erg, C.Elgot, and J. Shepherdson. Sets recognized by n-tape automata. J. Alg. , 13(4):447– 464, 1969. [14] S . F eferma n an d R.L. V augh t. The first order prop erties of product s of algebraic systems. F undam. Math. , 47:57–10 3, 1959. [15] B.R. Hod gson. D´ ecidabilit´ e par automate fi ni. Ann. Sci. Math. Queb e c , 7:39–57, 1983. [16] M. Kaminski and N. F rancez. Finite-memory automata. The or etic al Computer Scienc e , 134(2):329–3 63, 1994. [17] B. K houssaino v and A. N erod e. Aut omatic p resentations of structures. In LCC: International Workshop on L o gic and Computational Complexity , pages 367–392, 1994. [18] V . Kuncak, H . H. Nguyen, and M. Rinard. An algorithm for deciding bapa: Bo olean algebra with presburger arithmetic. In Pr o c. CADE-20 , vol ume 3632 of L e ct. Notes in Comput. Sci. , p ages 260–277, 2005. FEFERMAN-V A UGHT THEOR EM, AUTOMA T A AND LOGIC 23 [19] D . Kuske and M. Lohrey . Monadic c hain logic ov er iterations and app lications to p u shdown systems. In LICS , pages 91–100. IEEE Computer S ociety , 2006. [20] D . Lu giez. Multitree automata th at count. The or. Comput. Sci . , 333(1-2):225 –263, 2005. [21] J. A. Mako wsky . A lgorithmic uses of the F eferman-V aught theorem. A nnals of Pur e and Applie d L o gic , 126(1–3):1 59–213, 2004. [22] F. Maurin. The t h eory of integ er multiplication with order restricted t o p rimes is d ecidable. J. Symb. L o g. , 62(1):123–13 0, 1997. [23] A . Mostowski. On direct pro du ct s of t heories. J. Symb. L o g. , 17(1):1–31, 1952. [24] F. Neven, T. Sch we ntic k, an d V. Vianu. Finite state machines for strings over infinite alphab ets. ACM T r ans. Comput. L o g , 5(3):403–435, 2004. [25] M. Presburger. ¨ Ub er de vollst¨ andigkeit eines gewissen systems der arithmetik ganzer zahlen, in w elchen, die add ition als einzige operation herv ortritt. In Comptes R endus du Pr emi er Congr ` es des Math ´ ematiciens des Pays Slaves , pages 92–101, 395, W arsa w, 1927. [26] A . Rabinovic h. S election and uniformization in generalized pro duct. L o gic J. of IGPL , p ages 125–134, 2004. [27] A . R abinovic h. On comp ositionalit y and its limitations. ACM T r ans. Comput. L o g , 8(1), 2007. [28] P . Revesz. The expressivity of constraint query languages with b o olean algebra linear cardinality con- strain ts. In Pr o c. ADBI S’04 , volume 3631 of L e ct. Notes in Comput. Sci. , p ages 167–182, 2005. [29] W . Sierpinski. Car dinal and Or dinal Numb ers . PSW W arsa w, 2nd edition, 1965. [30] W . Thomas. On chain logic, path logic, and first-order logic ov er infinite trees. In Pr o c e e dings, Symp o- sium on Lo gic i n Computer Scienc e , pages 245–256. The Compu t er So ciety of the IEEE, 1987. [31] W . Thomas. Infinite trees and automation-defin able relations ov er omega-w ords. The or. Comput. Sci. , 103(1):143 –159, 1992. [32] W . Thomas. Ehrenfeuch t games, the comp osition metho d, and th e monadic theory of ordin al words. In Structur es in L o gic and Computer Scienc e, A Sele ction of Essays in Honor of A. Ehr enfeucht , num b er 1261 in Lect. Notes in Comput. Sci., pages 118–143 . S pringer-V erlag, 1997. [33] W . Thomas. Languages, automata and logic. In A. Salomaa and G. Rozenb erg, editors, Handb o ok of F ormal L anguages , volume 3, Beyond W ords, pages 389–456. Springer, Berlin, 1997. [34] S . W¨ ohrle and W. Thomas. Mod el chec k ing sy n chronized pro duct s of infinite transition systems. In Pr o c e e dings of the 19th Annual Symp osium on L o gic in Computer Scienc e (LICS) , p ages 2–11. I EEE Computer So ciety , 2004. This wor k is licensed under the Cre ative Commons Attribution- NoDeriv s License. T o view a copy of this license, visit ht tp://cr eativecommons.org/licenses/by-nd/2.0/ or se nd a letter to Creative Commons , 559 Natha n Abbott W ay , Stanford, California 94305, USA.

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment