0% found this document useful (0 votes)
21 views16 pages

Closure Properties of Decidable and Turing Recognizable Languages

Uploaded by

f20211307
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views16 pages

Closure Properties of Decidable and Turing Recognizable Languages

Uploaded by

f20211307
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Closure Properties of Decidable and

Turing Recognizable Languages

Shashank Gupta
Associate Professor
Disruptive Technologies Lab
Department of Computer Science & Information Systems
Profile Web Page Link
Today’s Agenda
• Computing Power of DTM and NTM
• Closure Properties of Decidable and Turing recognizable languages

2
Configuration Path

Given a Turing machine M and an input x to M, the configuration


graph of M on x, denoted as GM,x is defined as follows: -
• the vertices of GM,x are the configurations of the machine M on input x, and
• there is an edge from a configuration C1 to a configuration C2 if there is a one step
transition of M from C1 to C2, on the input x.
• Hence, it is a graphical representation of the computation of M on x.

A computation path is a path in GM,x starting from the start


configuration.
• M accepts x if and only if there is a path from the start configuration to an accept
configuration in GM,x
CS F351 Theory of Computation
3
Properties of Configuration Path

If M is deterministic then the outdegree of GM,x is at most one. On the


other hand, if M is nondeterministic then the outdegree can be arbitrary.
• A vertex in GM,x has outdegree zero if and only if it corresponds to an accept or reject
configuration.

Technically, GM,x can be infinite, however if the size of the tape is


bounded, then GM,x is finite.
• Although by definition GM,x contains all possible configurations, but we will usually
be interested in only those configurations in GM,x that are reachable from the start
configuration.

CS F351 Theory of Computation


4
Acceptance and Rejection Mechanism
Accept
• If any branch of the computation accepts, then the NTM will accept.

Reject
• If all branches of the computation halt and reject (i.e., no branches accept but all
computations halt), then the NTM will reject

Loop
• Computation continues. Some branches in the computation history are infinite.

5
Equivalence of Deterministic and Nondeterministic TMs

Every NTM has an equivalent DTM.

Approach
• Simulate N.
• Simulate all branches of computation.
• Search for any way N can Accept.
6
Equivalence of Deterministic and Nondeterministic TMs

The class of languages accepted by deterministic TMs is the same as the class of
languages accepted by nondeterministic TMs.
• One direction is trivial since deterministic TMs are also nondeterministic TMs.
• To see the other direction, consider a NDTM N.
• We will give the rough sketch of the design of a deterministic TM M, such that L(M) = L(N).

Let x be an input. The machine M essentially does a breadth first search on the
configuration graph GN,x by traversing it in a level wise manner.
• M maintains a queue data structure which initially has a start configuration.
• In every iteration, M dequeues a configuration and enqueues all its children into the queue.
• If an accept configuration is encountered at any stage then them M halts and accepts.
• If the queue becomes empty (that is all configurations reachable from the start configuration are
traversed) then M halts and rejects.
CS F351 Theory of Computation
7
Closure Properties of Decidable and
Turing Recognizable Languages

Shashank Gupta
Associate Professor
Disruptive Technologies Lab
Department of Computer Science & Information Systems
Profile Web Page Link
Union for Decidable Languages

Decidable languages are closed under union


• Suppose L1 and L2 are two decidable languages accepted by halting TMs M1
and M2 respectively.
• The machine M for L1 ∪ L2 will be designed as follows:

Given an input x, simulate M1 on x.


If M1 accepts then accept, else simulate M2 on x. If M2 accepts
then accept else reject.
• Hence, L(M) = L1 ∪ L2
CS F351 Theory of Computation
9
Union for Turing Recognizable Languages

Now suppose L1 and L2 are two Turing recognizable languages


accepted by TMs M1 and M2 respectively.
• Since L1 and L2 are Turing recognizable languages, therefore for strings that
do not belong to these languages, the corresponding machines may not even
halt.

The previous design of machine will not work because we can


have a scenario where M2 accepts x but M1 loops forever.

CS F351 Theory of Computation


10
Union for Turing Recognizable Languages...

Design of Machine M: Simultaneously simulate M1 and M2 on


input x.
• In other words, we design a machine M that executes one step of M1, followed by
one step of M2, then again one step of M1 and so on.

If either M1 or M2 accept x then M must accept.


If both reject, then M should reject.
• Similarly, if one machine rejects and another machine goes into an infinite loop,
then machine M must go into an infinite loop.
• Hence, L(M) = L1 ∪ L2
CS F351 Theory of Computation
11
Concatenation for Turing Recognizable Languages

Suppose L1 and L2 are two Turing recognizable languages accepted by


TMs M1 and M2 respectively.
The design of TM M for input x is as follows
• Non-deterministically partition x = x1 x2

Simulate M1 on x1. If M1 rejects, then reject


if M1 accepts then simulate M2 on x2.
if M2 accepts then accept else reject.
• Hence L(M) = L1. L2
12
CS F351 Theory of Computation
Intersection for Turing Recognizable Languages

Suppose L1 and L2 are two turing recognizable languages via TMs


M1 and M2 respectively.
The design of TM M on input x is as follows:
• Simulate M1 on x. If M1 rejects, then reject.

If M1 accepts, then simulate M2 on x, if M2 accepts then accept, else


reject.

• Hence, L(M) = L1 ∩ L2
CS F351 Theory of Computation
13
Complement under Decidable Languages

Assume L is decidable via a halting TM M


The design of M` is as follows:
• For input x, simulate M on x.

If M accepts then reject else accept.

• Hence L(M`) = L`
CS F351 Theory of Computation
14
Complement under Turing Recognizable Languages

Turing recognizable languages are not closed


under complement operation.

Theorem: A language L is decidable if both L and


L` are Turing recognizable.

CS F351 Theory of Computation


15
Proof Idea

If L is decidable then it is Turing recognizable. Moreover, since decidable


languages are closed under complement, L` is also Turing recognizable.
• Suppose L is Turing recognizable via a TM M and L is Turing recognizable via a TM M`

Given an input x, simulate x on both the machines M and M`


simultaneously
• If M accepts then accept and if M` accepts then reject.
• Observe that since the string x either belongs to L` or L therefore one of the two machines
must accept x.

CS F351 Theory of Computation


16

You might also like