CSCI 2670 Introduction to Theory of Computing September 1, 2005.

Slides:



Advertisements
Similar presentations
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.
Advertisements

CSCI 2670 Introduction to Theory of Computing September 13, 2005.
Introduction to Computability Theory
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
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.
Fall 2006Costas Busch - RPI1 Regular Expressions.
CS 310 – Fall 2006 Pacific University CS310 Converting NFA to DFA Sections:1.2 Page 54 September 15, 2006.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata (cont.) Prof. Amos Israeli.
1 Module 21 Closure Properties for LFSA using NFA’s –From now on, when I say NFA, I mean any NFA including an NFA- unless I add a specific restriction.
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.
Lecture 7 Sept 22, 2011 Goals: closure properties regular expressions.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
1 Lecture 19 Closure Properties for LFSA using NFA’s –union second proof –concatenation –Kleene closure.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1 Non-Deterministic Automata Regular Expressions.
1 Regular Languages Finite Automata eg. Supermarket automatic door: exit or entrance.
Introduction to Finite Automata Adapted from the slides of Stanford CS154.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Lecture 4UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 4.
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 Regular Expressions Definitions Equivalence to Finite Automata.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Regular Expressions. Notation to specify a language –Declarative –Sort of like a programming language. Fundamental in some languages like perl and applications.
Theory of Languages and Automata
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.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NFA to DFA.
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Text search.
CSCI 2670 Introduction to Theory of Computing August 26, 2004.
CSCI 2670 Introduction to Theory of Computing August 25, 2005.
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.
Lesson No.6 Naveen Z Quazilbash. Overview Attendance and lesson plan sharing Assignments Quiz (10 mins.). Some basic ideas about this course Regular Expressions.
CHAPTER 1 Regular Languages
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
CSCI 2670 Introduction to Theory of Computing October 12, 2005.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CSCI 2670 Introduction to Theory of Computing September 13.
Regular Expressions Costas Busch - LSU.
1 Regular Expressions Definitions Equivalence to Finite Automata.
Theory of Computing CSCI 356/541 Lab Session. Outline Lab 1: Finite Automata  Construct and Run Construct and Run  Manipulating Transitions Manipulating.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
1 Chapter 3 Regular Languages.  2 3.1: Regular Expressions (1)   Regular Expression (RE):   E is a regular expression over  if E is one of:
1 Some Properties of Regular Languages. 2 Properties Concatenation:Star: Union: Are regular Languages For regular languages and.
CSCI 2670 Introduction to Theory of Computing September 7, 2004.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
CSE 105 theory of computation
Formal Language & Automata Theory
Formal Language & Automata Theory
Single Final State for NFA
REGULAR LANGUAGES AND REGULAR GRAMMARS
Closure Properties for Regular Languages
Definitions Equivalence to Finite Automata
CSCI 2670 Introduction to Theory of Computing
Definitions Equivalence to Finite Automata
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
CSE 105 theory of computation
Chapter 1 Regular Language
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
COSC 3340: Introduction to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

CSCI 2670 Introduction to Theory of Computing September 1, 2005

Agenda Last class –Equivalence of DFA’s and NFA’s Today –Some work on designing NFA’s –Closure of regular languages under regular operators –Another method for describing regular languages

Group project For each NFA –Informally describe the behavior of the NFA –Construct a DFA accepting the same language

Group 1 ε ε All strings containing an even number of 0’s or an even number of 1’s

Group 2 0,ε 0110 All prefixes of the string 0110 Proper prefixes may be followed by a 0

Group 3 ε ε All strings with a zero count divisible by 2 or 3

Group 4 10,1 All strings that have a 1 in one of the last three positions ε ε

Group All strings with alternating 0’s and 1’s that start with a 0

Group ε All strings containing either zero 1’s or three or more 1’s

Closure of NFA’s under regular operations Recall the following are the regular operators –Union –Concatenation –Kleene star

Union is a regular operation Theorem: The class of regular languages is closed under the union operation Proof approach: Assume A 1 and A 2 are both regular languages with A 1 =L(M 1 ) and A 2 =L(M 2 ) and create an NFA M such that L(M) = A 1  A 2 Method: Proof by construction

M Construct M from M 1 and M 2 M1M1 M2M2 ε ε

Concatenation is a regular operation Theorem: The class of regular languages is closed under the concatenation operation Proof approach: Assume A 1 and A 2 are both regular languages with A 1 =L(M 1 ) and A 2 =L(M 2 ) and create an NFA M such that L(M) = A 1  A 2 Method: Proof by construction

M Construct M from M 1 and M 2 M1M1 M2M2 εε

Kleene star is a regular operation Theorem: The class of regular languages is closed under the Kleene operation Proof approach: Assume A 1 is a regular language with A 1 =L(M 1 ) and create an NFA M such that L(M) = A 1 * Method: Proof by construction

M Construct M from M 1 M1M1 ε ε ε

Regular expressions (RE’s) So far we have had to describe languages either with finite automata or with words –Potentially clumsy or imprecise Today we learn precise expression to describe regular languages –Example: All strings with at least one 1 becomes  *  {1}  *, or more simply  * 1  *

Where have you seen RE’s? Grep Awk Perl Search expressions within emacs or vi

RE inductive definition R is a regular expression if R is 1.a for some a   2. ε 3.  4.R 1  R 2 where R 1 and R 2 are both regular expressions 5.R 1  R 2 where R 1 and R 2 are both regular expressions 6.(R 1 * ) where R 1 is a regular expression

Examples 0 * 10 * 10 * –{w | w contains exactly two 1’s}  * 11  * –{w | w contains two consecutive 1’s}  * 1(0  ε)1  * –{w | w contains two 1’s separated by at most one 0} (0  ε)(1  ε) –{0,1,01,ε}