SlideShare a Scribd company logo
1 of 52
Download to read offline
The Automated-Reasoning Revolution:
from Theory to Practice and Back
Moshe Y. Vardi
Rice University
Is This Time Different? The Opportunities and
Challenges of Artificial Intelligence
Jason Furman, Chair, Council of Economic Advisers, July 2016:
“Even though we have not made as much progress recently on other
areas of AI, such as logical reasoning, the advancements in deep
learning techniques may ultimately act as at least a partial substitute
for these other areas.”
1
P vs. NP: An Outstanding Open Problem
Does P = NP?
• The major open problem in theoretical computer science
• A major open problem in mathematics
– A Clay Institute Millennium Problem
– Million dollar prize!
What is this about? It is about computational complexity – how hard it is
to solve computational problems.
2
Rally To Restore Sanity, Washington, DC, October 2010
3
Computational Problems
Example: Graph – G = (V, E)
• V – set of nodes
• E – set of edges
Two notions:
• Hamiltonian Cycle: a cycle that visits every node exactly once.
• Eulerian Cycle: a cycle that visits every edge exactly once.
Question: How hard it is to find a Hamiltonian cycle? Eulerian cycle?
4
Figure 1: The Bridges of K¨onigsburg
5
Figure 2: The Graph of The Bridges of K¨onigsburg
6
Figure 3: Hamiltonian Cycle
7
Computational Complexity
Measuring complexity: How many (Turing machine) operations does it
take to solve a problem of size n?
• Size of (V, E): number of nodes plus number of edges.
Complexity Class P: problems that can be solved in polynomial time – nc
for a fixed c
Examples:
• Is a number even?
• Is a number square?
• Does a graph have an Eulerian cycle?
What about the Hamiltonian Cycle Problem?
8
Hamiltonian Cycle
• Naive Algorithm: Exhaustive search – run time is n! operations
• “Smart” Algorithm: Dynamic programming – run time is 2n
operations
Note: The universe is much younger than 2200
Planck time units!
Fundamental Question: Can we do better?
• Is HamiltonianCycle in P?
9
Checking Is Easy!
Observation: Checking if a given cycle is a Hamiltonian cycle of a
graph G = (V, E) is easy!
Complexity Class NP: problems where solutions can be checked in
polynomial time.
Examples:
• HamiltonianCycle
• Factoring numbers
Significance: Tens of thousands of optimization problems are in NP!!!
• CAD, flight scheduling, chip layout, protein folding, . . .
10
P vs. NP
• P: efficient discovery of solutions
• NP: efficient checking of solutions
The Big Question: Is P = NP or P = NP?
• Is checking really easier than discovering?
Intuitive Answer: Of course, checking is easier than discovering, so
P = NP!!!
• Metaphor: finding a needle in a haystack
• Metaphor: Sudoku
• Metaphor: mathematical proofs
Alas: We do not know how to prove that P = NP.
11
P = NP
Consequences:
• Cannot solve efficiently numerous important problems
• RSA encryption may be safe.
Question: Why is it so important to prove P = NP, if that is what is
commonly believed?
Answer:
• If we cannot prove it, we do not really understand it.
• May be P = NP and the “enemy” proved it and broke RSA!
12
P = NP
S. Aaronson, MIT: “If P = NP, then the world would be a profoundly
different place than we usually assume it to be. There would be no special
value in ‘creative leaps,’ no fundamental gap between solving a problem and
recognizing the solution once it’s found. Everyone who could appreciate
a symphony would be Mozart; everyone who could follow a step-by-step
argument would be Gauss.”
Consequences:
• Can solve efficiently numerous important problems.
• RSA encryption is not safe.
Question: Is it really possible that P = NP?
Answer: Yes! It’d require discovering a very clever algorithm, but it
took 40 years to prove that LinearProgramming is in P.
13
Sharpening The Problem
NP-Complete Problems: hardest problems is NP
• HamilatonianCycle is NP-complete! [Karp, 1972]
Corollary: P = NP if and only if HamiltonianCycle is in P
There are thousands of NP-complete problems. To resolve the P = NP
question, it’d suffice to prove that one of them is or is not in P.
14
History
• 1950-60s: Futile effort to show hardness of search problems.
• Stephen Cook, 1971: Boolean Satisfiability is NP-complete.
• Richard Karp, 1972: 20 additional NP-complete problems– 0-1 Integer
Programming, Clique, Set Packing, Vertex Cover, Set Covering,
Hamiltonian Cycle, Graph Coloring, Exact Cover, Hitting Set, Steiner
Tree, Knapsack, Job Scheduling, ...
– All NP-complete problems are polynomially equivalent!
• Leonid Levin, 1973 (independently): Six NP-complete problems
• M. Garey and D. Johnson, 1979: “Computers and Intractability: A Guide
to NP-Completeness” - hundreds of NP-complete problems!
• Clay Institute, 2000: $1M Award!
15
Boole’s Symbolic Logic
Boole’s insight: Aristotle’s syllogisms are about classes of objects, which
can be treated algebraically.
“If an adjective, as ‘good’, is employed as a term of description, let us
represent by a letter, as y, all things to which the description ‘good’
is applicable, i.e., ‘all good things’, or the class of ‘good things’. Let
it further be agreed that by the combination xy shall be represented
that class of things to which the name or description represented by
x and y are simultaneously applicable. Thus, if x alone stands for
‘white’ things and y for ‘sheep’, let xy stand for ‘white sheep’.
16
Vardi at Univ. College Cork, Ireland, March 2017
17
Boolean Satisfiability
Boolean Satisfiability (SAT); Given a Boolean expression, using “and”
(∧) “or”, (∨) and “not” (¬), is there a satisfying solution (an assignment
of 0’s and 1’s to the variables that makes the expression equal 1)?
Example:
(¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ ¬x3 ∨ x4) ∧ (x3 ∨ x1 ∨ x4)
Solution: x1 = 0, x2 = 0, x3 = 1, x4 = 1
18
Complexity of Boolean Reasoning
History:
• William Stanley Jevons, 1835-1882: “I have given much attention,
therefore, to lessening both the manual and mental labour of the process,
and I shall describe several devices which may be adopted for saving trouble
and risk of mistake.”
• Ernst Schr¨oder, 1841-1902: “Getting a handle on the consequences
of any premises, or at least the fastest method for obtaining these
consequences, seems to me to be one of the noblest, if not the ultimate
goal of mathematics and logic.”
• Cook, 1971, Levin, 1973: Boolean Satisfiability is NP-complete.
19
Algorithmic Boolean Reasoning: Early History
• Newell, Shaw, and Simon, 1955: “Logic Theorist”
• Davis and Putnam, 1958: “Computational Methods in The
Propositional calculus”, unpublished report to the NSA
• Davis and Putnam, JACM 1960: “A Computing procedure for
quantification theory”
• Davis, Logemman, and Loveland, CACM 1962: “A machine program
for theorem proving”
DPLL Method: Propositional Satisfiability Test
• Convert formula to conjunctive normal form (CNF)
• Backtracking search for satisfying truth assignment
• Unit-clause preference
20
Modern SAT Solving
CDCL = conflict-driven clause learning
• Backjumping
• Smart unit-clause preference
• Conflict-driven clause learning
• Smart choice heuristic (brainiac vs speed demon)
• Restarts
Key Tools: GRASP, 1996; Chaff, 2001
Current capacity: millions of variables
21
S. A. Seshia 1
Some Experience with SAT Solving
Sanjit A. Seshia
Speed-up of 2012 solver over other solvers
1
10
100
1,000
Solver
Speed-up(logscale)
22
Knuth Gets His Satisfaction
SIAM News, July 26, 2016: “Knuth Gives Satisfaction in SIAM von
Neumann Lecture”
Donald Knuth gave the 2016 John von Neumann lecture at the SIAM
Annual Meeting. The von Neumann lecture is SIAM’s most prestigious
prize.
Knuth based the lecture, titled ”Satisfiability and Combinatorics”, on
the latest part (Volume 4, Fascicle 6) of his The Art of Computer
Programming book series. He showed us the first page of the fascicle,
aptly illustrated with the quote ”I can’t get no satisfaction,” from the
Rolling Stones. In the preface of the fascicle Knuth says ”The story of
satisfiability is the tale of a triumph of software engineering, blended
with rich doses of beautiful mathematics”.
23
Applications of SAT Solving in SW Engineering
Leonardo De Moura+Nikolaj Bj¨orner, 2012: Applications of Z3 at Microsoft
• Symbolic execution
• Model checking
• Static analysis
• Model-based design
• . . .
24
Verification of HW/SW systems
HW/SW Industry: $0.75T per year!
Major Industrial Problem: Functional Verification – ensuring that
computing systems satisfy their intended functionality
• Verification consumes the majority of the development effort!
Two Major Approaches:
• Formal Verification: Constructing mathematical models of systems
under verification and analyzing them mathematically: ≤ 10% of verification
effort
• Dynamic Verification: simulating systems under different testing
scenarios and checking the results: ≥ 90% of verification effort
25
Dynamic Verification
• Dominant approach!
• Design is simulated with input test vectors.
• Test vectors represent different verification scenarios.
• Results compared to intended results.
• Challenge: Exceedingly large test space!
26
Motivating Example: HW FP Divider
z = x/y: x, y, z are 128-bit floating-point numbers
Question How do we verify that circuit works correctly?
• Try for all values of x and y?
• 2256
possibilities
• Sun will go nova before done! Not scalable!
27
Test Generation
Classical Approach: manual test generation - capture intuition about
problematic input areas
• Verifier can write about 20 test cases per day: not scalable!
Modern Approach: random-constrained test generation
• Verifier writes constraints describing problematic inputs areas (based
on designer intuition, past bug reports, etc.)
• Uses constraint solver to solve constraints, and uses solutions as test
inputs – rely on industrial-strength constraint solvers!
• Proposed by Lichtenstein+Malka+Aharon, 1994: de-facto industry
standard today!
28
Random Solutions
Major Question: How do we generate solutions randomly and
uniformly?
• Randomly: We should not reply on solver internals to chose input vectors;
we do not know where the errors are!
• Uniformly: We should not prefer one area of the solution space to
another; we do not know where the errors are!
Uniform Generation of SAT Solutions: Given a SAT formula, generate
solutions uniformly at random, while scaling to industrial-size problems.
29
Constrained Sampling: Applications
Many Applications:
• Constrained-random Test Generation: discussed above
• Personalized Learning: automated problem generation
• Search-Based Optimization: generate random points of the candidate
space
• Probabilistic Inference: Sample after conditioning
• . . .
30
Constrained Sampling – Prior Approaches, I
Theory:
• Jerrum+Valiant+Vazirani: Random generation of combinatorial
structures from a uniform distribution, TCS 1986 – uniform generation
by a randomized polytime algrithm with an Σp
2 oracle.
• Bellare+Goldreich+Petrank: Uniform generation of NP-witnesses using
an NP-oracle, 2000 – uniform generation by a randomized polytime
algorithm with an NP oracle.
We implemented the BPG Algorithm: did not scale above 16 variables!
31
Constrained Sampling – Prior Work, II
Practice:
• BDD-based: Yuan, Aziz, Pixley, Albin: Simplifying Boolean constraint
solving for random simulation-vector generation, 2004 – poor scalability
• Heuristics approaches: MCMC-based, randomized solvers, etc. – good
scalability, poor uniformity
32
Almost Uniform Generation of Solutions
New Algorithm – UniGen: Chakraborty, Fremont, Meel, Seshia, V,
2013-15:
• almost uniform generation by a randomized polytime algorithms with a
SAT oracle.
• Based on universal hashing.
• Uses an SMT solver.
• Scales to millions of variables.
• Enables parallel generation of solutions after preprocessing.
33
Uniformity vs Almost-Uniformity
• Input formula: ϕ; Solution space: Sol(ϕ)
• Solution-space size: κ = |Sol(ϕ)|
• Uniform generation: for every assignment y: Prob[Output = y]=1/κ
• Almost-Uniform Generation: for every assignment y:
(1/κ)
(1+ε) ≤ Prob[Output = y] ≤ (1/κ) × (1 + ε)
34
The Basic Idea
1. Partition Sol(ϕ) into “roughly” equal small cells of appropriate size.
2. Choose a random cell.
3. Choose at random a solution in that cell.
You got random solution almost uniformly!
Question: How can we partition Sol(ϕ) into “roughly” equal small cells
without knowing the distribution of solutions?
Answer: Universal Hashing [Carter-Wegman 1979, Sipser 1983]
35
Universal Hashing
Hash function: maps {0, 1}n
to {0, 1}m
• Random inputs: All cells are roughly equal (in expectation)
Universal family of hash functions: Choose hash function randomly from
family
• For arbitrary distribution on inputs: All cells are roughly equal (in
expectation)
36
Strong Universality
Universal Family: Each input is hashed uniformly, but different inputs
might not be hashed independently.
H(n, m, r): Family of r-universal hash functions mapping {0, 1}n
to {0, 1}m
such that every r elements are mapped independently.
• Higher r: Stronger guarantee on range of sizes of cells
• r-wise universality: Polynomials of degree r − 1
37
Strong Universality
Key: Higher universality ⇒ higher complexity!
• BGP: n-universality ⇒ all cells are small ⇒ uniform generation
• UniGen: 3-universality ⇒ a random cell is small w.h.p ⇒ almost-uniform
generation
From tens of variables to millions of variables!
38
XOR-Based 3-Universal Hashing
• Partition {0, 1}n
into 2m
cells.
• Variables: X1, X2, . . . Xn
• Pick every variable with probability 1/2, XOR them, and equate to 0/1
with probability 1/2.
– E.g.: X1 + X7 + . . . + X117 = 0 (splits solution space in half)
• m XOR equations ⇒ 2m
cells
• Cell constraint: a conjunction of CNF and XOR clauses
39
SMT: Satisfiability Modulo Theory
SMT Solving: Solve Boolean combinations of constraints in an underlying
theory, e.g., linear constraints, combining SAT techniques and domain-
specific techniques.
• Tremendous progress since 2000!
CryptoMiniSAT: M. Soos, 2009
• Specialized for combinations of CNF and XORs
• Combine SAT solving with Gaussian elimination
40
UniGen Performance: Uniformity
0
50
100
150
200
250
300
350
400
450
500
160 180 200 220 240 260 280 300 320
#ofSolutions
Count
US
UniGen
Uniformity Comparison: UniGen vs Uniform Sampler
41
UniGen Performance: Runtime
0.1	
  
1	
  
10	
  
100	
  
1000	
  
10000	
  
100000	
  
case47	
  
case_3_b14_3	
  
case105	
  
case8	
  
case203	
  
case145	
  
case61	
  
case9	
  
case15	
  
case140	
  
case_2_b14_1	
  
case_3_b14_1	
  
squaring14	
  
squaring7	
  
case_2_ptb_1	
  
case_1_ptb_1	
  
case_2_b14_2	
  
case_3_b14_2	
  
Time(s)	
  
Benchmarks	
  
UniGen	
  
XORSample'	
  
Runtime Comparison: UniGen vs XORSample’
42
From Sampling to Counting
• Input formula: ϕ; Solution space: Sol(ϕ)
• #SAT Problem: Compute |Sol(ϕ)|
– ϕ = (p ∨ q)
– Sol(ϕ) = {(0, 1), (1, 0), (1, 1)}
– |Sol(ϕ)| = 3
Fact: #SAT is complete for #P – the class of counting problems for
decision problems in NP [Valiant, 1979].
43
Constrained Counting
A wide range of applications!
• Coverage in random-constrained verification
• Bayesian inference
• Planning with uncertainty
• . . .
But: #SAT is really a hard problem! In practice, quite harder than SAT.
44
Approximate Counting
Probably Approximately Correct (PAC):
• Formula: ϕ, Tolerance: ε, Confidence: 0 < δ < 1
• |Sol(ϕ)| = κ
• Prob[ κ
(1+ε) ≤ Count ≤ κ × (1 + ε) ≥ δ
• Introduced in [Stockmeyer, 1983]
• [Jerrum+Sinclair+Valiant, 1989]: BPPNP
• No implementation so far.
45
From Sampling to Counting
ApproxMC: [Chakraborty+Meel+V., 2013]
• Use m random XOR clauses to select at random an appropriately small
cell.
• Count number of solutions in cell and multiply by 2m
to obtain estimate
of |Sol(ϕ)|.
• Iterate until desired confidence is achieved.
ApproxMC runs in time polynomial in |ϕ|, ε−1
, and log(1 − δ)−1
, relative
to SAT oracle.
46
ApproxMC Performance: Accuracy
1.0E+00	
  
3.2E+01	
  
1.0E+03	
  
3.3E+04	
  
1.0E+06	
  
3.4E+07	
  
1.1E+09	
  
3.4E+10	
  
1.1E+12	
  
3.5E+13	
  
1.1E+15	
  
3.6E+16	
  
0	
   10	
   20	
   30	
   40	
   50	
   60	
   70	
   80	
   90	
  
Count	
  
Benchmarks	
  
Cachet*1.75	
  
Cachet/1.75	
  
ApproxMC	
  
Accuracy: ApproxMC vs Cachet (exact counter)
47
ApproxMC Performance: Runtime
0	
  
10000	
  
20000	
  
30000	
  
40000	
  
50000	
  
60000	
  
70000	
  
0	
   10	
   20	
   30	
   40	
   50	
   60	
   70	
   80	
   90	
   100	
   110	
   120	
   130	
   140	
   150	
   160	
   170	
   180	
   190	
  
Time	
  (seconds)	
  
Benchmarks	
  
ApproxMC	
  
Cachet	
  
Runtime Comparison: ApproxMC vs Cachet’
48
SAT Solving
• The improvement in the performance of SAT solvers over the past 20
years is revolutionary!
– Better marketing: Deep Solving
• SAT solving is an enabler, e.g., approximate sampling and counting
• When you have a big hammer, look for nails!!!
• Scalability is an ongoing challenge!
49
Reflection on P vs. NP
Old Clich´e “What is the difference between theory and practice? In theory,
they are not that different, but in practice, they are quite different.”
P vs. NP in practice:
• P=NP: Conceivably, NP-complete problems can be solved in polynomial
time, but the polynomial is n1,000
– impractical!
• P=NP: Conceivably, NP-complete problems can be solved by nlog log log n
operations – practical!
Conclusion: No guarantee that solving P vs. NP would yield practical
benefits.
50
Are NP-Complete Problems Really Hard?
• When I was a graduate student, SAT was a “scary” problem, not to be
touched with a 10-foot pole.
• Indeed, there are SAT instances with a few hundred variables that cannot
be solved by any extant SAT solver.
• But today’s SAT solvers, which enjoy wide industrial usage, routinely
solve real-life SAT instances with millions of variables!
Conclusion We need a richer and broader complexity theory, a theory that
would explain both the difficulty and the easiness of problems like SAT.
Question: Now that SAT is “easy” in practice, how can we leverage that?
• We showed how to leverage for sampling and counting. What else?
• Is BPPNP
the “new” PTIME?
51

More Related Content

Similar to The Automated-Reasoning Revolution: from Theory to Practice and Back

NP-Completeness-myppt.pptx
NP-Completeness-myppt.pptxNP-Completeness-myppt.pptx
NP-Completeness-myppt.pptxSanchayKedia2
 
20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrisonComputer Science Club
 
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...Codiax
 
Ads unit 3 ppt
Ads unit 3 pptAds unit 3 ppt
Ads unit 3 pptpraveena p
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10chidabdu
 
Theorem proving and the real numbers: overview and challenges
Theorem proving and the real numbers: overview and challengesTheorem proving and the real numbers: overview and challenges
Theorem proving and the real numbers: overview and challengesLawrence Paulson
 
Limits of Computation
Limits of ComputationLimits of Computation
Limits of ComputationJoshua Reuben
 
The Limits of Computation
The Limits of ComputationThe Limits of Computation
The Limits of ComputationJoshua Reuben
 
A friendly introduction to quantum computation: Analog computers with Schröd...
A friendly introduction to quantum computation: Analog computers with Schröd...A friendly introduction to quantum computation: Analog computers with Schröd...
A friendly introduction to quantum computation: Analog computers with Schröd...Facultad de Informática UCM
 
Has There Been Progress on the P vs. NP Question?,
Has There Been Progress on the P vs. NP Question?,Has There Been Progress on the P vs. NP Question?,
Has There Been Progress on the P vs. NP Question?,umsl snfrzb
 
Evolving Rules to Solve Problems: The Learning Classifier Systems Way
Evolving Rules to Solve Problems: The Learning Classifier Systems WayEvolving Rules to Solve Problems: The Learning Classifier Systems Way
Evolving Rules to Solve Problems: The Learning Classifier Systems WayPier Luca Lanzi
 

Similar to The Automated-Reasoning Revolution: from Theory to Practice and Back (20)

1019Lec1.ppt
1019Lec1.ppt1019Lec1.ppt
1019Lec1.ppt
 
Np complete
Np completeNp complete
Np complete
 
NP-Completeness-myppt.pptx
NP-Completeness-myppt.pptxNP-Completeness-myppt.pptx
NP-Completeness-myppt.pptx
 
Where Does It Break?
Where Does It Break?Where Does It Break?
Where Does It Break?
 
Knapsack problem using fixed tuple
Knapsack problem using fixed tupleKnapsack problem using fixed tuple
Knapsack problem using fixed tuple
 
20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison
 
CSE680-17NP-Complete.pptx
CSE680-17NP-Complete.pptxCSE680-17NP-Complete.pptx
CSE680-17NP-Complete.pptx
 
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
 
Ads unit 3 ppt
Ads unit 3 pptAds unit 3 ppt
Ads unit 3 ppt
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
 
Theorem proving and the real numbers: overview and challenges
Theorem proving and the real numbers: overview and challengesTheorem proving and the real numbers: overview and challenges
Theorem proving and the real numbers: overview and challenges
 
UNIT-V.ppt
UNIT-V.pptUNIT-V.ppt
UNIT-V.ppt
 
Ceplerley lecture
Ceplerley lectureCeplerley lecture
Ceplerley lecture
 
Limits of Computation
Limits of ComputationLimits of Computation
Limits of Computation
 
The Limits of Computation
The Limits of ComputationThe Limits of Computation
The Limits of Computation
 
Np complete
Np completeNp complete
Np complete
 
A friendly introduction to quantum computation: Analog computers with Schröd...
A friendly introduction to quantum computation: Analog computers with Schröd...A friendly introduction to quantum computation: Analog computers with Schröd...
A friendly introduction to quantum computation: Analog computers with Schröd...
 
Nister iccv2005tutorial
Nister iccv2005tutorialNister iccv2005tutorial
Nister iccv2005tutorial
 
Has There Been Progress on the P vs. NP Question?,
Has There Been Progress on the P vs. NP Question?,Has There Been Progress on the P vs. NP Question?,
Has There Been Progress on the P vs. NP Question?,
 
Evolving Rules to Solve Problems: The Learning Classifier Systems Way
Evolving Rules to Solve Problems: The Learning Classifier Systems WayEvolving Rules to Solve Problems: The Learning Classifier Systems Way
Evolving Rules to Solve Problems: The Learning Classifier Systems Way
 

Recently uploaded

An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniquesugginaramesh
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 

Recently uploaded (20)

An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniques
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 

The Automated-Reasoning Revolution: from Theory to Practice and Back

  • 1. The Automated-Reasoning Revolution: from Theory to Practice and Back Moshe Y. Vardi Rice University
  • 2. Is This Time Different? The Opportunities and Challenges of Artificial Intelligence Jason Furman, Chair, Council of Economic Advisers, July 2016: “Even though we have not made as much progress recently on other areas of AI, such as logical reasoning, the advancements in deep learning techniques may ultimately act as at least a partial substitute for these other areas.” 1
  • 3. P vs. NP: An Outstanding Open Problem Does P = NP? • The major open problem in theoretical computer science • A major open problem in mathematics – A Clay Institute Millennium Problem – Million dollar prize! What is this about? It is about computational complexity – how hard it is to solve computational problems. 2
  • 4. Rally To Restore Sanity, Washington, DC, October 2010 3
  • 5. Computational Problems Example: Graph – G = (V, E) • V – set of nodes • E – set of edges Two notions: • Hamiltonian Cycle: a cycle that visits every node exactly once. • Eulerian Cycle: a cycle that visits every edge exactly once. Question: How hard it is to find a Hamiltonian cycle? Eulerian cycle? 4
  • 6. Figure 1: The Bridges of K¨onigsburg 5
  • 7. Figure 2: The Graph of The Bridges of K¨onigsburg 6
  • 9. Computational Complexity Measuring complexity: How many (Turing machine) operations does it take to solve a problem of size n? • Size of (V, E): number of nodes plus number of edges. Complexity Class P: problems that can be solved in polynomial time – nc for a fixed c Examples: • Is a number even? • Is a number square? • Does a graph have an Eulerian cycle? What about the Hamiltonian Cycle Problem? 8
  • 10. Hamiltonian Cycle • Naive Algorithm: Exhaustive search – run time is n! operations • “Smart” Algorithm: Dynamic programming – run time is 2n operations Note: The universe is much younger than 2200 Planck time units! Fundamental Question: Can we do better? • Is HamiltonianCycle in P? 9
  • 11. Checking Is Easy! Observation: Checking if a given cycle is a Hamiltonian cycle of a graph G = (V, E) is easy! Complexity Class NP: problems where solutions can be checked in polynomial time. Examples: • HamiltonianCycle • Factoring numbers Significance: Tens of thousands of optimization problems are in NP!!! • CAD, flight scheduling, chip layout, protein folding, . . . 10
  • 12. P vs. NP • P: efficient discovery of solutions • NP: efficient checking of solutions The Big Question: Is P = NP or P = NP? • Is checking really easier than discovering? Intuitive Answer: Of course, checking is easier than discovering, so P = NP!!! • Metaphor: finding a needle in a haystack • Metaphor: Sudoku • Metaphor: mathematical proofs Alas: We do not know how to prove that P = NP. 11
  • 13. P = NP Consequences: • Cannot solve efficiently numerous important problems • RSA encryption may be safe. Question: Why is it so important to prove P = NP, if that is what is commonly believed? Answer: • If we cannot prove it, we do not really understand it. • May be P = NP and the “enemy” proved it and broke RSA! 12
  • 14. P = NP S. Aaronson, MIT: “If P = NP, then the world would be a profoundly different place than we usually assume it to be. There would be no special value in ‘creative leaps,’ no fundamental gap between solving a problem and recognizing the solution once it’s found. Everyone who could appreciate a symphony would be Mozart; everyone who could follow a step-by-step argument would be Gauss.” Consequences: • Can solve efficiently numerous important problems. • RSA encryption is not safe. Question: Is it really possible that P = NP? Answer: Yes! It’d require discovering a very clever algorithm, but it took 40 years to prove that LinearProgramming is in P. 13
  • 15. Sharpening The Problem NP-Complete Problems: hardest problems is NP • HamilatonianCycle is NP-complete! [Karp, 1972] Corollary: P = NP if and only if HamiltonianCycle is in P There are thousands of NP-complete problems. To resolve the P = NP question, it’d suffice to prove that one of them is or is not in P. 14
  • 16. History • 1950-60s: Futile effort to show hardness of search problems. • Stephen Cook, 1971: Boolean Satisfiability is NP-complete. • Richard Karp, 1972: 20 additional NP-complete problems– 0-1 Integer Programming, Clique, Set Packing, Vertex Cover, Set Covering, Hamiltonian Cycle, Graph Coloring, Exact Cover, Hitting Set, Steiner Tree, Knapsack, Job Scheduling, ... – All NP-complete problems are polynomially equivalent! • Leonid Levin, 1973 (independently): Six NP-complete problems • M. Garey and D. Johnson, 1979: “Computers and Intractability: A Guide to NP-Completeness” - hundreds of NP-complete problems! • Clay Institute, 2000: $1M Award! 15
  • 17. Boole’s Symbolic Logic Boole’s insight: Aristotle’s syllogisms are about classes of objects, which can be treated algebraically. “If an adjective, as ‘good’, is employed as a term of description, let us represent by a letter, as y, all things to which the description ‘good’ is applicable, i.e., ‘all good things’, or the class of ‘good things’. Let it further be agreed that by the combination xy shall be represented that class of things to which the name or description represented by x and y are simultaneously applicable. Thus, if x alone stands for ‘white’ things and y for ‘sheep’, let xy stand for ‘white sheep’. 16
  • 18. Vardi at Univ. College Cork, Ireland, March 2017 17
  • 19. Boolean Satisfiability Boolean Satisfiability (SAT); Given a Boolean expression, using “and” (∧) “or”, (∨) and “not” (¬), is there a satisfying solution (an assignment of 0’s and 1’s to the variables that makes the expression equal 1)? Example: (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ ¬x3 ∨ x4) ∧ (x3 ∨ x1 ∨ x4) Solution: x1 = 0, x2 = 0, x3 = 1, x4 = 1 18
  • 20. Complexity of Boolean Reasoning History: • William Stanley Jevons, 1835-1882: “I have given much attention, therefore, to lessening both the manual and mental labour of the process, and I shall describe several devices which may be adopted for saving trouble and risk of mistake.” • Ernst Schr¨oder, 1841-1902: “Getting a handle on the consequences of any premises, or at least the fastest method for obtaining these consequences, seems to me to be one of the noblest, if not the ultimate goal of mathematics and logic.” • Cook, 1971, Levin, 1973: Boolean Satisfiability is NP-complete. 19
  • 21. Algorithmic Boolean Reasoning: Early History • Newell, Shaw, and Simon, 1955: “Logic Theorist” • Davis and Putnam, 1958: “Computational Methods in The Propositional calculus”, unpublished report to the NSA • Davis and Putnam, JACM 1960: “A Computing procedure for quantification theory” • Davis, Logemman, and Loveland, CACM 1962: “A machine program for theorem proving” DPLL Method: Propositional Satisfiability Test • Convert formula to conjunctive normal form (CNF) • Backtracking search for satisfying truth assignment • Unit-clause preference 20
  • 22. Modern SAT Solving CDCL = conflict-driven clause learning • Backjumping • Smart unit-clause preference • Conflict-driven clause learning • Smart choice heuristic (brainiac vs speed demon) • Restarts Key Tools: GRASP, 1996; Chaff, 2001 Current capacity: millions of variables 21
  • 23. S. A. Seshia 1 Some Experience with SAT Solving Sanjit A. Seshia Speed-up of 2012 solver over other solvers 1 10 100 1,000 Solver Speed-up(logscale) 22
  • 24. Knuth Gets His Satisfaction SIAM News, July 26, 2016: “Knuth Gives Satisfaction in SIAM von Neumann Lecture” Donald Knuth gave the 2016 John von Neumann lecture at the SIAM Annual Meeting. The von Neumann lecture is SIAM’s most prestigious prize. Knuth based the lecture, titled ”Satisfiability and Combinatorics”, on the latest part (Volume 4, Fascicle 6) of his The Art of Computer Programming book series. He showed us the first page of the fascicle, aptly illustrated with the quote ”I can’t get no satisfaction,” from the Rolling Stones. In the preface of the fascicle Knuth says ”The story of satisfiability is the tale of a triumph of software engineering, blended with rich doses of beautiful mathematics”. 23
  • 25. Applications of SAT Solving in SW Engineering Leonardo De Moura+Nikolaj Bj¨orner, 2012: Applications of Z3 at Microsoft • Symbolic execution • Model checking • Static analysis • Model-based design • . . . 24
  • 26. Verification of HW/SW systems HW/SW Industry: $0.75T per year! Major Industrial Problem: Functional Verification – ensuring that computing systems satisfy their intended functionality • Verification consumes the majority of the development effort! Two Major Approaches: • Formal Verification: Constructing mathematical models of systems under verification and analyzing them mathematically: ≤ 10% of verification effort • Dynamic Verification: simulating systems under different testing scenarios and checking the results: ≥ 90% of verification effort 25
  • 27. Dynamic Verification • Dominant approach! • Design is simulated with input test vectors. • Test vectors represent different verification scenarios. • Results compared to intended results. • Challenge: Exceedingly large test space! 26
  • 28. Motivating Example: HW FP Divider z = x/y: x, y, z are 128-bit floating-point numbers Question How do we verify that circuit works correctly? • Try for all values of x and y? • 2256 possibilities • Sun will go nova before done! Not scalable! 27
  • 29. Test Generation Classical Approach: manual test generation - capture intuition about problematic input areas • Verifier can write about 20 test cases per day: not scalable! Modern Approach: random-constrained test generation • Verifier writes constraints describing problematic inputs areas (based on designer intuition, past bug reports, etc.) • Uses constraint solver to solve constraints, and uses solutions as test inputs – rely on industrial-strength constraint solvers! • Proposed by Lichtenstein+Malka+Aharon, 1994: de-facto industry standard today! 28
  • 30. Random Solutions Major Question: How do we generate solutions randomly and uniformly? • Randomly: We should not reply on solver internals to chose input vectors; we do not know where the errors are! • Uniformly: We should not prefer one area of the solution space to another; we do not know where the errors are! Uniform Generation of SAT Solutions: Given a SAT formula, generate solutions uniformly at random, while scaling to industrial-size problems. 29
  • 31. Constrained Sampling: Applications Many Applications: • Constrained-random Test Generation: discussed above • Personalized Learning: automated problem generation • Search-Based Optimization: generate random points of the candidate space • Probabilistic Inference: Sample after conditioning • . . . 30
  • 32. Constrained Sampling – Prior Approaches, I Theory: • Jerrum+Valiant+Vazirani: Random generation of combinatorial structures from a uniform distribution, TCS 1986 – uniform generation by a randomized polytime algrithm with an Σp 2 oracle. • Bellare+Goldreich+Petrank: Uniform generation of NP-witnesses using an NP-oracle, 2000 – uniform generation by a randomized polytime algorithm with an NP oracle. We implemented the BPG Algorithm: did not scale above 16 variables! 31
  • 33. Constrained Sampling – Prior Work, II Practice: • BDD-based: Yuan, Aziz, Pixley, Albin: Simplifying Boolean constraint solving for random simulation-vector generation, 2004 – poor scalability • Heuristics approaches: MCMC-based, randomized solvers, etc. – good scalability, poor uniformity 32
  • 34. Almost Uniform Generation of Solutions New Algorithm – UniGen: Chakraborty, Fremont, Meel, Seshia, V, 2013-15: • almost uniform generation by a randomized polytime algorithms with a SAT oracle. • Based on universal hashing. • Uses an SMT solver. • Scales to millions of variables. • Enables parallel generation of solutions after preprocessing. 33
  • 35. Uniformity vs Almost-Uniformity • Input formula: ϕ; Solution space: Sol(ϕ) • Solution-space size: κ = |Sol(ϕ)| • Uniform generation: for every assignment y: Prob[Output = y]=1/κ • Almost-Uniform Generation: for every assignment y: (1/κ) (1+ε) ≤ Prob[Output = y] ≤ (1/κ) × (1 + ε) 34
  • 36. The Basic Idea 1. Partition Sol(ϕ) into “roughly” equal small cells of appropriate size. 2. Choose a random cell. 3. Choose at random a solution in that cell. You got random solution almost uniformly! Question: How can we partition Sol(ϕ) into “roughly” equal small cells without knowing the distribution of solutions? Answer: Universal Hashing [Carter-Wegman 1979, Sipser 1983] 35
  • 37. Universal Hashing Hash function: maps {0, 1}n to {0, 1}m • Random inputs: All cells are roughly equal (in expectation) Universal family of hash functions: Choose hash function randomly from family • For arbitrary distribution on inputs: All cells are roughly equal (in expectation) 36
  • 38. Strong Universality Universal Family: Each input is hashed uniformly, but different inputs might not be hashed independently. H(n, m, r): Family of r-universal hash functions mapping {0, 1}n to {0, 1}m such that every r elements are mapped independently. • Higher r: Stronger guarantee on range of sizes of cells • r-wise universality: Polynomials of degree r − 1 37
  • 39. Strong Universality Key: Higher universality ⇒ higher complexity! • BGP: n-universality ⇒ all cells are small ⇒ uniform generation • UniGen: 3-universality ⇒ a random cell is small w.h.p ⇒ almost-uniform generation From tens of variables to millions of variables! 38
  • 40. XOR-Based 3-Universal Hashing • Partition {0, 1}n into 2m cells. • Variables: X1, X2, . . . Xn • Pick every variable with probability 1/2, XOR them, and equate to 0/1 with probability 1/2. – E.g.: X1 + X7 + . . . + X117 = 0 (splits solution space in half) • m XOR equations ⇒ 2m cells • Cell constraint: a conjunction of CNF and XOR clauses 39
  • 41. SMT: Satisfiability Modulo Theory SMT Solving: Solve Boolean combinations of constraints in an underlying theory, e.g., linear constraints, combining SAT techniques and domain- specific techniques. • Tremendous progress since 2000! CryptoMiniSAT: M. Soos, 2009 • Specialized for combinations of CNF and XORs • Combine SAT solving with Gaussian elimination 40
  • 42. UniGen Performance: Uniformity 0 50 100 150 200 250 300 350 400 450 500 160 180 200 220 240 260 280 300 320 #ofSolutions Count US UniGen Uniformity Comparison: UniGen vs Uniform Sampler 41
  • 43. UniGen Performance: Runtime 0.1   1   10   100   1000   10000   100000   case47   case_3_b14_3   case105   case8   case203   case145   case61   case9   case15   case140   case_2_b14_1   case_3_b14_1   squaring14   squaring7   case_2_ptb_1   case_1_ptb_1   case_2_b14_2   case_3_b14_2   Time(s)   Benchmarks   UniGen   XORSample'   Runtime Comparison: UniGen vs XORSample’ 42
  • 44. From Sampling to Counting • Input formula: ϕ; Solution space: Sol(ϕ) • #SAT Problem: Compute |Sol(ϕ)| – ϕ = (p ∨ q) – Sol(ϕ) = {(0, 1), (1, 0), (1, 1)} – |Sol(ϕ)| = 3 Fact: #SAT is complete for #P – the class of counting problems for decision problems in NP [Valiant, 1979]. 43
  • 45. Constrained Counting A wide range of applications! • Coverage in random-constrained verification • Bayesian inference • Planning with uncertainty • . . . But: #SAT is really a hard problem! In practice, quite harder than SAT. 44
  • 46. Approximate Counting Probably Approximately Correct (PAC): • Formula: ϕ, Tolerance: ε, Confidence: 0 < δ < 1 • |Sol(ϕ)| = κ • Prob[ κ (1+ε) ≤ Count ≤ κ × (1 + ε) ≥ δ • Introduced in [Stockmeyer, 1983] • [Jerrum+Sinclair+Valiant, 1989]: BPPNP • No implementation so far. 45
  • 47. From Sampling to Counting ApproxMC: [Chakraborty+Meel+V., 2013] • Use m random XOR clauses to select at random an appropriately small cell. • Count number of solutions in cell and multiply by 2m to obtain estimate of |Sol(ϕ)|. • Iterate until desired confidence is achieved. ApproxMC runs in time polynomial in |ϕ|, ε−1 , and log(1 − δ)−1 , relative to SAT oracle. 46
  • 48. ApproxMC Performance: Accuracy 1.0E+00   3.2E+01   1.0E+03   3.3E+04   1.0E+06   3.4E+07   1.1E+09   3.4E+10   1.1E+12   3.5E+13   1.1E+15   3.6E+16   0   10   20   30   40   50   60   70   80   90   Count   Benchmarks   Cachet*1.75   Cachet/1.75   ApproxMC   Accuracy: ApproxMC vs Cachet (exact counter) 47
  • 49. ApproxMC Performance: Runtime 0   10000   20000   30000   40000   50000   60000   70000   0   10   20   30   40   50   60   70   80   90   100   110   120   130   140   150   160   170   180   190   Time  (seconds)   Benchmarks   ApproxMC   Cachet   Runtime Comparison: ApproxMC vs Cachet’ 48
  • 50. SAT Solving • The improvement in the performance of SAT solvers over the past 20 years is revolutionary! – Better marketing: Deep Solving • SAT solving is an enabler, e.g., approximate sampling and counting • When you have a big hammer, look for nails!!! • Scalability is an ongoing challenge! 49
  • 51. Reflection on P vs. NP Old Clich´e “What is the difference between theory and practice? In theory, they are not that different, but in practice, they are quite different.” P vs. NP in practice: • P=NP: Conceivably, NP-complete problems can be solved in polynomial time, but the polynomial is n1,000 – impractical! • P=NP: Conceivably, NP-complete problems can be solved by nlog log log n operations – practical! Conclusion: No guarantee that solving P vs. NP would yield practical benefits. 50
  • 52. Are NP-Complete Problems Really Hard? • When I was a graduate student, SAT was a “scary” problem, not to be touched with a 10-foot pole. • Indeed, there are SAT instances with a few hundred variables that cannot be solved by any extant SAT solver. • But today’s SAT solvers, which enjoy wide industrial usage, routinely solve real-life SAT instances with millions of variables! Conclusion We need a richer and broader complexity theory, a theory that would explain both the difficulty and the easiness of problems like SAT. Question: Now that SAT is “easy” in practice, how can we leverage that? • We showed how to leverage for sampling and counting. What else? • Is BPPNP the “new” PTIME? 51