1/23/2010 Problems A problem (in Computer Science) specifies an input/output relationship, P I O . A Constant-Space Model of Computation for First-Order Queries (input) (output) P Steven Lindell How are input/output represented as data? Haverford College USA 1 2 Multiplication Transitive Closure Example: Example: (not first-order) (not first-order) MSB LSB E V V ordering matters d n -1 · · · d 0 order invariant unordered ordered e n -1 · · · e 0 data are strings graphs bits p 2 n -1 · · · · · · p 0 E + V V data are relations matrix operation (independent of simultaneous row/column permutations) 3 4 Complexity: Logical expressibility Complexity: Machine Computability input data output data input data output data M ( finite string ) ( finite string ) ( finite structure ) ( finite relation ) program formula is {SO, FP, FO} construct-bounded M is {time/space} resource-bounded. [ semantic restriction ] [ syntactic restriction ] 5 6 1
1/23/2010 Logical Definability Logical Framework Finite relational structure: second-order = polynomial-hierarchy A , R 1 , …, R k , Q fixed-point (<) = polynomial-time = P first-order (+, *) = constant (parallel) time L relations finite domain query (defines a new relation) First-order queries: = constant (serial) space x , y , z , … individual variables (over A ) =, R i atomics , , boolean connectives x , x quantification (over A ) 7 8 Example: Graph Simplicity Example: Linear Ordering G = V , E directed graph: E V V (binary relation) total linear order: Simplicity: ( x < x ) irreflexive ( x V )[ E ( x , x )] ( x y ) [( x < y ) ( y < x )] no self-loops total ( y )( z )[ E ( y , z ) E ( z , y ) [( x < y ) ( y < z )] ( x < z ) undirected edges transitive 9 10 Binary String Structures Arithmetic & bit {0, 1, …, n 1}, <, U Definition: For w {0, 1}*, | w |, <, bit, { i : w i = 1} where indicates the set of positions orders the bit( i , j ) the j th bit of i is 1 (numerical predicate) locations of positions 0’s and 1’s Example: w = 1010 is represented by 0 < 1 < … < (n 1) {0, 1, 2, 3}, <, {0, 2} , with 0 < 1 < 2 < 3. n , +, 0 a , b , c < n a b = c a + b = c < < < 0 1 2 3 11 12 2
1/23/2010 Examples Logspace Computation n is even? FO(+) \ FO(<) Off-line Turing machine (sub-linear space): n is prime? FO(+, ) \ FO(+) size = n read-only input tape a ^ b = c FO(+, ) heads FO(<, bit) = FO(+, ) read/write work tape finite control PARITY FO(any numerical predicates, U ) [FSS] space = O (log n ) (asks if | U | is even) space = O (1) 13 14 Bidirectional multi-head DFA Constant (parallel) time Circuit model (non-uniform): AC 0 read-only input tape . . . … constant n inputs finite state control depth . polynomial . size … … Each head can be thought of as an integer . “cursor” holding log n bits of storage, so this model is equivalent to logspace. inputs w/ negations 15 16 PRAM model (uniform) Regular Languages resolve conflicts in various ways On word models global read/write memory REG = mSO(<) . . . star-free REG = FO(<) O ( n O (1) ) processors FO(+, ) = PRAM( O (1) time) [Immerman] 17 18 3
1/23/2010 Inclusions Finite-State Machines EQUAL= { w : equal # of 0’s and 1’s} ALOGTIME\... FSM : read-only input tape ALOGTIME single oblivious head single scan (uniform NC 1 ) flip/flops & gates finite-state control PARITY = MIDDLE = FO(<,bit) REG { w : even # of 1’s} {0 n 1 n : n = 0, 1, …} REG\FO(<,bit) FO(<,bit) \REG Chart finite automata proposed model I/O access single scan multiple passes FO(<,mod) control state machine restricted mechanism EVEN = { w : | w | # is even} FO(<,mod) 19 20 Proposed Model Constant-Space Machine (hardware) read-only input tape . . . multiple oblivious heads fixed no. of heads read-only input tape destructive read movement data head position . . . positional comparators boolean control binary counters calculation finite control oblivious program read-once variables relative, absolute • multiple heads / multiple passes • flow of information 0 • actual read/write storage single token of information : flip-flop cannot be split or shared • uniform version of formula width (constant-width circuit (one bit) 1 ( a quantum bit )? with fan-out one) 21 22 Sample Program: Parity Constant-Space Program (software) b boolean variable Compute the parity of a = a 1 … a n : I[ h ] input bit under head h i < j head i is left of head j bit( i , j ) j th bit of head i ’s counter AND, OR, NOT to form expressions p := 0; {initialize} b := e boolean assignment LOOP h {LSB to MSB} P ; Q ; sequential composition LOOP h sequential iteration p := a ( h ) XOR p ; {exclusive-or} P ; (head h scans whole tape) IF e THEN P ; conditional (not allowed) Note: p violates the read-once condition in . • Program syntax guarantees: obliviousness ; read - once • Finiteness implies: constant-space ; polynomial-length 23 24 4
1/23/2010 Sample Program: Binary addition Main Result Binary addition : a n … a 1 + b n … b 1 = c s n … s 1 Theorem: A ( binary ) language L {0, 1}* is recognizable c := 0; {initialize carry} by a read-once constant-space program if and LOOP h {from LSB to MSB} only if it is definable by a first-order formula s ( h ) := a ( h ) XOR b ( h ) XOR c with arithmetic c := a ( h ) AND b ( h ) OR c AND (( a ( h ) OR b ( h )) • c in output statement doesn’t count since s is write-only • c occurs once in re-parenthesized majority function 25 26 Time / Space Duality Carry look-ahead (binary addition) Corollary (Duality principle): A problem is 𝑡 𝑗 = 𝑏 𝑗 ⊕ 𝑐 𝑗 ⊕ 𝑑 𝑗 where computable by a read-once constant-space serial algorithm if and only if it is computable by a carry generate constant-time parallel algorithm [ extends 𝑑 𝑗 = ∃𝑘 [𝑘 < 𝑗 ∧ 𝑏 𝑘 ∧ 𝑐 𝑘 ∧ previously known duality to below O ( log n )]. (∀𝑙)[𝑘 < 𝑙 < 𝑗 → 𝑏 𝑙 ∨ 𝑐 𝑙 ]] carry propagate 28 29 Extensions Question TC 0 Is there a uniform, deterministic, sequential Constant-depth threshold circuits: model of computation for VT(<, )? What is the • output on iff more output dual to the serial algorithm for multiplication ? than k inputs are on threshold (see Slide 1 for picture) gate • k = 0 OR gate > k ∙∙∙ • k = n − 1 AND gate n inputs s := 0 {initialize partial sum} LOOP i FROM 0 TO 2* n -1 {LSB to MSB of answer} Variable threshold logic (uniform TC 0 ): VT LOOP j FROM 0 TO i {do sum for ith column} s := s + d(j)*e(i-j ) {add next term} (∃ >𝑗 𝑦)𝜄(𝑦) 0 ≤ 𝑗 ≤ 𝑜 − 1 p ( i ) := s mod 2 {product bit} s := s div 2 {carry to next column} threshold quantifier existential universal 30 31 5
Recommend
More recommend