Language Recognition (12.4)

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.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
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 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)
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
Cs466(Prasad)L14Equiv1 Equivalence of Regular Language Representations.
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.
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.
CHAPTER 1 Regular Languages
Copyright © Curt Hill Finite State Automata Again This Time No Output.
Regular Expressions Costas Busch - LSU.
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.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
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
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.
Kleene’s Theorem and NFA
Languages.
Standard Representations of Regular Languages
Non Deterministic Automata
Properties of Regular Languages
NPDAs Accept Context-Free Languages
Formal Language & Automata Theory
PDAs Accept Context-Free Languages
NPDAs Accept Context-Free Languages
Single Final State for NFA
Chapter 2 FINITE AUTOMATA.
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
Non Deterministic Automata
Deterministic PDAs - DPDAs
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:

Language Recognition (12.4)   Longin Jan Latecki Temple University Based on slides by Costas Busch from the course http://www.cs.rpi.edu/courses/spring05/modcomp/ and …

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

EXAMPLE 1 Consider the language { ambn | 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.

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

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 sA, in particular, start symbol S is associated with the start state sS. Every transition is associated with a grammar production: T(sA,a) = sB  A  aB. Every production B   is associated with final state sB.

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

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

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

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

Induction Basis Primitive Regular Expressions: NFAs regular languages

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

Inductive Step We will prove: Are regular Languages

By definition of regular expressions:

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.

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

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

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

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

Another Example:

Reducing the states:

Resulting Regular Expression:

In General Removing states:

The final transition graph: The resulting regular expression:

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