
NL Completeness and Log Space Transducers
Explore the complexities of NL completeness and log space transducers in computational theory. Topics include NL vs L, NL-complete problems, log space reducibility, and more. Dive into the intricacies of log space computation and understand its impact on problem-solving methodologies.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
18.404/6.840 Lecture 20 Last time: - Games and Quantifiers - Generalized Geography is PSPACE-complete - Logspace: L and NL Today: (Sipser 8.4) - Review NL P - Review NL SPACE log2? - NL-completeness - NL = coNL
Review: log space Model: 2-tape TM with read-only input tape for defining sublinear space computation. Defn: L = SPACE log? NL = NSPACE log? doesn t count towards space used input tape read-only Log space can represent a constant number of pointers into the input. count cells used here work tape read/write Examples ? log? ?? ? } L 1. ababbaaaaaaaaaabbaba ? = ?3,?5, ?7,?22, ,? = ,? = input tape ???? NL Nondeterministically select the nodes of a path connecting ? to ?. 2. Work tape tracks corresponding locations in the input tape. the guessed path. Work tape tracks the current node on NL L L = NL? Unsolved
Review: L P Theorem: L P Proof: Say ? decides ? in space ? log? . Defn: A configuration for ? on ? is ?,?1,?2,? where ? is a state, ?1 and ?2 are the tape head positions, and ? is the work tape contents. The number of such configurations is ? ? ? log? ?? log ?= ?(??) for some ?. ?1 Therefore ? runs in polynomial time. Conclusion: ? P read-only input ? ?2 ?
Review: NL SPACE log2? Theorem: NL SPACE log2? Proof: Savitch s theorem works for log space ?(log?) Each recursion level stores 1 config = ? log? space. Number of levels = log? = ? log? . Total ? log2? space. ?0?1 ?? ? = ?? log ? aaba?7da cab ?accept
Review: NL P Theorem: NL P Proof: Say NTM ? decides ? in space ? log? . configuration graph ??,? Defn: The configuration graph ??,? for ? on ? has nodes: all configurations for ? on ? edges: edge from ?? ?? if ?? can yield ?? in 1 step. ?start ?accept iff ? accepts ? Claim: ? accepts ? iff the configuration graph ??,? has a path from ?start to ?accept ?? ?? Polynomial time algorithm ? for ?: ? = On input ? 1. Construct ??,?. [polynomial size] 2. Accept if there is a path from ?start to ?accept. Rejectif not. P NL L L = P? Unsolved
NL-completeness Check-in 20.1 If ? is a log-space transducer that computes ?, then for inputs ? of length ?, how long can ? ? be? Defn: ? is NL-complete if 1) ? NL 2) For all ? NL, ? L? (a) at most ? log? (d) at most 2? ? (b) at most ?(?) (e) any length (c) at most polynomial in ? read-only input Log-space reducibility read/write work ? Defn: A log-space transducer is a TM with three tapes: 1. read-only input tape of size ? 2. read/write work tape of size ?(log?) 3. write-only output tape ? log? write-only output Theorem: If ? L? and ? L then ? L Proof: TM for ? = On input ? 1. Compute ?(?) 2. Run decider for ? on ? ? . Output same. A log-space transducer ? computes a function ?: if ? on input ? halts with ? ? on its output tape for all ?. Say that ? is computable in log-space. Defn: ? is log-space reducible to ? (? L?) if ? m? by a reduction function that is computable in log-space. BUT we don t have space to store ?(?). So, (re-)compute symbols of ?(?) as needed. Check-in 20.1
???? is NL-complete Theorem: ???? is NL-complete Proof: 1) ???? NL 2) For all ? NL, ? L???? Let ? NL be decided by NTM ? in space ? log? . [Modify ? to erase work tape and move heads to left end upon accepting.] ??,? Give a log-space reduction ? mapping ? to ????. ? ? = ?,?,? = ??,?,?start,?accept ? ? iff ? has a path from ? to ? Here is a log-space transducer ? to compute ? in log-space. ?start ?accept ? ? = ?? ?? read-only input ? = on input ? 1. For all pairs ??,?? of configurations of ? on ?. 2. Output those pairs which are legal moves for ?. 3. Output ?start and ?accept. ? ?? ?? read/write work ? ? log? write-only output (??,?= ?3,?7, ?6,?22, ) (?start= ) (?accept= )
2??? is NL-complete Theorem: 2??? is NL-complete Proof: 1) Show 2??? NL good exercise 2) Show ???? ?2??? Give log-space reduction f from ???? to 2???. ? ?,?,? = ? For each node ? in ? put a variable ?? in ?. For each edge (?,?) in ?, put a clause (?? ??) in ? [equivalent to ?? ??]. In addition put the clauses (?? ??) and (?? ??) in ?. Show ? has an path from ? to ? iff ? is unsatisfiable. ( ) Follow implications to get a contradiction. ( ) If ? has no path from ? to ?, then assign all ?? TRUE where ? is reachable from ?, and all other variables FALSE. That gives a satisfying assignment to ?. Straightforward to show ? is computable in log-space.
NL = coNL (part 1/4) Theorem (Immerman-Szelepcs nyi): NL = coNL Proof: Show ???? NL Defn: NTM ? computes function ?: if for all ? 1) All branches of ? on ? halt with ? ? on the tape or reject. 2) Some branch of ? on ? does not reject. Check-in 20.2 Consider the statements: (1) ???? NL, and (2) Some NL-machine computes the ??? function. Theorem: If some NL-machine (log-space NTM) computes ??? , then some NL-machine computes ?. Proof: On input ?,? 1. Let ? 0 2. For each node ? 3. If ??? ?,?,? = YES, then ? ? + 1 4. If ??? ?,?,? = NO, then continue 5. Output ? (b) (2) (1) only (c) Both implications (d) Neither implication YES, if ? has a path from ? to ? NO, if not Let ??? ?,?,? = Let ? = ? ?,? = ? ??? ?,?,? = YES} Let ? = ? ?,? = |?| What implications can we prove easily? (a) (1) (2) only ? ? ? ? = Reachable nodes ? = # reachable Next: Converse of above ? = |?| Check-in 20.2
NL = coNL (part 2/4) key idea Theorem: If some NL-machine computes ?, then some NL-machine computes ??? . Proof: On input ?,?,? 1. Compute ? 2. ? 0 3. For each node ? 4. Nondeterministically go to (p) or (n) (p) Nondeterministically pick a path from ? to ? of length ?. If fail, then reject. If ? = ?, then output YES, else set ? ? + 1. (n) Skip ? and continue. 5. If ? ? then reject. 6. Output NO. [found all ? reachable nodes and none were ?} ? ? ? ? = |?|
NL = coNL (part 3/4) YES, if ? has a path ? to ? of length ? NO, if not Let ??? ??,?,? = Let ??= ???,? = ? ??? ??,?,? = YES} Let ??= ???,? = |??| Theorem: If some NL-machine computes ??, then some NL-machine computes ??? ?. Proof: On input ?,?,? 1. Compute ?? 2. ? 0 3. For each node ? 4. Nondeterministically go to (p) or (n) (p) Nondeterministically pick a path from ? to ? of length ?. If fail, then reject. If ? = ?, then output YES, else set ? ? + 1. (n) Skip ? and continue. 5. If ? ?? then reject. 6. Output NO [found all ?? reachable nodes and none were ?} ?? ? ? ??= |??|
NL = coNL (part 4/4) Theorem: If some NL-machine computes ??, then some NL-machine computes ??? ?+1. Proof: On input ?,?,? 1. Compute ? 2. ? 0 3. For each node ? 4. Nondeterministically go to (p) or (n) (p) Nondeterministically pick a path from ? to ? of length ?. If fail, then reject. If ? has an edge to ?, then output YES, else set ? ? + 1. (n) Skip ? and continue. 5. If ? ?? then reject. 6. Output NO. [found all ?? reachable nodes and none had an edge to ?} ?? ??+1 ? ? ??= |??| Check-in 20.3 Can we now show 2??? is NL-complete? (a) No. (b) Yes. Hence ???? NL On input ?,?,? 1. ?0= 1. 2. Compute each ??+1 from ?? for ? = 1 to ?. 3. Accept if ??? ?(?,?,?) = NO. 4. Reject if ??? ?(?,?,?) = YES. So ???? L 2??? thus ???? L2??? Yes: ???? L???? & ???? L 2??? Corollary: Some NL-machine computes ??+1 from ??. Check-in 20.3
Quick review of today 1. Log-space reducibility 2. L = NL? question 3. ???? is NL-complete 2??? is NL-complete 4. 5. NL = coNL