Deterministic Finite-State Automata

Similar documents
One Minute To Learn Programming: Finite Automata

Homework 3 Solutions

Regular Sets and Expressions

flex Regular Expressions and Lexical Scanning Regular Expressions and flex Examples on Alphabet A = {a,b} (Standard) Regular Expressions on Alphabet A

Unambiguous Recognizable Two-dimensional Languages

FORMAL LANGUAGES, AUTOMATA AND THEORY OF COMPUTATION EXERCISES ON REGULAR LANGUAGES

Regular Languages and Finite Automata

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding

Java CUP. Java CUP Specifications. User Code Additions You may define Java code to be included within the generated parser:

Bypassing Space Explosion in Regular Expression Matching for Network Intrusion Detection and Prevention Systems

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers.

Binary Representation of Numbers Autar Kaw

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

A Visual and Interactive Input abb Automata. Theory Course with JFLAP 4.0

and thus, they are similar. If k = 3 then the Jordan form of both matrices is

Algebra Review. How well do you remember your algebra?

Geometry 7-1 Geometric Mean and the Pythagorean Theorem

Integration by Substitution

NQF Level: 2 US No: 7480

Regular Languages and Finite State Machines

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY

Lecture 5. Inner Product

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes

Reasoning to Solve Equations and Inequalities

Learning Workflow Petri Nets

Brillouin Zones. Physics 3P41 Chris Wiebe

Solution to Problem Set 1

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( )

trademark and symbol guidelines FOR CORPORATE STATIONARY APPLICATIONS reviewed

GENERAL APPLICATION FOR FARM CLASSIFICATION

SE3BB4: Software Design III Concurrent System Design. Sample Solutions to Assignment 1

MODULE 3. 0, y = 0 for all y

Generating In-Line Monitors For Rabin Automata

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

Pointed Regular Expressions

DATABASDESIGN FÖR INGENJÖRER F

Linear Equations in Two Variables

Lecture 3 Gaussian Probability Distribution

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall Final Exam

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 4 Nancy Lynch

Physics 43 Homework Set 9 Chapter 40 Key

Protocol Analysis / Analysis of Software Artifacts Kevin Bierhoff

Finite Automata. Reading: Chapter 2

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions.

Operations with Polynomials

1. In the Bohr model, compare the magnitudes of the electron s kinetic and potential energies in orbit. What does this imply?

MATH 150 HOMEWORK 4 SOLUTIONS

CS103B Handout 17 Winter 2007 February 26, 2007 Languages and Regular Expressions

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

APPLICATION NOTE Revision 3.0 MTD/PS-0534 August 13, 2008 KODAK IMAGE SENDORS COLOR CORRECTION FOR IMAGE SENSORS

Automata and Computability. Solutions to Exercises

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered:

C H A P T E R Regular Expressions regular expression

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

5.2. LINE INTEGRALS 265. Let us quickly review the kind of integrals we have studied so far before we introduce a new one.

9 CONTINUOUS DISTRIBUTIONS

Intro to Circle Geometry By Raymond Cheong

e.g. f(x) = x domain x 0 (cannot find the square root of negative values)

Treatment Spring Late Summer Fall Mean = 1.33 Mean = 4.88 Mean = 3.

Regular Repair of Specifications

Vectors Recap of vectors

On decidability of LTL model checking for process rewrite systems

Finite Automata. Reading: Chapter 2

On the expressive power of temporal logic

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Developing Jazz Vocabulary

Automated Grading of DFA Constructions

When Simulation Meets Antichains (on Checking Language Inclusion of NFAs)

Math 135 Circles and Completing the Square Examples

License Manager Installation and Setup

CHAPTER 7 GENERAL PROOF SYSTEMS

19. The Fermat-Euler Prime Number Theorem

JaERM Software-as-a-Solution Package

! What can a computer do? ! What can a computer do with limited resources? ! Don't talk about specific machines or problems.

Today s Agenda. Automata and Logic. Quiz 4 Temporal Logic. Introduction Buchi Automata Linear Time Logic Summary

CUBIC-FOOT VOLUME OF A LOG

Modular Generic Verification of LTL Properties for Aspects

EQUATIONS OF LINES AND PLANES

Deterministic Finite Automata

Data Compression. Lossless And Lossy Compression

. At first sight a! b seems an unwieldy formula but use of the following mnemonic will possibly help. a 1 a 2 a 3 a 1 a 2

Learning Analysis by Reduction from Positive Data

Small Business Networking

Ratio and Proportion

Regular Expressions and Automata using Haskell

Lec 2: Gates and Logic

Learning Outcomes. Computer Systems - Architecture Lecture 4 - Boolean Logic. What is Logic? Boolean Logic 10/28/2010

Review guide for the final exam in Math 233

Distributions. (corresponding to the cumulative distribution function for the discrete case).

Warm-up for Differential Calculus

AP STATISTICS SUMMER MATH PACKET

Automata and Formal Languages

Second Term MAT2060B 1. Supplementary Notes 3 Interchange of Differentiation and Integration

2m + V ( ˆX) (1) 2. Consider a particle in one dimensions whose Hamiltonian is given by

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Friday 16 th May Time: 14:00 16:00

5 a LAN 6 a gateway 7 a modem

2 DIODE CLIPPING and CLAMPING CIRCUITS

Transcription:

Deterministic Finite-Stte Automt Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute of Science, Bnglore. 05 August 2011

Outline 1 Introduction 2

Exmple DFA 1 DFA for Odd number of s b b How DFA works.

Exmple DFA 1 DFA for Odd number of s b b e o How DFA works. Ech stte represents property of the input string red so fr: Stte e: Number of s seen is even. Stte o: Number of s seen is odd.

Exmple DFA 2 DFA for Contins the substring bb b, b b b Ech stte represents property of the input string red so fr:

Exmple DFA 2 DFA for Contins the substring bb b b b, b ǫ b bb Ech stte represents property of the input string red so fr: Stte ǫ: Not seen bb nd no suffix in or b. Stte : Not seen bb nd hs suffix. Stte b: Not seen bb nd hs suffix b. Stte bb: Seen bb.

Exmple DFA 3 Accept strings over {0,1} which stisfy even prity in length 4 blocks. Accept 0101 1010 Reject 0101 1011 DFA for Even prity checker 0 1, e 0 2, e 0 3, e 0, e 0 1 1 1 1 1 1 0 0, o 0, 1 1, o 0 2, o 0 3, o 1

Exmple DFA 4 Accept strings over {,b,/, } which don t end inside C-style comment. Scn from left to right till first /* is encountered; from there to next */ is first comment; nd so on. Accept b/ /bb nd b/ / /bb /. Reject b/ nd b/ / /bb/.

Exmple DFA 4 Accept strings over {,b,/, } which don t end inside C-style comment. Scn from left to right till first /* is encountered; from there to next */ is first comment; nd so on. Accept b/ /bb nd b/ / /bb /. Reject b/ nd b/ / /bb/. DFA for C-comment trcker /, /, / / out pbc in pec

Definitions nd nottion An lphbet is finite set of set of symbols or letters. Eg. A = {,b,c}, Σ = {0,1}. A string or word over n lphbet A is finite sequence of letters from A. Eg. b is string over {,b,c}. Empty string denoted by ǫ. Set of ll strings over A denoted by A. Wht is the size or crdinlity of A?

Definitions nd nottion An lphbet is finite set of set of symbols or letters. Eg. A = {,b,c}, Σ = {0,1}. A string or word over n lphbet A is finite sequence of letters from A. Eg. b is string over {,b,c}. Empty string denoted by ǫ. Set of ll strings over A denoted by A. Wht is the size or crdinlity of A? Infinite but Countble: Cn enumerte in lexicogrphic order:. ǫ,, b, c,, b,...

Definitions nd nottion An lphbet is finite set of set of symbols or letters. Eg. A = {,b,c}, Σ = {0,1}. A string or word over n lphbet A is finite sequence of letters from A. Eg. b is string over {,b,c}. Empty string denoted by ǫ. Set of ll strings over A denoted by A. Wht is the size or crdinlity of A? Infinite but Countble: Cn enumerte in lexicogrphic order: ǫ,, b, c,, b,.... Opertion of conctention on words: String u followed by string v: written u v or simply uv. Eg. bb = bb.

Definitions nd nottion: Lnguges A lnguge over n lphbet A is set of strings over A. Eg. for A = {,b,c}: L = {bc, b}. L 1 = {ǫ, b,, bb, b, b, b, bbb,...}. L 2 = {}. L 3 = {ǫ}. How mny lnguges re there over given lphbet A?

Definitions nd nottion: Lnguges A lnguge over n lphbet A is set of strings over A. Eg. for A = {,b,c}: L = {bc, b}. L 1 = {ǫ, b,, bb, b, b, b, bbb,...}. L 2 = {}. L 3 = {ǫ}. How mny lnguges re there over given lphbet A? Uncountbly infinite

Definitions nd nottion: Lnguges A lnguge over n lphbet A is set of strings over A. Eg. for A = {,b,c}: L = {bc, b}. L 1 = {ǫ, b,, bb, b, b, b, bbb,...}. L 2 = {}. L 3 = {ǫ}. How mny lnguges re there over given lphbet A? Uncountbly infinite Conctention of lnguges: L 1 L 2 = {u v u L 1, v L 2 }. Eg. {bc,b} {ǫ,,bb} = {bc, b, bc, b, bcbb, bbb}.

Definitions nd nottion: DFA A Deterministic Finite-Stte Automton A over n lphbet A is structure of the form (Q,s,δ,F) where Q is finite set of sttes s Q is the strt stte δ : Q A Q is the trnsition function. F Q is the set of finl sttes.

Definitions nd nottion: DFA A Deterministic Finite-Stte Automton A over n lphbet A is structure of the form (Q,s,δ,F) where Q is finite set of sttes s Q is the strt stte δ : Q A Q is the trnsition function. F Q is the set of finl sttes. Exmple of Odd s DFA: Here: Q = {e, o}, s = e, F = {o}, nd δ is given by: δ(e, ) = o, δ(e, b) = e, δ(e, ) = o, δ(e, b) = e. b e b o

Definitions nd nottion: Lnguge ccepted by DFA δ tells us how the DFA A behves on given word u. Define δ : Q A Q s δ(q, ǫ) = q δ(q, w ) = δ( δ(q, w), ). Lnguge ccepted by A, denoted L(A), is defined s: L(A) = {w A δ(s,w) F }. Eg. For A = DFA for Odd s, L(A) = {,b,b,,bb,bb,bb,...}.

Regulr Lnguges A lnguge L A is clled regulr if there is DFA A over A such tht L(A) = L. Exmples of regulr lnguges: Odd s, strings tht don t end inside C-style comment, {}, ny finite lnguge. All lnguges over A Regulr Are there non-regulr lnguges?

Regulr Lnguges A lnguge L A is clled regulr if there is DFA A over A such tht L(A) = L. Exmples of regulr lnguges: Odd s, strings tht don t end inside C-style comment, {}, ny finite lnguge. All lnguges over A Regulr Are there non-regulr lnguges? Yes, uncountbly mny, since Reg is only countble while clss of ll lnguges is uncountble.