Topological, Automata-Theoretic and Logical Characterization of Finitary Languages

Size: px
Start display at page:

Download "Topological, Automata-Theoretic and Logical Characterization of Finitary Languages"

Transcription

1 Topologicl, Automt-Theoretic nd Logicl Chrcteriztion of Finitry Lnguges Krishnendu Chterjee nd Nthnël Fijlkow IST Austri (Institute of Science nd Technology Austri) Am Cmpus 1 A-3400 Klosterneuurg Technicl Report No. IST June 4, 2010

2 Copyright 2010, y the uthor(s). All rights reserved. Permission to mke digitl or hrd copies of ll or prt of this work for personl or clssroom use is grnted without fee provided tht copies re not mde or distriuted for profit or commercil dvntge nd tht copies er this notice nd the full cittion on the first pge. To copy otherwise, to repulish, to post on servers or to redistriute to lists, requires prior specific permission.

3 Topologicl, Automt-Theoretic nd Logicl Chrcteriztion of Finitry Lnguges Krishnendu Chtterjee 1 nd Nthnël Fijlkow 1,2 1 IST Austri (Institute of Science nd Technology, Austri) 2 ENS Cchn (École Normle Supérieure de Cchn, Frnce) Astrct The clss of ω-regulr lnguges provide roust specifiction lnguge in verifiction. Every ω-regulr condition cn e decomposed into sfety prt nd liveness prt. The liveness prt ensures tht something good hppens eventully. Two min strengths of the clssicl, infinite-limit formultion of liveness re roustness (independence from the grnulrity of trnsitions) nd simplicity (strction of complicted time ounds). However, the clssicl liveness formultion suffers from the drwck tht the time until something good hppens my e unounded. A stronger formultion of liveness, so-clled finitry liveness, overcomes this drwck, while still retining roustness nd simplicity. Finitry liveness requires tht there exists n unknown, fixed ound such tht something good hppens within trnsitions. In this work we consider the finitry prity nd Streett (firness) conditions. We present the topologicl, utomt-theoretic nd logicl chrcteriztion of finitry lnguges defined y finitry prity nd Streett conditions. We () show tht the finitry prity nd Streett lnguges re Σ 2-complete; () present complete chrcteriztion of the expressive power of vrious clsses of utomt with finitry nd infinitry conditions (in prticulr we show tht non-deterministic finitry prity nd Streett utomt cnnot e determinized to deterministic finitry prity or Streett utomt); nd (c) show tht the lnguges defined y non-deterministic finitry prity utomt exctly chrcterize the str-free frgment of ωb-regulr lnguges. 1 Introduction Clssicl ω-regulr lnguges: strengths nd wekness. The clss of ω-regulr lnguges provide roust lnguge for specifiction for solving control nd verifiction prolems (see, e.g., [PR89,RW87]). Every ω-regulr specifiction cn e decomposed into sfety prt nd liveness prt [AS85]. The sfety prt ensures tht the component will not do nything d (such s violte n invrint) within ny finite numer of trnsitions. The liveness prt ensures tht the component will do something good (such s proceed, or respond, or terminte) in the long-run. Liveness cn e violted only in the limit, y infinite sequences of trnsitions, s no ound is stipulted on when the good thing must hppen. This infinitry, clssicl formultion of liveness hs oth strengths nd weknesses. A min strength is roustness, in prticulr, independence from the chosen grnulrity of trnsitions. Another min strength is simplicity, llowing liveness to serve s n strction for complicted sfety conditions. For exmple, component my lwys respond in numer of trnsitions tht depends, in some complicted mnner, on the exct size of the stimulus. Yet for correctness, we my e interested only tht the component will respond eventully. However, these strengths lso point to wekness of the clssicl definition of liveness: it cn e stisfied y components tht in prctice re quite unstisfctory ecuse no ound cn e put on their response time. Stronger notion of liveness. For the wekness of the infinitry formultion of liveness, lterntive nd stronger formultions of liveness hve een proposed. One of these is finitry liveness [AH94,DJP03]: finitry liveness does not insist on response within known ound (i.e., every stimulus is followed y response within trnsitions), ut on response within some unknown ound (i.e., there exists such tht every stimulus is followed y response within trnsitions). Note tht in the finitry cse, the ound my e ritrrily lrge, ut the response time must not grow forever from one stimulus to the next. In this wy, finitry liveness still mintins the roustness (independence of step grnulrity) nd simplicity (strction of complicted sfety) of trditionl liveness, while removing unstisfctory implementtions.

4 Finitry prity nd Streett conditions. The clssicl infinitry notion of firness is given y the Streett condition: Streett condition consists of set of d pirs of requests nd corresponding responses (grnts) nd the condition requires tht every request tht ppers infinitely often must e responsed infinitely often. The finitry Streett condition requires tht there is ound such tht in the limit every request is responsed within steps. The clssicl infinitry prity condition consists of priority function nd the condition requires tht the minimum priority visited infinitely often is even. The finitry prity condition requires tht there is ound such tht in the limit fter every odd priority lower even priority is visited within steps. Chrcteriztion of infinitry prity nd Streett utomt. There re severl roust lnguge-theoretic chrcteriztion of the lnguges expressile y utomt with infinitry liveness (Büchi), prity nd Streett conditions. Some of the importnt chrcteriztions re s follows: () Topologicl chrcteriztion: it is known tht deterministic utomt with Büchi conditions re Π 2 -complete, wheres non-deterministic Büchi nd oth deterministic nd non-deterministic prity nd Streett utomt lie in the oolen closure of Σ 2 nd Π 2 [MP92]; () Automt theoretic chrcteriztion: non-deterministic utomt with Büchi conditions hve the sme expressive power s deterministic nd non-deterministic prity nd Streett utomt [Cho74,Sf92]; nd (c) Logicl chrcteriztion: the clss of lnguges expressed y deterministic prity (tht is equivlent to non-deterministic Büchi, prity nd Streett utomt) is equivlent to the clss of ω-regulr lnguges nd is lso chrcterized y the mondic second-order logic (MSOL) (see the hndook [Tho97] for detils). Our results. For finitry Büchi, prity nd Streett utomt the topologicl, utomt-theoretic, nd logicl chrcteriztion were ll missing. In this work we present ll the three chrcteriztions. Our min results re s follows. 1. Topologicl chrcteriztion. We show tht the clss of lnguges defined y finitry Büchi, prity nd Streett conditions re Σ 2 -complete, nd thus present precise topologicl chrcteriztion of finitry Büchi, prity nd Streett lnguges. 2. Automt-theoretic chrcteriztion. We show tht lnguges defined y finitry prity nd Streett utomt re incomprle in expressive power s compred to infinitry prity nd Streett utomt. We show tht non-deterministic utomt with finitry prity nd Streett conditions hve the sme expressive power s non-deterministic utomt with finitry Büchi conditions, nd deterministic prity nd Streett utomt hve the sme expressive power nd is strictly more expressive thn deterministic finitry Büchi utomt. However, in contrst to infinitry prity condition, for finitry prity condition, non-deterministic utomt is strictly more expressive thn the deterministic counterprt. We lso present precise chrcteriztion of the closure properties of finitry utomt with respect to union, intersection nd complementtion. 3. Logicl chrcteriztion. Since finitry utomt re incomprle in expressive power s compred to ω-regulr lnguges, the result lso holds for MSOL. We consider the chrcteriztion of finitry utomt through n extension of MSOL nd ω-regulr lnguges defined s MSOLA nd ωb-regulr lnguges y [BC06]. We show tht lnguges defined y non-deterministic finitry prity utomt re exctly the str-free frgment of ωb-regulr lnguges. It follows tht in generl MSOLA nd ωbregulr lnguges re strictly more expressive, nd non-deterministic finitry prity utomt exctly chrcterize the str-free frgment. Hence we otin precise logicl chrcteriztion of the finitry lnguges. 2 Definitions In this section we define lnguges, topology relted to lnguges, then utomt nd lnguges descried y utomt with vrious cceptnce conditions. 2.1 Lnguges, Cntor topology nd Borel hierrchy Lnguges. Let Σ e finite set, we refer to Σ s the lphet, nd its elements s letters. A word w is sequence of letters, which cn e either finite or infinite. A word w will e descried s sequence

5 w 0 w 1... of letters, where w 0, w 1, Σ. Let Σ e the set of ll finite words over Σ nd Σ ω the set of ll infinite words over Σ. A lnguge is set of words, thus L Σ is lnguge over finite words nd L Σ ω is lnguge over infinite words. Cntor topology. The complexity of lnguges cn e studied ccording to the topologicl definition. To present topologicl definition on lnguges we first define open nd closed sets. A lnguge is open if it cn e descried s W Σ ω where W Σ. A closed set is complement of n open set. Then we define the Cntor topology to otin the topology over lnguges. It my e noted tht the ove topology defines the sme topology s the one induced y the following distnce over infinite words: distword(w, w ) = 1 2, i where i is the lrgest nonnegtive integer such tht w j = w j for ll 0 j < i. Borel hierrchy. We now define the Borel hierrchy of lnguges. Let Σ 1 denote the open sets, Π 1 denote the closed sets, nd then inductively we hve the following: Σ i+1 is otined s countle union of Π i sets; nd Π i+1 is otined s countle intersection of Σ i sets. We note tht the closed sets (lnguges in Π 1 ) correspond to sfety properties. For L Σ ω, let pref(l) Σ e the set of finite prefixes of words in L: u Σ elongs to pref(l) iff there exists w L such tht u is finite prefix of w. Then the following property holds. Proposition 1. For ll lnguges L Σ ω, the following sttements re equivlent: () L is closed; () for ll infinite words w, if ll finite prefixes of w re in pref(l), then w L. Topologicl reduction. The clsses Σ 1, Π 1, Σ 2, Π 2,... re the levels of Borel hierrchy. Since they re closed under continuous preimge, we cn define notion of reduction: L reduces to L, denoted y L L, if there exists continuous function f : Σ ω Σ ω such L = f (L ), where f (L ) is the preimge of L y f. This defines the notion of Wdge reduction [Wd84]. A lnguge is hrd with respect to clss if ll lnguges of this clss reduce to it. If it dditionlly elongs to this clss, then it is complete. Clssicl lnguges. We now consider severl clssicl notion of lnguges. For n infinite word w, let Inf(w) Σ denote the set of letters tht pper infinitely often in w. The clss of rechility, sfety, Büchi nd cobüchi lnguges re defined s follows. Let F Σ: Rech(F) = {w i N, w i F }; Sfe(F) = Σ ω \Rech(F) = {w i N, w i / F }; Büchi(F) = {w Inf(w) F }; CoBüchi(F) = Σ ω \Büchi(F) = {w Inf(w) Σ\F }. In other words, the rechility lnguge Rech(F) requires tht letter in F ppers t lest once nd the Büchi lnguge Büchi(F) requires tht some letter in F ppers infinitely often. The Sfe(F) nd CoBüchi(F) re duls of Rech(F) nd Büchi(F), respectively. The clss of prity lnguges is defined s follows. Let p : Σ N e priority function tht mps letters to integer priorities. The prity lnguges re defined s follows: Prity(p) = {w min(p(inf(w))) is even}; i.e., the prity condition ccepts infinite words where the lowest priority infinitely visited is even. The prity conditions re self-dul. The clss of Rin nd Streett lnguges re defined s follows. Let (R, G) = (R i, G i ) 1 i d, where R i, G i Σ re request-grnt pirs. Then we hve Streett(R, G) = {w i, 1 i d, Inf(w) R i Inf(w) G i }; Rin(R, G) = {w i, 1 i d, Inf(w) R i Inf(w) G i = }; i.e., the Streett condition ccepts infinite words w such tht for ll requests R i, if R i ppers infinitely often in w, then the corresponding grnt G i lso ppers infinitely often in w. Rin condition is the dul of Streett condition. Then we hve the following theorem tht presents the topologicl chrcteriztion of the clssicl lnguges. Theorem 1 (Topologicl chrcteriztion of clssicl lnguges [MP92]). The following ssertions hold.

6 For ll F Σ, we hve () Rech(F) is Σ 1 -complete nd Sfe(F) is Π 1 -complete; nd () Büchi(F) is Π 2 -complete nd CoBüchi(F) is Σ 2 -complete. The prity, Streett nd Rin lnguges lie in the oolen closure of Σ 2 nd Π 2. Finitry lnguges. Let p : Σ N priority function. We define: { 0 p(w k ) is even dist k (w, p) = inf{k k k k, p(w k ) is even nd p(w k ) < p(w k )} p(w k ) is odd The finitry prity lnguge FinPrity(p) ws defined s follows in [CHH09]: FinPrity(p) = {w limsup dist k (w, p) < }, k i.e., the FinPrity(p) requires tht the supremum limit of the distnce sequence is ounded. The definition for FinStreett(R, G) lnguges uses similr distnce sequence s follows: { dist j k (w, (R, G)) = 0 w k / R j inf{k k k k, w k G j } w k R j Then we hve dist k (w, (R, G)) = mx{dist j k (w, p) 1 j d}, nd the finitry Streett lnguge FinStreett(R, G) ws defined s follows in [CHH09]: FinStreett(R, G) = {w limsup dist k (w, (R, G)) < }, k i.e., similr to finitry prity lnguges FinStreett(R, G) requires the supremum limit of the distnce sequence to e ounded. 2.2 Automt, ω-regulr nd finitry lnguges In this section we consider utomt with cceptnce conditions nd consider the clss of lnguges defined y utomt with vrious clsses of cceptnce conditions. Definition 1. An utomton is tuple A = (Q, Σ, Q 0, δ,acc), where Q is finite set of sttes, Σ is the finite input lphet, Q 0 Q is the set of initil sttes, δ Q Σ Q is the trnsition reltion nd Acc Q ω is the cceptnce condition. Deterministic nd complete utomt. We consider the specil clss of deterministic nd complete utomt. An utomton A is deterministic if () Q 0 = 1, i.e., there is single initil stte; () for every letter nd every stte there is t most one trnsition, i.e., for ll q Q, for ll σ Σ we hve {q (q, σ, q ) δ} 1. Deterministic utomt will e descried s (Q, Σ, q 0, δ,acc), where δ : Q Σ Q is function. If for ll q Q nd for ll σ Σ, there exists q Q such tht (q, σ, q ) δ, then the corresponding utomton is complete. This is the cse when the trnsition function is totl. Runs. A run ρ = q 0 q 1... is word over Q, where q 0 Q 0. The run ρ is ccepting if it is infinite nd ρ Acc. We will write p q to denote (p,, q) δ. An infinite word w = w 0 w 1... induces possily severl runs of A: word w induces run ρ = q 0 q 1... if we hve q 0 Q 0 nd w q 0 w 0 q 1 w 1 q 2... q n n qn The lnguge ccepted y A, denoted y L(A) Σ ω, is s follows: L(A) = {w there exists run ρ induced y w such tht ρ Acc}.

7 Note tht for deterministic utomton, every word w induces t most one run, wheres in nondeterministic utomton word my induce severl possile runs. Acceptnce conditions. We will consider vrious cceptnce conditions for utomt otined from the lst section y considering Q s the lphet. For F Q, the conditions Rech(F), Sfe(F), Büchi(F), CoBüchi(F), define rechility, sfety, Büchi nd cobüchi cceptnce conditions, respectively. For p : Q N, the conditions Prity(p) nd FinPrity(p) define prity nd finitry prity cceptnce conditions, respectively. For (R, G) = (R i, G i ) 1 i d, where R i, G i Q, the conditionsstreett(r, G), Rin(R, G), nd FinStreett(R, G) define Streett, Rin nd finitry Streett cceptnce conditions, respectively. The set of lnguges recognized y non-deterministic Büchi utomt corresponds to the clss of ω-regulr lnguges [Büc62] nd we will denote the clss of ω-regulr lnguges s L ω. Nottion 1 We use stndrd nottion to denote set of lnguges recognized y some clss of utomt. The first letter is either N or D, where N stnds for non-deterministic nd D stnds for deterministic. The lst lock of letters refers to the cceptnce condition, for exmple, B stnds for Büchi, C stnds for CoBüchi, P stnds for prity nd S stnds for Streett. The cceptnce condition my e prefixed y F for finitry. For exmple, NP denotes non-deterministic prity utomt, nd DFS denotes deterministic finitry Streett utomt. Hence we hve the following comintion: { } { } N F D ε B C P S We now present the following theorem tht summrizes the results of utomt with clssicl lnguges, nd the results of the theorem follows from [Büc62,Sf92,Cho74,GH82]. Theorem 2 (Automt-theoretic results for clssicl lnguges). The following ssertions hold: (1) L ω = NB = NP = NS = DP = DS; (2) DB NB; (3) DC = NC NB. 3 Topologicl Chrcteriztion of Finitry Lnguges In this section we present the topologicl chrcteriztion of finitry Büchi, finitry prity nd finitry Streett lnguges. We first present definition nd then use the definition for chrcteriztion of finitry lnguges. Union of ω-regulr nd closed suset of lnguge. Given lnguge L Σ ω, the lnguge UniCloOmg(L) Σ ω is the union of the lnguges M tht re suset of L, ω-regulr nd closed, i.e., UniCloOmg(L) = {M M Π 1, M L ω, M L}. Proposition 2. The following ssertions hold: () the opertor UniCloOmg is idempotent; i.e., for ll lnguges L we hve UniCloOmg(UniCloOmg(L)) = UniCloOmg(L); () the lnguge UniCloOmg(L) is in Σ 2, i.e., for ll lnguges L we hve UniCloOmg(L) Σ 2. Proof. We prove oth the properties elow. 1. By definition for ll lnguges L we hve UniCloOmg(L ) L. Given lnguge L, let L = UniCloOmg(L). Hence we hve UniCloOmg(L ) L, i.e., UniCloOmg(UniCloOmg(L)) UniCloOmg(L). We now show the other direction. For ny lnguge L nd M L, if M Π 1 nd M L ω, then M UniCloOmg(L ). Consider the lnguge L = UniCloOmg(L). For lnguge M such tht M L, M Π 1 nd M L ω, we hve M UniCloOmg(L), (i.e., M L ) nd hence M UniCloOmg(L ). Hence we hve The result follows. L = {M M Π 1, M L ω, M L} UniCloOmg(L ).

8 2. Since L ω = NB (y Theorem 2), nd the set of finite utomt cn e enumerted in sequence, it follows L ω is countle. It follows tht for ll lnguges L, the set UniCloOmg(L) is descried s countle union of closed sets. Hence UniCloOmg(L) Σ 2. The result follows. We now present pumping lemm for regulr lnguges, nd will use it to present the topologicl chrcteriztion for finitry lnguges. Lemm 1 (A pumping lemm). Let M e ω-regulr lnguge. There exists n 0 such tht for ll words w M, for ll positions j n 0, there exist j i 1 < i 2 j + n 0 such tht for ll l 0 we hve w 0 w 1 w 2... w i1 1 (w i1 w i w i2 1) l w i2 w i M. Proof. Given M is ω-regulr lnguge, let A e complete nd deterministic prity utomt tht recognizes M (such n utomton exists y Theorem 2), nd let n 0 e the numer of sttes of A. Consider word w = w 0 w 1 w 2... such tht w M, nd let ρ = q 0 q 1 q 2... e the unique run induced y w in A. Consider position j in w such tht j n 0. Then there exist j i 1 < i 2 j + n 0 such tht q i1 = q i2, this must hppen s A hs n 0 sttes. For l 0, if we consider the word w l = w 0 w 1 w 2... w i1 1 (w i1 w i w i2 1) l w i2 w i2+1..., then the unique run induced y w l in A is ρ l = q 0 q 1 q 2... q i1 1 (q i1 q i q i2 1) l q i2 q i Since the prity condition is independent of finite prefixes nd the run ρ is ccepted y A, it follows tht ρ l is ccepted y A. Since A recognizes M, it follows w l M, nd the result follows. We now present the min lemm of this section. Lemm 2. For ll (R, G) = (R i, G i ) 1 i d, where R i, G i Σ, we hve UniCloOmg(Streett(R, G)) = FinStreett(R, G); i.e., FinStreett(R, G) is otined y pplying the UniCloOmg opertor to Streett(R, G). Proof. We present the two directions of the proof. 1. We first show tht UniCloOmg(Streett(R, G)) FinStreett(R, G). Let M Streett(R, G) such tht M is closed nd ω-regulr. Let w = w 0 w 1... M, nd ssume towrds contrdiction, tht limsup k dist k (w, (R, G)) =. Hence for ll n 0 N, there exists n N such tht n n 0 nd dist n (w, (R, G)) n 0. Let n 0 N given y the pumping lemm on M, from ove given n 0 we otin j such tht j n 0 nd dist j (w, (R, G)) n 0. By the pumping lemm (Lemm 1), we otin the witness j i 1 < i 2 j + n 0. Let u = w 0 w 1... w i1 1, v = w i1 w i w i2 1 nd w = w i2 w i Since w M, y the pumping lemm for ll l 0 we hve uv l w M. This entils tht ll finite prefixes of the infinite word uv ω re in pref(m). Since M is closed, it follows to uv ω M. Since dist j (w, (R, G)) n 0 it follows tht there is some request i in position j, nd there is no corresponding grnt i for the next n 0 steps. Hence there is position j in v such tht there is request i t j nd no corresponding grnt in v, nd thus it follows tht the word uv ω Streett(R, G). This contrdicts tht M Streett(R, G). Hence it follows tht UniCloOmg(Streett(R, G)) FinStreett(R, G). 2. We now show the converse: UniCloOmg(Streett(R, G)) FinStreett(R, G). We hve FinStreett(R, G) = {w limsup dist k (w, (R, G)) < } = limsup dist k (w, (R, G)) B} k B N{w k = {w k n, dist k (w, (R, G)) B} B N n N The lnguge {w k n, dist k (w, (R, G)) B} is closed, ω-regulr, nd included in Streett(R, G). It follows FinStreett(R, G) UniCloOmg(Streett(R, G)). The result follows.

9 Corollry 1. For ll p : Σ N, we hve UniCloOmg(Prity(p)) = FinPrity(p). Proof. This follows from Lemm 2 nd the fct tht prity condition is specil cse of Streett condition. Corollry 2. For ll F Σ, we hve UniCloOmg(CoBüchi(F)) = CoBüchi(F). Proof. We show tht CoBüchi(F) properties re stle under UniCloOmg opertor. By Lemm 2 we hve UniCloOmg(CoBüchi(F)) nd finitry cobüchi lnguges coincide, nd since finitry cobüchi nd cobüchi lnguges coincide, the result follows. We now present chrcteriztion for finitry Büchi tht will e used in the sequel. For set F Σ, let next k (w, F) = inf{k k k k, w k F }. Corollry 3. For ll F Σ, we hve UniCloOmg(Büchi(F)) = {w limsup k next k (w, F) < }. We now present the results for topologicl chrcteriztion of finitry Büchi, prity nd Streett lnguges. Theorem 3 (Topologicl chrcteriztion of finitry lnguges). The following ssertions hold: 1. For ll p : Σ N, we hve FinPrity(p) Σ For ll (R, G) = (R i, G i ) 1 i d, we hve FinStreett(R, G) Σ For ll F Σ, we hve tht UniCloOmg(Büchi(F)) is Σ 2 -complete. 4. There exists p : Σ N such tht FinPrity(p) is Σ 2 -complete. 5. There exists (R, G) = (R i, G i ) 1 i d such tht FinStreett(R, G) is Σ 2 -complete. Proof. We prove ll the cses elow. 1. It follows from Corollry 1 nd Proposition 2.() tht UniCloOmg(FinPrity(p)) = FinPrity(p), nd then it follows from Proposition 2.() tht FinPrity(p) Σ As ove it follows from Lemm 2 nd Proposition It follows from Proposition 2 tht UniCloOmg(Büchi(F)) Σ 2. We hve tht CoBüchi(Σ \F) is Σ 2 - complete from Theorem 1. We now present topologicl reduction to show tht CoBüchi(Σ \ F) UniCloOmg(Büchi(F)). Recll tht w CoBüchi(Σ \ F) iff Inf(w) F. Let : Σ ω Σ ω e the stuttering function defined s follows: w = w 0 w 1... w n... (w) = w 0 w 1 w }{{} 1... w n w n... w n... }{{} 2 2 n The function is continuous, since distword((w), (w )) distword(w, w ). It remins to show the following: Inf(w) F iff B N, n N, k n, next k ((w), F) B. Left to right direction: ssume tht from the position n of w, letters elong to F. Then from the position 2 n 1, letters of (w) elong to F, then next k ((w), F) = 0 for k 2 n 1. Right to left direction: let B nd n e integers such tht for ll k n we hve next k ((w), F) B. Assume 2 k 1 > B nd k n, then the letter in position 2 k 1 in (w) is repeted 2 k 1 times, thus next k ((w), F) is either 0 or higher thn 2 k 1. The ltter is not possile since it must e less thn B. It follows tht the letter in position k in w elongs to F. 4. This follows from item 3 ove nd the fct tht Büchi condition is specil cse of prity condition. 5. This follows from item 3 ove nd the fct tht Büchi condition is specil cse of Streett condition. The desired result follows.

10 4 Automt-Theoretic Chrcteriztion of Finitry Lnguges In this section we consider the utomt-theoretic chrcteriztion of finitry lnguges. We compre the expressive power of vrious clsses of utomt with finitry cceptnce conditions with respect to utomt with clssicl ω-regulr cceptnce condition. 4.1 Comprison with clssicl lnguges In this section we compre the expressive power of utomt with finitry cceptnce conditions s compred to utomt with clssicl cceptnce conditions. In the exmples we will consider Σ = {, }. Exmple 1 (DFB NB). Consider the finitry Büchi utomton A shown in Fig. 1 nd the stte leled 0 is the ccepting set F. The lnguge of A is L B = {( j0 f(0) ) ( j1 f(1) ) ( j2 f(2) )... f : N N, f ounded, i N, j i N}. Indeed, 0-leled stte is visited while reding the letter, nd the 1- leled stte is visited while reding the letter. An infinite word w is ccepted iff the 0-leled stte is visited infinitely often, nd there must e ound etween ny two consecutive visits of the 0-leled stte. We now show tht L B is not ω-regulr: ssume towrds contrdiction tht L B is ω-regulr. Then y 1 0 Figure 1. A finitry Büchi utomton A Theorem 2 there is deterministic prity utomton A tht recognizes L B, hving N sttes. Without loss of generlity we ssume this utomton to e complete, nd let the strting stte e q 0. Since the word ω elongs to the lnguge, the unique run on this word is ccepting nd cn e decomposed s: q n 0 0 s p 0 0 s p 0 0 s 0... where s 0 is the lowest priority stte visited infinitely often (thus it hs even priority), nd n 0 N, 1 p 0 N. Since the word n0 ω elongs to the lnguge L B, we cn repet the ove construction. By induction, we define s k nd q k s shown in the Figure 2: s k is the lowest priority stte visited infinitely often while n 0 q 0 s 0 p 0 n 0 n 1 q 1 s 1 p 1 p 0 p k q k n k s k n k p k 1 q k+1 Figure 2. Inductive construction showing tht L B / DP. reding n0 n 0 n 1 n 1... n k 1 n k 1 n k ω (thus it hs even priority), nd n k N, 1 p k N,

11 nd similrly for q k, reding n0 n 0 n 1 n 1... n k 1 n k 1 ω. There exists i < j such tht q i = q j, nd hence the infinite word u ( p i 1 v) ( 2p i 1 v)...( kp i 1 v)..., where u = n 0 n 0... n i 1 nd v = ni... n j 1, is ccepted y A, nd hence we hve contrdiction tht A recognizes L B. We now show tht there exist lnguges expressed y deterministic Büchi utomt tht cnnot e expressed y non-deterministic finitry prity utomt. Exmple 2 (DB NFP). Consider the lnguge of infinitely mny s, i.e., L I = {w w hs n infinite numer of }. The lnguge L I is ω-regulr nd there is deterministic Büchi utomton A such tht the lnguge of A is L I. We now show tht there is no non-deterministic finitry prity utomt tht recognizes L I. Assume towrds contrdiction tht A is non-deterministic finitry prity utomt recognizing L I nd let A hve N sttes. Let us consider the infinite word w = n... L I. Since w must e ccepted y A, there must e n ccepting run ρ, nd we represent the ccepting run s follows: nd q 0 p0 q1 p1 2 q 2...p n 1 n q n pn n+1 q n+1... p n 1 qn,1 qn,2... q n,n 1 qn,n = q n... The sequence stisfies tht B N, n N, k n we hve dist k (ρ, p) B. Let c e the lowest priority infinitely visited, nd c must e even. The stte p k 1 is in position k (k+1) 2 in ρ. Let k e n integer such tht () k (k+1) 2 n nd () k (N + 1) B. Let us consider the set of sttes {q k,1,..., q k,k }. Since the distnce function is ounded y B, the priority c ppers t lest once in ech set of consecutively visited sttes of size B. Since k (N + 1) B, it ppers t lest N + 1 times in {q k,1,...,q k,k }. Since there is N sttes in A, t lest one stte hs een reched twice. We cn thus iterte: the infinite word w = k 1 ω, nd the word w is ccepted y A. However, w L I nd hence we hve contrdiction. Remrk 1. From Exmple 2 we deduce the following result: NFB nd NFP re not closed under complementtion. The lnguge {, } ω \L I = {w w hs finite numer of } NFB (see Exmple 3 lter); however, Exmple 2 shows tht the complement is not expressile y non-deterministic finitry prity utomt. We summrize the results in the following theorem. Theorem 4. The following ssertions hold: () DB NFP nd DFP NB; () DB NFB nd DFB NB. 4.2 Deterministic finitry utomt In this susection we consider deterministic utomt with finitry cceptnce conditions. Given deterministic complete utomton A with ccepting condition Acc, we will consider the lnguge otined y the finitry restriction of the cceptnce condition. We first consider function C A s follows: C A : Σ ω Q ω mps n infinite word w to the unique run ρ of A on w (there is unique run since A is deterministic nd complete). Then L(A) = {w C A (w) Acc} = C A (Acc). We will focus on the following property: C A (UniCloOmg(Acc)) = UniCloOmg(C A (Acc)), which follows from the following lemm. Lemm 3. For ll A = (Q, Σ, q 0, δ,acc) deterministic complete utomton, we hve: 1. for ll A Q ω, A is closed C A (A) closed (C A is continuous). 2. for ll L Σ ω, L is closed C A (L) closed (C A is closed).

12 3. for ll A Q ω, A is ω-regulr C A (A) ω-regulr. 4. for ll L Σ ω, L is ω-regulr C A (L) ω-regulr. Proof. We prove ll the cses elow. 1. Let A Q ω such tht A is closed. Let w e such tht for ll n N we hve w 0...w n pref(c A (A)). We define the run ρ = C A (w) nd show tht ρ = q 0 q 1... A. Since A is closed, we will show for ll n N we hve q 0... q n pref(a). From the hypothesis we hve w 0...w n 1 pref(c A (A)), nd then there exists n infinite word u such tht C A (w 0...w n 1 u) A. Let C A (w 0...w n 1 u) = q 0 q 1...q n..., then we hve q w 0 0 q w 1 1 q 2 w n 1 q n. Since A is deterministic, we get q i = q i, nd hence q 0... q n pref(a). 2. Let L Σ ω such tht L is closed. Let ρ = q 0 q 1... such tht for ll n N we hve q 0... q n w pref(c A (L)). Then for ll n N, there exists word w 0 w 1...w n 1 such tht q 0 w 0 q 1 1 w n 1 q 2... qn, nd w 0 w 1... w n 1 pref(l). We define y induction on n n infinite nested sequence of finite words w 0 w 1... w n pref(l). We denote y w the limit of this nested sequence of finite words. We hve tht ρ = C A (w). Since L is closed, w L. 3. Let A Q ω such tht A recognized y Büchi utomton B = (Q B, Q, P 0, τ, F). We define the Büchi utomton C = (Q Q B, Σ, {q 0 } P 0, γ, Q B F), where (q 1, p 1 ) σ σ (q 2, p 2 ) iff q 1 q2 in A nd q 1 p 1 p2 in B. We now show the correctness of our construction. Let w = w 0 w 1... ccepted y C, then there exists n ccepting run ρ, s follows: (q 0, p 0 ) w0 (q 1, p 1 ) w1 (q 2, p 2 )...(q n, p n ) wn (q n+1, p n+1 )... where the second component visits F infinitely often. Hence: w q 0 w 0 q 1 w 1 q 2... q n q 0 q 1 q n n qn+1... in A nd p 0 p1 p2...p n pn+1... in B ( ) Hence from ( ), we hve C A (w) = q 0 q 1 L(B) = A, nd it follows tht w C A (A). Conversely, let w C A (A), then we hve ρ = C A(w) = q 0 q 1 A = L(B). Then the ove sttement ( ) holds, which entils tht w is ccepted y C. It follows tht C recognizes C A (A). 4. Let L Σ ω such tht L is recognized y Büchi utomton B = (Q B, Σ, P 0, τ, F). We define the Büchi utomton C = (Q Q B, Q, {q 0 } P 0, γ, Q F), where (q, p 1 ) q (q, p 2 ) iff there exists σ Σ, such tht q σ q σ in A nd p 1 p2 in B. A proof similr to ove show tht C recognizes C A (L). The desired result follows. Theorem 5. For ll deterministic complete utomt A = (Q, Σ, q 0, δ,acc) recognizing lnguge L, the finitry restriction of this utomton UniCloOmg(A) = (Q, Σ, q 0, δ, UniCloOmg(Acc)) recognizes UniCloOmg(L). Proof. A word w is ccepted y UniCloOmg(A) iff w C A (UniCloOmg(Acc)) = UniCloOmg(C A (Acc)) = UniCloOmg(L). Theorem 5 llows to extend ll known results on deterministic clsses to finitry deterministic clsses, nd we hve the following corollry. Corollry 4. We hve: () DFP = DFS; () DFB DFP; (c) DC DFP. We now show tht non-deterministic finitry prity utomt is more expressive thn deterministic finitry prity utomt. Exmple 3 (DFP NFP). Consider the following lnguge L F of finitely mny s, L F = {, } ω \L I = {w w hs finite numer of } NFP.

13 , 1 0 Figure 3. A NFB for L F. The lnguge L F is recognized y the non-deterministic finitry Büchi utomt shown in Fig 3. To show tht deterministic finitry prity utomt re strictly less expressive thn non-deterministic finitry prity utomt, i.e., DFP NFP we show L F DFP. Assume towrds contrdiction tht there is deterministic finitry prity utomton A with N sttes tht recognizes L F. Without loss of generlity we ssume this utomton to e complete, nd let the strting stte e q 0. Since the word ω elongs to the lnguge, the unique run on this word is ccepting nd cn e decomposed s: q n 0 0 s p 0 0 s p 0 0 s 0... where s 0 is the lowest priority stte visited infinitely often (thus it hs even priority), nd n 0, p 0 N. Let s 0 r0. Since the word n0 ω elongs to the lnguge L F, we cn repet the ove construction. By induction, we define s k nd q k s shown in the Figure 4: s k is the lowest priority stte visited infinitely n 0 q 0 s 0 p 0 p 1 n 1 q 1 s 1 p k q k n k s k q k+1 Figure 4. Inductive construction showing tht L F / DFP. often while reding n0 n1... n k 1 n k ω (thus it hs even priority), nd n k, p k N. There exists i < j such tht q i = q j, nd hence the infinite word u ( ni+pi v) ( ni+2pi v)...( ni+kpi v)... where u = n0 n1... ni 1 nd v = ni... nj 1, is ccepted y A. u q 0 n i qi s p i v i s i n i qi s 2p i i... Indeed, iterting on s i s loop ensures tht there is no ound etween two consecutive visits of stte, for those which re not in this loop. In s i s loop, s i hs the lowest priority, nd it is even. There is ound etween two consecutive visits of s i : the loop hs less thn N sttes, nd the wy from s i y v to q i nd ck to s i hs constnt size v + n i. Hence we hve contrdiction tht A recognizes L F. Theorem 6. We hve DFP NFP. Remrk 2. Oserve tht Theorem 5 does not hold for non-deterministic utomt, since we hve DP = NP ut DFP NFP.

14 4.3 Non-deterministic finitry utomt We now show tht non-deterministic finitry Streett utomt cn e reduced to non-deterministic finitry Büchi utomt, nd this would complete the picture of utomt-theoretic chrcteriztion. We first show tht non-deterministic finitry Büchi utomt re closed under conjunction, nd use it to show Theorem 7. Lemm 4. NFB is closed under conjunction. Proof. Let A 1 = (Q 1, Σ, δ 1, Q 1 0, F 1) nd A 2 = (Q 2, Σ, δ 2, Q 2 0, F 2) e two non-deterministic finitry Büchi utomt. Without loss of generlity we ssume oth A 1 nd A 2 to e complete. We will define construction similr to the synchronous product construction, where switch etween copies will hppen while visiting F 1 or F 2. The finitry Büchi utomton is A = (Q 1 Q 2 {1, 2}, Σ, δ, Q 1 0 Q2 0 {1}, F 1 Q 2 {2} Q 1 F 2 {1}). We define the trnsition reltion δ elow: δ = {((q 1, q 2, k), σ, (q 1, q 2, k)) q 1 / F 1, q 2 / F 2, (q 1, σ, q 1) δ 1, (q 2, σ, q 2) δ 2, k {1, 2}} {((q 1, q 2, 1), σ, (q 1, q 2, 2)) q 1 F 1, (q 1, σ, q 1 ) δ 1, (q 2, σ, q 2 ) δ 2} {((q 1, q 2, 2), σ, (q 1, q 2, 1)) q 2 F 2, (q 1, σ, q 1 ) δ 1, (q 2, σ, q 2 ) δ 2} Intuitively, the trnsition function δ is s follows: the first component mimics the trnsition for utomt A 1, the second component mimics the trnsition for A 2, nd there is switch for the third component from 1 to 2 visiting stte in F 1, nd from 2 to 1 visiting stte in F 2. We now prove the correctness of the construction. Consider word w tht is ccepted y A 1, nd then there exists ound B 1 nd run ρ 1 in A 1 such tht eventully, the numer of steps etween two visits to F 1 in ρ 1 is t most B 1 ; nd similrly, there exists ound B 2 nd run ρ 2 in A 2 such tht eventully the numer of steps etween two visits to F 2 in ρ 2 is t most B 2. It follows tht in our construction there is run ρ (tht mimics the runs ρ 1 nd ρ 2 ) in A such tht eventully within mx{b 1, B 2 } steps stte in F 1 Q 2 {2} Q 1 F 2 {1} is visited in ρ. Hence w is ccepted y A. Conversely, consider word w tht is ccepted y A, nd let ρ e run nd B e the ound such tht eventully etween two visits to the ccepting sttes in ρ is seprted y t most B steps. Let ρ 1 nd ρ 2 e the decomposition of the run ρ in A 1 nd A 2, respectively. It follows tht oth in A 1 nd A 2 the respective finl sttes re eventully visited within t most 2 B steps in ρ 1 nd ρ 2, respectively. It follows tht w is ccepted y oth A 1 nd A 2. Hence we hve L(A) = L(A 1 ) L(A 2 ). Theorem 7. We hve NFS NFP NFB. Proof. We will present reduction of NFS to NFB nd the result will follow. Since the Streett condition is finite conjunction of conditions Inf(w) R i Inf(w) G i, y Lemm 4 it suffices to hndle the specil cse when d = 1. Hence we consider non-deterministic Streett utomton A = (Q, Σ, δ, Q 0, (R, G)) with (R, G) = (R 1, G 1 ). Without loss of generlity we ssume A to e complete. We construct non-deterministic Büchi utomton A = (Q {1, 2, 3}, Σ, δ, Q 0 {1}, Q {2}), where the trnsition reltion δ is given s follows: δ = {(q, 1), σ, (q, j) (q, σ, q ) δ, j {1, 2}} {(q, 2), σ, (q, 2) q / R 1, (q, σ, q ) δ} {(q, 2), σ, (q, 3) q R 1, (q, σ, q ) δ} {(q, 3), σ, (q, 3) q / G 1, (q, σ, q ) δ} {(q, 3), σ, (q, 2) q G 1, (q, σ, q ) δ} In other words, the stte component mimics the trnsition of A, nd in the second component: () the utomton cn choose to sty in component 1, or switch to 2; () there is switch from 2 to 3 upon visiting stte in R 1 ; nd () there is switch from 3 to 2 upon visiting stte in G 1. Consider word w ccepted y A nd n ccepting run ρ in A, nd let B e the ound on the distnce sequence. We show tht w is ccepted y A y constructing n ccepting run ρ in A. We consider the following cses:

15 1. If infinitely mny requests R 1 re visited in ρ, then in A immeditely switch to component 2, nd then mimic the run ρ s run ρ in A. It follows tht from some point j on every request is grnted within B steps, nd it follows tht fter position j, whenever the second component is 3, it ecomes 2 within B steps. Hence w is ccepted y A. 2. If finitely mny requests R 1 re visited in ρ, then fter some point j, there re no more requests. The utomton A mimics the run ρ y stying in the second component s 1 for j steps, nd then switches to component 2. Then fter j steps we lwys hve the second component s 2, nd hence the word is ccepted. Conversely, consider word w ccepted y A nd consider the ccepting run ρ. We mimic the run in A. To ccept the word w, the run ρ must switch to the second component s 2, sy fter j steps. Then, from some point on whenever stte with second component 3 is visited, within some ound B steps stte with second component 2 is visited. Hence the run ρ is ccepting in A. Thus the lnguges of A nd A coincide, nd the desired result follows. Corollry 5. We hve DFB DFP NFB = NFP = NFS. Our results estlishing the precise utomt-theoretic chrcteriztion of lnguges defined y utomt with finitry cceptnce condition is shown in Fig 5. In generl NFP cnnot e determinized to DFP, however, for every lnguge L L ω there is A DP such tht A recognizes L, nd hence the deterministic finitry prity utomt UniCloOmg(A) recognizes UniCloOmg(L). Corollry 6. For every lnguge L L ω there is deterministic finitry prity utomt A such tht A recognizes UniCloOmg(L). L ω DB DC DFB DFP = DFS NFB = NFP = NFS Figure 5. Automt-theoretic chrcteriztion

16 5 Logicl Chrcteriztion of Finitry Lnguges In this section we consider the logicl chrcteriztion of finitry lnguges. Closure properties. For logicl chrcteriztion of lnguges defined y utomt with finitry cceptnce conditions, we first study the closure properties of deterministic nd non-deterministic utomt with finitry cceptnce conditions. We will consider DFP nd NFP. Theorem 8 (Closure properties). The following closure properties hold: 1. DFP is closed under intersection. 2. DFP nd NFP re not closed under complementtion. 3. DFP is not closed under union. 4. NFP is closed under union nd intersection. Proof. We prove ll the cses elow. 1. Intersection closure for DFP follows from Theorem 5 nd from the oservtion tht for ll L, L Σ ω we hve UniCloOmg(L L ) = UniCloOmg(L) UniCloOmg(L ). The oservtion is proved s follows. Let M Π 1 L ω nd M L L, then M UniCloOmg(L) UniCloOmg(L ), nd hence UniCloOmg(L L ) UniCloOmg(L) UniCloOmg(L ). Conversely, let M 1 UniCloOmg(L) nd M 2 UniCloOmg(L ), then M 1 M 2 Π 1 L ω nd M 1 M 2 L L. Hence M 1 M 2 UniCloOmg(L L ), thus UniCloOmg(L) UniCloOmg(L ) UniCloOmg(L L ). 2. It follows from Exmple 2 nd Exmple 3 tht there is non-deterministic finitry prity utomt tht recognizes the lnguge L F, nd the complementry lnguge {, } ω \L F = L I is not recognized y non-deterministic finitry prity utomton. It follows tht NFP is not closed under complementtion. The result for DFP is similr. 3. As for Exmple 1 we consider the lnguges L 1 = {( j0 f(0) ) ( j1 f(1) ) ( j2 f(2) )... f : N N, f ounded, i N, j i N} nd L 2 = {( f(0) j0 ) ( f(1) j1 ) ( f(2) j2 )... f : N N, f ounded, i N, j i N}, lso descried y the ωb-regulr expressions ( B )ω nd ( B )ω, respectively. It follows from Exmple 1 tht oth L 1 nd L 2 elong to DFP, nd we show tht L 1 L 2 / DFP. The proof is the very similr to Exmple 1. Assume towrds contrdiction tht L 1 L 2 DFP, nd let A e deterministic complete finitry prity utomton tht recognizes L 1 L 2. Let A hs N sttes, nd let q 0 e the strting stte. Since ω elongs to this lnguge, its unique run on A is ccepting: q n 0 0 s p 0 0 s p where n 0 N, 1 p 0 N nd s 0 is the lowest priority visited infinitely often while reding ω. Then, n0 ω elongs to this lnguge, its unique run on A is ccepting: q n 0 0 s n 0 0 q p 0 1 q p where n 0 N, 1 p 0 N nd q 1 is the lowest priority visited infinitely often while reding n0 ω. Repeting this construction nd y induction we hve: q n 0 0 s n 0 q n 1 1 s n 1... q k k 0 1 n k s k n k q k+1 with s k p k s k nd q p k+1 q k+1, where n k, n k N nd 1 p k, p k N; nd s k is the lowest priority visited infinitely often while reding n0 n 0... n k ω ; nd q k+1 is the lowest priority visited infinitely often while reding n0 n 0... n k n k ω. There must e i < j, such tht q i = q j. Let u = n0 n 0... n i 1 nd v = n i... n j 1. The word w = u ( p i n i+p i v) ( 2p i n i+2p i v)...( kp i n i+kp i v)... is ccepted y A, ut does not elong to L 1 L 2. Hence we hve contrdiction, nd the result follows. 4. Union closure for NFP is ovious, intersection closure for NFP follows from Lemm 4, since NFP = NFB (Corollry 5). The result follows.

17 Comprison with ωb-regulr expressions. We now study the expressive power of NFP s compred to ωb-regulr expressions. The clss of ωb-regulr expressions ws introduced in the work of [BC06] s n extension of ω-regulr expressions. Regulr expressions defines exctly regulr lnguges over finite words, nd hs the following grmmr: L := ε σ L L L L + L; σ Σ In the ove grmmr, stnds for conctention, for Kleene str nd + for union. Then ω-regulr lnguges re finite union of L L ω, where L nd L re regulr lnguges of finite words. The clss of ωb-regulr lnguges, s defined in [BC06], is exctly descried y finite union of L M ω, where L is regulr lnguge over finite words nd M is B-regulr lnguge over infinite sequences of finite words. The grmmr for B-regulr lnguges is s follows: M := ε σ M M M M B M + M; σ Σ The semntics of regulr lnguges over infinite sequences of finite words will ssign to B-regulr expression M, lnguge in (Σ ) ω. The infinite sequence u 0, u 1,... will e denoted y u. The semntics is defined y structurl induction s follows. is the empty lnguge, ε is the lnguge contining the single sequence (ε, ε,...), is the lnguge contining the single sequence (,,...), M 1 M 2 is the lnguge { u 0 v 0, u 1 v 1,... u M 1, v M 2 }, M is the lnguge { u 1... u f(1) 1, u f(1)... u f(2) 1,... u M, f : N N}, M B is defined like M ut we dditionlly require the vlues f(i + 1) f(i) to e ounded, M 1 + M 2 is {w u M 1, v M 2, i, w i {u i, v i }}. Finlly, the ω opertor on sequences with nonempty words on infinitely mny coordintes: u 0, u 1,... ω = u 0 u This opertion is nturlly extended to lnguges of sequences y tking the ω power of every sequence in the lnguge (ignoring those with nonempty words on finitely mny coordintes). The clss of ωb-regulr lnguges is more expressive thn NFP, nd this is due to the -opertor. We will consider the following frgment of ωb-regulr lnguges where we do not consider the -opertor for B-regulr expressions (however, the -opertor is llowed for L, regulr lnguges over finite words). We cll this frgment the str-free frgment of ωb-regulr lnguges. In the following two lemms we show tht strfree ωb-regulr expressions express exctly NFP = NFB. Lemm 5. All lnguges in NFP cn e descried y str-free ωb-regulr expression. Proof. Let A = (Q, Σ, δ, Q 0, p) e non-deterministic finitry prity utomton. Without loss of generlity we ssume Q = {1,..., n}. Let C = p(q) e the set of priorities, Q even = {q Q p(q) even} the set of sttes with even priority nd Q c = {q Q p(q) c} the set of sttes with priority t lest c. Let L q,q = {u Σ q u q } nd Mq c = {u ( u i ) i is ounded nd i, q ui q where ll intermedite visited sttes hve priority greter thn c}. Then L(A) = L q0,q (Mq p(q) ) ω. q 0 Q 0,q Q even For ll q, q Q we hve L q,q Σ is regulr. We now show tht for ll q Q nd c C the lnguge Mq c is B-regulr. We fix c C, nd then for simplicity of nottion revite Mq c to M q. For ll 0 k n nd q, q Q, let Mq,q k = {u ( u u i ) i is ounded nd i, q i q where ll intermedite visited sttes re from {1,...,k} nd hve priority greter thn c}. We show y induction on 0 k n tht for ll q, q Q the lnguge Mq,q k is B-regulr. The se cse k = 0 follows from oservtion: l if q q nd (q,, q ) δ i {1,...,l}, = i Mq,q 0 = ε l if q = q nd (q,, q ) δ i {1,...,l}, = i otherwise

18 The inductive cse for k > 0 follows from oservtion: M k q,q = Mk 1 q,k (Mk 1 k,k )B M k 1 k,q + Mk 1 q,q Since M n q,q = M q, we conclude tht L(A) is descried y str-free ωb-regulr expression. Lemm 6. All lnguges descried y str-free ωb-regulr expression is recognized y nondeterministic finitry Büchi utomton. Proof. To prove this result, we will descrie utomt reding infinite sequences of finite words, nd corresponding cceptnce conditions. Let A = (Q, Σ, δ, Q 0, F) finitry Büchi utomton. While reding n infinite sequence u of finite words, A will ccept if the following conditions re stisfied: (1) q 0 u Q 0, q 1, q 2,... F, i N, we hve q i i qi+1 nd (2) ( u n ) n is ounded. We show tht for ll M str-free B-regulr expression, there exists non-deterministic finitry Büchi utomton ccepting M B, lnguge of infinite sequence of finite words, s descried ove. We proceed y induction on M. The cses, ε nd Σ re esy. From M to M B, the sme utomton for M works for M B s well, since B is idempotent. From M 1, M 2 to M 1 + M 2 : this involves non-determinism. The utomton guesses for ech finite word which word is used. Let A 1 = (Q 1, Σ, δ 1, Q 0 1, F 1) nd A 2 = (Q 2, Σ, δ 2, Q 0 2, F 2) two nondeterministic finitry Büchi utomt ccepting M B 1 nd M B 2, respectively. For k {1, 2} nd T Q k, we define Finl(T) = {q F k q T, u Σ, q u Ak q } to e the stte of finl sttes rechle from stte in T. We denote y Finl k the k-th itertion of Finl, e.g., Finl 3 (T) = Finl(Finl(Finl(T))). We define finitry Büchi utomton: where A = ((Q 1 2 Q1 ) (Q 2 2 Q1 ) 2 }{{}} Q1 {{ 2 Q2 }, Σ, δ, (Q 0 1, Q 0 2), F) computtion sttes guess sttes δ = {((Q, Q ), ε, (q, Finl(Q ))) q Q} (guess is 1) {((Q, Q ), ε, (q, Finl(Q))) q Q } (guess is 2) {((q, T), σ, (q, T)) (q, σ, q ) δ 1 δ 2 } {((q 1, T), ε, ({q 1 }, T)) q 1 F 1 } {((q 2, T), ε, (T, {q 2 })) q 2 F 2 } There re two kinds of sttes. Computtion sttes re (q, T) where q Q 1 nd T Q 2 (or symmetriclly q Q 2 nd T Q 1 ), where q is the current stte of the utomton tht hs een decided to use for the current finite word, nd T is the set of finl sttes of the other utomton tht would hve een rechle if one hd chosen this utomton. Guess sttes re (Q, Q ), where Q is the set of sttes from A 1 one cn strt reding the next word, nd similrly for Q. We now prove the correctness of our construction. Consider n infinite sequence w ccepted y A, nd consider n ccepting run ρ. There re three cses: 1. either ll guesses re 1; 2. or ll guesses re 2; 3. else, oth guesses hppen. The first two cses re symmetric. In the first, we cn esily see tht w is ccepted y A 1, nd similrly in the second w is ccepted y A 2. We now consider the third cse. There re two symmetric sucses: either the first guess is 1, then ρ = (Q 0 1, Q0 2 ) (q0 1, Finl(Q0 2 ))..., with q1 0 Q0 1 ; or symmetriclly the first guess is 2, then ρ = (Q 0 1, Q0 2 ) (q0 2, Finl(Q0 1 ))...,

19 with q2 0 Q0 2. We consider only the first sucse. Then ρ = (Q 0 1, Q0 2 ) (q0 1, Finl(Q0 2 ))...(q1 1, Finl(Q0 2 )) ({q1 1 }, Finl(Q0 2 ))..., u 0 where u 0 is finite prefix of w ω such tht q1 0 q 1 1 in A 1 nd q1 1 F 1. We denote y ρ 0 the finite prefix of ρ up to (q1 1, Finl(Q0 2 )). Let k e the first time when guess is 2: then ρ = ρ 0 ρ 1 ρ k 1 ({q k 1 }, Finlk (Q 0 2 )) (q0 2, Finl({q k}))..., where q 0 2 Finl k (Q 0 2) nd for 1 i k 1, we hve ρ i = ({q i 1}, Finl i (Q 0 2)) (q i 1, Finl i+1 (Q 0 2))...(q i+1 1, Finl i+1 (Q 0 2)), u i nd u i is finite word such tht q1 i q i+1 1 in A 1, q1 i+1 F 1 nd u 0 u 1... u k 1 finite prefix of w ω. Since q2 0 Finlk (Q 0 2 ), there exists v 0, v 1,..., v k 1 finite words nd q2 1,..., qk 2 F 2 such tht: q2 0 v 0 q 1 v 1 v k q k 2. Then we cn repet this y induction, constructing u M1 B nd v MB 2, such tht for ll i N, we hve w i {u i, v i }. Conversely, let u M1 B nd v M2 B, nd w such tht i N, w i {u i, v i }. Using A 1 when w i = u i nd A 2 otherwise, one cn construct n ccepting run for w nd A. Hence A recognizes (M 1 +M 2 ) B. From M 1, M 2 to M 1 M 2 : the utomton keeps trcks of pending sttes while reding the other word. Let A 1 = (Q 1, Σ, δ 1, Q 0 1, F 1) nd A 2 = (Q 2, Σ, δ 2, Q 0 2, F 2) two non-deterministic finitry Büchi utomt ccepting M1 B nd MB 2, respectively. Let A = ((Q 1 F 2 ) (Q 2 F 1 ), Σ, δ, Q 0 1 Q0 2, F 1 F 2 ), where δ = {((q, f), σ, (q, f)) (q, σ, q ) δ 1, f F 2 } {((q, f), σ, (q, f)) (q, σ, q ) δ 2, f F 1 } {((q 1, f), ε, (f, q 1 )) q 1 F 1 } {((q 2, f), ε, (f, q 2 )) q 2 F 2 } Intuitively, the trnsition reltion is s follows: either one is reding using A 1 or A 2. In oth cses, the utomton rememers the lst finl stte visited while reding in the other utomton in order to restore this stte for the next word. Let w ccepted y A, n ccepting run is s follows: (q1, 0 q2) 0 w0 (q1, 1 q2) 1 w1... (q1, i q2) i wi (q1 i+1, q2 i+1 )... where (q1, 0 q2) 0 Q 0 1 Q 0 2, for ll i 1, we hve (q1, i q2) i F 1 F 2 nd ( w n ) n ounded. From the construction, for ll i N, we hve w i = u 0 i v0 i u1 i v1 i... uki i v ki i, where q1 i = q1(0) i u0 i q1(1) i u1 i q1(2)... i uk i i q1(k i i + 1) = q1 i+1 in A 1 q2 i = q2(0) i v0 i q2(1) i v1 i q2(2)... i vk i i q2(k i i + 1) = q2 i+1 in A 2 the sttes (q1 i(k), qi 2 (k)) elong to F 1 F 2. We define u i = u 0 i u1 i... uki i nd v i = v 0 i v1 i... vki i. From the ove follows tht u nd v re ccepted y A 1 nd A 2, respectively. Then w (M 1 M 2 ) B. Conversely, sequence in (M 1 M 2 ) B is clerly ccepted y A. Hence A recognizes (M 1 M 2 ) B. We now prove tht ll str-free ωb-regulr expressions re recognized y non-deterministic finitry Büchi utomton. Since NFB re closed under finite union (Theorem 8), we only need to consider expressions L M ω, where L Σ is regulr lnguge of finite words nd M str-free B-regulr expression. The constructions ove ensure tht there exists A M = (Q M, Σ, δ M, Q 0 M, F M), non-deterministic finitry Büchi utomton tht recognizes the lnguge M B of infinite sequences. Let A L = (Q L, Σ, δ L, Q 0 L, F L) e finite utomton over finite words tht recognizes L. We construct non-deterministic finitry Büchi utomton s follows: A = (Q L Q M, Σ, δ, Q 0 L, F M) where δ = δ L δ M {(q, ε, q ) q F L, q Q 0 M }. In other words, first A simultes A L, nd when finite prefix is recognized y A L, then A turns to A M nd simultes it.

Lecture 9: LTL and Büchi Automata

Lecture 9: LTL and Büchi Automata Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled

More information

Formal Languages and Automata

Formal Languages and Automata Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University

More information

Lecture 08: Feb. 08, 2019

Lecture 08: Feb. 08, 2019 4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny

More information

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38 Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control

More information

Theory of Computation Regular Languages

Theory of Computation Regular Languages Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of

More information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton 25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q

More information

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University U.U.D.M. Project Report 07:4 Frey Frctions Rickrd Fernström Exmensrete i mtemtik, 5 hp Hledre: Andres Strömergsson Exmintor: Jörgen Östensson Juni 07 Deprtment of Mthemtics Uppsl University Frey Frctions

More information

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

Chapter 2 Finite Automata

Chapter 2 Finite Automata Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

Regular expressions, Finite Automata, transition graphs are all the same!!

Regular expressions, Finite Automata, transition graphs are all the same!! CSI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 7: Kleene s Theorem Chpter 7: Kleene s Theorem Regulr expressions, Finite Automt, trnsition grphs re ll the sme!! Dr. Neji Zgui CSI3104-W11 1

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

3 Regular expressions

3 Regular expressions 3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll

More information

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9. Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.

More information

Harvard University Computer Science 121 Midterm October 23, 2012

Harvard University Computer Science 121 Midterm October 23, 2012 Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

More information

Designing finite automata II

Designing finite automata II Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of

More information

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy:

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy: Scnner Specifying ptterns source code tokens scnner prser IR A scnner must recognize the units of syntx Some prts re esy: errors mps chrcters into tokens the sic unit of syntx x = x + y; ecomes

More information

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages 5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

Finite-State Automata: Recap

Finite-State Automata: Recap Finite-Stte Automt: Recp Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute of Science, Bnglore. 09 August 2016 Outline 1 Introduction 2 Forml Definitions nd Nottion 3 Closure under

More information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

Lecture 09: Myhill-Nerode Theorem

Lecture 09: Myhill-Nerode Theorem CS 373: Theory of Computtion Mdhusudn Prthsrthy Lecture 09: Myhill-Nerode Theorem 16 Ferury 2010 In this lecture, we will see tht every lnguge hs unique miniml DFA We will see this fct from two perspectives

More information

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

More information

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018 CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA

More information

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016 CS125 Lecture 12 Fll 2016 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

More information

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck. Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session 1 2006 Rlf Huuck 1 Session 1 2006 Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent

More information

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science CSCI 340: Computtionl Models Kleene s Theorem Chpter 7 Deprtment of Computer Science Unifiction In 1954, Kleene presented (nd proved) theorem which (in our version) sttes tht if lnguge cn e defined y ny

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages lgorithms & Models of omputtion S/EE 374, Spring 209 NFs continued, losure Properties of Regulr Lnguges Lecture 5 Tuesdy, Jnury 29, 209 Regulr Lnguges, DFs, NFs Lnguges ccepted y DFs, NFs, nd regulr expressions

More information

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Converting Regular Expressions to Discrete Finite Automata: A Tutorial Converting Regulr Expressions to Discrete Finite Automt: A Tutoril Dvid Christinsen 2013-01-03 This is tutoril on how to convert regulr expressions to nondeterministic finite utomt (NFA) nd how to convert

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic

More information

First Midterm Examination

First Midterm Examination 24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet

More information

State Minimization for DFAs

State Minimization for DFAs Stte Minimiztion for DFAs Red K & S 2.7 Do Homework 10. Consider: Stte Minimiztion 4 5 Is this miniml mchine? Step (1): Get rid of unrechle sttes. Stte Minimiztion 6, Stte is unrechle. Step (2): Get rid

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages Algorithms & Models of Computtion CS/ECE 374, Fll 2017 NFAs continued, Closure Properties of Regulr Lnguges Lecture 5 Tuesdy, Septemer 12, 2017 Sriel Hr-Peled (UIUC) CS374 1 Fll 2017 1 / 31 Regulr Lnguges,

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2 CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb. CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

Tutorial Automata and formal Languages

Tutorial Automata and formal Languages Tutoril Automt nd forml Lnguges Notes for to the tutoril in the summer term 2017 Sestin Küpper, Christine Mik 8. August 2017 1 Introduction: Nottions nd sic Definitions At the eginning of the tutoril we

More information

More on automata. Michael George. March 24 April 7, 2014

More on automata. Michael George. March 24 April 7, 2014 More on utomt Michel George Mrch 24 April 7, 2014 1 Automt constructions Now tht we hve forml model of mchine, it is useful to mke some generl constructions. 1.1 DFA Union / Product construction Suppose

More information

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook

More information

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd

More information

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz University of Southern Cliforni Computer Science Deprtment Compiler Design Fll Lexicl Anlysis Smple Exercises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sciences Institute 4676 Admirlty Wy, Suite

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)

More information

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-* Regulr Expressions (RE) Regulr Expressions (RE) Empty set F A RE denotes the empty set Opertion Nottion Lnguge UNIX Empty string A RE denotes the set {} Alterntion R +r L(r ) L(r ) r r Symol Alterntion

More information

Formal languages, automata, and theory of computation

Formal languages, automata, and theory of computation Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm

More information

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA RIGHT LINEAR LANGUAGES. Right Liner Grmmr: Rules of the form: A α B, A α A,B V N, α V T + Left Liner Grmmr: Rules of the form: A Bα, A α A,B V N, α V T

More information

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute Victor Admchik Dnny Sletor Gret Theoreticl Ides In Computer Science CS 5-25 Spring 2 Lecture 2 Mr 3, 2 Crnegie Mellon University Deterministic Finite Automt Finite Automt A mchine so simple tht you cn

More information

Name Ima Sample ASU ID

Name Ima Sample ASU ID Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to

More information

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata CS103B ndout 18 Winter 2007 Ferury 28, 2007 Finite Automt Initil text y Mggie Johnson. Introduction Severl childrens gmes fit the following description: Pieces re set up on plying ord; dice re thrown or

More information

Let's start with an example:

Let's start with an example: Finite Automt Let's strt with n exmple: Here you see leled circles tht re sttes, nd leled rrows tht re trnsitions. One of the sttes is mrked "strt". One of the sttes hs doule circle; this is terminl stte

More information

ɛ-closure, Kleene s Theorem,

ɛ-closure, Kleene s Theorem, DEGefW5wiGH2XgYMEzUKjEmtCDUsRQ4d 1 A nice pper relevnt to this course is titled The Glory of the Pst 2 NICTA Resercher, Adjunct t the Austrlin Ntionl University nd Griffith University ɛ-closure, Kleene

More information

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan CS 267: Automted Verifiction Lecture 8: Automt Theoretic Model Checking Instructor: Tevfik Bultn LTL Properties Büchi utomt [Vrdi nd Wolper LICS 86] Büchi utomt: Finite stte utomt tht ccept infinite strings

More information

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

More information

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd T. vn Lrhoven Institute for Computing nd Informtion Sciences Intelligent

More information

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA) Finite Automt (FA or DFA) CHAPTER Regulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, equivlence of NFAs DFAs, closure under regulr

More information

Revision Sheet. (a) Give a regular expression for each of the following languages:

Revision Sheet. (a) Give a regular expression for each of the following languages: Theoreticl Computer Science (Bridging Course) Dr. G. D. Tipldi F. Bonirdi Winter Semester 2014/2015 Revision Sheet University of Freiurg Deprtment of Computer Science Question 1 (Finite Automt, 8 + 6 points)

More information

How Deterministic are Good-For-Games Automata?

How Deterministic are Good-For-Games Automata? How Deterministic re Good-For-Gmes Automt? Udi Boker 1, Orn Kupfermn 2, nd Mich l Skrzypczk 3 1 Interdisciplinry Center, Herzliy, Isrel 2 The Herew University, Isrel 3 University of Wrsw, Polnd Astrct

More information

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt From Regulr Expressions to NFA- Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Eugene Weinstein Google, NYU Cournt Institute eugenew@cs.nyu.edu Slide Credit: Mehryr Mohri Preliminries Finite lphet, empty string.

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30 Tlen en Automten Test 1, Mon 7 th Dec, 2015 15h45 17h30 This test consists of four exercises over 5 pges. Explin your pproch, nd write your nswer to ech exercise on seprte pge. You cn score mximum of 100

More information

Deterministic Finite Automata

Deterministic Finite Automata Finite Automt Deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion Sciences Version: fll 2016 J. Rot Version: fll 2016 Tlen en Automten 1 / 21 Outline Finite Automt Finite

More information

Thoery of Automata CS402

Thoery of Automata CS402 Thoery of Automt C402 Theory of Automt Tle of contents: Lecture N0. 1... 4 ummry... 4 Wht does utomt men?... 4 Introduction to lnguges... 4 Alphets... 4 trings... 4 Defining Lnguges... 5 Lecture N0. 2...

More information

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014 CS125 Lecture 12 Fll 2014 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

More information

DFA minimisation using the Myhill-Nerode theorem

DFA minimisation using the Myhill-Nerode theorem DFA minimistion using the Myhill-Nerode theorem Johnn Högerg Lrs Lrsson Astrct The Myhill-Nerode theorem is n importnt chrcteristion of regulr lnguges, nd it lso hs mny prcticl implictions. In this chpter,

More information

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University CS415 Compilers Lexicl Anlysis nd These slides re sed on slides copyrighted y Keith Cooper, Ken Kennedy & Lind Torczon t Rice University First Progrmming Project Instruction Scheduling Project hs een posted

More information

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings... Tle of contents: Lecture N0.... 3 ummry... 3 Wht does utomt men?... 3 Introduction to lnguges... 3 Alphets... 3 trings... 3 Defining Lnguges... 4 Lecture N0. 2... 7 ummry... 7 Kleene tr Closure... 7 Recursive

More information

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!) CMSC 330: Orgniztion of Progrmming Lnguges DFAs, nd NFAs, nd Regexps (Oh my!) CMSC330 Spring 2018 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All

More information

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Mehryr Mohri Cournt Institute nd Google Reserch mohri@cims.nyu.com Preliminries Finite lphet Σ, empty string. Set of ll strings over

More information

Software Engineering using Formal Methods

Software Engineering using Formal Methods Softwre Engineering using Forml Methods Propositionl nd (Liner) Temporl Logic Wolfgng Ahrendt 13th Septemer 2016 SEFM: Liner Temporl Logic /GU 160913 1 / 60 Recpitultion: FormlistionFormlistion: Syntx,

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed

More information

CDM Automata on Infinite Words

CDM Automata on Infinite Words CDM Automt on Infinite Words 1 Infinite Words Klus Sutner Crnegie Mellon Universlity 60-omeg 2017/12/15 23:19 Deterministic Lnguges Muller nd Rin Automt Towrds Infinity 3 Infinite Words 4 As mtter of principle,

More information

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science CSCI 340: Computtionl Models Trnsition Grphs Chpter 6 Deprtment of Computer Science Relxing Restrints on Inputs We cn uild n FA tht ccepts only the word! 5 sttes ecuse n FA cn only process one letter t

More information

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation 9/6/28 Stereotypicl computer CISC 49 Theory of Computtion Finite stte mchines & Regulr lnguges Professor Dniel Leeds dleeds@fordhm.edu JMH 332 Centrl processing unit (CPU) performs ll the instructions

More information

1 From NFA to regular expression

1 From NFA to regular expression Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work

More information

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 4 1. UsetheproceduredescriedinLemm1.55toconverttheregulrexpression(((00) (11)) 01) into n NFA. Answer: 0 0 1 1 00 0 0 11 1 1 01 0 1 (00)

More information

Myhill-Nerode Theorem

Myhill-Nerode Theorem Overview Myhill-Nerode Theorem Correspondence etween DA s nd MN reltions Cnonicl DA for L Computing cnonicl DFA Myhill-Nerode Theorem Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

Introduction to ω-autamata

Introduction to ω-autamata Fridy 25 th Jnury, 2013 Outline From finite word utomt ω-regulr lnguge ω-utomt Nondeterministic Models Deterministic Models Two Lower Bounds Conclusion Discussion Synthesis Preliminry From finite word

More information

Fundamentals of Computer Science

Fundamentals of Computer Science Fundmentls of Computer Science Chpter 3: NFA nd DFA equivlence Regulr expressions Henrik Björklund Umeå University Jnury 23, 2014 NFA nd DFA equivlence As we shll see, it turns out tht NFA nd DFA re equivlent,

More information

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is

More information

Good-for-Games Automata versus Deterministic Automata.

Good-for-Games Automata versus Deterministic Automata. Good-for-Gmes Automt versus Deterministic Automt. Denis Kuperberg 1,2 Mich l Skrzypczk 1 1 University of Wrsw 2 IRIT/ONERA (Toulouse) Séminire MoVe 12/02/2015 LIF, Luminy Introduction Deterministic utomt

More information

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford Probbilistic Model Checking Michelms Term 2011 Dr. Dve Prker Deprtment of Computer Science University of Oxford Long-run properties Lst lecture: regulr sfety properties e.g. messge filure never occurs

More information

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1 Non-Deterministic Finite Automt Fll 2018 Costs Busch - RPI 1 Nondeterministic Finite Automton (NFA) Alphbet ={} q q2 1 q 0 q 3 Fll 2018 Costs Busch - RPI 2 Nondeterministic Finite Automton (NFA) Alphbet

More information

Automata and Languages

Automata and Languages Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering Lb. The University of Aizu Jpn Grmmr Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Regulr Lnguges Context Free Lnguges Context Sensitive

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

Homework Solution - Set 5 Due: Friday 10/03/08

Homework Solution - Set 5 Due: Friday 10/03/08 CE 96 Introduction to the Theory of Computtion ll 2008 Homework olution - et 5 Due: ridy 10/0/08 1. Textook, Pge 86, Exercise 1.21. () 1 2 Add new strt stte nd finl stte. Mke originl finl stte non-finl.

More information

On Determinisation of History-Deterministic Automata.

On Determinisation of History-Deterministic Automata. On Deterministion of History-Deterministic Automt. Denis Kupererg Mich l Skrzypczk University of Wrsw YR-ICALP 2014 Copenhgen Introduction Deterministic utomt re centrl tool in utomt theory: Polynomil

More information

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers 80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES 2.6 Finite Stte Automt With Output: Trnsducers So fr, we hve only considered utomt tht recognize lnguges, i.e., utomt tht do not produce ny output on ny input

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q

More information

1.3 Regular Expressions

1.3 Regular Expressions 56 1.3 Regulr xpressions These hve n importnt role in describing ptterns in serching for strings in mny pplictions (e.g. wk, grep, Perl,...) All regulr expressions of lphbet re 1.Ønd re regulr expressions,

More information