CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

Similar documents
Regular expressions, Finite Automata, transition graphs are all the same!!

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

Chapter 2 Finite Automata

Let's start with an example:

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

1 Nondeterministic Finite Automata

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15

CHAPTER 1 Regular Languages. Contents

Worked out examples Finite Automata

Finite Automata-cont d

Languages & Automata

Lecture 08: Feb. 08, 2019

CISC 4090 Theory of Computation

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

CS375: Logic and Theory of Computing

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Homework 3 Solutions

Thoery of Automata CS402

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Designing finite automata II

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Nondeterminism and Nodeterministic Automata

State Minimization for DFAs

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Convert the NFA into DFA

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Lexical Analysis Finite Automate

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1

Deterministic Finite Automata

Finite-State Automata: Recap

Chapter 7. Kleene s Theorem. 7.1 Kleene s Theorem. The following theorem is the most important and fundamental result in the theory of FA s:

Automata and Languages

Harvard University Computer Science 121 Midterm October 23, 2012

Some Theory of Computation Exercises Week 1

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

Fundamentals of Computer Science

CS375: Logic and Theory of Computing

Today s Topics Automata and Languages

Automata and Languages

Lexical Analysis Part III

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

Context-Free Grammars and Languages

Minimal DFA. minimal DFA for L starting from any other

3 Regular expressions

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

First Midterm Examination

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy:

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

GNFA GNFA GNFA GNFA GNFA

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Formal Languages and Automata

CMSC 330: Organization of Programming Languages

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

First Midterm Examination

Theory of Computation Regular Languages

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

input tape head moves current state

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

More on automata. Michael George. March 24 April 7, 2014

Deterministic Finite-State Automata

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

1 From NFA to regular expression

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Tutorial Automata and formal Languages

Lecture 09: Myhill-Nerode Theorem

Gold s algorithm. Acknowledgements. Why would this be true? Gold's Algorithm. 1 Key ideas. Strings as states

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

ɛ-closure, Kleene s Theorem,

List all of the possible rational roots of each equation. Then find all solutions (both real and imaginary) of the equation. 1.

Name Ima Sample ASU ID

Formal languages, automata, and theory of computation

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Java II Finite Automata I

Recursively Enumerable and Recursive. Languages

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

Coalgebra, Lecture 15: Equations for Deterministic Automata

CS 573 Automata Theory and Formal Languages

CSE396 Prelim I Answer Key Spring 2017

Turing Machines Part One

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

In-depth introduction to main models, concepts of theory of computation:

Formal Language and Automata Theory (CS21004)

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

Transcription:

CSCI 340: Computtionl Models Trnsition Grphs Chpter 6 Deprtment of Computer Science

Relxing Restrints on Inputs We cn uild n FA tht ccepts only the word! 5 sttes ecuse n FA cn only process one letter t time. Cn we construct more powerful mchine? 1 / 14

Relxing Restrints on Inputs We cn uild n FA tht ccepts only the word! 5 sttes ecuse n FA cn only process one letter t time. Cn we construct more powerful mchine? 1 0 2 3,, Only processing one- or two- chrcters t time 1 / 14

Relxing Restrints on Inputs We cn uild n FA tht ccepts only the word! 5 sttes ecuse n FA cn only process one letter t time. Cn we construct more powerful mchine? 0 1 ll else, 2, Processing up to three chrcters t time 1 / 14

Relxing Restrints on Inputs We cn uild n FA tht ccepts only the word! 5 sttes ecuse n FA cn only process one letter t time. Cn we construct more powerful mchine? 0 1 The most sic of possile FA-like mchines ccepting only But we hve prolem: wht hppens with? 1 / 14

A Blck-Hole Stte? Up until this point, we hd lwys specified trnsition for every single letter from every single stte Rules of FAs sttes we cnnot stop reding input until we hve no more letters Do we wnt to specify n imginry hell stte for every FA? Alterntively introduce new term to descrie wht hppens 2 / 14

A Blck-Hole Stte? Up until this point, we hd lwys specified trnsition for every single letter from every single stte Rules of FAs sttes we cnnot stop reding input until we hve no more letters Do we wnt to specify n imginry hell stte for every FA? Alterntively introduce new term to descrie wht hppens Definition When n input string tht hs not een completely red reches stte (finl or otherwise) tht cnnot leve ecuse there is no outgoing edge tht it my follow, we sy tht the input (or the mchine) crshes t tht stte. Execution termintes nd the input must e rejected. 2 / 14

Exmple: A Doule-Letter Accepting Mchine,, Prolem, 0 1 How mny letters should we red t time? Discussion 3 / 14

Exmple: A Doule-Letter Accepting Mchine,,, 0 1 Prolem How mny letters should we red t time? Discussion Given we cn tokenize it in the following wys: -- - - Only one of these yields dmission into the finl stte ( 1 ) 3 / 14

A Potentil Prolem A string is ccepted y mchine if there is some wy it could e processed so s to rrive t finl stte. 1 0 3 2 4 / 14

A Potentil Prolem A string is ccepted y mchine if there is some wy it could e processed so s to rrive t finl stte. 1 0 3 2 We cn ccept in two different wys! These re no longer Finite Automt We shll refer to these new mchines s trnsition grphs 4 / 14

Trnsition Grphs Definition A trnsition grph, revited TG, is collection of three things: 1 A finite set of sttes, t lest one of which is designted s the strt stte nd some (mye none) of which re designted s finl sttes. 2 An lphet Σ of possile input letters from which input strings re formed. 3 A finite set of trnsitions (edge lels) tht show how to go from some sttes to some others, sed on reding specified sustrings of input letters (possily even the null string ). TGs were invented y John Myhill in 1957 A successful pth through trnsition grph is series of edges forming pth eginning t some strt stte nd ending t finl stte. Conctenting the edges visited will yield the input string. 5 / 14

Exmple with trnsitions 1 0 2 3 Wht lnguge is ccepted y this TG? 6 / 14

Multiple Strt Sttes 1 0 2 4 3 7 / 14

Multiple Strt Sttes 1 2 4 3 lnguge-cceptor euivlent (the TG on the prior slide is functionlly euivlent s the TG on this slide) Importnt note: every FA is TG, however every TG is not n FA 7 / 14

Looking t Simple Trnsition Grphs 1 0 4 0 2 0 5 0 1 3 0 1 2 3 6 0 1 8 / 14

Looking t Simple Trnsition Grphs 1 ccepts nothing (no finl) 0 2 ccepts only 0 3 ccepts only,, 0 1 2 3 4 ccepts nothing (no strt) 0 5 ccepts only 0 1 6 ccepts only 0 1 8 / 14

Exmples Wht do they do? TG1: TG2: 0 1, TG3: 0 1 3 2 0 1 2, TG4:,,, 3 4 0 1, 9 / 14

Infinite Pths? Question Cn we construct TG which hs infinitely mny ccept pths for finite-length string? 0 1 2 Solution 10 / 14

Infinite Pths? Question Cn we construct TG which hs infinitely mny ccept pths for finite-length string? 0 1 2 Solution 0 1 2 10 / 14

Circuits Question How cn we remove -trnsitions? 0 1 2 3 11 / 14

Circuits Question How cn we remove -trnsitions? 0 1 2 3, 0 1 2 3, 11 / 14

Generlized Trnsition Grphs (GTGs) We wnt to lierte! stte-to-stte trnsitions Allow the input to progress from one stte to stte Not with seuences of chrcters But with lnguges! L 1, L 2,..., L n How do we wnt to represent the lnguges? Definition A generlized trnsition grph (GTG) is collection of 3 things: 1 A finite set of sttes, of which s lest one is strt stte nd some (mye none) re finl sttes. 2 An lphet Σ of input letters. 3 Directed edges connecting some pirs of sttes, ech leled with regulr expression. 12 / 14

Exmples of GTG Exmple 1 (demonstrtion): ( + ) ( + ) 0 1 2 Exmple 2 (conversion):,, 0 1 2 Loops == Kleene Str, == ( + ) 13 / 14

Exmples of GTG Exmple 1 (demonstrtion): ( + ) ( + ) 0 1 2 Exmple 2 (conversion):,, 0 1 2 Loops == Kleene Str, == ( + ) ( + ) ( + ) 0 1 2 3 13 / 14

Non-Determinism Or, how I lerned to stopped worrying nd love GTGs GTGs force us to fce deep, sutle, nd disturing fct: Just s nd + in regulr expression represent potentil multiplicity of choices, so does the possile multiplicity of pths to e selected from TG. In GTG, the choices re sttic nd dynmic We often hve choices of edges t ech stte, ech leled with n infinite lnguge of lterntives The numer of wys to trnsition from Q i to Q j might e We cn t forid it ( Dred It. Run From It. Destiny Still Arrives. ) GTGs re non-deterministic. Humn choice ecomes fctor in selecting the pth; the mchine doesn t mke ll its own determintions. 14 / 14