Computer Science & Engineering Department. IIT Kharagpur. Theory of Computation: CS41001 Lecture I

Size: px
Start display at page:

Download "Computer Science & Engineering Department. IIT Kharagpur. Theory of Computation: CS41001 Lecture I"

Transcription

1 Computer Science & Engineering Department IIT Kharagpur Theory of Computation: CS4 Lecture I Instructor: Goutam Biswas Autumn Semester Büchi Automata. Finite and Infinite Sequences An alphabet Σ is afinite set ofsymbols. The collectionoffinite length sequences of symbols from Σ is called Σ. Σ = {σ σ k : σ i Σ, k N } = k N Σ k, where N = {,,2, } and Σ k = {σ σ k : σ i Σ} for all k N. It is not difficult to prove that Σ is a countably infinite set. A Σ-language (or a language over Σ) L is a subset of Σ. So the set of Σ- languagesis uncountable 2 and most ofthese languagescannot have anyeffective finite description. We may view x Σ k, as a map from {,2,,k} Σ, where x(i) Σ is the i th symbol of x from the left. We shall write x i for x(i). The set Σ k is the collection of all possible maps from {,2,,k} Σ. If there are d symbols in Σ, the size of Σ k is d k. The null string ε is the map from Σ. An infinite string α is a map from N Σ, where N = {,2,3, }. As usual α(i) is the i th symbol of α, and we write α i. The collection of all infinite strings over Σ is called Σ ω. It is also not difficult to show that Σ ω is uncountable 3 if Σ >. An ω-language over Σ is a subset of Σ ω. We call Σ = Σ ω Σ. Example. It is clear that is a subset of both Σ as well as Σ ω. If L Σ and α Σ ω, then Lα = {xα : x L} is an ω-language over Σ..2 Finite State Recognisers We look into languages both over Σ and also over Σ ω, that can be recognised by machine models having finite number of states. It has finite memory, so it can remember finite amount of history for deciding the future course of action..2. Languages over Σ It is known that most of the Σ -languages cannot have effective descriptions. But some of them (countably many) can be recognised by a mathematical machine model known as nondeterministic finite automaton (nfa). An nfa N, over Σ is specified by four data, N = (Q,I,F,T), where Q is a finite set of states, I Q is the set of initial states, F Q is the set of final states, and T Q Σ Q, is the transition relation. The transition relation gives a directed graph with set of states as vertices. Edges of the graph are labeled with the symbols of Σ. If (p,σ,q) T, then there is an edge from p to q labeled with σ. The reading is that the machine from the state p will go to state q on input (on event) σ. A run or computation of the machine on an input x = σ σ 2 σ k Σ, is a finite sequence of states s,s 2,,s k+, such that. s I, and 2. (s i,σ i,s i+ ) T, for all i, i k. If Σ = d, then any element of Σ may be viewed as a numeral in radix-(d+) numeral. So there is an injective map from Σ N, the set of natural numbers. 2 There is no surjective map from Σ PΣ (Cantor). 3 If Σ has two symbols, then a map from N Σ may be viewed as the characteristic function of a subset of N. So the collection of all such functions is bijective with the power set of N. And it is known (Cantor) that power set cannot be equinumerous to the original set.

2 An nfa N accepts x = σ σ 2 σ k Σ, if there is a run of the machine on x such that the last state s k+ F. The language of the automaton L(N) is the collection of all strings for which there are accepting runs or computations of the automaton. A language L Σ is is called regular, if there is an nfa N such that L = L(N). An nfa is deterministic (dfa) if following two conditions are satisfied.. I =, 2. for each p Q and σ Σ, there is at most one q Q so that (p,σ,q) T. An nfa or dfa is complete if for each p Q and σ Σ, there is at least one q Q so that (p,σ,q) T. It can be shown that the model of dfa and nfa are of equivalent in terms of recognising languages of Σ i.e. if L Σ is recognised by an nfa, then there is a dfa for L. But an nfa is a more succinct model. In the worst case the equivalent dfa model of an n state nfa can have O(2 n ) states. Ex. Show that the collection of all regular languages over Σ is a countable Boolean algebra..2.2 Languages over Σ ω In case of languages over Σ ω we have a model similar to nfa, known as Büchi automaton 4. A Büchi automatonis alsospecified by four data, B = (Q,I,F,T), with the symbols having their same meaning. But a run or computation of this model on an infinite sequence of elements from Σ is an infinite sequence of states (non-terminating). Let the sequence of events or inputs be α = α α 2 Σ ω. The corresponding infinite run or computation is the sequence of states s,s 2, Q ω, such that. s I, and 2. (s i,α i,s i+ ) T, for all i N. The obvious question is what can be the an accepting or successful run? A successful or accepting run of a Büchi automaton is the one that starts from an initial state, and at least one of the final states is present infinitely often in it. Given a run r : N Q we define a subset of states Inf(r) = {p Q : r (p) is infinite}, where r (p) is the set of pre-images of the state p Q. So an infinite sequence α = α α 2 is accepted by a Büchi automaton B = (Q,I,F,T), ifr = s,s 2, is arun 5 ofthe automatononαandf Inf(r). The language of the Büchi automaton B, L(B) = {α Σ ω : B has a successful run on α}. A Büchi automaton is said to be incomplete if there is a some s Q and σ Σ, there is no state t Q such that (s,σ,t) T. An incomplete Büchi automaton can be completed by introducing a new state g Q and the following set of transitions.. T = {(s,σ,g) : (s,σ,t) T for any t Q}. 2. T 2 = {(g,σ,g) : σ Σ}. The equivalent complete Büchi automaton, B = (Q {g},i,f,t T T 2 ). Example 2. Following are a few examples of Büchi automaton. Let Σ = {,} in all these cases.. Each string has either exactly one or exactly one. 4 In 962 it was introduced by J R Büchi in his paper On a decision method in restricted second order arithmetic. 5 There may be more than one run of B on α, as the machine is non-deterministic. 2

3 s s2 s3 s4 The machine has two start states, I = {s,s 3 } and two final states, F = {s 2,s 4 }. It is incompletely specified. 2. Each should be followed by two s. s s2 s3 s4 3. There are finitely many s in each sequence., s, s2 4. After every there must be either even number of consecutive s or there must be infinite number of consecutive s. s5 s s2 s3 s4 5. Each sequence is of the form xα, where x = () k and α Σ ω, where k. s s2 s3 s4, 3

4 .2.3 Closure Properties The class of languages over Σ ω recognised by Büchi automaton is closed under (i) union, (ii) intersection and (iii) projection. We present this fact in form of following lemmas. Lemma. If L and L 2, languages over Σ ω, are recognised by Büchi automata B = (Q,I,F,T ) and B 2 = (Q 2,I 2,F 2,T 2 ) respectively, then L L 2 is also recognised by a Büchi automaton. Proof: We construct the recogniser for L = L L 2. Without any loss of generality we assume that Q Q 2 =. Our recogniser for L is B = (Q Q 2,I I 2,F F 2,T T 2 ). The claim that any α L L 2 is accepted by B is straight forward. If α has an successful run on B, then it also has a successful run on B. Similar is the case if α has a successful run on B 2. In the other direction, if α has a successful run on B, then it must have a successful run on B or B 2 component of B. By our construction these two components are disjoint. Example 3. Consider the following two languages: L : each string has either exactly one or exactly one. L 2 : there are finitely many s in each sequence. The automaton for L = L L 2 is s s2 s3 s4, s5, s6 Lemma 2. If L and L 2, languages over Σ ω, are recognised by Büchi automata B = (Q,I,F,T ) and B 2 = (Q 2,I 2,F 2,T 2 ) respectively, then L L 2 is also recognised by a Büchi automaton. Proof: The construction of intersection machine requires two things. Given an input α Σ ω,. we should simulate computations of both B and B 2 simultaneously, and 2. keep track of visiting final states of both the machines. The first condition calls for the set of states of the intersection machine as the Cartesian product of Q and Q 2. For a successful run on an input α on the intersection machines, the final states of each of the component machines must appear infinitely often in the run. We use a switch in the states of the intersection machine to remember that the final states of B and B 2 are visited alternately. This will not create any problem as on any successful run on an input α L L 2, of the intersection machine, as after every occurrence of a final state of either B or B 2, there are infinitely many occurrences of final states of both B and B 2. 4

5 We describe the product or intersection machine as follows: B = (Q Q 2 {,2,3},I I 2 {},Q Q 2 {3},T). where transition table T is defined as follows:. ((s,s 2,),σ,(s,s 2,)), where (s,σ,s ) T, (s 2,σ,s 2) T 2, and s F. Expecting a final state of B. 2. ((s,s 2,),σ,(s,s 2,2)), where (s,σ,s ) T, (s 2,σ,s 2 ) T 2, and s F. Expecting a final state of B ((s,s 2,2),σ,(s,s 2,2)), where (s,σ,s ) T, (s 2,σ,s 2) T 2, and s 2 F 2. Expecting a final state of B ((s,s 2,2),σ,(s,s 2,3)), where (s,σ,s ) T, (s 2,σ,s 2) T 2, and s 2 F 2. Visited both the final states. 5. ((s,s 2,3),σ,(s,s 2,)), where (s,σ,s ) T, (s 2,σ,s 2 ) T 2, and s F. Expecting a final state of B. 6. ((s,s 2,3),σ,(s,s 2,2)), where (s,σ,s ) T, (s 2,σ,s 2 ) T 2, and s F. Expecting a final state of B 2. It is possible to work with two-valued switch i.e. Q = Q Q 2 {,2}, where F = F F 2 {2} etc. Definition : Let Σ = Σ Σ 2, and α = (α,α 2 )(α 2,α 22 )(α 3,α 32 ). The Σ -projectionofα isπ (α) = α = α α 2 α 3 Σ ω. Similarly,Σ 2-projection of α is π 2 (α) = α 2 = α 2 α 22 α 32 Σ ω 2. If L Σ ω = (Σ Σ 2 ) ω, then the projection languages of L are π (L) = {π (α) : α L} and π 2 (L), defined similarly. Lemma 3. If L Σ ω, where Σ = Σ Σ 2, is recognised by a Büchi automaton B = (Q,I,F,T), then π (L) and π 2 (L) are also Büchi recognisable. Proof: We construct the machine B = (Q,I,F,T ) to recognise π (L), where for all σ Σ, (s,σ,t) T, if there exists some σ 2 Σ 2, such that (s,(σ,σ 2 ),t) T. Let α = (α,α 2 )(α 2,α 22 )(α 3,α 32 ) L Σ ω = (Σ Σ 2 ) ω. So there isasuccessfulrunr = s s 2 ofb onα, wheres I and(s i,(α i,α i2 ),s i+ ) T, for all i =,2,. But then according to the construction there is a successful run of B on π (α) = α α 2. The other direction can also be proved similarly. We can construct recogniser for π 2 (L) in a similar manner..2.4 Büchi Characterisation Theorem First we show that for any regular language L over Σ, the language of infinite words L ω is recognised by some Büchi automaton, where L ω = {x x 2 : where all x i L, i and x i ε }. We start with a regularlanguageloverσ. There is an nfa N = (Q,I,F,T) thatrecognisesl. Itiswellknownthatthenfacanbeconvertedtoanequivalent dfa by subset construction. Let M = (Q,s,F,T) be the equivalent dfa. The following lemma claims that there is an equivalent dfa with a start state having no incoming transition. Lemma 4. If a regular language L is recognised by a dfa M = (Q,s,F,T), then there is an equivalent dfa M = (Q,s,F,T ) such that L = L(M ) and there is no incoming transition to the initial state s of M. Proof: The construction of M is simple. If there is no incoming transition to s, then M = M. If there are incoming transitions to s, we introduce a new state s Q. The incoming transitions to s are removed and are directed towards s. The state s has all the outgoing transitions of s.. Q = Q {s }. 2. T = (T \ {(t,σ,s ) : t Q,σ Σ}) {(t,σ,s ) : if (t,σ,s ) T} {(s,σ,t) : if (s,σ,t) T}. 5

6 3. F = F if s F, else F = F {s }. We can prove by induction on the length of x = σ σ k Σ, that there is a run r = s s s k of M on x if and only if there is a run r = s s s k of M on x, where s i = s i if s i s and s i = s otherwise, for all i =,,k. Example 4. Let L = {x {,} : x has a substring }. Following dfa accepts L, s s2 s3 s4 We wish to remove incoming transition to the initial state s. s, s s2 s3 s4 Given a dfa M = (Q,s,F,T) for the language L Σ where there is no incoming transition to any initial state, the construction of the Büchi automaton for L ω is simple. Lemma 5. If L Σ is recognised by a dfa M = (Q,s,F,T), there there is a Büchi automaton for L ω. Proof: Without any loss of generality we assume that no initial state of M has any incoming transition. We copy all in-coming transitions to the final states of M to the initial state (this makes it non-deterministic). So the machine after consuming a string of L(N) Σ will start afresh from the initial state and this continues ad infinitum. Formally the Büchi automaton B = (Q b,i b,f b,t b ) is. Q b = Q, I b = {s }, F b = I b. 2. T b = T {(t,σ,s ) : if (t,σ,f) T, where f F}. A successful run is as follows: s,q,,q k,s q 2,,q 2k,s, The strings consumed in the portion s,q j,,q jkj,s belongs to L because any x Σ that drives the machine from the initial state s to the state q jkj and then to s again, also drives M form s to a final state of M. Example 5. The Büchi automaton corresponding to L ω of Example..2.4 is s, s s2 s3 s4, 6

7 Lemma 6. If L and L 2 are regular languages over Σ, then L L ω 2 is Büchi recognisable. Proof: We have two dfa s M = (Q,s,F,T ) and M 2 = (Q 2,s 2,F 2,T 2 ) for L and L 2 respectively. We assume that Q Q 2 = and the initial state of Q 2 does not have any in-coming transition. We know how to construct a Büchi automaton corresponding to L ω 2. Let it be B 3 = (Q 2 {s 2 },{s 2},{s 2 },T 3 ), where s 2 Q Q 2, and T 3 is defined as earlier. Now we can construct a Büchi automaton B = (Q,I,F,T) for L L ω 2 as follows:. Q = Q Q 2 {s 2 }, 2. I = {s }, F = {s 2 }, 3. T T 3 {(t,σ,s 2 ) : if (t,σ,f) T and f F }. We add transitions (t,σ,s 2 ) where (t,σ,f) T and f F. An infinite string α Σ ω drives B on a successful run if its initial segment is a string of L, and then there is an infinite repetition of strings of L 2. Theorem 7. (Büchi) An ω-language L Σ ω is Büchi recognisable if and only if L = k i= L iki ω, where L i,k i Σ are regular languages. Proof: We already have done the ground work for the proof of the if ( ) part. We know that L i Ki ω is Büchi recognisable and Büchi recognisablelanguages are closed under union. To prove the only if ( ) part we proceed as follows. Let B = (Q,I,F,T) be a Büchi automaton such that L = L(B). For every p,q Q, we define an nfa M p,q = (S,p,q,T) and L p,q = L(M p,q ) Σ. As Q is finite, there are finite number of such languages. We define the following ω-language using these regular languages. L = L p,q L ω q,q. p I,q F We claim that L = L. Suppose α L, then there is some p I and q F such that α L p,q L ω q,q. So this α drives B starting from one of its start state p to a final state q and then in the run the state q appears infinitely often. So α L i.e. L L. Conversely, suppose α L. So there is a successful run of the machine B on α. The machine starts from a start state p, and in the infinite sequence of states, at least one of the final states q appears infinitely often. So the run may be viewed as p q q q. The initial segment of α that drives B from state p to state q, so the segment belongs L p,q and each portion of α that drives themachinefromstateq toq belongstol q,q. Soα L p,q L ω q,q i.e. L L..2.5 Complement of Büchi Language We know that Σ \ L is a regular language if and only if L Σ is a regular language. The collection of regular languages over Σ is closed under complementation. The question is whether the collection of Büchi recognisable languages are closed under complementation. The answer is positive but the proof is more involved than the case of regular languages. The main reason is that as a model deterministic Büchi automaton is strictly less powerful than its non-deterministic counterpart. Let α Σ ω. We define α(m,n) or α m,n as the string α(m)α(m+) α(n ) Σ, wheremandnaretwopositiveintegersandm < n. Similarly, α(m, ) is the ω-string α(m)α(m+) Σ ω. Let L Σ. We define L Σ ω as follows: L = {α Σ ω : α(,n) L for infinitely many n N}. So any string α L has infinite number of prefixes from L. This may be viewed as some kind of limit operator. 7

8 .2.6 Deterministic Büchi Automata We have the following theorem that characterises the language recognised by a deterministic automaton. Theorem 8. An ω-language L over Σ is recognisable by a deterministic Büchi automaton if and only if there is a regular language L such that L = L. Proof: Let B = (Q,s,F,T) be adeterministic Büchi automatonand L ω (B) be the ω-language accepted by B. We may view B as an dfa accepting L(B) Σ. We shall show that L(B) = L ω (B). Let α = α α 2 L ω (B) and the corresponding successful run be r = s s. In r there are infinitely many occurrences of final states of B. So there are infinite number of prefixes of α belonging to L(B) i.e. α L(B). So L ω (B) L(B). Let α = α α L(B). As the machine is deterministic there is only one run and there are infinite number of prefixes of α belonging to L(B). So some final state is visited infinitely often implies that α L ω (B) i.e. L(B) L ω (B). Determinism is important in the second part of the proof. If the machine is non-deterministic, it is possible to have an α with infinite number of prefixes in the regular language, but no run of the corresponding Büchi automaton on α have infinitely many final states. Next example makes it clear. Example 6. Consider the following non-deterministic automaton N., s s2 An α = () ω has infinitely many prefixes,,,, from the regular language of N. But there is no successful run of N as a Büchi automaton on this α. Theorem 9. There is a Büchi recognisable language that cannot be accepted by a deterministic Büchi automaton. Proof: We fix the alphabet Σ = {,}. Define the ω-language L = {α Σ ω : there are finite number of occurrences of in α}. L = Σ {} ω and is recognised by the non-deterministic Büchi automaton of example (.2.6). We prove by contradiction that L cannot be recognised by a deterministic Büchi automaton. Assume that L is recognised by a deterministic Büchi automaton. So there is a regular language L Σ such that L = L (deterministic Büchi language). It is clear that ω L, so there is some positive integer n, such that n L ( L = L and there are infinite number of such prefixes). But the infinite string n ω L as it has finite number of s. So again there is some positive integer n 2 such that n n2 L. By a similar argument we have n n2 ω L and there is a positive integer n 3 such that n n2 n3 L. Continuing this way we construct an ω-string α = n n2 n3 ni, where each n i, such that α has infinite number of prefixes belonging to L. So α L = L. But that is contradictory as it has infinite number of s. Corollary. Thereis a deterministic Büchi automaton B such that Σ ω \L ω (B) is not recognised by any deterministic Büchi automaton. Proof: We define L = {w : w Σ, Σ} {,}. It is not difficult to construct a dfa that recognises L. An element α ω-language L has infinitely many prefixes of in L i.e. α has infinite number of s in it. The language L = Σ ω \ L = {α Σ ω : only finitely many prefixes of α are in L. So there are finite number of s in α. But we have already proved in theorem (.2.6) that there is no deterministic Büchi automaton for L. 8

9 .2.7 Equivalences Classes on NFA Definition 2: Let B = (Q,I,F,T)be a Büchi automaton and p,q Q. We define L p,q Σ as the collection of all strings that drives the machine from state p to state q. This is the language L(M p,q ), where M p,q = (Q,{p},{q},T). Similarly for A Q, we define L A p,q Σ as the collection of all strings that drives the machine (i) from state p to state q, and (ii) one of the states in the run is in A. L A p,q may be viewed as r A (L p,rl r,q ). So both these languages are regular. We define a binary relation B on Σ in the following way. Let x,y Σ, then x B y if. for all pairs of states p,q Q, the input x drives the machine from p to q (p x q) if and only if y drives the machine from p to q (p y q), and also 2. for all pairs of states p,q Q, the input x drives the machine from p to q through a final state (p F x q) if and only if y drives the machine from p to q through a final state (p F y q). It is not difficult to prove that B is an equivalence relation. i Afterward we shall characterise the equivalence classes of Σ under B. Definition 3: An equivalence relation on Σ is said to be a congruence relation if for all x,y,z Σ, x B y implies that xz B yz. Lemma. Given a Büchi automata B = (Q,I,F,T), the equivalence relation B is a congruence relation. Proof: Suppose x,y,z Σ and x B y i.e. for all p,q Q, (i) p x q if and only if p y q, and (ii) p F x q if and only if p F y q. p xz r if and only if there is some q Q, so that p x q and q z r if and only if p y q and q z r i.e. p yz r. If p F xz r, then there are two possibilities, (i) there is some q Q, so that p F x q and q z r, or (ii) there is some q Q, so that p x q and q F z r. In the first case we have p F y q and q z r i.e. p F yz r. And in the second case we have p y q and q F z r i.e. p F yz r. Lemma 2. Given a Büchi automata, the congruence relation B partitions Σ in finite number of equivalence classes i.e B has finite index. Proof: We define two functions e,e 2 : Σ 2 Q Q in the following way: and e (x) = {(p,q) Q Q : p x q}, e 2 (x) = {(p,q) Q Q : p F x q}. Let A Q Q. The preimage of A, e (A) = L A Σ, if non-empty, is such that for any two x,y L A, and for any p,q Q, p x q if and only if p y q. So the preimages of two subsets of Q Q are disjoint subsets of Σ. Number of subsets of Q Q are finite, so the partitions are also finite. Similarly the preimage of A Q Q under e 2, e 2 (A) = L A Σ, if nonempty, is such that for any two x,y L A, and for any p,q Q, p F x q if and only if p F y q. This also divides Σ in finite number of partitions. Refinement of these two partitions gives the equivalence classes of B. So the number of equivalence classes are finite. It is well known (Mihill-Nerode theorem) that if there is an equivalence relation of finite index over Σ, and the relation is a congruence relation, then the equivalence classes are regular languages. Example 7. Consider the following Büchi automaton B = (Q,I,F,T) over the alphabet Σ = {,}., s2 s s3 9

10 The map e : Σ 2 Q Q is as follows: e ({ε}) = {(,),(2,2),(3,3)}, e ({ n : n }) = {(,),(,2),(2,2)}, e ({ n : n }) = {(,),(,3),(3,3)}, e ({x : x Σ Σ }) = {(,),(,2)}, e ({x : x Σ Σ }) = {(,),(,3)}, So the map e induces an equivalence relation of finite index on Σ. The classes are, E = {ε}, A = { n : n }, B = { n : n }, C = {x : x Σ Σ }, D = {x : x Σ Σ }. Similarly, map e 2 : Σ 2 Q Q is as follows: e 2 ({ε}) = {(2,2),(3,3)}, e 2 ({ n : n }) = {(,2),(2,2)}, e 2 ({ n : n }) = {(,3),(3,3)}, e 2 ({x : x Σ Σ }) = {(,2)}, e 2 ({x : x Σ Σ }) = {(,3)}, This map also induces the same equivalence relation. So both the map together induces the same equivalence relation of finite index and the equivalence classes are A,B,C,D,E. Lemma 3. Given a Büchi automaton B = (Q,I,F,T), the equivalence class [x] B ([x] in short) is the intersection of all languages of the form L p,q, L F p,q, Σ \L p,q, Σ \L F p,q which contain x. Proof: Let T x be the intersection of all the sets of the form L p,q, L F p,q, Σ \L p,q and Σ \L F p,q, containing x. If y [x], then y B x and y belongs to all sets of the above form containing x 6. So y is in the intersection T x. Suppose y T x, the intersection of all the above mentioned sets. If p x q, then x L p,q. By our definition of T x L p,q. So y L p,q, implies that p y q. If p x q, then x Σ \L p,q. Again by definition y T x Σ \L p,q i.e. p y q. Similarly, if p F x q, then p F y q. And if p F x q then p F y q. It is clear that given a Büchi automaton B = (Q,I,F,T), the corresponding nfa induces an equivalence (congruence) relation B on Σ, where each equivalence class is regular..2.8 Complementation Theorem The plan for the construction of a Büchi automaton that recognises the complement of a Büchi recognisable language is as follows: Let B be a Büchi automaton. We have already shown how a congruence relation of finite index over Σ can be constructed using B as an nfa. We also know that these equivalence classes are regular languages. So for any two equivalence classes L and L 2, the language L L ω 2 is Büchi recognisable. We shall prove that if L L ω 2 L ω (B), then L L ω 2 L ω(b). We also prove that each α L ω (B) belongs to some L L ω 2, where L and L 2 are two equivalence classes. So the complement language Σ ω \ L ω (B) is the union of all L L ω 2 such that L L ω 2 L ω(b) =, where L and L 2 are equivalence classes. Example 8. In the example (.2.7), the equivalence classes are E = {ε}, A = { n : n }, B = { n : n }, C = {x : x Σ Σ }, D = {x : x Σ Σ }. The Büchi recognisable language L ω (B) = A ω B ω CA ω DA ω CB ω DB ω. The complement language consists of AC ω, BC ω etc. Definition 4: AcongruencerelationE onσ saturatesanω-languagelifforany pair of equivalence classes L and L 2, whenever L L ω 2 L, then L L ω 2 L. Lemma 4. Let B = (Q,I,F,T) be a Büchi automaton and L = L ω (B). The congruence relation B defined on Σ saturates L. In other words, for any pair 6 Given a p,q Q, x L p,q if and only if y L p,q. Similarly x L F p,q y L F p,q. if and only if

11 of equivalence classes L and L 2, if there an α L L ω 2 that has a successful run on B, then all strings of L L ω 2 have successful runs on B i.e. L L ω 2 L. Proof: LetL andl 2 be equivalenceclassesandα = uv v 2 L L ω 2 L ω(b), where u L and v i L 2, i =,2,. So there is a successful run r = s s s 2 of B on α, where s I and Inf(r) F. Given α and its successful run r, we get the following infinite sequence of states: s q q 2, such that. u drives the machine from the start state s to q, s u q, and 2. every v i drives the machine from q i to q i+, i.e. q i vi q i+, for i =,2,. As r is a successful run, there are infinitely many final states. So there are infinitely many v i s such that v i drives the machine from q i to q i+ through some final state, q i F v i q i+. Take any arbitrary word β = u v v 2 L L ω 2, where u L and v i L 2. Moreover, u B u and v i B v i, as L and L 2 are equivalence classes. So s u q and q i vi q i+ for i =,2,. Also if q i F v i q i+ then so is q i F v q i i+. We conclude that β has a successful run on B. Nowwegoto provethe secondpart, whereweclaim that everyinfinite string α belongs to some L L ω 2, where L and L 2 are equivalence classes. This will enable us to claim that L ω (B) = L L ω 2, where the union is over all pairs of equivalence classes L and L 2 such that L ω (B) L L ω 2. So the complement language Σ ω \L ω (B) = L L ω 2, where the union is over all pairs of equivalence classesl and L 2 such that L ω (B) L L ω 2 =. Hence the complement language is also Büchi recognisable. Let B = (Q,I,F,T) be a Büchi automaton and B be the equivalence relation defined earlier. Let α = α α 2 Σ ω. The symbol at the i th -position of α is α i. Let k,l and m be positions in α so that k,l < m. We say that positions k and l merge at m if α k,m B α l,m i.e. the string α k α m and α l α m belong to the same equivalence class of B. It is also clear that if α k,m B α l,m, then α k,m B α l,m, where m m i.e. if the positions k and l merge at m, then they merge at all positions after this as B is a congruence relation. Definition 5: Given a Büchi automata B = (Q,I,F,T) and an ω-string α we define a binary relation on the positions in the string, or on the set of positive integers N as follows: k α l, if there is a position m > k,l, such that α k,m B α l,m. We may also write k α l(at m) or simply k α l(m). The binary relation is clearly reflexive and symmetric. We prove that it is transitive. Let j,k,l N and j α k(m), where m is the smallest merge position and k α l(n), where n is the smallest merge position. But we know that j α k at any merge position m m and k α l at any merge position n n. Let p = max(m,n), then α j,p B α k,p and α k,p B α l,p. So we have α j,p B α l,p i.e. j α l at p. So the binary relation on N is an equivalence relation. Lemma 5. Given a Büchi automaton B = (Q,I,F,T) and an ω-string α, the equivalence relation α has finite index i.e. it partitions N in finite number of equivalence classes. Proof: The proof is by contradiction. Assume that α creates infinitely many equivalence classes. So there are infinitely many positions k < k 2 < such that for every k i and k j (i j), k i α k j i.e. there is no position m > k i,k j, such that α ki,m B α kj,m. But we know that B is of finite index. Let the number of equivalence classes of Σ under B be n. Consider positions k < k 2 < < k n+. For all position m > k,,k n+, by our assumption none of α k,m,,α kn+,m are equivalent. But that is impossible as there are only n equivalence classes of Σ under B. The is a contradiction and hence the index of α is finite. Now we know that given a Büchi automaton B and an ω-word α, the equivalence relation α partitions N (positions in α) in finite number of equivalence classes. So there must be an equivalence class with infinite number of positions

12 (positive integers) in it. Let points (positions) in such an equivalence class be k < k < where we may assume that < k. Each k i,k j in this sequence of positions are α equivalent with respect to some position m > k i,k j. We consider the following sequence of finite words: α k,k,α k,k 2,. Again due to finite number of equivalence classes of Σ under B, there will be an infinite subsequence of α k,k,α k,k 2,, whose strings are B equivalent. We pick-up those k j s (positions where α k,k j s are B equivalent and belong to an equivalence class of infinite size). So we have an infinite sequence of positions, k = l,l,l 2, such that l i α l j for all i,j and α l,l i B α l,l j. We claim now that there is an infinite sequence of positions p,p,p 2, such that for all i < j, p i merges with p j at p j+. The sequence is constructed as follows:. Basis: p = l,p = l. 2. Inductive step: If we have already identified the positions p,p,,p n, where p i α p j at position p j+, j =,,n. There is a position m such that p i α p j (m), for all i,j, i,j n. We choose the smallest such m, and take l k as p n+ such that m l k. So we have the infinite sequence of positions, p,p,p 2,, satisfying the following conditions:. < p, 2. α p,p i B α p,p j for all i,j. 3. For all positions p i and p j, i < j, p i α p j, merges at p j+. We define two subsets of Σ as follows: L = {x Σ : x B α,p }, L 2 = {x Σ : x B α p,p }. Clearly L and L 2 are two equivalence classes under B. Lemma 6. The ω-string α L L ω 2. Proof: We consider the position sequence p < p < generated earlier. We know that α pi,p i+ B α p,p i+ (condition (3)). We also have α p,p B α p,p i b α p,p i+ (condition (2)). So, α p,p B α pi,p i+ i.e. the string α pi,p i+ L 2. Hence the infinite string α can be written as α = α,p α p,p α p,p 2, where α,p L and α pi,p i+ L 2 i.e. α L L ω 2. Theorem 7. Let B be a Büchi automaton over Σ. The language Σ ω \L ω (B) is Büchi recognisable. Proof: We have already proved that L L ω 2 L ω (B), where L and L 2 are equivalence classes generated by B, and L L ω 2 L ω(b). Again from the previous lemma we know that if α L ω (B), then α L L ω 2 for some equivalence classes. So we conclude that L L ω 2 = L ω (B), where the union is over all pairs of equivalence classes L and L 2 such that L L ω 2 L ω(b). In the previous theorem we proved that any ω-string is a member of some L L ω 2. So, the complement language, Σω \L ω (B) = L L ω 2, where L and L 2 are equivalence classes generated by B, and the union is over all pairs of such L and L 2 such that L L ω 2 L ω(b) =. So the conclusion is that the collection of Büchi recognisable languages are closed under complementation. References [BKAN] Automata Theory and its Applications, by Bakhadyr Khoussainov and Anil Nerode, Birkhäuser, Springer Int. Ed., 2, ISBN

13 [DPJEP] Infinite Words Automat, Semigroups, Logic and Games, by Dominique Perrin and Jean-Éric Pin, Elsevier, Academic Press, 24, ISBN

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar Büchi Automata and their closure properties - Ajith S and Ankit Kumar Motivation Conventional programs accept input, compute, output result, then terminate Reactive program : not expected to terminate

More information

Definition of Büchi Automata

Definition of Büchi Automata Büchi Automata Definition of Büchi Automata Let Σ = {a,b,...} be a finite alphabet. By Σ ω we denote the set of all infinite words over Σ. A non-deterministic Büchi automaton (NBA) over Σ is a tuple A

More information

What we have done so far

What we have done so far What we have done so far DFAs and regular languages NFAs and their equivalence to DFAs Regular expressions. Regular expressions capture exactly regular languages: Construct a NFA from a regular expression.

More information

Computational Models - Lecture 3

Computational Models - Lecture 3 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Computational Models - Lecture 3 Equivalence of regular expressions and regular languages (lukewarm leftover

More information

CS243, Logic and Computation Nondeterministic finite automata

CS243, Logic and Computation Nondeterministic finite automata CS243, Prof. Alvarez NONDETERMINISTIC FINITE AUTOMATA (NFA) Prof. Sergio A. Alvarez http://www.cs.bc.edu/ alvarez/ Maloney Hall, room 569 alvarez@cs.bc.edu Computer Science Department voice: (67) 552-4333

More information

Computational Models - Lecture 3 1

Computational Models - Lecture 3 1 Computational Models - Lecture 3 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. March 13/18, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

3515ICT: Theory of Computation. Regular languages

3515ICT: Theory of Computation. Regular languages 3515ICT: Theory of Computation Regular languages Notation and concepts concerning alphabets, strings and languages, and identification of languages with problems (H, 1.5). Regular expressions (H, 3.1,

More information

Computational Models: Class 3

Computational Models: Class 3 Computational Models: Class 3 Benny Chor School of Computer Science Tel Aviv University November 2, 2015 Based on slides by Maurice Herlihy, Brown University, and modifications by Iftach Haitner and Yishay

More information

CS 154, Lecture 3: DFA NFA, Regular Expressions

CS 154, Lecture 3: DFA NFA, Regular Expressions CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and

More information

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.

More information

We define the multi-step transition function T : S Σ S as follows. 1. For any s S, T (s,λ) = s. 2. For any s S, x Σ and a Σ,

We define the multi-step transition function T : S Σ S as follows. 1. For any s S, T (s,λ) = s. 2. For any s S, x Σ and a Σ, Distinguishability Recall A deterministic finite automaton is a five-tuple M = (S,Σ,T,s 0,F) where S is a finite set of states, Σ is an alphabet the input alphabet, T : S Σ S is the transition function,

More information

Uses of finite automata

Uses of finite automata Chapter 2 :Finite Automata 2.1 Finite Automata Automata are computational devices to solve language recognition problems. Language recognition problem is to determine whether a word belongs to a language.

More information

Fooling Sets and. Lecture 5

Fooling Sets and. Lecture 5 Fooling Sets and Introduction to Nondeterministic Finite Automata Lecture 5 Proving that a language is not regular Given a language, we saw how to prove it is regular (union, intersection, concatenation,

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.4 Explain the limits of the class of regular languages Justify why the

More information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

More information

Proving languages to be nonregular

Proving languages to be nonregular Proving languages to be nonregular We already know that there exist languages A Σ that are nonregular, for any choice of an alphabet Σ. This is because there are uncountably many languages in total and

More information

Computational Theory

Computational Theory Computational Theory Finite Automata and Regular Languages Curtis Larsen Dixie State University Computing and Design Fall 2018 Adapted from notes by Russ Ross Adapted from notes by Harry Lewis Curtis Larsen

More information

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 Prepared by, Dr. Subhendu Kumar Rath, BPUT, Odisha. UNIT 2 Structure NON-DETERMINISTIC FINITE AUTOMATA

More information

Sri vidya college of engineering and technology

Sri vidya college of engineering and technology Unit I FINITE AUTOMATA 1. Define hypothesis. The formal proof can be using deductive proof and inductive proof. The deductive proof consists of sequence of statements given with logical reasoning in order

More information

Warshall s algorithm

Warshall s algorithm Regular Expressions [1] Warshall s algorithm See Floyd-Warshall algorithm on Wikipedia The Floyd-Warshall algorithm is a graph analysis algorithm for finding shortest paths in a weigthed, directed graph

More information

1 More finite deterministic automata

1 More finite deterministic automata CS 125 Section #6 Finite automata October 18, 2016 1 More finite deterministic automata Exercise. Consider the following game with two players: Repeatedly flip a coin. On heads, player 1 gets a point.

More information

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2 5-25 Great Theoretical Ideas in Computer Science Lecture 4: Deterministic Finite Automaton (DFA), Part 2 January 26th, 27 Formal definition: DFA A deterministic finite automaton (DFA) M =(Q,,,q,F) M is

More information

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r Syllabus R9 Regulation UNIT-II NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: In the automata theory, a nondeterministic finite automaton (NFA) or nondeterministic finite state machine is a finite

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Sipser Ch 1.4 Explain the limits of the class of regular languages Justify why the Pumping

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

More information

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages CS 154 Finite Automata vs Regular Expressions, Non-Regular Languages Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and guessing

More information

NOTES ON AUTOMATA. Date: April 29,

NOTES ON AUTOMATA. Date: April 29, NOTES ON AUTOMATA 1. Monoids acting on sets We say that a monoid S with identity element ɛ acts on a set Q if q(st) = (qs)t and qɛ = q. As with groups, if we set s = t whenever qs = qt for all q Q, then

More information

Finite Automata and Regular languages

Finite Automata and Regular languages Finite Automata and Regular languages Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/

More information

ACS2: Decidability Decidability

ACS2: Decidability Decidability Decidability Bernhard Nebel and Christian Becker-Asano 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem

More information

Computer Sciences Department

Computer Sciences Department 1 Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER 3 objectives Finite automaton Infinite automaton Formal definition State diagram Regular and Non-regular

More information

Regular Languages. Problem Characterize those Languages recognized by Finite Automata.

Regular Languages. Problem Characterize those Languages recognized by Finite Automata. Regular Expressions Regular Languages Fundamental Question -- Cardinality Alphabet = Σ is finite Strings = Σ is countable Languages = P(Σ ) is uncountable # Finite Automata is countable -- Q Σ +1 transition

More information

Computational Models - Lecture 3 1

Computational Models - Lecture 3 1 Computational Models - Lecture 3 1 Handout Mode Iftach Haitner. Tel Aviv University. November 14, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.

More information

Advanced Automata Theory 7 Automatic Functions

Advanced Automata Theory 7 Automatic Functions Advanced Automata Theory 7 Automatic Functions Frank Stephan Department of Computer Science Department of Mathematics National University of Singapore fstephan@comp.nus.edu.sg Advanced Automata Theory

More information

Equivalence of Regular Expressions and FSMs

Equivalence of Regular Expressions and FSMs Equivalence of Regular Expressions and FSMs Greg Plaxton Theory in Programming Practice, Spring 2005 Department of Computer Science University of Texas at Austin Regular Language Recall that a language

More information

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) Definition 1 (Alphabet) A alphabet is a finite set of objects called symbols. Definition 2 (String)

More information

More on Finite Automata and Regular Languages. (NTU EE) Regular Languages Fall / 41

More on Finite Automata and Regular Languages. (NTU EE) Regular Languages Fall / 41 More on Finite Automata and Regular Languages (NTU EE) Regular Languages Fall 2016 1 / 41 Pumping Lemma is not a Sufficient Condition Example 1 We know L = {b m c m m > 0} is not regular. Let us consider

More information

CS 455/555: Finite automata

CS 455/555: Finite automata CS 455/555: Finite automata Stefan D. Bruda Winter 2019 AUTOMATA (FINITE OR NOT) Generally any automaton Has a finite-state control Scans the input one symbol at a time Takes an action based on the currently

More information

Languages, regular languages, finite automata

Languages, regular languages, finite automata Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,

More information

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 CMPSCI 250: Introduction to Computation Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 λ-nfa s to NFA s to DFA s Reviewing the Three Models and Kleene s Theorem The Subset

More information

Computational Models - Lecture 4

Computational Models - Lecture 4 Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push

More information

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CS 154. Finite Automata, Nondeterminism, Regular Expressions CS 54 Finite Automata, Nondeterminism, Regular Expressions Read string left to right The DFA accepts a string if the process ends in a double circle A DFA is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set

More information

Logic and Automata I. Wolfgang Thomas. EATCS School, Telc, July 2014

Logic and Automata I. Wolfgang Thomas. EATCS School, Telc, July 2014 Logic and Automata I EATCS School, Telc, July 2014 The Plan We present automata theory as a tool to make logic effective. Four parts: 1. Some history 2. Automata on infinite words First step: MSO-logic

More information

X-MA2C01-1: Partial Worked Solutions

X-MA2C01-1: Partial Worked Solutions X-MAC01-1: Partial Worked Solutions David R. Wilkins May 013 1. (a) Let A, B and C be sets. Prove that (A \ (B C)) (B \ C) = (A B) \ C. [Venn Diagrams, by themselves without an accompanying logical argument,

More information

(Refer Slide Time: 0:21)

(Refer Slide Time: 0:21) Theory of Computation Prof. Somenath Biswas Department of Computer Science and Engineering Indian Institute of Technology Kanpur Lecture 7 A generalisation of pumping lemma, Non-deterministic finite automata

More information

Unit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1

Unit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1 Unit 6 Non Regular Languages The Pumping Lemma Reading: Sipser, chapter 1 1 Are all languages regular? No! Most of the languages are not regular! Why? A finite automaton has limited memory. How can we

More information

On Recognizable Languages of Infinite Pictures

On Recognizable Languages of Infinite Pictures On Recognizable Languages of Infinite Pictures Equipe de Logique Mathématique CNRS and Université Paris 7 JAF 28, Fontainebleau, Juin 2009 Pictures Pictures are two-dimensional words. Let Σ be a finite

More information

CS 455/555: Mathematical preliminaries

CS 455/555: Mathematical preliminaries CS 455/555: Mathematical preliminaries Stefan D. Bruda Winter 2019 SETS AND RELATIONS Sets: Operations: intersection, union, difference, Cartesian product Big, powerset (2 A ) Partition (π 2 A, π, i j

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6 CHAPTER 2 FINITE AUTOMATA 2. Nondeterministic Finite Automata NFA 3. Finite Automata and Regular Expressions 4. Languages

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

More information

Formal Language and Automata Theory (CS21004)

Formal Language and Automata Theory (CS21004) Theory (CS21004) Announcements The slide is just a short summary Follow the discussion and the boardwork Solve problems (apart from those we dish out in class) Table of Contents 1 2 3 Languages that are

More information

Lecture 4: More on Regexps, Non-Regular Languages

Lecture 4: More on Regexps, Non-Regular Languages 6.045 Lecture 4: More on Regexps, Non-Regular Languages 6.045 Announcements: - Pset 1 is on piazza (as of last night) - If you don t have piazza access but are registered for 6.045, send email to TAs with

More information

Chapter 1. Sets and Mappings

Chapter 1. Sets and Mappings Chapter 1. Sets and Mappings 1. Sets A set is considered to be a collection of objects (elements). If A is a set and x is an element of the set A, we say x is a member of A or x belongs to A, and we write

More information

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations D. R. Wilkins Academic Year 1996-7 1 Number Systems and Matrix Algebra Integers The whole numbers 0, ±1, ±2, ±3, ±4,...

More information

Properties of Regular Languages. BBM Automata Theory and Formal Languages 1

Properties of Regular Languages. BBM Automata Theory and Formal Languages 1 Properties of Regular Languages BBM 401 - Automata Theory and Formal Languages 1 Properties of Regular Languages Pumping Lemma: Every regular language satisfies the pumping lemma. A non-regular language

More information

Regular Expressions. Definitions Equivalence to Finite Automata

Regular Expressions. Definitions Equivalence to Finite Automata Regular Expressions Definitions Equivalence to Finite Automata 1 RE s: Introduction Regular expressions are an algebraic way to describe languages. They describe exactly the regular languages. If E is

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION IDENTIFYING NONREGULAR LANGUAGES PUMPING LEMMA Carnegie Mellon University in Qatar (CARNEGIE MELLON UNIVERSITY IN QATAR) SLIDES FOR 15-453 LECTURE 5 SPRING 2011

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are

More information

DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17. Beregnelighed. Jacob Aae Mikkelsen DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................

More information

Finite State Automata

Finite State Automata Trento 2005 p. 1/4 Finite State Automata Automata: Theory and Practice Paritosh K. Pandya (TIFR, Mumbai, India) Unversity of Trento 10-24 May 2005 Trento 2005 p. 2/4 Finite Word Langauges Alphabet Σ is

More information

Incorrect reasoning about RL. Equivalence of NFA, DFA. Epsilon Closure. Proving equivalence. One direction is easy:

Incorrect reasoning about RL. Equivalence of NFA, DFA. Epsilon Closure. Proving equivalence. One direction is easy: Incorrect reasoning about RL Since L 1 = {w w=a n, n N}, L 2 = {w w = b n, n N} are regular, therefore L 1 L 2 = {w w=a n b n, n N} is regular If L 1 is a regular language, then L 2 = {w R w L 1 } is regular,

More information

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is Abstraction of Problems Data: abstracted as a word in a given alphabet. Σ: alphabet, a finite, non-empty set of symbols. Σ : all the words of finite length built up using Σ: Conditions: abstracted as a

More information

UNIT-III REGULAR LANGUAGES

UNIT-III REGULAR LANGUAGES Syllabus R9 Regulation REGULAR EXPRESSIONS UNIT-III REGULAR LANGUAGES Regular expressions are useful for representing certain sets of strings in an algebraic fashion. In arithmetic we can use the operations

More information

Finite Automata and Regular Languages

Finite Automata and Regular Languages Finite Automata and Regular Languages Topics to be covered in Chapters 1-4 include: deterministic vs. nondeterministic FA, regular expressions, one-way vs. two-way FA, minimization, pumping lemma for regular

More information

CSci 311, Models of Computation Chapter 4 Properties of Regular Languages

CSci 311, Models of Computation Chapter 4 Properties of Regular Languages CSci 311, Models of Computation Chapter 4 Properties of Regular Languages H. Conrad Cunningham 29 December 2015 Contents Introduction................................. 1 4.1 Closure Properties of Regular

More information

On Recognizable Languages of Infinite Pictures

On Recognizable Languages of Infinite Pictures On Recognizable Languages of Infinite Pictures Equipe de Logique Mathématique CNRS and Université Paris 7 LIF, Marseille, Avril 2009 Pictures Pictures are two-dimensional words. Let Σ be a finite alphabet

More information

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10 Decidability Andreas Karwath und Malte Helmert 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem : decide

More information

THEORY OF COMPUTATION

THEORY OF COMPUTATION THEORY OF COMPUTATION There are four sorts of men: He who knows not and knows not he knows not: he is a fool - shun him; He who knows not and knows he knows not: he is simple teach him; He who knows and

More information

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed HKN CS/ECE 374 Midterm 1 Review Nathan Bleier and Mahir Morshed For the most part, all about strings! String induction (to some extent) Regular languages Regular expressions (regexps) Deterministic finite

More information

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam ECS 120: Theory of Computation Handout MT UC Davis Phillip Rogaway February 16, 2012 Midterm Exam Instructions: The exam has six pages, including this cover page, printed out two-sided (no more wasted

More information

BASIC MATHEMATICAL TECHNIQUES

BASIC MATHEMATICAL TECHNIQUES CHAPTER 1 ASIC MATHEMATICAL TECHNIQUES 1.1 Introduction To understand automata theory, one must have a strong foundation about discrete mathematics. Discrete mathematics is a branch of mathematics dealing

More information

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Before we show how languages can be proven not regular, first, how would we show a language is regular? CS35 Proving Languages not to be Regular Before we show how languages can be proven not regular, first, how would we show a language is regular? Although regular languages and automata are quite powerful

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 1.4 Give an example of a non-regular language Outline two strategies for proving

More information

Inf2A: Converting from NFAs to DFAs and Closure Properties

Inf2A: Converting from NFAs to DFAs and Closure Properties 1/43 Inf2A: Converting from NFAs to DFAs and Stuart Anderson School of Informatics University of Edinburgh October 13, 2009 Starter Questions 2/43 1 Can you devise a way of testing for any FSM M whether

More information

Introduction to the Theory of Computing

Introduction to the Theory of Computing Introduction to the Theory of Computing Lecture notes for CS 360 John Watrous School of Computer Science and Institute for Quantum Computing University of Waterloo June 27, 2017 This work is licensed under

More information

Büchi Automata and Their Determinization

Büchi Automata and Their Determinization Büchi Automata and Their Determinization Edinburgh, October 215 Plan of the Day 1. Büchi automata and their determinization 2. Infinite games 3. Rabin s Tree Theorem 4. Decidability of monadic theories

More information

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010 University of Virginia - cs3102: Theory of Computation Spring 2010 PS2 - Comments Average: 77.4 (full credit for each question is 100 points) Distribution (of 54 submissions): 90, 12; 80 89, 11; 70-79,

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Mahesh Viswanathan Introducing Nondeterminism Consider the machine shown in Figure. Like a DFA it has finitely many states and transitions labeled by symbols from an input

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described

More information

2. Elements of the Theory of Computation, Lewis and Papadimitrou,

2. Elements of the Theory of Computation, Lewis and Papadimitrou, Introduction Finite Automata DFA, regular languages Nondeterminism, NFA, subset construction Regular Epressions Synta, Semantics Relationship to regular languages Properties of regular languages Pumping

More information

Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

More information

Lecture 2: Connecting the Three Models

Lecture 2: Connecting the Three Models IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 2: Connecting the Three Models David Mix Barrington and Alexis Maciel July 18, 2000

More information

CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont )

CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont ) CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont ) Sungjin Im University of California, Merced 2-3-214 Example II A ɛ B ɛ D F C E Example II A ɛ B ɛ D F C E NFA accepting

More information

Uncountable Automatic Classes and Learning

Uncountable Automatic Classes and Learning Uncountable Automatic Classes and Learning Sanjay Jain a,1, Qinglong Luo a, Pavel Semukhin b,2, Frank Stephan c,3 a Department of Computer Science, National University of Singapore, Singapore 117417, Republic

More information

Chapter 2: Finite Automata

Chapter 2: Finite Automata Chapter 2: Finite Automata 2.1 States, State Diagrams, and Transitions Finite automaton is the simplest acceptor or recognizer for language specification. It is also the simplest model of a computer. A

More information

Equivalence of DFAs and NFAs

Equivalence of DFAs and NFAs CS 172: Computability and Complexity Equivalence of DFAs and NFAs It s a tie! DFA NFA Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: L.von Ahn, L. Blum, M. Blum What we ll do today Prove that DFAs

More information

Further discussion of Turing machines

Further discussion of Turing machines Further discussion of Turing machines In this lecture we will discuss various aspects of decidable and Turing-recognizable languages that were not mentioned in previous lectures. In particular, we will

More information

Lecture 2: Regular Expression

Lecture 2: Regular Expression Lecture 2: Regular Expression Instructor: Ketan Mulmuley Scriber: Yuan Li January 8, 2015 In the last lecture, we proved that DFA, NFA, and NFA with ϵ-moves are equivalent. Recall that a language L Σ is

More information

Advanced Automata Theory 2 Finite Automata

Advanced Automata Theory 2 Finite Automata Advanced Automata Theory 2 Finite Automata Frank Stephan Department of Computer Science Department of Mathematics National University of Singapore fstephan@comp.nus.edu.sg Advanced Automata Theory 2 Finite

More information

Theory of Computation (II) Yijia Chen Fudan University

Theory of Computation (II) Yijia Chen Fudan University Theory of Computation (II) Yijia Chen Fudan University Review A language L is a subset of strings over an alphabet Σ. Our goal is to identify those languages that can be recognized by one of the simplest

More information

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS 1. [6 POINTS] For language L 1 = {0 n 1 m n, m 1, m n}, which string is in L 1? ANSWER: 0001111 is in L 1 (with n =

More information

Lecture 3: Nondeterministic Finite Automata

Lecture 3: Nondeterministic Finite Automata Lecture 3: Nondeterministic Finite Automata September 5, 206 CS 00 Theory of Computation As a recap of last lecture, recall that a deterministic finite automaton (DFA) consists of (Q, Σ, δ, q 0, F ) where

More information

Chapter 6. Properties of Regular Languages

Chapter 6. Properties of Regular Languages Chapter 6 Properties of Regular Languages Regular Sets and Languages Claim(1). The family of languages accepted by FSAs consists of precisely the regular sets over a given alphabet. Every regular set is

More information

Notes on Pumping Lemma

Notes on Pumping Lemma Notes on Pumping Lemma Finite Automata Theory and Formal Languages TMV027/DIT321 Ana Bove, March 5th 2018 In the course we see two different versions of the Pumping lemmas, one for regular languages and

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata COMP2600 Formal Methods for Software Engineering Katya Lebedeva Australian National University Semester 2, 206 Slides by Katya Lebedeva. COMP 2600 Nondeterministic Finite

More information

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) Algorithms & Models of Computation CS/ECE 374, Fall 27 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, September 5, 27 Sariel Har-Peled (UIUC) CS374 Fall 27 / 36 Part I DFA Introduction Sariel

More information

Chapter 5. Finite Automata

Chapter 5. Finite Automata Chapter 5 Finite Automata 5.1 Finite State Automata Capable of recognizing numerous symbol patterns, the class of regular languages Suitable for pattern-recognition type applications, such as the lexical

More information