Download presentation
Presentation is loading. Please wait.
Published byTheodore Moore Modified over 8 years ago
1
Lecture 11 Minimization Topics: Strings distinguishing states Equivalence relation October 6, 2008 CSCE 355 Foundations of Computation
2
– 2 – CSCE 355 Fall 2008 Last Time: Readings section 3.1,3.2(skip DFA RE), 3.3 Questions onTEST 1 – September 29 th Post-class make-up for problem 1 DFA RegExpr NFA DFA Algebraic Laws for Regular Expressions Languages are sets so inherit some properties Associativity, commutivity of + Identity, Annihilator Checking for Equality of Two Regular Expressions r,s Closure properties of regular languages: Intersection, complementNew: ReversalReadings section 3.1,3.2(skip DFA RE), 3.3 Ruby: Matching in files
3
– 3 – CSCE 355 Fall 2008 Homework P 124 3.5 Which are true which are false. If false provide a counterexample R(S+T) = RS +RT (R*)* = R* (R*S*)* = (R+S)* (R+S)* = R*+S* S(RS+S)*R = RR*S(RR*S)* (RS+R)*R = R(SR+R) 2.4.4.2
4
– 4 – CSCE 355 Fall 2008 Ruby Matching in Files ### Pattern match from pickaxe book f = File.open("testfile") f.each do |line| puts line puts line if line =~ /Perl|Python/ if line =~ /Perl|Python/ puts "Scripting language mentioned: #{line}" puts "Scripting language mentioned: #{line}" end endendf.close
5
– 5 – CSCE 355 Fall 2008 To follow the construction precisely or to wing it Construction shortcuts (simplifications less states). Now Consider a* b*
6
– 6 – CSCE 355 Fall 2008 Induction Proofs in text
7
– 7 – CSCE 355 Fall 2008 Review Relations Again Reflexive Irreflexive Symmetric Asymmetric Anti-symmetric Transitive Total Injection Surjection Function Equivalence relation
8
– 8 – CSCE 355 Fall 2008 Strings distinguishing states A string x in Σ * distinguishes two states q 1 and q 2 if one of δ( q 1, x) and δ( q 2,x) is a final state and one if not. Examples What string distinguishes q 1 and q 2 in the DFA? What string distinguishes q 3 and q 2 ? Graphically
9
– 9 – CSCE 355 Fall 2008 Indistinguishable states Two states are indistinguishable if there is no string that distinguishes them What if we change the DFA to δ ( q 1,0) = q 3 δ ( q 1,1) = q 1 Then and are not distinguished by any string Then q 1 and q 2 are not distinguished by any string
10
– 10 – CSCE 355 Fall 2008 Indistinguishable is an Equivalence relation A relation is an Equivalence relation if 1.. 2.. 3.. Indistinguishable is an Equivalence relation Prove Indistinguishable is an Equivalence relation Proof: Let
11
– 11 – CSCE 355 Fall 2008
12
– 12 – CSCE 355 Fall 2008 Figure 4.8 DFA page 156 Consider the DFA Table of inequivalences B C D E F G H ABCDEFG
13
– 13 – CSCE 355 Fall 2008 Partitions Equivalence class of x denoted [x] Π = {X 1, X 2, … X n } is a partition of a set S if. If R is an equivalence relation on a set S then R induces a partition on S which means the equivalence classes form a partition
14
– 14 – CSCE 355 Fall 2008 Refinement of a partition
15
– 15 – CSCE 355 Fall 2008 Minimization of DFA 1.First eliminate states not reachable from the start state 2.Start with initial partition Π = { F, Q-F } 3.For each X in Π refine X by Considering a in Σ such that two states are in the same subgroup
16
– 16 – CSCE 355 Fall 2008
17
– 17 – CSCE 355 Fall 2008 Strings distinguishable
18
– 18 – CSCE 355 Fall 2008
19
– 19 – CSCE 355 Fall 2008
20
– 20 – CSCE 355 Fall 2008 Not all Languages are regular
21
– 21 – CSCE 355 Fall 2008
22
– 22 – CSCE 355 Fall 2008 Pumping Lemma
23
– 23 – CSCE 355 Fall 2008 Every finite language is Regular
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.