Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Decidable Problems about Regular Languages | CS 215, Study notes of Computer Science

Material Type: Notes; Class: THEORY OF COMPUTATION; Subject: Computer Science; University: University of California-Riverside; Term: Unknown 1989;

Typology: Study notes

2009/2010

Uploaded on 03/28/2010

koofers-user-9uf-1
koofers-user-9uf-1 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Decidability
CS215, Lecture 7 c
1999 Mitsunori Ogihara 1
Decidable Problems About Regular Languages
The Acceptance Problem for DFA
Define
is a DFA that accepts input string
.
Here we assume a fixed encoding scheme for
and
.
Theorem.
is decidable.
Proof A Turing machine can, given an input
, try to decode
into
an NFA
and a string
. If the decoding is successful then it can test
whether
accepts
by simulating
on
.
CS215, Lecture 7 c
1999 Mitsunori Ogihara 2
The Acceptance Problem for NFA
Define
is an NFA that accepts input string
.
Theorem.
is decidable.
Proof Given an input
, try to decode
into an NFA
and a string
.
If “successful” then:
1. Convert
to a DFA
.
2. Run the machine for
on
. If the machine accepts, then
accept; otherwise reject.
CS215, Lecture 7 c
1999 Mitsunori Ogihara 3
The Acceptance Problem for Regular Exp.
Define
is a regular expression that produces
.
Theorem.
is decidable.
Proof Given an input
, try to decode
into a regular expression
and a string
. If “successful” then:
1. Convert
to a DFA
.
2. Run the machine for
on
. If the machine accepts, then
accept; otherwise reject.
CS215, Lecture 7 c
1999 Mitsunori Ogihara 4
pf3

Partial preview of the text

Download Decidable Problems about Regular Languages | CS 215 and more Study notes Computer Science in PDF only on Docsity!

Decidability CS215, Lecture 7 c 1999 Mitsunori Ogihara Decidable Problems About Regular Languages The Acceptance Problem for DFA Define

^ 

is a DFA that accepts input string . Here we assume a fixed encoding scheme for

and . Theorem.

is decidable. Proof A Turing machine can, given an input

, try to decode

into an NFA

and a string

. If the decoding is successful then it can test whether

accepts by simulating

on . CS215, Lecture 7 c 1999 Mitsunori Ogihara The Acceptance Problem for NFA Define

^ 

is an NFA that accepts input string . Theorem.

^ 

is decidable. Proof Given an input

, try to decode

into an NFA

and a string . If “successful” then:

  1. Convert

to a DFA

.

  1. Run the machine for

^ 

on

. If the machine accepts, then accept ; otherwise reject . CS215, Lecture 7 c 1999 Mitsunori Ogihara 3 The Acceptance Problem for Regular Exp. Define

is a regular expression that produces . Theorem.

is decidable. Proof Given an input

, try to decode

into a regular expression

and a string

. If “successful” then: 1. Convert

to a DFA

.

  1. Run the machine for

on

. If the machine accepts, then accept ; otherwise reject . CS215, Lecture 7 c 1999 Mitsunori Ogihara 4

The Emptiness Problem for DFA Define

^ 

is a DFA that accepts no string . Theorem.

^ 

is decidable. Proof Given an input

, try to decode a DFA

out of

. If “successful” then: 1. Mark the start state of

.

Repeat until no new states are marked:

Mark any unmarked state that has a transition from a marked state

  1. Accept if no final state is marked ; reject otherwise. CS215, Lecture 7 c 1999 Mitsunori Ogihara The Equivalence Problem for DFA Define

^ 

and

are DFA that accept the same language . Theorem.

^ 

is decidable. Proof Given a string

, try to decode

into a pair of DFAs

and . If “successful” then construct a DFA

that accepts the symmetric difference of

^ 

and

, 

^ 

^ 

^ ,

and test the emptiness of

.  

CS215, Lecture 7 c 1999 Mitsunori Ogihara The Acceptance Problem for CFG Define

is a CFG that generates . Theorem.

is decidable. Proof Given an input

, try to decode

into a CFG

and a string . If “successful” then:

  1. Convert

to an equivalent Chomsky normal form grammar

%^ &

.

  1. List all derivations with

steps, where

.

  1. If any of the listed derivations generate , then accept ; otherwise, reject. CS215, Lecture 7 c 1999 Mitsunori Ogihara 7 The Emptiness Problem for CFG Define

is a CFG such that

. Theorem.

is decidable. Proof Given

, first try to decode a grammar

out of it. If “pass” then test the ability of generating terminal strings:

Mark all the terminals .

  1. Repeat the following until no new symbols are marked:

Mark any variables

with a production

such that all symbols in are marked .

Accept if the start symbol is marked; reject otherwise. CS215, Lecture 7 c 1999 Mitsunori Ogihara 8