Cpt S 317: Spring 2009 Reading: Chapters 1-4

Slides:



Advertisements
Similar presentations
Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
Advertisements

Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Regular Expressions and DFAs COP 3402 (Summer 2014)
1 Midterm I review Reading: Chapters Test Details In class, Wednesday, Feb. 25, :10pm-4pm Comprehensive Closed book, closed notes.
CS21 Decidability and Tractability
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Final Course Review Reading: Chapters Objectives Introduce concepts in automata theory and theory of computation Identify different formal language.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Regular Expressions Hopcroft, Motawi, Ullman, Chap 3.
CHAPTER 1 Regular Languages
CMSC 330: Organization of Programming Languages Finite Automata NFAs  DFAs.
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
1 Regular Expressions Reading: Chapter 3. 2 Regular Expressions vs. Finite Automata Offers a declarative way to express the pattern of any string we want.
CS 203: Introduction to Formal Languages and Automata
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
Finite Automata Chapter 1. Automatic Door Example Top View.
CSCI 3130: Formal languages and automata theory Tutorial 1 Lee Chin Ho.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 2 Context-Free Languages Some slides are in courtesy.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Regular Expressions CS 130: Theory of Computation HMU textbook, Chapter 3.
1 Introduction to the Theory of Computation Regular Expressions.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Lecture 2 Compiler Design Lexical Analysis By lecturer Noor Dhia
1 Chapter 2 Finite Automata (part a) Hokkaido, Japan.
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
Formal Language & Automata Theory
Cpt S 317: Spring 2009 Reading: Chapter 3
CIS Automata and Formal Languages – Pei Wang
Closed book, closed notes
Standard Representations of Regular Languages
CSE 105 theory of computation
Non Deterministic Automata
PROPERTIES OF REGULAR LANGUAGES
Regular Expressions.
Recognizer for a Language
Chapter 2 FINITE AUTOMATA.
Intro to Theory of Computation
Cpt S 317: Spring 2009 Reading: Chapters 1-9
Hierarchy of languages
Non-deterministic Finite Automata (NFA)
Course 4 Finite Automata (part 2)
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
Lecture3 DFA vs. NFA, properties of RL
Non-Deterministic Finite Automata
Principles of Computing – UFCFA3-30-1
Non-Deterministic Finite Automata
Definitions Equivalence to Finite Automata
Finite Automata Reading: Chapter 2.
Definitions Equivalence to Finite Automata
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
CSCI 2670 Introduction to Theory of Computing
Chapter 4 Properties of Regular Languages
CS21 Decidability and Tractability
CS21 Decidability and Tractability
Instructor: Aaron Roth
Definitions Equivalence to Finite Automata
Chapter 1 Regular Language
Cpt S 317: Spring 2009 Reading: Chapters 1-4
CSE 105 theory of computation
CHAPTER 1 Regular Languages
CHAPTER 1 Regular Languages
Lexical Analysis Uses formalism of Regular Languages
Presentation transcript:

Cpt S 317: Spring 2009 Reading: Chapters 1-4 Midterm I review Reading: Chapters 1-4 School of EECS, WSU

Test Details In class, Wednesday, Feb. 25, 2015 3:10pm-4pm Cpt S 317: Spring 2009 Test Details In class, Wednesday, Feb. 25, 2015 3:10pm-4pm Comprehensive Closed book, closed notes School of EECS, WSU

Syllabus Formal proofs Finite Automata Regular expressions Cpt S 317: Spring 2009 Syllabus Formal proofs Finite Automata NFA, DFA, -NFA Regular expressions Regular languages & properties Pumping lemma for regular languages School of EECS, WSU

Finite Automata Deterministic Finite Automata (DFA) Cpt S 317: Spring 2009 Finite Automata Deterministic Finite Automata (DFA) The machine can exist in only one state at any given time Non-deterministic Finite Automata (NFA) The machine can exist in multiple states at the same time -NFA is an NFA that allows -transitions What are their differences? School of EECS, WSU

Deterministic Finite Automata Cpt S 317: Spring 2009 Deterministic Finite Automata A DFA is defined by the 5-tuple: {Q, ∑ , q0,F, δ } Two ways to define: State-diagram (preferred) State-transition table DFA construction checklist: Associate states with their meanings Capture all possible combinations/input scenarios break into cases & subcases wherever possible Are outgoing transitions defined for every symbol from every state? Are final/accepting states marked? Possibly, dead/error-states will have to be included depending on the design. School of EECS, WSU

Non-deterministic Finite Automata Cpt S 317: Spring 2009 Non-deterministic Finite Automata A NFA is defined by the 5-tuple: {Q, ∑ , q0,F, δ } Two ways to represent: State-diagram (preferred) State-transition table NFA construction checklist: Has at least one nondeterministic transition Capture only valid input transitions Can ignore invalid input symbol transitions (paths will die implicitly) Outgoing transitions defined only for valid symbols from every state Are final/accepting states marked? School of EECS, WSU

NFA to DFA conversion Checklist for NFA to DFA conversion Cpt S 317: Spring 2009 NFA to DFA conversion Checklist for NFA to DFA conversion Two approaches: Enumerate all possible subsets, or Use lazy construction strategy (to save time) Introduce subset states only as needed In your solutions, use the lazy construction procedure by default unless specified otherwise. Any subset containing an accepting state is also accepting in the DFA Have you made a special entry for Φ, the empty subset? This will correspond to the dead/error state School of EECS, WSU

 -NFA to DFA conversion Cpt S 317: Spring 2009  -NFA to DFA conversion Checklist for  -NFA to DFA conversion First take ECLOSE(start state) New start state = ECLOSE(start state) Remember: ECLOSE(q) include q Then convert to DFA: Use lazy construction strategy for introducing subset states only as needed (same as NFA to DFA), but … Only difference : take ECLOSE after transitions and also include those states in the subset corresponding to your destination state. E.g., if q_i goes to {q_j, q_k}, then your subset must be: ECLOSE(q_j) U ECLOSE(q_k) Again, check for a special entry for Φ if needed School of EECS, WSU

Regular Expressions A way to express accepting patterns Cpt S 317: Spring 2009 Regular Expressions A way to express accepting patterns Operators for Reg. Exp. (E), L(E+F), L(EF), L(E*).. Reg. Language  Reg. Exp. (checklist): Capture all cases of valid input strings Express each case by a reg. exp. Combine all of them using the + operator Pay attention to operator precedence Try to reuse previously built regular expressions wherever possible School of EECS, WSU

Regular Expressions… DFA to Regular expression Cpt S 317: Spring 2009 Regular Expressions… DFA to Regular expression Enumerate all paths from start to every final state Generate regular expression for each segment, and concatenate Combine the reg. exp. for all each path using the + operator Reg. Expression to  -NFA conversion Inside-to-outside construction Start making states for every atomic unit of RE Combine using: concatenation, + and * operators as appropriate For connecting adjacent parts, use  -transitions Remember to note down final states School of EECS, WSU

Regular Expressions… Algebraic laws Commutative Associative Cpt S 317: Spring 2009 Regular Expressions… Algebraic laws Commutative Associative Distributive Identity Annihiliator Idempotent Involving Kleene closures (* operator) School of EECS, WSU

English description of lang. Cpt S 317: Spring 2009 English description of lang. Finite automata  english description Regular expression  english description “English description” should be similar to how we have been describing languages in class E.g., languages of strings over {a,b} that end in b; or Languages of binary strings that have 0 in its even position, etc. Thumbrule: the simpler the description is, the better. However, make sure that the description should accurately capture the language. School of EECS, WSU

Pumping Lemma Purpose: Regular or not? Verification technique Cpt S 317: Spring 2009 Pumping Lemma Purpose: Regular or not? Verification technique Steps/Checklist for Pumping Lemma (in order): Let N  pumping lemma constant Choose a template string w in L, such that |w|≥N. (Note: the string you choose should depend on N. And the choice of your w will affect the rest of the proof. So select w judiciously. Generally, a simple choice of w would be a good starting point. But if that doesn’t work, then go for others.) Now w should satisfy P/L, and therefore, all three conditions of the lemma. Specifically, using conditions |xy|≤N and y, try to conclude something about the property of the xy part and y part separately. Next, use one of these two below strategies to arrive at the conclusion of xykzL (for some value of k): Pump down (k=0) Pump up (k >= 2) Note: arriving at a contradiction using either pumping up OR down is sufficient. No need to show both. School of EECS, WSU

Working out pumping lemma based proofs as a 2-player game: Cpt S 317: Spring 2009 Working out pumping lemma based proofs as a 2-player game: Steps (think of this 2-party game): Good guy (us) Bad guy (someone else) Claims L is regular Builds w using N (without assuming any particular value of N) => Knows N and has the freedom to choose any value of N≥1 Tries to break the third condition of P/L without assuming any particular {x,y,z} split this is done by first pumping down (k=0) if that does not work, then try pumping up (k≥2) Comes up with {x,y,z} combination, s.t. w=xyz (again, has the freedom to choose any xyz split, but meeting the two conditions of P/L: i.e., |xy|≤N and y) School of EECS, WSU

GOOD LUCK!