Docsity

Cook-Levin Theorem - Computability - Lecture Slide, Slides of Computer Science

Partial preview of the text

Download Cook-Levin Theorem - Computability - Lecture Slide and more Slides Computer Science in PDF only on Docsity!

1

The Cook-Levin Theorem

2

Agenda

Proof from definition that CSAT is NP - complete (Cook-Levin Theorem) CSAT P 3SAT so 3SAT is NP - complete

4

Notation for NTM Branching

A: b= 2.

This means that computation trees are binary:

0 1 2 3

a|bR bR a|bR (^) • L

0ababa a0baba ab0aba ab1aba aba0ba abab0a abab1a

aba2ba crash ababa0•

crash

ababa2• abab 3 a• Docsity.com

5

Notation for NTM Branching

Given a state q and tape-symbol a in a NTM, d(q,a ) is a set of possible state-symbol-direction outputs. Order this set and let the k ’th possibility be denoted by: where q’, a’ and D are the transition’s output. When less than k possibilities were defined, just add transitions that go directly to the reject state and write blank: Q: What are below?

δ (^) k ( q , a )  ( q ', a ', D )

0 1 2 3

bR a|bR (^) • L

δ (^) k ( q , a )  ( q reject ,,L) δ 1 ( 0 , b ), δ 2 ( 0 , b ) andδ 2 ( 0 , a ) a|bR

7

Boolean Uniqueness

Expression

Let’s give some handy boolean expression in conjunctive normal form:

The uniqueness expression U says

that exactly one of its arguments is true:

Here stands for the conjunction over

all possible i,j.

Q: Why is each a 2-clause?

  

      

   n i j i j

n i j

n i x x x x x

U x x x i x

, 1 ,

1 2

1 2 ( ) ( )

( , , , ) "! , true"

 

n

i , j 1

( xi   xj ) Docsity.com

8

Boolean Uniqueness

Expression

A: and are logically equivalent.

Q: What is the size of U in terms of the

number of variables?

( xi   xj ) (  xi  xj )

10

Cook-Levin Theorem

THM: Suppose we are given a NTM N and a

string w of length n which is decided by N

in f (n) or fewer nondeterministic steps.

Then there is an explicit cnf formula f of

length O (f (n)^3 ) which satisfiable iff N

accepts w. In particular, when f (n) is a

polynomial, f has polynomial length in

terms of n so that every language in NP

reduces to CSAT in polynomial time. Thus CSAT is NP -hard. Finally, as CSAT is in NP , CSAT is NP -complete.

11

Confusing Indices

The most confusing thing about the proof of the Cook-Levin Theorem are all the indices. We use the following conventions:

a – index for letters in tape alphabet

q – index for NTM states

i – index for tape cells

t – index for computation step (time)

k – index for branching choice

Q: How many choices for each index?

13

Variables for

Simulating NTM Computation

T-variables will track the possible

symbols on the tape cells at each step in computation

Tt,i,a = true iff at time t, i’ th cell reads a

S-variables will track the active state at

each step in computation

St,q = true iff at time t in state q

14

Variables for

Simulating NTM Computation

H-variables gives the head’s position

Ht,i = true iff at time t reading i’ th cell

C-variables gives the nondeterministic

choice at each step in computation

Ct,k = true iff at time t +1 take choice k

16

Boolean Expressions for

Simulating NTM Computation

Ending configuration should accept:

φ end  S f ( n ), q accept

17

Boolean Expressions for

Simulating NTM Computation

At each time step t :

A. Machine is in a unique state:

B. Each tape cell has a unique symbol:

( )

0

φA ( , )

f n

t

Uq Q St q

 

 G

( )

0

( )

1

φB ( , , )

f n

t

f n

i

Ua Tt i a

19

Boolean Expressions for

Simulating NTM Computation

F. If already rejected, reject at t+1:

G. Cells which aren’t being read remain

the same at time t+1:

Q: Why can (x  y  z ) be considered a

clause?

  G

( ) 1

0

( )

1

φG ( , , , 1 , , )

f n

t

f n

i a

Ht i Tt i a Tt i a

( ) 1

0

φF , reject 1 , reject

f n

t

St q St q

20

Boolean Expressions for

Simulating NTM Computation

A: (x  y  z ) is logically equivalent to

( x   y  z )