MA/CSSE 474 Decision Problems about Regular Languages

Slides:



Advertisements
Similar presentations
CMPS 3223 Theory of Computation
Advertisements

The Big Picture Chapter 3. We want to examine a given computational problem and see how difficult it is. Then we need to compare problems Problems appear.
1 Module 25 Decision problems about regular languages –Basic problems are solvable halting, accepting, and emptiness problems –Solvability of other problems.
MA/CSSE 474 Theory of Computation
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Finite State Machines Chapter 5. Languages and Machines.
CMPS 3223 Theory of Computation
TM Design Universal TM MA/CSSE 474 Theory of Computation.
MA/CSSE 474 Theory of Computation DFSM Canonical Form Proof of NDFSM  DFSM ALGORITHM (as much as we have time for) This version includes the "answers"
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
Decidable Questions About Regular languages 1)Membership problem: “Given a specification of known type and a string w, is w in the language specified?”
MA/CSSE 474 Theory of Computation Enumerability Reduction.
Poetry The Pumping Lemma Any regular language L has a magic number p And any long-enough word in L has the following property: Amongst its first p symbols.
MA/CSSE 474 Theory of Computation Decision Problems DFSMs.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
Nondeterministic Finite State Machines Chapter 5.
Finite State Machines Chapter 5. Languages and Machines.
Algorithms and Decision Procedures for Regular Languages Chapter 9.
MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping.
MA/CSSE 474 Theory of Computation Languages, prefixes, sets, cardinality, functions.
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
TM Macro Language MA/CSSE 474 Theory of Computation.
Decidability and Undecidability Proofs
CSE 105 theory of computation
L1= { w  {a,b}* : w consists of all strings that begin with an even number of a's followed by an odd number of b's. } L2= { w  {a,b}* : the number of.
MA/CSSE 474 Theory of Computation
More on showing L non-regular
Properties of Regular Languages
FORMAL LANGUAGES AND AUTOMATA THEORY
MA/CSSE 474 Decision Problems Languages, Machines, Computation
Languages, prefixes, sets, cardinality, functions
(Universal Turing Machine)
LIMITS OF ALGORITHMIC COMPUTATION
MA/CSSE 474 Theory of Computation
Two issues in lexical analysis
Turing Machines Acceptors; Enumerators
How Hard Can It Be?.
COSC 3340: Introduction to Theory of Computation
Chapter Nine: Advanced Topics in Regular Languages
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
Bottom-up parsing Pumping Theorem for CFLs
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation
Languages, prefixes, sets, cardinality, functions
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation Computation FSM Intro.
MA/CSSE 474 Theory of Computation
CSCI 2670 Introduction to Theory of Computing
MA/CSSE 474 Theory of Computation
Pushdown Automata (PDA) Part 2
MA/CSSE 474 Theory of Computation Nondeterminism NFSMs.
More on showing L non-regular
MA/CSSE 474 Theory of Computation
MA/CSSE 474 DFSM to RE Theory of Computation
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
Minimize # states in a DFSM
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation
More About Nondeterminism
Answer Questions about Exam2 problems
MA/CSSE 474 Theory of Computation
Computation Chapter 4.
CSE 105 theory of computation
Presentation transcript:

MA/CSSE 474 Decision Problems about Regular Languages Theory of Computation Decision Problems about Regular Languages Slides 8-10 were hidden for 201220. I unhid for 201240, should probably hide again for 201420

Your Questions? Previous class days' material Reading Assignments HW 9 problems Next Tuesday's exam Anything else

Functions from one Language to Another Let chop(L) = {w : xL ( x = x1cx2, x1  L*, x2  L*, c  L, |x1| = |x2|, and w = x1x2)} Is the set of regular languages closed under chop? Finish up this example from yesterday Chop(a*db*) = AnBn ∪ {aidbj : i+j is odd} Its intersection with a*b* is not regular, so it is not regular. L chop(L)  a*b* a*db* Chop(a*db*) = AnBn and also strings of the form aidbj where i+j is an odd number The intersection of this with A*B* is not regular, so it is not regular.

Functions from One Language to Another Let maxstring(L) = {w: w  L, z * (z    wz  L)} Is the set of regular languages closed under maxstring? Practice exercise for later L maxstring(L)  a*b* ab*a a*b*a

Summary of algorithms we have so far The next few slides are here for reference. I do not expect to spend class time on them. You should know how to do all of them, but during class exercises and homework you may simply "call" any of them as part of your decision procedures. ● Operate on FSMs without altering the language that is accepted: ● ndfsmtodfsm(M: NDFSM) ● minDFSM (M:DFSM) ● buildFSMcanonicalform(M:FSM)

Summary of Algorithms ● Compute functions of languages defined as FSMs: ● Given FSMs M1 and M2, construct a FSM M3 such that L(M3) = L(M2)  L(M1). ● Given FSMs M1 and M2, construct a new FSM M3 such that L(M3) = L(M2) L(M1). ● Given FSM M, construct an FSM M* such that L(M*) = (L(M))*. ● Given a DFSM M, construct an FSM M* such that L(M*) = L(M). ● Given two FSMs M1 and M2, construct an FSM M3 such that L(M3) = L(M2)  L(M1). L(M3) = L(M2) - L(M1). ● Given an FSM M, construct an FSM M* such that L(M*) = (L(M))R. ● Given an FSM M, construct an FSM M* that accepts letsub(L(M)).

Algorithms, Continued ● Converting between FSMs and regular expressions: ● Given a regular expression , construct an FSM M such that: L() = L(M) ● Given an FSM M, construct a regular expression  ● Algorithms that implement operations on languages defined by regular expressions: any operation that can be performed on languages defined by FSMs can be implemented by converting all regular expressions to equivalent FSMs and then executing the appropriate FSM algorithm.

Algorithms, Continued ● Converting between FSMs and regular grammars: ● Given a regular grammar G, construct an FSM M such that: L(G) = L(M) ● Given an FSM M, construct a regular grammar G L(G) = L(M). We have not yet discussed regular grammars. They are in the reading assignment for tomorrow. This is here for completeness.

Decision Procedures A decision procedure is an algorithm whose result is a Boolean value (in this course's context, sometimes we will write "yes" or "no" instead of "true" or "false"). It must: ● Halt, no matter what (correctly typed) input it is given. ● Always give the correct answer Usually a decision procedure has one or more parameters Zero-parameter decision procedures are not very interesting!

Simple decision procedure: Regular Language Membership Given a DFSM M=(Κ,Σ, δ, s, A) and a string w  Σ*, is w  L(M)?

Answering Specific Questions Given two regular expressions 1 and 2, is: (L(1)  L(2)) – {}  ? 1. From 1, construct an FSM M1 such that L(1) = L(M1). 2. From 2, construct an FSM M2 such that L(2) = L(M2). 3. Construct M such that L(M ) = L(M1)  L(M2). 4. Construct M such that L(M) = {}. 5. Construct M such that L(M ) = L(M ) - L(M). 6. If L(M ) is empty return False; else return True. (in today's exercises, you'll write an algorithm for step 6) For practice later: Given two regular expressions 1 and 2, are there at least 3 strings that are generated by both of them?

Decision Procedures for Regular Languages ● Given a regular expression  and a string w, is w in L()? ● Given a FSM M, is L(M) empty? ● Given a FSM M, does L(M) = M*? ● Given a FSM M, is L(M) finite? ● Given a FSM M, is L(M) infinite? ● Given two FSMs M1 and M2, are they equivalent? ● Given an DFSM M, is M minimal? (Do this with a group of three students)