Closure Properties of Regular Languages

Similar documents
Nondeterministic Finite Automata

Direct Proof Rational Numbers

Lecture 7 Properties of regular languages

Composition of Functions

Direct Proof Floor and Ceiling

Direct Proof Division into Cases

Direct Proof Universal Statements

The Pairwise-Comparison Method

Direct Proof Divisibility

Direct Proof Divisibility

Instantaneous Rate of Change

Maximums and Minimums

Predicates and Quantifiers

Confidence Intervals for Proportions Sections 22.2, 22.3

The Interpretation of λ

Vector Operations. Lecture 19. Robb T. Koether. Hampden-Sydney College. Wed, Oct 7, 2015

Conditional Statements

Compound Interest. Lecture 34 Section 4.1. Robb T. Koether. Hampden-Sydney College. Tue, Mar 28, 2017

CS 133 : Automata Theory and Computability

Closure under the Regular Operations

Paired Samples. Lecture 37 Sections 11.1, 11.2, Robb T. Koether. Hampden-Sydney College. Mon, Apr 2, 2012

The Pumping Lemma and Closure Properties

Finite Automata and Regular languages

CS 455/555: Finite automata

Independent Samples: Comparing Means

FABER Formal Languages, Automata. Lecture 2. Mälardalen University

The Cobb-Douglas Production Functions

Equivalence of DFAs and NFAs

Closure Properties of Context-Free Languages. Foundations of Computer Science Theory

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Negations of Quantifiers

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

CSE 105 THEORY OF COMPUTATION

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Strong Mathematical Induction

Sampling Distribution of a Sample Proportion

CS 121, Section 2. Week of September 16, 2013

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Inf2A: Converting from NFAs to DFAs and Closure Properties

Lecture 3: Nondeterministic Finite Automata

CSE 105 THEORY OF COMPUTATION

CS 154, Lecture 3: DFA NFA, Regular Expressions

Context-Free and Noncontext-Free Languages

Sampling Distribution of a Sample Proportion

Formal Languages, Automata and Models of Computation

Theory of Computation (I) Yijia Chen Fudan University

Properties of Context-Free Languages. Closure Properties Decision Properties

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

Intro to Theory of Computation

Regular Expressions. Definitions Equivalence to Finite Automata

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Regular Languages. Problem Characterize those Languages recognized by Finite Automata.

Theory of Computation

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

1 Alphabets and Languages

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

CSE 105 THEORY OF COMPUTATION

Computational Models - Lecture 3 1

Elementary Logic and Proof

Ogden s Lemma. and Formal Languages. Automata Theory CS 573. The proof is similar but more fussy. than the proof of the PL4CFL.

CS 154. Finite Automata, Nondeterminism, Regular Expressions

Context-Free Grammars (and Languages) Lecture 7

Chapter 6. Properties of Regular Languages

Sri vidya college of engineering and technology

2.1 Solution. E T F a. E E + T T + T F + T a + T a + F a + a

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries

Binary Search Trees. Lecture 29 Section Robb T. Koether. Hampden-Sydney College. Fri, Apr 8, 2016

Fooling Sets and. Lecture 5

CPS 220 Theory of Computation REGULAR LANGUAGES

This Lecture will Cover...

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

More Properties of Regular Languages

TAFL 1 (ECS-403) Unit- II. 2.1 Regular Expression: The Operators of Regular Expressions: Building Regular Expressions

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

Regular Expressions [1] Regular Expressions. Regular expressions can be seen as a system of notations for denoting ɛ-nfa

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro Diniz

Unit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1

CMSC 330: Organization of Programming Languages

What Is a Language? Grammars, Languages, and Machines. Strings: the Building Blocks of Languages

CSE 105 THEORY OF COMPUTATION

Decidability (What, stuff is unsolvable?)

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages

HW6 Solutions. Micha l Dereziński. March 20, 2015

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

Computational Theory

Context-Free Languages (Pre Lecture)

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen

Uses of finite automata

Languages. A language is a set of strings. String: A sequence of letters. Examples: cat, dog, house, Defined over an alphabet:

1 More finite deterministic automata

Automata and Formal Languages - CM0081 Algebraic Laws for Regular Expressions

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

DM17. Beregnelighed. Jacob Aae Mikkelsen

Transcription:

Closure Properties of Regular Languages Lecture 13 Section 4.1 Robb T. Koether Hampden-Sydney College Wed, Sep 21, 2016 Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 1 / 28

Outline 1 Closure Properties of Regular Languages 2 Additional Closure Properties 3 Examples 4 Right Quotients 5 Example 6 Assignment Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 2 / 28

Outline 1 Closure Properties of Regular Languages 2 Additional Closure Properties 3 Examples 4 Right Quotients 5 Example 6 Assignment Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 3 / 28

Closure Theorem (Closure Properties of Regular Languages) The class of regular languages is closed under the operations of complementation, union, concatenation, and Kleene star. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 4 / 28

Closure Proof for unions. A B Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 5 / 28

Closure Proof for unions. A B Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 6 / 28

Closure Proof for concatenations. A B Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 7 / 28

Closure Proof for concatenations. A B Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 8 / 28

Closure Proof for Kleene star. A Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 9 / 28

Closure Proof for Kleene star. A Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 10 / 28

Closure Example (Closure) A DFA for the language (A BC). A B C Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 11 / 28

Closure Example (Closure) A DFA for the language (A BC). A B C Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 12 / 28

Closure Example (Closure) A DFA for the language (A BC). A B C Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 13 / 28

Closure Example (Closure) A DFA for the language (A BC). ε A B C Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 14 / 28

Closure Example (Closure) If A = {a}, B = {b}, and C = {c}, then we have. A B C a c b Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 15 / 28

Closure Example (Closure) The equivalent DFA is. a a b a b c b Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 16 / 28

Closure Example (Closure) This can be minimized to. a a b c b Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 17 / 28

Outline 1 Closure Properties of Regular Languages 2 Additional Closure Properties 3 Examples 4 Right Quotients 5 Example 6 Assignment Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 18 / 28

More Closure Properties Corollary The set of regular languages is closed under intersection and set difference. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 19 / 28

Outline 1 Closure Properties of Regular Languages 2 Additional Closure Properties 3 Examples 4 Right Quotients 5 Example 6 Assignment Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 20 / 28

Example (Intersection) Let Σ = {a, b} and L 1 = {w w contains aba} L 2 = {w w contains bab} Design a DFA for L 1 L 2. Design a DFA for L 1 L 2. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 21 / 28

Example (Intersection) Let Σ = {a, b} and L 1 = {w w contains aba} L 2 = {w w contains bab} Design a DFA for L 1 L 2. Design a DFA for L 1 L 2. Design a DFA for L 1 L 2. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 21 / 28

Outline 1 Closure Properties of Regular Languages 2 Additional Closure Properties 3 Examples 4 Right Quotients 5 Example 6 Assignment Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 22 / 28

Right Quotients Definition (Right Quotient) Let L 1 and L 2 be languages on an alphabet Σ. The right quotient of L 1 with L 2 is L 1 /L 2 = {x xy L 1 for some y L 2 }. Theorem If L 1 and L 2 are regular languages, then L 1 /L 2 is regular. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 23 / 28

Right Quotients Proof. Let L 1 = L(M) and M = (Q, Σ, δ, q 0, F ). Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 24 / 28

Right Quotients Proof. Let L 1 = L(M) and M = (Q, Σ, δ, q 0, F ). Define M = (Q, Σ, δ, q 0, F ) with F defined as follows. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 24 / 28

Right Quotients Proof. Let L 1 = L(M) and M = (Q, Σ, δ, q 0, F ). Define M = (Q, Σ, δ, q 0, F ) with F defined as follows. For each q i Q, let M i = (Q, Σ, δ, q i, F ). Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 24 / 28

Right Quotients Proof. Let L 1 = L(M) and M = (Q, Σ, δ, q 0, F ). Define M = (Q, Σ, δ, q 0, F ) with F defined as follows. For each q i Q, let M i = (Q, Σ, δ, q i, F ). Determine whether L(M i ) L 2 =. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 24 / 28

Right Quotients Proof. Let L 1 = L(M) and M = (Q, Σ, δ, q 0, F ). Define M = (Q, Σ, δ, q 0, F ) with F defined as follows. For each q i Q, let M i = (Q, Σ, δ, q i, F ). Determine whether L(M i ) L 2 =. If L(M i ) L 2, then q i F. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 24 / 28

Right Quotients Proof. Let L 1 = L(M) and M = (Q, Σ, δ, q 0, F ). Define M = (Q, Σ, δ, q 0, F ) with F defined as follows. For each q i Q, let M i = (Q, Σ, δ, q i, F ). Determine whether L(M i ) L 2 =. If L(M i ) L 2, then q i F. If L(M i ) L 2 =, then q i / F. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 24 / 28

Right Quotients Proof. Let L 1 = L(M) and M = (Q, Σ, δ, q 0, F ). Define M = (Q, Σ, δ, q 0, F ) with F defined as follows. For each q i Q, let M i = (Q, Σ, δ, q i, F ). Determine whether L(M i ) L 2 =. If L(M i ) L 2, then q i F. If L(M i ) L 2 =, then q i / F. The idea is that x goes from q 0 to q i for some q i Q. y goes from q i to q f for some q f F and y L 2. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 24 / 28

Outline 1 Closure Properties of Regular Languages 2 Additional Closure Properties 3 Examples 4 Right Quotients 5 Example 6 Assignment Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 25 / 28

Right Quotients Example (Right Quotients) Let Σ = {a, b} and L 1 = L(aba ) L 2 = L(b a) That is, L 1 = {ab, aba, abaa, abaaa,...} L 2 = {a, ba, bba, bbba,...} Use the construction in the proof to create a DFA for L 1 /L 2. Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 26 / 28

Outline 1 Closure Properties of Regular Languages 2 Additional Closure Properties 3 Examples 4 Right Quotients 5 Example 6 Assignment Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 27 / 28

Assignment Assignment Section 4.1 Exercises 1a, 2, 4, 6b, 11, 12, 14, 16, 20. Is the family of regular languages closed under infinite union? That is, if L 1, L 2, L 3,... are regular languages, is L 1 L 2 L 3 necessarily a regular language? What about infinite intersections of regular languages? Must L 1 L 2 L 3 be regular? Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages Wed, Sep 21, 2016 28 / 28