Bindings ml b variable bindings a dan grossman fall

Info iconThis 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: Draw the NFA for (ab|c): Lecture 1 Lecture 1 Course Course Mechanics Mechanics b a ML Variable Bindings ML Variable Bindings Dan Grossman Fall 2011 Dan Grossman Fall 2011 c Winter 2013 UW CSE 401 (Michael Ringenburg) 50 23 1/11/13 Example CSE341: Programming CSE341: Programming Languages Languages •  Draw the NFA for (ab|c): Lecture 1 Lecture 1 Course Course Mechanics Mechanics ε b a ML Variable Bindings ML Variable Bindings Dan Grossman Fall 2011 ε Dan Grossman Fall 2011 c Winter 2013 UW CSE 401 (Michael Ringenburg) 51 Example CSE341: Programming CSE341: Programming Languages Languages •  Draw the NFA for (ab|c): Lecture 1 Lecture 1 Course Course Mechanics Mechanics b a ML Variable Bindings ML Variable Bindings Dan Grossman Dan Grossman (If a state has a single outgoing ε- transi?on, and no other Fall 2011 Fall 2011 outgoing transi?ons, you can merge it into the ε target.) c Winter 2013 UW CSE 401 (Michael Ringenburg) 52 24 1/11/13 Example CSE341: Programming CSE341: Programming Languages Languages •  Draw the NFA for (ab|c): ε Lecture 1 Lecture 1 Course Course Mechanics Mechanics b a ML Variable Bindings ML Variable Bindings ε Dan Grossman Dan Grossman Fall 2011 Fall 2011 ε ε c Winter 2013 UW CSE 401 (Michael Ringenburg) 53 Exercise CSE341: Programming CSE341: Programming Languages Languages •  Draw the NFA for: b(at|ag) | bug Lecture 1 Lecture 1 Course Course Mechanics Mechanics ML Variable Bindings ML Variable Bindings Dan Grossman Fall 2011 Winter 2013 Dan Grossman Fall 2011 UW CSE 401 (Michael Ringenburg) 54 25 1/11/13 Exercise CSE341: Programming CSE341: Programming Languages Languages •  Draw the NFA for: b(at|ag) | bug Lecture 1 Lecture 1 Course Course Mechanics Mechanics ML Variable Bindings ML Variable Bindings b(at|ag) Dan Grossman Fall 2011 ε Dan Grossman Fall 2011 ε ε ε bug Winter 2013 55 UW CSE 401 (Michael Ringenburg) Exercise CSE341: Programming CSE341: Programming Languages Languages •  Draw the NFA for: b(at|ag) | bug Lecture 1 Lecture 1 Course Course Mechanics Mechanics ML Variable Bindings ML Variable Bindings b(at|ag) Dan Grossman Fall 2011 ε Dan Grossman Fall 2011 ε ε ε b Winter 2013 ε u ε UW CSE 401 (Michael Ringenburg) g 56 26 1/11/13 Exercise CSE341: Programming CSE341: Programming Languages Languages •  Draw the NFA for: b(at|ag) | bug Lecture 1 Lecture 1 Course Course Mechanics Mechanics ML Variable Bindings ML b Variable Bindings at|ag Dan Grossman Fall 2011 ε Dan Grossman Fall 2011 ε ε ε b ε Winter 2013 u ε g 57 UW CSE 401 (Michael Ringenburg) Exercise CSE341: Programming CSE341: Programming Languages Languages •  Draw the NFA for: b(at|ag) | bug Lecture 1 Lecture 1 t a Course Course Mechanicsε Mechanics ε ε ML Variable Bindings ML b Variable Bindings ε a Dan Grossman Fall 2011 ε Dan Grossman ε g Fall 2011 ε ε ε ε b Winter 2013 ε u ε UW CSE 401 (Michael Ringenburg) g 58 27 1/11/13 From NFA to DFA C construct a Languages CSE341: Programming DFA from an N Languages •  Subset construc?on: SE341: ProgrammingFA. Each DFA state represents a set of NFA states. Lecture 1 Lecture 1 •  Key idea: State of DFA a{er reading some input is the set of all states Course Course Mechanics Mechanics that NFA could have reached a{er reading the same input ML Variable Bindings •  Algorithm (ML Variable Bindings example of a fixed- point computa?on): –  Find ε- closure (all states reachable via 0 or more ε- transi?ons) of start Dan to this set. state. Create DFA state corresponding Grossman Add to unvisited list. Dan Grossman Fall 2011 –  While there exist unvisited DFA states, select one (call it d): Fall 2011 •  For each symbol s in the alphabet, determine the NFA states reachable by any NFA state in the set corresponding to d. •  Determine the ε closure of these states. Create a transi?on from d on symbol s to a DFA state corresponding to this closure set. •  If this state is new, add to the unvisited list. Winter 2013 UW CSE 401 (Mic...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online