190 likes | 288 Views
Solving SAT. Two kinds of (computing) problems. “Calculator” problems Problems solvable using the application of a set of well-defined operations ( functions ). “Search” problems Problems solvable only through search --- no “straightforward” operations can be used. 0. a. OR. 1. b. ?.
E N D
Two kinds of (computing) problems “Calculator” problems Problems solvable using the application of a set of well-defined operations (functions). “Search” problems Problems solvable only through search --- no “straightforward” operations can be used.
0 a OR 1 b ? AND a’ 1 OR 1 b Evaluating a Boolean function ? a ? b 1 a’ ? ? b Inverting a Boolean function SAT = satisfiability of Boolean formulae Input: A Boolean formula such as (a+b) (a’+b) Question: Is there an assignment (of 0s and 1s) to the variables (a and b) such that the formula evaluates to 1?
SAT = satisfiability of Boolean formulae A satisfiable formula: (a + c+ e’) (b’) (b + c + d + e) (d’ + e) Can be satisfied with a = 0; b = 0; c = 1; d = 0; e = 0. An un-satisfiable formula: (a) (a’ + b) (a’ + b’) (b’ + c)
7919 ? multiply 5839 ? 46239041 factor ? A similar “inverting” problem Traditionally, these “inverting” problems are solved by viewing them as search problems.
Setting up inputs and observe outputs Can we set up the “output” and maneuver “input” settings? A different approach to invert functions
No one publishes papers On CAT, RAT or BAT; Why so many on SAT? Patience! For, there is a reason: Stephen Cook, the mighty mathematician Proved that “anything” can be expressed as SAT-- Even CAT, RAT and BAT! SAT: much ado about nothing?
(a + b) (a’ + b) a = 0 a = 1 b = 0 b = 1 b = 0 b = 1 Search tree for a SAT instance; a path (leading to a leaf) might correspond to a “solution”. SAT is NP-complete GO TO label-1(deterministic computer’s version) GO TO {label-1, label-2} (non-deterministic computer’s version)
SAT: expressing BAT, CAT & RAT A Boolean circuit can simulate any T-step computation of a digital computer (a Turing machine).
50c 50c 50c 50c . . . A B C D E $1 50c 50c 50c . . . $1 50c 50c A B C D . . . A C D E Boolean Circuits (don’t have memory!) Boolean Circuits (don’t have memory!) 50c $1 50c 50c 50c 50c SAT: expressing BAT, CAT & RAT
configuration0 configuration2 configuration1 0 1 configuration4 0 configuration6 1 configuration3 0 1 configuration5 config.7 config.8 config.9 config.10 config.11 config.12 config.13 1 config.14 0 0 0 1 0 1 1 Boolean Circuits (don’t have memory!) . . . SAT: expressing BAT, CAT & RAT
a b a’ b Evaluating a Boolean function a b a’ b Inverting a Boolean function Solving SAT: a different approach
OR gate AND gate a b a.b 0 0 0 1 0 0 0 1 0 1 1 1 a b a + b 0 0 0 1 0 1 0 1 1 1 1 1 Inputs (use weights): “push” = 1; “no-push” = 0 Outputs (use fluid level): “up” = 1; “down” = 0 Note: AND gates use a higher threshold (liquid-level) for signaling a 1-output Bilateral computing devices - AND, OR gates
a ~a 0 1 1 0 “see-saw” joint NOT gate Bilateral computing devices - NOT gate
Assumptions 1. The seesaw always keeps pistons one up and the other down. 2. Push inputs are “restrained” (one can use standard weights to give the exact “push” required rather than actually pushing). 3. There is a stop-cock in the apparatus (the weakest spot in the whole machinery) ready to be released if pressure exceeds a certain limit.
(~a + b) (a + b) (~a + b) (a + b) b ~a a b Solving an instance of SAT Is (~a + b)(a + b) satisfiable? a b (~a + b) (a + b) 0 0 0 1 0 0 0 1 1 1 1 1
A generic “SAT solver” 1. Using m-ary OR gates. or 2. Using k-1binary OR gates in a tree fashion to implement a (disjunctive) clause of k variables.
AND gate λ OR gates d Time complexity Speed = distance travelled / time taken t = t1 + t2 = (d/ λ) + t2 t1: time taken for the impulse to reach the pistons t2: time taken for the pistons to react (due to friction) dgrows linearly with no. of gates; t2, λ(speed of sound in water)are constants
456 450072 987 Bilateral computing Bilateral circuit element Unilateral circuit element Multiply/ Factor Bilateral element computes “both ways” at the same cost. Inherent “asymmetry” in traditional computing