More on DFA minimization and DFA equivalence

Slides:



Advertisements
Similar presentations
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Properties.
Advertisements

Summary Showing regular Showing non-regular construct DFA, NFA
3.2 Pumping Lemma for Regular Languages Given a language L, how do we know whether it is regular or not? If we can construct an FA to accept the language.
Examples for Finite Automata
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Fall 2006Costas Busch - RPI1 Regular Expressions.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
CS 310 – Fall 2006 Pacific University CS310 Decidability Section 4.1/4.2 November 10, 2006.
Lecture 7 Sept 22, 2011 Goals: closure properties regular expressions.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Limitations.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1 Non-Deterministic Automata Regular Expressions.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
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.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA to regular.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Closure.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NFA to DFA.
Decidable Questions About Regular languages 1)Membership problem: “Given a specification of known type and a string w, is w in the language specified?”
Prof. Busch - LSU1 NFAs accept the Regular Languages.
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NFA to.
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
Theory of Computing CSCI 356/541 Lab Session. Outline Lab 1: Finite Automata  Construct and Run Construct and Run  Manipulating Transitions Manipulating.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA minimization.
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
CSE 202 – Formal Languages and Automata Theory 1 REGULAR EXPRESSION.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
Theory of Computation Automata Theory Dr. Ayman Srour.
Nondeterminism The Chinese University of Hong Kong Fall 2011
LR(k) grammars The Chinese University of Hong Kong Fall 2009
Non Deterministic Automata
Formal Language & Automata Theory
Reducibility The Chinese University of Hong Kong Fall 2010
Single Final State for NFA
Chapter 2 FINITE AUTOMATA.
LR(1) grammars The Chinese University of Hong Kong Fall 2010
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
Non Deterministic Automata
Finite Automata.
4b Lexical analysis Finite Automata
NFAs, DFAs, and regular expressions
Decidable and undecidable languages
Chapter 1 Regular Language - 02
NP-completeness The Chinese University of Hong Kong Fall 2008
More undecidable languages
4b Lexical analysis Finite Automata
LR(1) grammars The Chinese University of Hong Kong Fall 2011
NFA to DFA conversion and regular expressions
Non-regular languages
Non-regular languages
Chapter 1 Regular Language
Pushdown automata The Chinese University of Hong Kong Fall 2011
More undecidable languages
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
DFA minimization The Chinese University of Hong Kong Fall 2011
Finite Automata Fall 2018.
Nondeterminism The Chinese University of Hong Kong Fall 2010
Presentation transcript:

More on DFA minimization and DFA equivalence The Chinese University of Hong Kong Fall 2008 CSC 3130: Automata theory and formal languages More on DFA minimization and DFA equivalence Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130

Example Construct a DFA over alphabet {0, 1} that accepts those strings that end in 111 This is big, isn’t there a smaller DFA for this? q000 1 q00 1 q001 q0 1 … q01 … qe 1 q101 q10 … 1 q1 … 1 q11 1 q111 1

Smaller DFA Yes, we can do it with 4 states: 1 q0 q1 q2 q3

No smaller DFA! Last time we saw that In fact, it is also true that There is no DFA with 3 states for L This is the unique 4-state DFA for L 1 q0 q1 q2 q3

Theorem The DFA M found by the minimization algorithm is the unique minimal DFA for L Proof outline Suppose there are two minimal DFAs M, M’ for L In both M and M’, every pair of states is distinguishable M M’ q0 q0’

Proof outline for uniqueness If M and M’ are not the same, there must be states q1, q2 of M and q’ of M’ like this: For some strings u and v M M’ u q1 q’ q0 q0’ u, v v q2

Proof outline for uniqueness Since q1 and q2 are distinguishable, there is a string w such that But in M’ this cannot happen! M’ M’’ u q1 w q’ w ? u, v v q2 w

Testing equivalence of DFAs Two DFAs are called equivalent if they accept the same language q00 q0 1 1 q01 qe 1 q10 1 1 q1 1 q11 1 1 1 qA qB qC 1

Testing equivalence of DFAs How can we tell if M and M’ are equivalent? Algorithm for testing DFA equivalence: Run DFA minimization algorithm on M Run DFA minimization algorithm on M’ Check that M and M’ are the same

Example Do the following two NFAs accept the same language? 0,1 0,1 1 1 q0 q1 q0 1 1 q1

Answer We cannot run minimization procedure on NFAs But we can convert both NFAs to DFA and test equivalence regular expression NFA DFA