Theory Of Automata By Dr. MM Alam

Slides:



Advertisements
Similar presentations
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Advertisements

4b Lexical analysis Finite Automata
Theory Of Automata By Dr. MM Alam
Lecture # 11 Theory Of Automata By Dr. MM Alam 1.
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.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Theory Of Automata By Dr. MM Alam
Finite Automata with Output
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Cohen, Chapter 61 Introduction to Computational Theory Chapter 6.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
Finite Automata Chapter 5. Formal Language Definitions Why need formal definitions of language –Define a precise, unambiguous and uniform interpretation.
Topics Automata Theory Grammars and Languages Complexities
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Finite-State Machines with No Output Longin Jan Latecki Temple University Based on Slides by Elsa L Gunter, NJIT, and by Costas Busch Costas Busch.
Finite-State Machines with No Output
Lecture 03: Theory of Automata:08 Finite Automata.
Lecture 07: Formal Methods in SE Finite Automata Lecture # 07 Qaisar Javaid Assistant Professor.
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
Regular Expressions and Languages A regular expression is a notation to represent languages, i.e. a set of strings, where the set is either finite or contains.
Kleene’s Theorem Group No. 3 Presented To Mam Amina Presented By Roll No Roll No Roll No Roll No Group No. 3 Presented To Mam.
Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007.
Overview of Previous Lesson(s) Over View  Symbol tables are data structures that are used by compilers to hold information about source-program constructs.
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.
Lecture 4 Theory of AUTOMATA
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
Recursive Definations Regular Expressions Ch # 4 by Cohen
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Lecture 04: Theory of Automata:08 Transition Graphs.
Lecture # 4.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
CSC312 Automata Theory Lecture # 8 Chapter # 5 (Cont…) Finite Automata.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Conversions Regular Expression to FA FA to Regular Expression.
1 Chapter 3 Regular Languages.  2 3.1: Regular Expressions (1)   Regular Expression (RE):   E is a regular expression over  if E is one of:
1 Introduction to the Theory of Computation Regular Expressions.
1 Section 11.2 Finite Automata Can a machine(i.e., algorithm) recognize a regular language? Yes! Deterministic Finite Automata A deterministic finite automaton.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Lecture 09: Theory of Automata:2014 Asif NawazUIIT, PMAS-Arid Agriclture University Rawalpindi. Kleene’s Theorem and NFA.
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.
Lecture # 8 (Transition Graphs). Example Consider the language L of strings, defined over Σ={a, b}, having (containing) triple a or triple b. Consider.
Lecture 14: Theory of Automata:2014 Finite Automata with Output.
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.
Recap lecture 5 Different notations of transition diagrams, languages of strings of even length, Odd length, starting with b, ending in a (with different.
Kleene’s Theorem and NFA
Transition Graphs.
Generalized Transition Graphs
Mathematical Notions and Terminology
[Week#03,04] (b) - Finite Automata
Some slides by Elsa L Gunter, NJIT, and by Costas Busch
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
Finite Automata.
Recap lecture 6 Language of strings, beginning with and ending in different letters, Accepting all strings, accepting non-empty strings, accepting no string,
Language Recognition (12.4)
CSC312 Automata Theory Transition Graphs Lecture # 9
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 15 Examples of Kleene’s theorem part III (method 3), NFA, examples, avoiding loop using NFA, example, converting FA to NFA, examples, applying.
NFAs and Transition Graphs
Recap Lecture 4 Regular expression of EVEN-EVEN language, Difference between a* + b* and (a+b)*, Equivalent regular expressions; sum, product and closure.
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
Presentation transcript:

Theory Of Automata By Dr. MM Alam Lecture # 5 Theory Of Automata By Dr. MM Alam

Lecture#4 Recap Recursive way of defining languages Recursive way examples Regular expressions Regular expression examples

Construct a regular expression for all words that contain exactly two b’s or exactly three b’s, not more. a*ba*ba* + a*ba*ba*ba* or a*(b + Λ)a*ba*ba*

Construct a regular expression for: (i) all strings that end in a double letter. (ii) all strings that do not end in a double letter (i) (a + b)*(aa + bb) (ii) (a + b)*(ab + ba) + a + b + Λ

Construct a regular expression for all strings that have exactly one double letter in them (b + Λ)(ab)*aa(ba)*(b + Λ) + (a + Λ)(ba)*bb(ab)*(a + Λ)

Construct a regular expression for all strings in which the letter b is never tripled. This means that no word contains the substring bbb (Λ + b + bb)(a + ab + abb)* Words can be empty and start and end with a or b. A compulsory ‘a’ is inserted between all repetitions of b’s.

Construct a regular expression for all words in which a is tripled or b is tripled, but not both. This means each word contains the substring aaa or the substring bbb but not both. (Λ + b + bb)(a + ab + abb)*aaa(Λ + b + bb)(a + ab + abb)* + (Λ + a + aa)(b + ba + baa)*bbb(Λ + a + aa)(b + ba + baa)*

Let r1, r2, and r3 be three regular expressions Let r1, r2, and r3 be three regular expressions. Show that the language associated with (r1 + r2)r3 is the same as the language associated with r1r3 + r2r3. Show that r1(r2 + r3) is equivalent to r1r2 + r1r3. This will be the same as providing a ‘distributive law’ for regular expressions.

(r1+ r2)r3: The first expression can be either r1 or r2. The second expression is always r3. There are two possibilities for this language: r1r3 or r2r3. r1(r2 + r3): The first expression is always r1. It is followed by either r2 or r3. There are two possibilities for this language: r1r2 or r1r3.

Question Can a language be expressed by more than one regular expressions, while given that a unique language is generated by that regular expression?

Deterministic Finite Automata Also known as Finite state machine, Finite state automata It represents an abstract machine which is used to represent a regular language A regular expression can also be represented using Finite Automata There are two ways to specify an FA: Transition Tables and Directed Graphs.

Graph Representation Each node (or vertex) represents a state, and the edges (or arcs) connecting the nodes represent the corresponding transitions. Each state can be labeled.

Finite Automata Table Representation (continued) Input State a,b a,b 1 2 3 final state start state transition Input State a b 1 2 3 Table Representation (continued) An FSA may also be represented with a state-transition table. The table for the above FSA:

Finite Automata Definition An FA is defined as follows:- Finite no of states in which one state must be initial state and more than one or may be none can be the final states. Sigma Σ provides the input letters from which input strings can be formed. FA Distinguishing Rule: For each state, there must be an out going transition for each input letter in Sigma Σ.

Σ = {a,b} and states = 0,1,2 where 0 is an initial state and 1 is the final state. Transitions: At state 0 reading a,b go to state 1, At state 1 reading a, b go to state 2 At state 2 reading a, b go to state 2

Transition Table Representation Old state Input Next State a 1 B 2 b

Another way of representation… Old States New States Reading a Reading b 0 - 1 2 2 +

FA directed graph a,b a,b a,b 0 - 1 2+

Example Σ = {a,b} and states = 0,1,2 where 0 is an initial state and 1 is the final state. Transitions: At state 0 reading a go to state 1, At state 0 reading b go to state 2, At state 1 reading a,b go to state 2 At state 2 reading a, b go to state 2

Transition Table Representation Old state Input Next State a 1 b 2

Another way of representation… Old States New States Reading a Reading b 0 - 1 2 2 +

b a,b a a,b 0 - 1 2+

Σ = {a,b} and states = 0,1,2 where 0 is an initial state and 0 is the final state. Transitions: At state 0 reading a go to state 0, At state 0 reading b go to state 1, At state 1 reading a go to state 1 At state 1 reading b go to state 1

Transition Table Representation Old state Input Next State a b 1

Another way of representation… Old States New States Reading a Reading b 0 - 1

Lecture#5 summary Regular expression examples Introduction to Finite Automata Finite Automata representation using Transition tables and using graphs Finite Automata examples