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.

Slides:



Advertisements
Similar presentations
4b Lexical analysis Finite Automata
Advertisements

Theory Of Automata By Dr. MM Alam
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 9,10 Theory of AUTOMATA
Finite Automata with Output
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
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.
1 Finite Automata. 2 Finite Automaton Input “Accept” or “Reject” String Finite Automaton Output.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
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
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
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.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Lecture 07: Formal Methods in SE Finite Automata Lecture # 07 Qaisar Javaid Assistant Professor.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
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.
CHAPTER 1 Regular Languages
Overview of Previous Lesson(s) Over View  Symbol tables are data structures that are used by compilers to hold information about source-program constructs.
Fundamentals of Informatics
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
Lecture 8 Theory of AUTOMATA
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.
Lecture 04: Theory of Automata:08 Transition Graphs.
Lecture # 4.
Lecture 2 Theory of AUTOMATA
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 09: Theory of Automata:2014 Asif NawazUIIT, PMAS-Arid Agriclture University Rawalpindi. Kleene’s Theorem and NFA.
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.
  An alphabet is any finite set of symbols.  Examples: ASCII, Unicode, {0,1} ( binary alphabet ), {a,b,c}. Alphabets.
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
CSC312 Automata Theory Chapter # 5 by Cohen Finite Automata
Lecture 9 Theory of AUTOMATA
[Week#03,04] (b) - Finite Automata
Non-deterministic Finite Automata (NFA)
THEORY OF COMPUTATION Lecture One: Automata Theory Automata Theory.
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.
Kleene’s Theorem Muhammad Arif 12/6/2018.
NFAs and Transition Graphs
Finite Automata.
Finite Automata.
4b Lexical analysis 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,
Deterministic Finite Automaton (DFA)
4b Lexical analysis Finite Automata
Recap lecture 10 Definition of GTG, examples of GTG accepting the languages of strings:containing aa or bb, beginning with and ending in same letters,
CSC312 Automata Theory Chapter # 5 by Cohen Finite Automata
CSC312 Automata Theory Transition Graphs Lecture # 9
Recap lecture 37 New format for FAs, input TAPE, START, ACCEPT , REJECT, READ states Examples of New Format of FAs, PUSHDOWN STACK , PUSH and POP states,
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:

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 language. Example Consider the following regular expressions r1 = (a + b)* (aa + bb) r2 = (a + b)*aa + ( a + b)*bb then both regular expressions define the language of strings ending in aa or bb

E QUIVALENT R EGULAR E XPRESSIONS Note If r1 = (aa + bb) and r2 = ( a + b) then r1+r2 = (aa + bb) + (a + b) r1r2 = (aa + bb) (a + b)= (aaa + aab + bba + bbb) (r1)* = (aa + bb)*

R EGULAR L ANGUAGES Definition The language generated by any regular expression is called a regular language. It is to be noted that if r1, r2 are regular expressions, corresponding to the languages L1 and L2 then the languages generated by r1+ r2, r1r2( or r2r1) and r1*( or r2*) are also regular languages.

R EGULAR L ANGUAGES Example Consider the language L, defined over Σ = {a,b}, of strings of length 2, starting with a, then L = {aa, ab}, may be expressed by the regular expression aa+ab. Hence L, by definition, is a regular language.

R EGULAR L ANGUAGES All finite languages are regular Example Consider the language L, defined over Σ = {a,b}, of strings of length 2, starting with a, then L = {aa, ab}, may be expressed by the regular expression aa+ab. Hence L, by definition, is a regular language.

G RAPHS Set of points with the lines connecting some of the points (also called simple graph). The points are called nodes or vertices and the lines are called edges. Numbers of edges at a particular node is the degree of that node. G = (V, E)

G RAPHS C ONTINUE ….. Path : in a graph is a sequence of nodes connected by edges. Simple Path : is a path that does not repeat nodes. Connected Graph : if every two nodes have a path between them. Cycle: A path is a cycle if it starts and ends with same node.

G RAPHS C ONTINUE …. Tree: if it is connected and has no simple cycles Directed Graph : If it has arrows instead of lines Strongly Connected : if a directed path connects every two nodes.

F INITE A UTOMATON Definition A Finite automaton (FA), is a collection of the followings 1) Finite number of states, having one initial and some (maybe none) final states. 2) Finite set of input letters (Σ) from which input strings are formed. 3) Finite set of transitions i.e. for each state and for each input letter there is a transition showing how to move from one state to another.

F INITE A UTOMATON Example Σ = {a,b} States: x, y, z where x is an initial state and z is final state. Transitions: At state x reading a, go to state z At state x reading b, go to state y At state y reading a, b go to state y At state z reading a, b go to state z

F INITE A UTOMATON Transition Table These transitions can be expressed by the following table called transition table

F INITE A UTOMATON Transition Diagram The information of an FA, given in the previous table, can also be depicted by the following diagram, called the transition diagram, of the given FA

F INITE A UTOMATON The above transition diagram is an FA accepting the language of strings, defined over Σ = {a, b}, starting with a. It may be noted that this language may be expressed by the regular expression a(a + b)*

F INITE A UTOMATON To indicate the initial state, an arrow head can also be placed before that state. Final state with double circle, as shown below. While expressing an FA by its transition diagram, the labels of states are not necessary.

F INITE A UTOMATON It may be noted that corresponding to a given language there may be more than one FA accepting that language,but for a given FA there is a unique language accepted by that FA. It is also to be noted that given the languages L1 and L2,where L1 = The language of strings, defined over Σ ={a, b}, beginning with a. L2 = The language of strings, defined over Σ ={a, b}, not beginning with b The Λ does not belong to L1 while it does belong to L2. This fact may be depicted by the corresponding transition diagrams of L1 and L2.

F INITE A UTOMATON FA1 Corresponding to L1 The language L1 may be expressed by the regular expression a(a + b)*

F INITE A UTOMATON FA2 Corresponding to L2 The language L2 may be expressed by the regular expression a(a + b)* + Λ

F INITE A UTOMATON Equivalent FAs Two FAs are said to be equivalent, if they accept the same language, as shown in the following FAs. FA1 FA2 FA3

F INITE A UTOMATON Equivalent FAs FA1 does not accept any string, even it does not accept the null string because there is no path starting from initial state and ending in final state. While in FA2, there is no final state. And in FA3, there is a final state but FA3 is disconnected as the states 2 and 3 are disconnected. The language of strings accepted by FA1, FA2 and FA3 is denoted by the empty set i.e. { }