CSE 105 THEORY OF COMPUTATION

Similar documents
CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CSE 105 THEORY OF COMPUTATION

CS 154, Lecture 3: DFA NFA, Regular Expressions

CSE 105 THEORY OF COMPUTATION

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

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 Theory of Computation Professor Jeanne Ferrante

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

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Finite Automata Part Two

CSE 105 THEORY OF COMPUTATION

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

Closure under the Regular Operations

CS 455/555: Finite automata

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

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,

CSE 105 THEORY OF COMPUTATION

Equivalence of DFAs and NFAs

CSE 105 THEORY OF COMPUTATION

Intro to Theory of Computation

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

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

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

CPS 220 Theory of Computation REGULAR LANGUAGES

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Inf2A: Converting from NFAs to DFAs and Closure Properties

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

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

CSC236 Week 10. Larry Zhang

Sri vidya college of engineering and technology

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

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

CISC 4090 Theory of Computation

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

Finite Automata and Regular languages

Theory of Computation (I) Yijia Chen Fudan University

Closure Properties of Regular Languages

Theory of Computation Lecture 1. Dr. Nahla Belal

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

Computer Sciences Department

CS 154 Introduction to Automata and Complexity Theory

COM364 Automata Theory Lecture Note 2 - Nondeterminism

CHAPTER 1 Regular Languages. Contents

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

Incorrect reasoning about RL. Equivalence of NFA, DFA. Epsilon Closure. Proving equivalence. One direction is easy:

CSC173 Workshop: 13 Sept. Notes

CSE 105 THEORY OF COMPUTATION

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa

Lecture 3: Nondeterministic Finite Automata

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Constructions on Finite Automata

MA/CSSE 474 Theory of Computation. Your Questions? Previous class days' material Reading Assignments

Nondeterminism. September 7, Nondeterminism

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

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

CSCI 2670 Introduction to Theory of Computing

CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont )

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

MA/CSSE 474 Theory of Computation

Turing Machines Part III

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

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013

Finite Automata Part Two

Computational Models - Lecture 4

Recap from Last Time

CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

CSE 105 Theory of Computation

CSE 105 THEORY OF COMPUTATION

Lecture 4: More on Regexps, Non-Regular Languages

CMSC 330: Organization of Programming Languages

CpSc 421 Homework 1 Solutions

Deterministic Finite Automata (DFAs)

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)

Chapter Two: Finite Automata

Fooling Sets and. Lecture 5

Homework Assignment 6 Answers

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

Properties of Regular Languages. BBM Automata Theory and Formal Languages 1

Non-deterministic Finite Automata (NFAs)

Deterministic Finite Automata (DFAs)

Constructions on Finite Automata

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

Formal Definition of Computation. August 28, 2013

Theory of Languages and Automata

Regular Expressions. Definitions Equivalence to Finite Automata

Theory of computation: initial remarks (Chapter 11)

Transcription:

CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/

Today's learning goals Sipser Section 1.1 Determine if a language is regular Apply closure properties to conclude that a language is or isn't regular Prove closure properties of the class of regular languages

Regular languages Sipser p. 35 Def 1.5 DFA M over the alphabet Σ For each string w over Σ, M either accepts w or rejects w The language recognized by M is the set of strings M accepts a.k.a. the language of M is the set of strings M accepts a.k.a. L(M) = { w w is a string over Σ and M accepts w} A language is regular iff there is some finite automaton that recognizes exactly it.

Justification? To prove that the DFA we build, M, actually recognizes the language L WTS L(M) = L (1) Is every string accepted by M in L? (2) Is every string from L accepted by M? or contrapositive version: Is every string rejected by M not in L?

A useful (optional) bit of terminology When is a string accepted by a DFA? Computation of M on w: where do we land when start at q 0 and read each symbol of w one-at-a time? δ*( q, w ) = Recursively defined function

Regular languages: bounds? Is every finite language regular? A. No: some finite languages are regular, and some are not. B. No: there are no finite regular languages. C. Yes: every finite language is regular. D. I don't know.

Building DFA Remember States are our only (computer) memory. Design and pick states with specific roles / tasks in mind. "Have not seen any of desired pattern yet" "Trap state"

Complementation ( {q1,q2,q3}, {a,b}, δ, q1,? )

Building DFA New strategy Express L in terms of simpler languages use them as building blocks. Example L = { w w does not contain the substring baba } = the complement of the set {w w contains the substring baba}

Complementation Claim: If A is a regular language over {0,1} *, then so is A aka "the class of regular languages is closed under complementation"

Complementation Claim: If A is a regular language over {0,1} *, then so is A aka "the class of regular languages is closed under complementation" Proof: Let A be a regular language. Then there is a DFA M=(Q,Σ,δ,q0,F) such that L(M) = A. We want to build a DFA whose language is A. Define M' =? Claim of Correctness L(M') = A Proof of claim

Why closure proofs? General technique of proving a new language is regular Stretch the power of the model Puzzle!

Set operations Input set(s) OPERATION Output set Complementation Kleene star Concatenation Union Intersection Set difference

The regular operations Sipser Def 1.23 p. 44 For A, B languages over same alphabet, define: These are operations on sets!

Union Sipser Theorem 1.25 p. 45 Theorem: The class of regular languages over fixed alphabet Σ is closed under the union operation. Proof: What are we proving here? A. For any set A, if A is regular then so is A U A. B. For any sets A and B, if A U B is regular, then so is A. C. For two DFAs M1 and M2, M1 U M2 is regular. D. None of the above. E. I don't know.

Union Sipser Theorem 1.25 p. 45 Theorem: The class of regular languages over fixed alphabet Σ is closed under the union operation. Proof: Let A1, A2 be any two regular languages over Σ. WTS that A1 U A2 is regular. Goal: build a machine that recognizes A1 U A2.

Union Sipser Theorem 1.25 p. 45 Goal: build a machine that recognizes A1 U A2. Strategy: use machines that recognize each of A1, A2. Input M1 M2 Accept if either (or both) accepts ** HOW? **

"Run in parallel" M = (Q1xQ2, Σ, δ,?,?) Start state: Accept state(s): Transition function: The set of accepting states for M is A. F1 x F2 B. { (r,s) r is in F1 and s is in F2 } C. { (r,s) r is in F1 or s is in F2 } D. F1 U F2 E. I don't know.

Union Sipser Theorem 1.25 p. 45 Proof: Let A1, A2 be any two regular languages over Σ. Given M1 = (Q1,Σ,δ1,q1,F1) such that L(M1) = A1 and M2 = (Q2,Σ,δ2,q2,F2) such that L(M2) = A2. WTS that A1 U A2 is regular. Define M = (Q1xQ2,Σ,δ,(q1,q2),{(r,s) in Q1xQ2 r in F1 or s in F2}) with δ( (r,s), x ) = ( δ1(r,x), δ2(s,x) ) for (r,s) in Q1xQ2 and x in Σ. Why does L(M) = A1 U A2?

Aside: Intersection How would you prove that the class of regular languages is closed under intersection? Can you think of more than one proof strategy? A B = { x x in A and x in B} U

Payoff { w w contains neither the substrings aba nor baab} Is this a regular set?

Payoff { w w contains neither the substrings aba nor baab} Is this a regular set? A = { w w contains aba as a substring} B = { w w contains baab as a substring}

General proof structure/strategy Theorem: For any L over Σ, if L is regular then [ the result of some operation on L ] is also regular. Proof: Given name variables for sets, machines assumed to exist. WTS state goal and outline plan. Construction using objects previously defined + new tools working towards goal. Give formal definition and explain. Correctness prove that construction works. Conclusion recap what you've proved.

The regular operations Sipser Def 1.23 p. 44 For A, B languages over same alphabet, define: How can we prove that the concatenation of two regular languages is a regular language?

For next time Work on Group Homework 1 due Saturday Pre class-reading for Friday: - Page 48 (Figure 1.27 and description below it) - Example 1.35 on page 52