CSC312 Automata Theory Lecture # 4 Languages-III.

Slides:



Advertisements
Similar presentations
Theory Of Automata By Dr. MM Alam
Advertisements

L ECTURE 3 T HEORY OF AUTOMATA. E QUIVALENT R EGULAR E XPRESSIONS Definition Two regular expressions are said to be equivalent if they generate the same.
Theory Of Automata By Dr. MM Alam
1 Lecture 22 Myhill-Nerode Theorem –distinguishability –equivalence classes of strings –designing FSA’s –proving a language L is not regular.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
1 Module 24 Myhill-Nerode Theorem –distinguishability –equivalence classes of strings –designing FSA’s –proving a language L is not regular.
Theory Of Automata By Dr. MM Alam
Lecture # 1 (Automata Theory)
1 Welcome to ! Theory Of Automata. 2 Text and Reference Material 1.Introduction to Computer Theory, by Daniel I. Cohen, John Wiley and Sons, Inc., 1991,
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 7 1.
CSC312 Automata Theory Lecture # 2 Languages.
L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS  Pre-Requisites  No Pre-Requisite  Text book  Introduction to Computer Theory by Daniel I.A. Cohen 
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
1 Language Definitions Lecture # 2. Defining Languages The languages can be defined in different ways, such as Descriptive definition, Recursive definition,
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
Lecture # 3 Regular Expressions 1. Introduction In computing, a regular expression provides a concise and flexible means to "match" (specify and recognize)
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
Lecture-2 Recap Lecture-1
L ECTURE 3 Chapter 4 Regular Expressions. I MPORTANT T ERMS Regular Expressions Regular Languages Finite Representations.
Regular Grammars Chapter 7 1. Regular Grammars A regular grammar G is a quadruple (V, , R, S), where: ● V is the rule alphabet, which contains nonterminals.
Recursive Definitions & Regular Expressions (RE)
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
Lecture 02: Theory of Automata:08 Theory of Automata.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010.
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
CSC312 Automata Theory Lecture # 3 Languages-II. Formal Language A formal language is a set of words—that is, strings of symbols drawn from a common alphabet.
Recursive Definations Regular Expressions Ch # 4 by Cohen
Theory of Computing CSCI 356/541 Lab Session. Outline Lab 1: Finite Automata  Construct and Run Construct and Run  Manipulating Transitions Manipulating.
Lecture # Book Introduction to Theory of Computation by Anil Maheshwari Michiel Smid, 2014 “Introduction to computer theory” by Daniel I.A. Cohen.
Lecture # 4.
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
CSC312 Automata Theory Lecture # 8 Chapter # 5 (Cont…) Finite Automata.
1 Some Properties of Regular Languages. 2 Properties Concatenation:Star: Union: Are regular Languages For regular languages and.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Lecture # 8 (Transition Graphs). Example Consider the language L of strings, defined over Σ={a, b}, having (containing) triple a or triple b. Consider.
Lecture 01: Theory of Automata:2013 Asif Nawaz Theory of Automata.
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
Theory of Computation Automata Theory Dr. Ayman Srour.
Recap lecture 5 Different notations of transition diagrams, languages of strings of even length, Odd length, starting with b, ending in a (with different.
Pumping Lemma.
Theory of Computation Lecture #
Lecture # 2.
PROGRAMMING LANGUAGES
Regular Languages, Regular Operations, Closure
Generalized Transition Graphs
L1= { w  {a,b}* : w consists of all strings that begin with an even number of a's followed by an odd number of b's. } L2= { w  {a,b}* : the number of.
Theory of Automata.
Regular Expressions (Examples)
LANGUAGES Prepared by: Paridah Samsuri Dept. of Software Engineering
Lecture 9 Theory of AUTOMATA
[Week#03,04] (b) - Finite Automata
COSC 3340: Introduction to Theory of Computation
Recap lecture 29 Example of prefixes of a language, Theorem: pref(Q in R) is regular, proof, example, Decidablity, deciding whether two languages are equivalent.
NFAs and Transition Graphs
Pumping Lemma.
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
Recap lecture 11 Proof of Kleene’s theorem part II (method with different steps), particular examples of TGs to determine corresponding REs.
RECAP Lecture 7 FA of EVEN EVEN, FA corresponding to finite languages(using both methods), Transition graphs.
Recap lecture 23 Mealy machines in terms of sequential circuit.
CSCI 2670 Introduction to Theory of Computing
CSC312 Automata Theory Lecture # 5 Chapter # 4 Cont…
Chapter # 5 by Cohen (Cont…)
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
CSC312 Automata Theory Lecture # 3 Languages-II.
Recap Lecture 4 Regular expression of EVEN-EVEN language, Difference between a* + b* and (a+b)*, Equivalent regular expressions; sum, product and closure.
Welcome to ! Theory Of Automata Irum Feroz
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
LECTURE # 07.
Mealy and Moore Machines
CSC312 Automata Theory Lecture # 24 Chapter # 11 by Cohen Decidability.
Presentation transcript:

CSC312 Automata Theory Lecture # 4 Languages-III

Languages of Regular Expressions Example: Consider the alphabet Σ={a} The language of all words containing even number of a’s can be defined by the following RE (aa)* Example: Language of all words containing only odd no. of a’s can be defined by the following RE 1. (aaa)* 2. a(aa)*+ 3. a+(aa)* 4. a+a* 5. a+(aa)*a correct but inefficient due to repetition 6. (aa)*a or a(aa)*

Languages of Regular Expressions Example: The language of all words having all possible combinations of a’s followed be one b can be described by the following RE. 1. a+b 2. a*+b 3. a*b 4. (+a+)b 5. a+b+b Example: The language of all words in which all a’s (if any) comes before all the b’s (if any) can be defined the following RE (ab)* 2. a*b* 3. a+b+ +  4. a+b* +  both are inefficient

Example:The language of all words of a’s & b’s that have atleast two letters, that begin & end with a’s & that have nothing but b’s inside (if any thing at all) can be defined by following RE. Σ = {a, b} (aba)* 2. ab*a+ 3. ab+a 4. a+b*a+ all above are incorrect 5. ab*a

Example: Consider the alphabet Σ={a,b,c} Example: Consider the alphabet Σ={a,b,c}. The language of all words that begins with either a or c, followed be any no. of b’s can be defined by following RE. (a+c)b* = ab* + cb* Example: The language of all words that ends with letter b can be defined be RE (a+b)*b

Note: All finite languages are regular whereas some infinite languages are regular & some are non-regular. In order to write RE for finite languages just include +’s between the words of finite languages. Consider the alphabet Σ={a,b}. The words of length 1 are two. Its RE will be a+b. Similarly the words of length 2 will be aa,ab,ba,bb. Its RE will be aa+ab+ba+bb or (a+b)(b+a). Similary the languages of all words whose length is 3 will be aaa,aab,aba,abb,bbb,bba,bab,baa. Thus we can conclude that all words of a’s and b’s of any length can be defined by (a+b)*.

Definition For regular expressions and

Example Regular expression:

Example Regular expression

Example = { all strings with at least two consecutive 0 } = { all strings without two consecutive 0 }

Equivalent Regular Expressions Definition: Regular expressions and are equivalent if

Examples (a+)* = (a*)+ = a* (a*+b)* = (a+b)* (a+b)*ab(a+b)* = (a+b)*a(a+b)*b(a+b)* (a+b)*= (a*b*)* (a+b)*= (a*b*+b*a*)* (aa+ab*)* = (aa+ab)* a*a* = (aa)*

Regular Expressions and Regular Languages

Theorem Languages Generated by Regular Expressions Regular Languages