FORMAL LANGUAGES AND AUTOMATA THEORY

Slides:



Advertisements
Similar presentations
CS2303-THEORY OF COMPUTATION Closure Properties of Regular Languages
Advertisements

Properties of Regular Sets
Lecture 9,10 Theory of AUTOMATA
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1 Regular Languages Finite Automata eg. Supermarket automatic door: exit or entrance.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
THEORY OF COMPUTATION 08 KLEENE’S THEOREM.
Theory of Languages and Automata
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NFA to DFA.
Chapter 4 Pumping Lemma Properties of Regular Languages Decidable questions on Regular Languages.
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
CS355 - Theory of Computation Regular Expressions.
CS 203: Introduction to Formal Languages and Automata
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
An Introduction to Rabin Automata Presented By: Tamar Aizikowitz Spring 2007 Automata Seminar.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Regular Languages ภาษาปกติ. Jaruloj Chongstitvatana Outline Regular expressions Regular languages Equivalence between languages accepted by.
Algorithms for hard problems Automata and tree automata Juris Viksna, 2015.
BİL711 Natural Language Processing1 Regular Expressions & FSAs Any regular expression can be realized as a finite state automaton (FSA) There are two kinds.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
Dept. of Computer Science & IT, FUUAST Automata Theory 2 Automata Theory III Properties of Regular Languages 1.Closure 2.Union 3.Concatenation 4.Complement(Negation)
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Theory of Languages and Automata By: Mojtaba Khezrian.
CIS Automata and Formal Languages – Pei Wang
Foundations of Computing Science
Languages.
CIS Automata and Formal Languages – Pei Wang
Properties of Regular Languages
PROPERTIES OF REGULAR LANGUAGES
FORMAL LANGUAGES AND AUTOMATA THEORY
FORMAL LANGUAGES AND AUTOMATA THEORY
Formal Language & Automata Theory
CSE 3813 Introduction to Formal Languages and Automata
FORMAL LANGUAGES AND AUTOMATA THEORY
Lecture 9 Theory of AUTOMATA
Jaya Krishna, M.Tech, Assistant Professor
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
Closure Properties for Regular Languages
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
4. Properties of Regular Languages
Deterministic PDAs - DPDAs
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
CSCI 2670 Introduction to Theory of Computing
Chapter 4 Properties of Regular Languages
CS21 Decidability and Tractability
Chapter 1 Regular Language - 02
Regular Languages ภาษาปกติ.
Convert to a DFA: Start state: Final States: State Symbol Read- Q E(Q)
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
CSE 105 theory of computation
Chapter 1 Regular Language
CSC 4170 Theory of Computation Finite Automata Section 1.1.
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
CHAPTER 1 Regular Languages
NFAs accept the Regular Languages
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
Presentation transcript:

FORMAL LANGUAGES AND AUTOMATA THEORY C K Nagpal M.Tech. Ph.D. Associate Professor Computer Engg. YMCA University of Science & Technology nagpalckumar@rediffmail.com

Chapter 4 Regular Grammar and Regular Sets In these slides, we will cover the following topics: • Definition of regular expression and regular sets • Basic identities related to regular expressions • Kleene’s theorem • Finding a finite automaton corresponding to a regular expression and vice versa Conditions for Application of Arden’s Theorem Algorithm to Find Regular Expression Corresponding to a Finite Automaton Closure Properties of Regular Sets Finite Automata for Union, Intersection, and Difference • Using pumping lemma to prove that a language is not regular • Production system associated with regular languages Myhill Nerode Theorem Decision Problems Related to Finite Automata and Regular Languages Regular Languages and Current Programming Scenario

Regular Expression All alphabets ϵ If R then R* If R1 and R2 then R1+R2 If R1 and R2 then R1R2 If R then (R) Combination of all the above Φ if L= { }

Regular Expressions and Regular Sets

Identities Related to Regular Expressions

Kleene’s Theorem Every regular language is accepted by some finite automaton. The language accepted by a finite automaton is regular.

Finite Automaton Corresponding to Regular Expression

Finite Automaton Corresponding to Regular Expression ( Contd.)

Regular Expression Corresponding to Finite Automaton

Conditions for Application of Arden’s Theorem The FA should not contain ϵ moves There should be exactly one initial state There is an assumption while using the Arden’s theorem a state in Finite automaton is used like a regular expression

Algorithm to Find Regular Expression Corresponding to a Finite Automaton 1. Simplify M by eliminating unreachable states and dead-states. Because these are the states from where, it is not possible to reach to final state. 2. If all states are eliminated then the regular expression is Ф. 3. For each final-state qi in M, let Mi be the DFA which is same as M except that qi is the only final-state. Simplify Mi by eliminating unreachable states, if any, and then reduce Mi to a transition diagram. Let Ri be the corresponding regular expression. 4. The final regular expression for M is R1+R2+------+Rn where n = number of final-states in M

Closure Properties of Regular Sets Union Concatenation Transpose Intersection Complement Difference Kleene’s Star

Finite Automata for Union, Intersection, and Difference Let M1 be defined as M1(Q1, ∑, q1, δ1, F1) and M2 be defined as M2(Q2, ∑, q2, δ2, F2) where all the entities have the usual meaning. The finite automaton M (Q, ∑, q0, δ, F) for union, intersection and difference can be obtained as follow: Q=Q1 X Q2 q0 = (q1, q2) δ((p, q), a)= (δ1(p, a), δ2(q, a)) For union, F= (p, q) if p F1 or q F2. For intersection, F= (p, q) if p F1 and q F2. For difference, F= (p, q) if p F1 and q F2.

Pumping Lemma for Regular Languages Let L be a regular language. Then there exists a constant n (whose value depends upon L) such that for every string w belonging to the language L and |w| ≥ n, w can be broken into three parts xyz such that y≠ϵ and |xy| ≤ n. Then for all i ≥ 0 the string xyiz also belongs to L. Application of Pumping Lemma L={0s| s is a perfect square} is not regular. L={0p| p is prime} is not regular L={w| w is palindrome} is not regular Suitability Pumping lemma is not necessary and sufficient condition to prove that a language L is not regular. It is not possible in all cases to apply pumping lemma to conclusively prove that a language is not regular. It is a one way mechanism. It can be used to prove that a language is not regular but vice versa is not possible.

Production System Associated with Regular Grammar A→a A→aB

Myhill Nerode Theorem If number of equivalent classes over a language L is finite then the language L is regular Examples A language L over {0,1} such that every string ends with 0 can be divided into two equivalent classes. A language L over {0,1} such that every string ends with 00 can be divided into four two equivalent classes. A positive mechanism to prove that a language is regular.

Decision Problems Related to Finite Automata and Regular Languages 1. Given an arbitrary string x and a regular expression R, does x belong to the language L(R). Given a finite automaton M, is L(M)=Ф? Given a finite automaton M, is L(M) infinite. 4. Given two automata M1 and M2, if L1(M1)=L2(M2). 5. Given two automata M1 and M2, if L1(M1) is subset of L2(M2). 6. Given two automata M1 and M2, if L2(M1) ∩ L2(M2)=Ф. 7. Given two regular expressions R1 and R2, do they generate same language.

Regular Languages and Current Programming Scenario