Ng winter 2013 23 uw cse 401 michael ringenburg

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview:   The symbols correspond to characters all t2011 Fall 2011 2 b 1 Winter 2013 a 3 b a 4 19 UW CSE 401 (Michael Ringenburg) Finite State Automaton C input symbols (usually c CSE341: Programming Languagesharacters) •  Operate by reading SE341: Programming Languages –  Transi?on can be taken if labeled with current symbol Lecture 1 Lecture 1 –  ε- transi?on can be taken at any ?me Course Course Mechanics Mechanics •  Accept when final state reached and no more input ML Variable Bindings –  Slightly different in a scanner, where the FSA is used as a subrou?ne to ML Variable Bindings find the longest input string that matches a token RE. •  Reject if no transi?on possible, or no more input and not in Dan Grossman final state (DFA) Dan Grossman Fall 2011 Fall 2011 2 b 1 Winter 2013 a 3 b a UW CSE 401 (Michael Ringenburg) 4 20 8 1/11/13 Example: FSA for “pig” p Winter 2013 i g 21 UW CSE 401 (Michael Ringenburg) Example: FSA for “pig” Input 1: pig p i g Status: Execu?ng… Winter 2013 UW CSE 401 (Michael Ringenburg) 22 9 1/11/13 Example: FSA for “pig” Input 1: pig p i g Status: Execu?ng… Winter 2013 23 UW CSE 401 (Michael Ringenburg) Example: FSA for “pig” Input 1: pig p i g Status: Execu?ng… Winter 2013 UW CSE 401 (Michael Ringenburg) 24 10 1/11/13 Example: FSA for “pig” Input 1: pig p i g Status: Accept! (In a final state, and no more input.) Winter 2013 25 UW CSE 401 (Michael Ringenburg) Example: FSA for “pig” Input 2: pit p i g Status: Execu?ng… Winter 2013 UW CSE 401 (Michael Ringenburg) 26 11 1/11/13 Example: FSA for “pig” Input 1: pit p i g Status: Execu?ng… Winter 2013 27 UW CSE 401 (Michael Ringenburg) Example: FSA for “pig” Input 1: pit p i g Status: Execu?ng… Winter 2013 UW CSE 401 (Michael Ringenburg) 28 12 1/11/13 Example: FSA for “pig” Input 1: pit p i g Status: Reject! (No legal transi?ons on ‘t’.) Winter 2013 UW CSE 401 (Michael Ringenburg) 29 DFA vs NFA CSE341: Programming CSE341: Programming Languages Languages •  Determinis?c Finite Automata (DFA) –  No choice of which transi?on to take Lecture 1 Lecture 1 Course Course inite Automata (NFA) •  Non- determinis?c FMechanics Mechanics ML Variable ML Variable Bindings –  Choice of transi?on in at least one case Bindings –  ε transi?ons (arcs): If the current state has any outgoing ε arcs, Dan Grossman we can follow Dny of them without consuming any input a an Grossman Fall 2011 Fall 2011 –  Accept if...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern