4. Properties of Regular Languages

Slides:



Advertisements
Similar presentations
CS2303-THEORY OF COMPUTATION Closure Properties of Regular Languages
Advertisements

Lecture 24 MAS 714 Hartmut Klauck
Properties of Regular Languages
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Lecture 8 From NFA to Regular Language. Induction on k= # of states other than initial and final states K=0 a a* b a c d c*a(d+bc*a)*
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
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.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
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 Languages and Finite Automata or how to talk to machines...
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.
Homework 4 Solutions.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Definitions Equivalence to Finite Automata
Theory of Computing Lecture 22 MAS 714 Hartmut Klauck.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
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.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
CHAPTER 1 Regular Languages
Chapter 4 Pumping Lemma Properties of Regular Languages Decidable questions on Regular Languages.
1 Closure Properties of Regular Languages L 1 and L 2 are regular. How about L 1  L 2, L 1  L 2, L 1 L 2, L 1, L 1 * ?
CS 203: Introduction to Formal Languages and Automata
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
General Discussion of “Properties” The Pumping Lemma Membership, Emptiness, Etc.
CIS Automata and Formal Languages – Pei Wang
Closed book, closed notes
Languages.
Formal Language & Automata Theory
Standard Representations of Regular Languages
Properties of Context-Free Languages
CIS Automata and Formal Languages – Pei Wang
Closure Properties of Regular Languages
Properties of Regular Languages
PROPERTIES OF REGULAR LANGUAGES
FORMAL LANGUAGES AND AUTOMATA THEORY
7. Properties of Context-Free Languages
PDAs Accept Context-Free Languages
Single Final State for NFA
Jaya Krishna, M.Tech, Assistant Professor
Decision Properties of Regular Languages
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
Properties of Regular Languages
CS 154, Lecture 3: DFANFA, Regular Expressions.
COSC 3340: Introduction to Theory of Computation
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
7. Properties of Context-Free Languages
Non-Deterministic Finite Automata
Deterministic PDAs - DPDAs
Finite Automata Reading: Chapter 2.
Closure Properties of Context-Free languages
Elementary Questions about Regular Languages
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Closure Properties of Regular Languages
The Pumping Lemma for CFL’s
Closure Properties of Regular Languages
Chapter 1 Regular Language - 02
Instructor: Aaron Roth
CSE 105 theory of computation
Chapter 1 Regular Language
Regular Language Equivalence and DFA Minimization
CHAPTER 1 Regular Languages
CSE 105 theory of computation
Presentation transcript:

4. Properties of Regular Languages CIS 5513 - Automata and Formal Languages – Pei Wang

Questions about formal languages Fundamental questions about a language: Is it regular? Is it empty? Does it contain a specific string? Is it equivalent to another language? A typical regular language contains infinite strings, though has finite representations (as DFA, NFA, ε-NFA, Regular Expression)

Converting among representations ε-NFA to DFA: computing ε-closure, then listing the transitions between subsets DFA to NFA: transforming states to sets of state in the transition function DFA to Regular Expression: incrementally expending expressions to cover paths Regular Expression to ε-NFA: recursively building ε-NFA for each symbol and operation

Closure properties of regular languages If languages L1 and L2 are regular, so are their Union, Concatenations, and Closures Reversals Complements Intersection and Differences Homomorphism (substitution of strings for symbols) and inverse homomorphism These conclusions can be proved constructively

4.2.1: Suppose h is the homomorphism h(0) = a, h(1) = ab, h(2) = ba Exercises for Section 4.2 4.2.1: Suppose h is the homomorphism h(0) = a, h(1) = ab, h(2) = ba (a) What is h(0120)? (c) If L is L(01*2), what is h(L)? (e) If L = {ababa}, what is h-1(L)? 4.2.2: L/a, the quotient of L and a, is { w | wa  L }. Prove: if L is regular, so is L/a Solutions: http://infolab.stanford.edu/~ullman/ialcsols/sol4.html#sol42

Pumping lemma

Applications of pumping lemma Pumping lemma can be used to prove that a language is not regular Example 4.2: the language Leq whose sentences each has the same number of 0’s and 1’s. Pick w = 0n1n, then xy contains 0 only Example 4.3: the language consisting of all strings of 1’s whose length is a prime. Pick w = 1p with p > n+2. Let |y| = m, |xyp-mz| = (m+1)(p–m), where both factors cannot be 1

Emptiness of regular languages If the language is represented by an automaton, then the question is about whether the final states are reachable from the start state, which can be solved by graph search If the language is represented by an expression without Ø, it is not empty; otherwise it can be decided recursively by checking each step of the construction

Membership of regular languages If the language is represented by an automaton, simply check δ^(q0, w)  F Otherwise convert the representation into DFA first, or directly compare it with the Regular Expression that generates the language

Equivalence of states Two states p and q of a DFA are equivalent if for all input strings w, δ^(p, w)  F if and only if δ^(q, w)  F Otherwise they are distinguishable

Recognizing distinguishable states BASIS: an accepting state and a non-accepting state are distinguishable INDUCTION: If two states lead to distinguishable states by the same input symbol, they are distinguishable themselves

Equivalent states in a DFA {C} vs. {A, B, D, E, F, G, H} {D, F} vs. {A, B, E, G, H} on 0 {B, H} vs. {A, E, G} on 1 {G} vs. {A, E} on 1

Minimization of DFA’s A DFA can be minimized by removing the states unreachable from the start state, then merging the equivalent states A minimized DFA has fewest states among the equivalent DFA’s

Equivalence of DFA’s Two DFAs are equivalent if when they are considered as within the same DFA, the two start states are equivalent