Download presentation
Presentation is loading. Please wait.
1
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections:1.1 page 44 September 8, 2006
2
CS 310 – Fall 2006 Pacific University Quick Review Deterministic Finite Automata: 5-tuple (Q, ∑, δ,q 0, F) Q: finite set of states ∑: alphabet (finite set) δ : transition function (δ: Qx∑ -> Q) q 0 : start state F : accepting states (subset of Q) Language A is regular if there exists a Finite Automata that recognizes A.
3
CS 310 – Fall 2006 Pacific University Regular Operations on Languages Given two languages, A,B, we can create new languages in a variety of ways: Union Concatenation Kleene star Intersection Complement
4
CS 310 – Fall 2006 Pacific University Examples ∑={a,…,z}, A={good,bad}, B={boy,girl} A union B = AB = A* = A intersection B = A’ =
5
CS 310 – Fall 2006 Pacific University Closure of Regular Languages A collection of objects is closed under some operation if applying the operation to members of that collection returns an object still in that collection –Integer addition, for example. Others? Given two regular languages, A,B, under the regular operations, are the resulting languages also regular? Yes (hard to prove for some operations)
6
CS 310 – Fall 2006 Pacific University Proof Theorem 1.25: The class of regular languages is closed under the union operation. If A and B are regular languages, so is A U B. What do we need to prove? What does regular mean? What does it mean for A U B to be regular?
7
CS 310 – Fall 2006 Pacific University Proof Theorem 1.26: The class of regular languages is closed under the concatenation operation. If A and B are regular languages, so is AB. What do we need to prove? What does regular mean? What does it mean for AB to be regular?
8
CS 310 – Fall 2006 Pacific University Examples A = {north,south} B= {east,west} w = northeast is in AB many ways to break down this string If the AB machine breaks the string as nort and heast the string will not be accepted A = {w | w = begins with 1 ends with 0} B = {w | w = begins with 0 ends with 1} w = 1000011
9
CS 310 – Fall 2006 Pacific University Nondeterminism DFA: state diagram has exactly one exiting arrow on each state for each letter of the alphabet Nondeterministic Finite Automata: state diagram can have none, one or many exiting arrows for each state and each letter of the alphabet, and will often be running several processes at once. 1 1 q0q0 q1q1 q2q2 –Input can cause the machine to be one or more states at once.
10
CS 310 – Fall 2006 Pacific University NFA Transitions indicated by ε are performed automatically without any input When entering a state with an ε-transition, you simultaneously begin running two processes. They start at: 1) Current state 2) Result of the ε-transition Why would we ever use this? –NFAs and DFAs recognize the same class of languages –Sometimes easier to build NFA for a language
11
CS 310 – Fall 2006 Pacific University Example 0, ε 1 q1q1 q2q2 q3q3 0,1 q4q4 1 Does this NFA accept 010110? What sequence of states does it go through?
12
CS 310 – Fall 2006 Pacific University Proof Theorem 1.26: The class of regular languages is closed under the concatenation operation. If A and B are regular languages, so is AB. NFA! We will get back to this after more practice with NFAs.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.