Cohen, Chapter 61 Introduction to Computational Theory Chapter 6.

Slides:



Advertisements
Similar presentations
CS 44 – Aug. 29 Regular operations –Union construction Section Nondeterminism –2 kinds of FAs –How to trace input –NFA design makes “union” operation.
Advertisements

4b Lexical analysis Finite Automata
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.
Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
Theory Of Automata By Dr. MM Alam
Finite Automata CPSC 388 Ellen Walker Hiram College.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2005.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
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.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
1 Finite state automaton (FSA) LING 570 Fei Xia Week 2: 10/07/09 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA.
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.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
1 Non-Deterministic Automata Regular Expressions.
CS Chapter 2. LanguageMachineGrammar RegularFinite AutomatonRegular Expression, Regular Grammar Context-FreePushdown AutomatonContext-Free Grammar.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
Theory of computing, part 3. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CHAPTER 1 Regular Languages
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
Lecture 4 Theory of AUTOMATA
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
User Interaction Design Representing User Interactions.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Lecture 04: Theory of Automata:08 Transition Graphs.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2007.
CS 154 Formal Languages and Computability February 9 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2006.
1 Section 11.2 Finite Automata Can a machine(i.e., algorithm) recognize a regular language? Yes! Deterministic Finite Automata A deterministic finite automaton.
Lecture # 8 (Transition Graphs). Example Consider the language L of strings, defined over Σ={a, b}, having (containing) triple a or triple b. Consider.
Lecture 14: Theory of Automata:2014 Finite Automata with Output.
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
Transition Graphs.
Generalized Transition Graphs
Non Deterministic Automata
Chapter 2 Finite Automata
CSC312 Automata Theory Chapter # 5 by Cohen Finite Automata
Chapter 2 FINITE AUTOMATA.
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
Non Deterministic Automata
NFAs and Transition Graphs
Finite Automata.
4b Lexical analysis Finite Automata
Recap lecture 6 Language of strings, beginning with and ending in different letters, Accepting all strings, accepting non-empty strings, accepting no string,
4b Lexical analysis Finite Automata
CSC312 Automata Theory Chapter # 5 by Cohen Finite Automata
CSC312 Automata Theory Transition Graphs Lecture # 9
Chapter 1 Regular Language
RECAP Lecture 7 FA of EVEN EVEN, FA corresponding to finite languages(using both methods), Transition graphs.
NFAs and Transition Graphs
Chapter # 5 by Cohen (Cont…)
LECTURE # 07.
CHAPTER 1 Regular Languages
Non Deterministic Automata
Presentation transcript:

Cohen, Chapter 61 Introduction to Computational Theory Chapter 6

Cohen, Chapter 62 Automatic Door/FA Front pad Rear pad closedopen Front Neither Front, Rear, Both Rear, Both, Neither

Cohen, Chapter 63 Nondeterministic When the ultimate path through a machine is not determined by input alone the machine is nondeterministic.

Cohen, Chapter 64 Preamble to Chapter 6 n NFAs – Non-deterministic finite automata – Vs. DFAs (deterministic – the book calls FAs) n We allow multiple transitions per letter per state – Including “lambda-transitions” n Move on a whim (w/o consuming input) – Accept if a path exists to a final state n Transition relation:

Cohen, Chapter 65 a a a a -+ aa a,b a - + b a b Examples

Cohen, Chapter 66 Why Non-determinism? n More expressive model n Easier to find machines for a language – E.g., unions of two languages/machines

Cohen, Chapter 67 Examples n (ab + aba)* n Language over {a b} where last symbol is repeated

Cohen, Chapter 68 NFA – DFA Equivalence n There is an algorithm to convert a NFA to a DFA n Just track all the possibilities – Collapse lambda moves n States are a subset of 2 Q n “Rabin-Scott” Algorithm n Example: a + c*b*

Cohen, Chapter 69 Lambda Transitions n Handy for combining machines – E.g., union of two languages: create a new start state with lambda moves to the start states of the two machines

Cohen, Chapter 610 Examples a -+ b b a x1x1 x2x2 x4x4 x3x3 a,b

Cohen, Chapter 611 Examples bb - x1x1 x2x2 + x4x4 x3x3 b b

Cohen, Chapter 612 Examples bb - x1x1 x2x2 + x3x3 a,b

Cohen, Chapter 613 Examples b b - x1x1 x2x2 x3x3 a,b x5x5 x6x6 x7x7 + b a a a

Cohen, Chapter 614 Transition Graphs Abandon the requirement that the edges eat just one letter at a time. -+ baa a,bAll else a,b -+ baa All else

Cohen, Chapter 615 Crashes (Formerly, Hell State or Jail) When an input string that has not been completely read reaches a state (final or otherwise) that it cannot leave because there is no outgoing edge that it may follow, we say that the input (or the machine) crashes at that state.

Cohen, Chapter 616 Rejected Input n Trace a path ending in a non-final state n Crash while being processed -+ a,b aa, bb baa

Cohen, Chapter 617 Acceptance A string is accepted by a TG if there is some way it could be processed as to arrive at a final state. There may also be ways in which this string does not get to a final state, but we ignore all failures.

Cohen, Chapter 618 Transition Graph A collection of three things: 1. A finite set of states, at least one of which is designated as the start state ( - ) and some (maybe none) of which are designated as final states ( + ) 2. An alphabet of possible input letters from which input strings are formed. 3. A finite set of transitions (edge labels) that show how to go from some states to some others, based on reading specified substrings of input letters (possibly even the null string )

Cohen, Chapter 619 Successful Path A successful path through a transition graph is a series of edges forming a path beginning at some start state (there may be several) and ending at a final state abba aa b Free Ride abbab… abbaa… abbababba A Lambda transition occurs when you get a free transition that was not initiated by user or system action/interaction. Move on a whim (w/o consuming input). Slide modified by Seals

Cohen, Chapter 620 Equivalent Language Acceptors aba a b aba a b 1-

Cohen, Chapter 621 Examples baa abba

Cohen, Chapter 622 Examples a bb -+ a,ba,b

Cohen, Chapter 623 Examples (a + b)*b -+ a,ba,b b TG -+ a bb a FA

Cohen, Chapter 624 Examples + a,ba,b b + a,ba,b a - b a

Cohen, Chapter 625 Examples (EVEN-EVEN; cf. p. 69) aa,bb ab.ba aa,bb ab.ba

Cohen, Chapter 626 Example (p. 84) a,ba,b ab bb b bbb a aa a a b b - +

Cohen, Chapter 627 Examples (p. 85) a a + - a a + - +

Cohen, Chapter 628 Example (Problem 17, p. 91) n L = {a abb bbaab bbbaa} n 1) given a FA that accepts L, construct a TG that accepts transpose(L) – Invert start/final states; reverse arrows n 2) given a TG that accepts L, construct a TG that accepts transpose(L) – Same as 1, but reverse transition strings

Cohen, Chapter 629 Generalized Transition Graph (GTG) A collection of three things: 1. A finite set of states, at least one of which is designated as the start state ( - ) and some (maybe none) of which are designated as final states ( + ) 2. An alphabet of possible input letters from which input strings are formed. 3. Directed edges connecting some pairs of states, each labeled with a regular expression.

Cohen, Chapter 630 Examples L1L1 L2L2 L3L3 L4L4 L5L5 + (ab + a)* a a