Recursive and Recursively Enumerable Languages-Theory of Automata-Lecture Slides, Slides of Theory of Automata

This lecture was delivered by Sufi Tabsum Gul at Pakistan Institute of Engineering and Applied Sciences, Islamabad (PIEAS) for Theory of Automata course. it includes: Recursively, Enumerable, Languages, Machine, Theorem, Proof, Observation, Turing

Typology: Slides

2011/2012

Uploaded on 07/11/2012

sobia
sobia 🇵🇰

4.8

(14)

24 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Recursively Enumerable
and
Ri L
1
R
ecurs
i
ve
L
Based on slides by Costas Busch [http://csc.lsu.edu/~busch]
Recursive Languages
Definition:
A recursive language L is a formal language for which there
exists a TM that will halt and accept an input string in L, and
halt and reject, otherwise.
El
E
xamp
l
e:
The decision problem of determining whether a natural
number is a perfect square (represented by using the string
an) is decidable.
2
Recursive Languages
Let L be a recursive language and M the Turing Machine
that accepts it
For string :
If then halts in a final state
Lw
w
M
If then halts in a non-final state
Costas Busch -RPI 3
Lw
M
Recursively Enumerable Languages
Definition:
A language is recursively enumerable if some Turing
machine accepts it
Let L be a recursively enumerable language and M the
T i M hi th t t it
T
ur
i
ng
M
ac
hi
ne
th
a
t
accep
t
s
it
For string :
If then halts in a final state
If then halts in a non-final state and loops
forever
Costas Busch -RPI 4
Lw
Lw
M
M
w
Non Recursively Enumerable
We will prove:
1. There is a specific language which is not recursively
enumerable (not accepted by any Turing Machine)
2. There is a specific language which is recursively
bl b t t i
enumera
bl
e
b
u
t
no
t
recurs
i
ve
Costas Busch -RPI 5
Type-0 Languages
(Recursively Enum.
)
Recursive
Languages
T
Technical Note:
Type-1 languages explicitly
exclude the null string.
All other language
families permit the null
string as a member.
(The Venn diagram is
in slight error because
of this technicality.)
Context-Free Languages
6
T
ype-
(Context-sensitive)
Languages
Typ e - 2
(Context-free)
Languages
Typ e - 3
(Regular)
Languages
Linear
(Context-free)
Languages
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Recursive and Recursively Enumerable Languages-Theory of Automata-Lecture Slides and more Slides Theory of Automata in PDF only on Docsity!

Recursively Enumerable

and

R i L

1

Recursive L

Based on slides by Costas Busch [http://csc.lsu.edu/~busch]

Recursive Languages

Definition:

A recursive language L is a formal language for which there

exists a TM that will halt and accept an input string in L, and

halt and reject, otherwise.

EExample: l

The decision problem of determining whether a natural

number is a perfect square (represented by using the string

an) is decidable.

2

Recursive Languages

Let L be a recursive language and M the Turing Machine

that accepts it

For string :

If then halts in a final state

w ∈ L

w

M

If then halts in a non-final state

Costas Busch - RPI 3

w ∉ L

M

Recursively Enumerable Languages

Definition:

A language is recursively enumerable if some Turing

machine accepts it

Let L be a recursively enumerable language and M the

TTuring Machine that accepts it i M hi th t t it

For string :

If then halts in a final state

If then halts in a non-final state and loops

forever

Costas Busch - RPI 4

w ∈ L

w ∉ L

M

M

w

Non Recursively Enumerable

We will prove:

  1. There is a specific language which is not recursively

enumerable (not accepted by any Turing Machine)

  1. There is a specific language which is recursively

enumerable but not recursivebl b t t i

Costas Busch - RPI 5

Type-0 Languages

(Recursively Enum.)

Recursive

Languages

T 1

Technical Note:

Type-1 languages explicitly

exclude the null string.

All other language

families permit the null

string as a member.

(The Venn diagram is

in slight error because

of this technicality.)

Context-Free Languages

6

Type-

(Context-sensitive)

Languages

Type-

(Context-free)

Languages

Type-

(Regular)

Languages

Linear

(Context-free)

Languages

Recursively Enumerable

Non Recursively Enumerable

7

Recursive

A Language which

is not

Recursively Enumerable

Costas Busch - RPI 8

Recursively Enumerable

Non Recursively Enumerable

  • We want to find a language that is Non Recursively

Enumerable

  • This language is not accepted by any Turing Machine

Costas Busch - RPI 9

Non Recursively Enumerable

Consider alphabet

{ a }

Strings: a , aa , aaa , aaaa ,K

1

a

2

a

3

a

4

a

L

Costas Busch - RPI 10

Consider Turing Machines

that accept languages over alphabet { a }

They are countable:

, , , , K

1 2 3 4

M M M M

Non Recursively Enumerable

Example language accepted by

L ( M ) { aa , aaaa , aaaaaa }

i

2 4 6

L M a a a

i

i

M

Costas Busch - RPI 11

Alternative representation

1

a

2

a

3

a

4

a

5

a

6

a

7

a

i

LM

L

L

Non Recursively Enumerable

1

a

2

a

3

a

4

a

1

LM

L

0 1 0 1 L

Costas Busch - RPI 12

2

LM

3

LM

1 0 0 1 L

0 1 1 1 L

4

L M

L

1

a

2

a

3

a

4

a

1

LM

L

L

2

LM

L ( M )

L

Costas Busch - RPI 19

3

L M

0 1 1 1 L

4

L M

0 0 0 1 L

Question:?

1

M M

k

1

a

2

a

3

a

4

a

1

LM

L

L

2

LM

L ( M )

L

Costas Busch - RPI 20

3

L M

0 1 1 1 L

4

L M

0 0 0 1 L

Answer:

1

M M

k

1

1

1

a L M

a LM

k

1

a

2

a

3

a

4

a

1

LM

L

L

2

LM

L ( M )

1 0 0 1 L

Costas Busch - RPI 21

3

L M

L

4

L M

0 0 0 1 L

Question:

2

M M

k

1

a

2

a

3

a

4

a

1

LM

L

L

2

LM

L ( M )

1 0 0 1 L

Costas Busch - RPI 22

3

L M

L

4

L M

0 0 0 1 L

Answer:

2

M M

k

2

2

2

a L M

a LM

k

1

a

2

a

3

a

4

a

1

LM

L

0 1 0 1 L

2

LM

L ( M )

1 0 0 1 L

Costas Busch - RPI 23

3

L M

0 1 1 1 L

4

L M 0 0 0 1 L

Question:?

3

M M

k

1

a

2

a

3

a

4

a

1

LM

L

0 1 0 1 L

2

LM

L ( M )

1 0 0 1 L

Costas Busch - RPI 24

3

L M

0 1 1 1 L

4

L M 0 0 0 1 L

Answer:

3

M M

k

3

3

3

a L M

a LM

k

Non Recursively Enumerable

Similarly:

k i

M ≠ M for any i

Because either:

Costas Busch - RPI 25

i

i

k

i

a LM

a LM

i

i

k

i

a LM

a LM

or

Non Recursively Enumerable

Therefore, the machine cannot exist. Therefore, the

language is not recursively enumerable

Observation:

There is no algorithm that describes (otherwise

ld b t d b T i M hi )

k

M

L

L

would be accepted by some Turing Machine)

Costas Busch - RPI 26

Recursively Enumerable

Non Recursively Enumerable

L

27

Recursive

A Language which is

Recursively Enumerable

and not Recursive

Costas Busch - RPI 28

and not Recursive

We want to find a language which

Is recursively

enumerable

But not

recursive

Costas Busch - RPI 29

There is a Turing

Machine that accepts

the language

The machine

doesn’t halt

on some input

We will prove that the language

i

i i

L = a a ∈ LM

Is recursively enumerable but not recursive

Costas Busch - RPI 30

Therefore:

L is recursive

But we know:

Costas Busch - RPI 37

L

is not recursively enumerable

thus, not recursive

CONTRADICTION!!!!

Therefore, is not recursive

L

Recursively Enumerable

Non Recursively Enumerable

L

L

38

Recursive

Turing acceptable languages

and

Enumeration Procedures

Costas Busch - RPI 39

Enumeration Procedures

We will prove:

If a language is recursive then there is an

enumeration procedure for it

(weak result)

Costas Busch - RPI 40

A language is recursively enumerable if and only if

there is an enumeration procedure for it

(strong result)

Theorem:

If a language is recursive then there is an

enumeration procedure for it

L

Costas Busch - RPI 41

Proof:

M

M

Enumeration Machine

Costas Busch - RPI 42

M

M

Accepts

L

Enumerates all

strings of input alphabet

If the alphabet is then can enumerate

strings as follows:

{ a , b }

M

a

b

aa

ab

Costas Busch - RPI 43

ba

bb

aaa

aab

Enumeration procedure

Repeat:

M

generates a string

M

w

checks if w ∈ L

Costas Busch - RPI 44

M checks if w ∈ L

YES: print w to output

NO: ignore

w

End of Proof

Example:

M

a

b

aa

L ( M )

b

L ={ b , ab , bb , aaa ,....}

Enumeration

Output

b

Costas Busch - RPI 45

aa

ab

ba

bb

aaa

aab

ab

bb

aaa

ab

bb

aaa

Theorem:

If language is recursively enumerable then

there is an enumeration procedure for it

L

Costas Busch - RPI 46

Proof:

M

M

Enumeration Machine

Costas Busch - RPI 47

M

M

Accepts L

Enumerates all

strings of input alphabet

If the alphabet is then can enumerate

strings as follows:

{ a , b } M

a

b

aa

Costas Busch - RPI 48

ab

ba

bb

aaa

aab

Proof:

w

Input Tape

Machine that

accepts L

Costas Busch - RPI 55

Enumerator

for L

Compare

Turing machine that accepts L

Repeat:

Using the enumerator,

For input string w

Costas Busch - RPI 56

generate the next string of

L

Compare generated string with w

If same, accept and exit loop

End of Proof

We have proven:

A language is recursively enumerable if and only if

there is an enumeration procedure for it

Costas Busch - RPI 57

Technical Note:

Type-1 languages explicitly

exclude the null string.

All other language

families permit the null

string as a member.

(The Venn diagram is

in slight error because

of this technicality.)

Context-Free Languages

Type-0 Languages

(Recursively Enum.)

Recursive

Languages

T 1

Non Recursively Enumerator)

58

Type-

(Regular)

Languages

Type-

(Context-sensitive)

Languages

Type-

(Context-free)

Languages

Linear

(Context-free)

Languages