Minimizing DFA’s By Partitioning.

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

Sorting Really Big Files Sorting Part 3. Using K Temporary Files Given  N records in file F  M records will fit into internal memory  Use K temp files,
Spatial Join Queries. Spatial Queries Given a collection of geometric objects (points, lines, polygons,...) organize them on disk, to answer point queries.
Cook’s Theorem The Foundation of NP-Completeness.
Finite Automata CPSC 388 Ellen Walker Hiram College.
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.
Pizza and a (short) Movie! Tomorrow (Friday), 1 – 2 p.m., here!
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.
More on Decision Trees. Numerical attributes Tests in nodes can be of the form x j > constant Divides the space into rectangles.
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.
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.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA minimization.
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.
Decidable Questions About Regular languages 1)Membership problem: “Given a specification of known type and a string w, is w in the language specified?”
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.
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,
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.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Consider problems with answer YES or NO Examples: Does Machine have three states ? Is string a binary.
ΟΡΓΑΝΩΣΗ ΚΑΙ ΔΙΟΙΚΗΣΗ ΕΠΙΧΕΙΡΗΣΕΩΝ 3 Ο ΜΑΘΗΜΑ. ΟΙ ΜΕΓΑΛΕΣ ΕΠΙΧΕΙΡΗΣΕΙΣ Η δημιουργία μεγάλων επιχειρήσεων είναι ένα από τα χαρακτηριστικά του 20 ου αιώνα.
Graphing in the Coordinate Plane
Improv: Let’s go on a picnic and take….
Lecture2 Regular Language
GETNS Says NO TO BULLYING
Fractions: What They Mean, and Equivalent Forms
The Perfect Marriage! Ephesians 5:21-33.
Algebra 1 Notes Lesson 4-1: The Coordinate Plane
Graphing / Plotting Points Review
The Numbers … 5.
Jaya Krishna, M.Tech, Assistant Professor
The Numbers … 5.
CS 154, Lecture 4: Limitations on DFAs (I),
بنــام خــدا.
The Numbers … 5.
The Coordinate Plane -5 5.
Nondeterministic Finite Automata
Minimal DFA Among the many DFAs accepting the same regular language L, there is exactly one (up to renaming of states) which has the smallest possible.
The Numbers … 5.
Transition Diagrams Lecture 3 Fri, Jan 21, 2005.
DFA Equivalence & Minimization
DFA Minimization: The Idea
The Numbers … 5.
The Numbers … 5.
De Morgan’s laws presentation
Как да кандидатстваме по НИФ
ОПЕРАТИВНА ПРОГРАМА “ИНОВАЦИИ И КОНКУРЕНТОСПОСОБНОСТ“ „Подобряване на производствения капацитет в МСП“
The Numbers … 5.
Objective - To graph ordered pairs on the coordinate plane.
The Numbers … 5.
Go over homework – Practice Sheet 3-2 & 3-3 evens only
Numbers
Solving Equations 3x+7 –7 13 –7 =.
Lecture 12 Non-Regular Languages
The Numbers … 5.
Regular Language Equivalence and DFA Minimization
The Numbers … 5.
Example Make x the subject of the formula
The Numbers … 5.
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:

Minimizing DFA’s By Partitioning

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

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?

S2 and S7 are really the same: Both Final states Both go to S6 under input b Both go to S3 under an a S0 and S5 really the same. Why? We say each pair is equivalent Are there any other equivalent states? We can merge equivalent states into 1 state

Partitioning Algorithm First Divide the set of states into Final and Non-final states Partition I Partition II a b S0 S1 S4 S5 S2 S3 S6 S7 *S2 *S7

Partitioning Algorithm Now See if states in each partition each go to the same partition S1 & S6 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 S0 S1 I S4 I S1 S5 I S2 II S3 S3 I S3 I S4 S1 I S5 S6 S7 II *S2 S6 I *S7

Partitioning Algorithm b S0 S1 S4 S5 S3 S2 S6 S7 *S2 *S7

Partitioning Algorithm Now again See if states in each partition each go to the same partition In Partition I, S3 goes to a different partition from S0, S5 and S4 We’ll move S3 to its own partition a b S0 S1 III S4 I S5 S3 S3 I S4 S1 S5 I S2 II S6 S7 II *S2 S6 III *S7

Partitioning Algorithm b S0 S1 III S4 I S5 S4 S3 S3 IV S1 S5 I S2 II S6 S7 II *S2 S6 III *S7 Note changes in S6, S2 and S7

Partitioning Algorithm Now S6 goes to a different partition on an a from S1 S6 gets its own partition. We now have 5 partitions Note changes in S2 and S7 a b S0 S1 III S4 I S5 S4 S3 S3 IV S1 S5 I S2 II S6 S7 II *S2 S6 V *S7

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 S0 S1 III S4 I S5 S4 S3 S3 IV S1 S5 I S2 II S6 S7 II *S2 S6 V *S7

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

b b b V b a a a a b a b