1 Minimizing DFA’s By Partitioning 2 Minimizing DFA’s Lots of methods All involve finding equivalent states: –States that go to equivalent states under.

Slides:



Advertisements
Similar presentations
Reducing DFA’s Section 2.4. Reduction of DFA For any language, there are many DFA’s that accept the language Why would we want to find the smallest? Algorithm:
Advertisements

Cook’s Theorem The Foundation of NP-Completeness.
Investigating Factors of numbers. Investigate the factors of the following numbers Prime numbers are numbers that have exactly two different factors (
DFA Minimization Jeremy Mange CS 6800 Summer 2009.
Finite Automata CPSC 388 Ellen Walker Hiram College.
Size matters! Minimizing DFAs. Minimising states = Minimising cost Minimising number of states = Minimising number of memory cells (hardware size) = Minimising.
Trigonometric Functions on Any Angle
x y 0 radians 2  radians  radians radians radius = 1 unit(1,0) (0,1) (-1,0) (0,-1) (1,0)
1 Financial Mathematics Clicker review session, Final.
Homework #5 Solutions 1. True or False a) Regular Languages are always Context-Free Languages True False b) Context Free Languages are always Regular.
Pizza and a (short) Movie! Tomorrow (Friday), 1 – 2 p.m., here!
More on Decision Trees. Numerical attributes Tests in nodes can be of the form x j > constant Divides the space into rectangles.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
I.1 ii.2 iii.3 iv.4 1+1=. i.1 ii.2 iii.3 iv.4 1+1=
NFA- to NFA conversion. Purpose This presentation presents an example execution of the algorithm which takes as input an NFA with -transitions and produces.
1 Non-Deterministic Automata Regular Expressions.
I.1 ii.2 iii.3 iv.4 1+1=. i.1 ii.2 iii.3 iv.4 1+1=
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY For next time: Read 2.1 & 2.2.
1 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
Transparency No. 8-1 Formal Language and Automata Theory Chapter 8 DFA state minimization (lecture 13, 14)
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA minimization.
VOWELS a e i o u CONSONANTS b c d f g h j k l m n p q r s t v w x y z.
CSE 311: Foundations of Computing Fall 2014 Lecture 23: State Minimization, NFAs.
Efficient Algorithms Quicksort. Quicksort A common algorithm for sorting non-sorted arrays. Worst-case running time is O(n 2 ), which is actually the.
Overview of Previous Lesson(s) Over View  Strategies that have been used to implement and optimize pattern matchers constructed from regular expressions.
CH. 27 : THE DEMAND FOR RESOURCES. I. Resource Pricing A. Here we analyze input costs to the business (ie. Cost of labor, machines) B. Ch determined.
1 For each language, give a regular expression that generates the language and a DFA that accepts it. L 1 = { w  {0, 1}* : has both 00 and 11 as substrings}
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
Decidable Questions About Regular languages 1)Membership problem: “Given a specification of known type and a string w, is w in the language specified?”
Week 14 - Wednesday.  What did we talk about last time?  Regular expressions  Introduction to finite state automata.
DFA Minimization 1 2 Equivalent States Consider the accept states c and g. They are both sinks meaning that any string which ever reaches them is guaranteed.
Lexical Analysis III : NFA to DFA DFA Minimization Lecture 5 CS 4318/5331 Spring 2010 Apan Qasem Texas State University *some slides adopted from Cooper.
8.1.4 Can it still be factored? Factoring Completely I can factor out a common factor.
Transition Diagrams Lecture 3 Wed, Jan 21, Building Transition Diagrams from Regular Expressions A regular expression consists of symbols a, b,
CMSC 330: Organization of Programming Languages Theory of Regular Expressions NFAs  DFAs.
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
Complexity and Computability Theory I Lecture #8 Instructor: Rina Zviel-Girshin Lea Epstein.
Exercise 1 Consider a language with the following tokens and token classes: ID ::= letter (letter|digit)* LT ::= " " shiftL ::= " >" dot ::= "." LP ::=
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA minimization.
Regular Language Algorithms. Algorithms We have seen many algorithms for manipulating computational systems for the regular languages. Each treats these.
1 For each language, give a DFA that accepts it. L 1 = { w  {a, b}* : w at most 2 a’s} L 2 = { w  {0, 1}* : has both 00 and 11 as substrings} L 3 = {
1 Chapter Constructing Efficient Finite Automata.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA.
LECTURE 5 Scanning. SYNTAX ANALYSIS We know from our previous lectures that the process of verifying the syntax of the program is performed in two stages:
1 Section 11.3 Constructing Efficient Finite Automata First we’ll see how to transform an NFA into a DFA. Then we’ll see how to transform a DFA into a.
1 Lexical Analysis Uses formalism of Regular Languages Uses formalism of Regular Languages Regular Expressions Regular Expressions Deterministic Finite.
ΟΡΓΑΝΩΣΗ ΚΑΙ ΔΙΟΙΚΗΣΗ ΕΠΙΧΕΙΡΗΣΕΩΝ 3 Ο ΜΑΘΗΜΑ. ΟΙ ΜΕΓΑΛΕΣ ΕΠΙΧΕΙΡΗΣΕΙΣ Η δημιουργία μεγάλων επιχειρήσεων είναι ένα από τα χαρακτηριστικά του 20 ου αιώνα.
Graphing in the Coordinate Plane
The Perfect Marriage! Ephesians 5:21-33.
'. \s\s I. '.. '... · \ \ \,, I.
Algebra 1 Notes Lesson 4-1: The Coordinate Plane
Graphing / Plotting Points Review
Jaya Krishna, M.Tech, Assistant Professor
ФОНД ЗА РАЗВОЈ РЕПУБЛИКЕ СРБИЈЕ
Transition Diagrams Lecture 3 Fri, Jan 21, 2005.
Minimizing DFA’s By Partitioning.
DFA Equivalence & Minimization
Как да кандидатстваме по НИФ
ОПЕРАТИВНА ПРОГРАМА “ИНОВАЦИИ И КОНКУРЕНТОСПОСОБНОСТ“ „Подобряване на производствения капацитет в МСП“
'III \-\- I ', I ,, - -
Objective - To graph ordered pairs on the coordinate plane.
' '· \ ·' ,,,,
Go over homework – Practice Sheet 3-2 & 3-3 evens only
Solving Equations 3x+7 –7 13 –7 =.
Regular Language Equivalence and DFA Minimization
The Coordinate Plane pg
Example Make x the subject of the formula
,, 'III \-\-
Given a list of n  8 integers, what is the runtime bound on the optimal algorithm that sorts the first eight? O(1) O(log n) O(n) O(n log n) O(n2)
U A B II III I IV 94.
Presentation transcript:

1 Minimizing DFA’s By Partitioning

2 Minimizing DFA’s Lots of methods All involve finding equivalent states: –States that go to equivalent states under all inputs (sounds recursive) We will use the Partitioning Method

3 Minimizing DFA’s by Partitioning Consider the following dfa (from Forbes Louis at U of KY): Accepting states are yellow Non-accepting states are blue Are any states really the same?

4 S 2 and S 7 are really the same: Both Final states Both go to S6 under input b Both go to S3 under an a S 0 and S 5 really the same. Why? We say each pair is equivalent Are there any other equivalent states? We can merge equivalent states into 1 state

5 Partitioning Algorithm First –Divide the set of states into Final and Non-final states Partition I Partition II a b S0S0 S1S1 S4S4 S1S1 S5S5 S2S2 S3S3 S3S3 S3S3 S4S4 S1S1 S4S4 S5S5 S1S1 S4S4 S6S6 S3S3 S7S7 *S 2 S3S3 S6S6 *S 7 S3S3 S6S6

6 Partitioning Algorithm Now –See if states in each partition each go to the same partition S 1 & S 6 are different from the rest of the states in Partition I (but like each other) We will move them to their own partition a b S0S0 S 1 I S 4 I S1S1 S 5 I S 2 II S3S3 S 3 I S4S4 S 1 I S 4 I S5S5 S 1 I S 4 I S6S6 S 3 I S 7 II *S 2 S 3 I S 6 I *S 7 S 3 I S 6 I

7 Partitioning Algorithm a b S0S0 S1S1 S4S4 S5S5 S1S1 S4S4 S3S3 S3S3 S3S3 S4S4 S1S1 S4S4 S1S1 S5S5 S2S2 S6S6 S3S3 S7S7 *S 2 S3S3 S6S6 *S 7 S3S3 S6S6

8 Partitioning Algorithm Now again –See if states in each partition each go to the same partition –In Partition I, S 3 goes to a different partition from S 0, S 5 and S 4 –We’ll move S3 to its own partition a b S0S0 S 1 III S 4 I S5S5 S 1 III S 4 I S3S3 S 3 I S4S4 S 1 III S 4 I S1S1 S 5 I S 2 II S6S6 S 3 I S 7 II *S 2 S 3 I S 6 III *S 7 S 3 I S 6 III

9 Partitioning Algorithm Note changes in S 6, S 2 and S 7 a b S0S0 S 1 III S 4 I S5S5 S 1 III S 4 I S4S4 S 1 III S 4 I S3S3 S 3 IV S1S1 S 5 I S 2 II S6S6 S 3 IV S 7 II *S 2 S 3 IV S 6 III *S 7 S 3 IV S 6 III

10 Partitioning Algorithm Now S 6 goes to a different partition on an a from S 1 S 6 gets its own partition. We now have 5 partitions Note changes in S 2 and S 7 a b S0S0 S 1 III S 4 I S5S5 S 1 III S 4 I S4S4 S 1 III S 4 I S3S3 S 3 IV S1S1 S 5 I S 2 II S6S6 S 3 IV S 7 II *S 2 S 3 IV S 6 V *S 7 S 3 IV S 6 V

11 Partitioning Algorithm All states within each of the 5 partitions are identical. We might as well call the states I, II III, IV and V. a b S0S0 S 1 III S 4 I S5S5 S 1 III S 4 I S4S4 S 1 III S 4 I S3S3 S 3 IV S1S1 S 5 I S 2 II S6S6 S 3 IV S 7 II *S 2 S 3 IV S 6 V *S 7 S 3 IV S 6 V

12 Partitioning Algorithm a b I III I *II IVV III I II IV V II Here they are:

13 V a a a a a b b b b b b