1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch

Slides:



Advertisements
Similar presentations
Finite-State Machines with No Output Ying Lu
Advertisements

CSC 361NFA vs. DFA1. CSC 361NFA vs. DFA2 NFAs vs. DFAs NFAs can be constructed from DFAs using transitions: Called NFA- Suppose M 1 accepts L 1, M 2 accepts.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Costas Busch - RPI1 Single Final State for NFAs. Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Fall 2006Costas Busch - RPI1 Regular Expressions.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata (cont.) Prof. Amos Israeli.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Fall 2006Costas Busch - RPI1 Properties of Regular Languages.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
1 Finite state automaton (FSA) LING 570 Fei Xia Week 2: 10/07/09 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
1 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Fall 2003Costas Busch - RPI1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
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
1 Language Recognition (11.4) and Turing Machines (11.5) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch.
THEORY OF COMPUTATION 08 KLEENE’S THEOREM.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Context-free Grammars Example : S   Shortened notation : S  aSaS   | aSa | bSb S  bSb Which strings can be generated from S ? [Section 6.1]
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
1 INFO 2950 Prof. Carla Gomes Module Modeling Computation: Language Recognition Rosen, Chapter 12.4.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
Lecture 5 Sept 06, 2012 Regular expressions – examples Converting DFA to regular expression. (same works for NFA to r.e. conversion.) Converting R.E. to.
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.
CHAPTER 1 Regular Languages
Copyright © Curt Hill Finite State Automata Again This Time No Output.
Regular Expressions Costas Busch - LSU.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
September1999 CMSC 203 / 0201 Fall 2002 Week #15 – 2/4/6 December 2002 Prof. Marie desJardins.
Modeling Computation: Finite State Machines without Output
Regular Grammars Reading: 3.3. What we know so far…  FSA = Regular Language  Regular Expression describes a Regular Language  Every Regular Language.
Algorithms for hard problems Automata and tree automata Juris Viksna, 2015.
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
Costas Busch - LSU1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Conversions Regular Expression to FA FA to Regular Expression.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
Lecture 09: Theory of Automata:2014 Asif NawazUIIT, PMAS-Arid Agriclture University Rawalpindi. Kleene’s Theorem and NFA.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Language Recognition MSU CSE 260.
Non Deterministic Automata
Properties of Regular Languages
NPDAs Accept Context-Free Languages
Single Final State for NFA
Language Recognition (12.4)
REGULAR LANGUAGES AND REGULAR GRAMMARS
Some slides by Elsa L Gunter, NJIT, and by Costas Busch
DPDA Deterministic PDA
Non-Deterministic Finite Automata
Properties of Regular Languages
Non-Deterministic Finite Automata
Elementary Questions about Regular Languages
CSCI 2670 Introduction to Theory of Computing
Language Recognition (12.4)
DPDA Deterministic PDA
Chapter 1 Regular Language
Finite-State Machines with No Output
CSCI 2670 Introduction to Theory of Computing
NFAs accept the Regular Languages
Presentation transcript:

1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch and …

2 Three Equivalent Representations Finite automata Regular expressions Regular languages Each can describe the others Kleene’s Theorem: For every regular expression, there is a deterministic finite-state automaton that defines the same language, and vice versa.

3 EXAMPLE 1 Consider the language { a m b n | m, n  N}, which is represented by the regular expression a*b*. A regular grammar for this language can be written as follows: S   | aS | B B  b | bB.

4 Regular ExpressionRegular Grammar a*S   | aS (a+b)*S   | aS | bS a* + b*S   | A | B A  a | aA B  b | bB a*bS  b | aS ba*S  bA A   | aA (ab)*S   | abS

5 NFAs  Regular grammars Thus, the language recognized by FSA is a regular language Every NFA can be converted into a corresponding regular grammar and vice versa. Each symbol A of the grammar is associated with a non- terminal node of the NFA s A, in particular, start symbol S is associated with the start state s S. Every transition is associated with a grammar production: T(s A,a) = s B  A  aB. Every production B   is associated with final state s B.

6 Equivalent FSA and regular grammar, Ex. 4, p G=(V,T,S,P) V={S, A, B, 0, 1} with S=s 0, A=s 1, and B=s 2, T={0,1}, and productions are S  0A | 1B | 1 | λ A  0A | 1B | 1 B  0A | 1B | 1 | λ

7 Kleene’s Theorem Languages Generated by Regular Expressions Languages Recognized by FSA

8 Languages Generated by Regular Expressions Languages Recognized by FSA Languages Generated by Regular Expressions Languages Recognized by FSA We will show:

9 Proof - Part 1 For any regular expression the language is recognized by FSA (= is a regular language) Languages Generated by Regular Expressions Languages Recognized by FSA Proof by induction on the size of

10 Induction Basis Primitive Regular Expressions: NFAs regular languages

11 Inductive Hypothesis Assume for regular expressions and that and are regular languages

12 Inductive Step We will prove: Are regular Languages

13 By definition of regular expressions:

14 By inductive hypothesis we know: and are regular languages Regular languages are closed under: Union Concatenation Star We need to show: This fact is illustrated in Fig. 2 on p. 769.

15 Therefore: Are regular languages And trivially:is a regular language

16 Proof - Part 2 Languages Generated by Regular Expressions Languages Recognized by FSA For any regular language there is a regular expression with Proof by construction of regular expression

17 Since is regular take the NFA that accepts it Single final state

18 From construct the equivalent Generalized Transition Graph in which transition labels are regular expressions Example:

19 Another Example:

20 Reducing the states:

21 Resulting Regular Expression:

22 In General Removing states:

23 The final transition graph: The resulting regular expression:

24 Three Equivalent Representations Finite automata Regular expressions Regular languages Each can describe the others