Non-Deterministic Space is Closed Under Complementation

23
Non-Deterministic Space is Closed Under Complementation Neil Immerman Richard Szelepcsenyi Presented By: Subhajit Dasgupta

description

Non-Deterministic Space is Closed Under Complementation. Neil Immerman Richard Szelepcsenyi Presented By: Subhajit Dasgupta. Background. 1960: Myhill first defined the Linear Bounded Automata (LBA) Chomskey defined the formal languages: - PowerPoint PPT Presentation

Transcript of Non-Deterministic Space is Closed Under Complementation

Page 1: Non-Deterministic Space is Closed Under Complementation

Non-Deterministic Space is Closed Under Complementation

Neil ImmermanRichard Szelepcsenyi

Presented By:Subhajit Dasgupta

Page 2: Non-Deterministic Space is Closed Under Complementation

Background 1960: Myhill first defined the Linear Bounded Automata

(LBA)

Chomskey defined the formal languages:Regular, Context-Free, Context-Sensitive and Recursively Enumerable

1962: CFL are exactly the languages accepted by non-deterministic push down automata

1963: Landweber showed every set of languages accepted by deterministic Linear Bounded Automata was a CSL

1964: Kuroda’s Theorem;CSL=NSPACE[n]

Page 3: Non-Deterministic Space is Closed Under Complementation

LBA Problem:

I. Are the languages accepted by deterministic and Non-Deterministic LBA the same ?

DCSL=NDCSL ?

II. If So Is family of CSL is closed under Complementation?

Page 4: Non-Deterministic Space is Closed Under Complementation

NSPACE

Complexity classes correspond to bounds on resources

One such resource is space: the number of tape cells a TM uses when solving a problem

For any function f(n), we define:

SPACE(f(n))={ L : L is decidable by deterministic O(f(n)) space TM}

NSPACE(f(n))={ L : L is decidable by a non-deterministic O(f(n)) space TM}

Page 5: Non-Deterministic Space is Closed Under Complementation

Immerman-Szelepcsenyi Theorem

NSPACE{f(n)} is closed under complementation for f(n)≥log{n)

Settles the question raised by KurodaThe family of CSL is closed under complementation

NSPACE=DSPACE ?

Page 6: Non-Deterministic Space is Closed Under Complementation

Steps to TheoremLemma1 Suppose we are given an NSPACE[s(n)] machine M, a size

s(n), initial configuration, START, and the exact number N of configurations of size s(n) reachable by M from START. Then We can test in NSPACE[s(n)] if M rejects

Lemma 2 Given START, as in Lemma 1, we calculate N – the total

number of configurations of size s(n) reachable by M from START – in NSPACE[s(n)].

Theorem For any s(n)≥log(n),

NSPACE[s(n)] =co-NSPACE[s(n)]

Page 7: Non-Deterministic Space is Closed Under Complementation

Proof Idea For any nondeterministic log-space machine, and

any input x, construct, in log space, a graph G whose nodes are the possible configurations, and whose edges are the possible transitions.

Then the machine accepts x iff some path from the node corresponding to the start configuration leads to the node corresponding to the accepting configuration. Call This problem PATH.

Show PATH NSPACE[log(n)], clearly PATH is NSPACE[log(n)] complete.

Page 8: Non-Deterministic Space is Closed Under Complementation

…Proof Idea Define PATH Then the machine accepts x iff there is

no path from the node corresponding to the start configuration to any of the nodes s to the node corresponding to the accepting configurations.

Show PATH NSPACE[log(n)]

Page 9: Non-Deterministic Space is Closed Under Complementation

Configuration Graph

A Computation of a NTM M on an input x can be described by a graph GMx:

t

the start configuratio

n

(u,v)E if M can move from u to v in one step

A vertex per configuratio

n

the accepting configuration

s

Page 10: Non-Deterministic Space is Closed Under Complementation

PATH Instance: A directed graph G and two vertices s,tV. Problem: To decide if there is any path from s to t. PATH NL Proof Idea: we prove it by showing a

nondeterministic log space algorithm for PATH This TM starts at node s and nondeterministically

guesses the steps of a path form s to t. It records only the position of the current node at

each step on the work tape, not entire path and nondeterministically selects the next node from among those pointed at by the current node.

Repeat this action until reaches node t and accepts, or until it has gone on for m steps and rejects.

Page 11: Non-Deterministic Space is Closed Under Complementation

Algorithm

Start at s For i = 1, .., |V| {

Non-deterministically choose a neighbor and jump to it

Accept if you get to t }

If you got here – reject

Page 12: Non-Deterministic Space is Closed Under Complementation

PATH Instance: A directed graph G and two vertices s,tV. Problem: To decide if there is no path from s to t.

Clearly, PATH is co-NL Complete.(Because PATH is NL-Complete)

If we can show it is also in NL, then NL=co-NL

Page 13: Non-Deterministic Space is Closed Under Complementation

Algorithm We’re going to do this

inductively, Define A(i) = the

collection of nodes reachable from s in i steps, c(i) = |A(i)|. We are looking for c(m) where m is the number of nodes in the graph

Base case: A(0) = {s} and c(0) = 1. For each node v in G Go through all nodes

and guess whether each node is in A(i)

For each u verified to be in A(i), test if (u, v) is an edge of G. If it is, v is in A(i+1)

Count nodes number verified to be in A(i), computation branch rejects if is not c(i).

Repeat until we get c(m) = |A(m)|

v

u

A(i)

Page 14: Non-Deterministic Space is Closed Under Complementation

From c(i) to c(i+1)

For every node v in G, Go through all the nodes of G and guess whether each one

is in A(i). For each node u that is guessed to be in A(i), verify it by guessing a path from s to u in i steps. If the verification fails, reject that branch of the computation.

Count all nodes verified to be in A(i). If the number counted is not c(i), which means not all of A(i) have been found, then reject this branch of the computation.

Now we find all the nodes in A(i), count them, and check whether each on has an edge to v.

We keep a running tally of the nodes in A(i) and compare each one with v as we go, deleting each one before writing the next, and somewhere keeping a number of how many of the nodes of G we’ve checked for membership in A(i).

Page 15: Non-Deterministic Space is Closed Under Complementation

Is u verified reachable from s?

Yes

No

Is u = t?

reject

reject

Yes

No

Is d = c?

Accept

Reject

Yes

No

Increase d,

Go to next node

Page 16: Non-Deterministic Space is Closed Under Complementation

Construct M: Guess reachable nodes from s

for each node u in G, M non-deterministically guesses if u is reachable from s.

If it guesses it is, then it verifies by guessing a path of length m from s to u. If the verification fails, reject that computation branch.

If, at any point, we guess that t is reachable from s, we reject. Keep counting how many nodes have been verified as d

– again, we have to delete them after checking them to avoid linear space.

After checking and guessing all nodes of G, we compare d with c. If d is not equal to c, we did not guess all reachable nodes from s, so we reject this branch of computation.

If d = c, and t has not been guessed, then we have guessed all the nodes reachable from s on the graph G, and t was not among them, so we accept.

Page 17: Non-Deterministic Space is Closed Under Complementation

Algorithm On input <G, s, t> Let c(0) = 1 For I = 0 to m – 1:

Let c(i+1)=0 Let d=0 For each node v in G:

For each node u in G Nondeterministically either perform or skip these steps:

Nondeterministically follow a path of length i from s and if none of the nodes encountered are u, reject.

Increment d If (u, v) is an edge of G, increment c(i + 1). Repeat for next node v

If d is not equal with c(i), reject For each node u in G:

Nondeterministically either perform or skip these steps: Nondeternimistically follow a path of length m from s and if none of the nodes

encountered are u, reject If u = t, the reject Increment d

If d is not equal with c(m), reject; otherwise, accept.

Page 18: Non-Deterministic Space is Closed Under Complementation

Space Complexity

At any time, this algorithm only needs to store c(i), d, i, m and a pointer to the head of a path.

It runs in log space.

Page 19: Non-Deterministic Space is Closed Under Complementation

Corollary 1 The Class of Context Sensitive Language is

closed under Complementation

Proof: According to Kuroda’s theorem CSL=NSPACE[n], for all L CSL

Now, NSPACE[s(n)]=CO-NSPACE[s(n)]For all s(n)≥log(n)

=> CSL is closed under complementation

Page 20: Non-Deterministic Space is Closed Under Complementation

Corollary 2 NSPACE[log(n)]= (FO+pos TC) = (FO+TC) Any formula in (FO+TC) may be expressed in the form TC[ ](0,max),

where is the quantifier free first order formula and 0 and max are constants.

Proof. It follows from an earlier proof where the same author proved: NL=(FO+pos TC) and NL can be expressed in the form TC[ ](0,max),

FO=First Order LogicTC=Transitive Closure(FO+pos TC)=set of properties expressible using positive applications of TC, i.e. not using any negation sign

Page 21: Non-Deterministic Space is Closed Under Complementation

Reference[1]Neil Immerman, “Non-deterministic Space is closed under

complementation”[2] J.Hartmanis and H.B. Hunt, III, “The LBA Problem”[3] Neil Immerman, “Languages that Capture Complexity Classes”[4] S.Y. Kuroda, “Classes of Languages and Linear-Bounded

Automata”

Page 22: Non-Deterministic Space is Closed Under Complementation

Questions

Page 23: Non-Deterministic Space is Closed Under Complementation

Assignment

How FO and (FO+TC) is related to NL complexity. Please explain.