Love this article and the push to build awareness of what modern SAT solvers can do.<p>It's worth mentioning that there are higher level abstractions that are <i>far</i> more accessible than SAT. If I were teaching a course on this, I would start with either Answer Set Programming (ASP) or Satisfiability Modulo Theories (SMT). The most widely used solvers for those are clingo [0] and Z3 [1]:<p>With ASP, you write in a much clearer Prolog-like syntax that does not require nearly as much encoding effort as your typical SAT problem. Z3 is similar -- you can code up problems in a simple Python API, or write them in the smtlib language.<p>Both of these make it easy to add various types of optimization, constraints, etc. to your problem, and they're much better as modeling languages than straight SAT. Underneath, they have solvers that leverage all the modern CDCL tricks.<p>We wrote up a paper [2] on how to formulate a modern dependency solver in ASP; it's helped tremendously for adding new types of features like options, variants, and complex compiler/arch dependencies to Spack [3]. You could not get good solutions to some of these problems without a capable and expressive solver.<p>[0] <a href="https://github.com/potassco/clingo">https://github.com/potassco/clingo</a><p>[1] <a href="https://github.com/Z3Prover/z3">https://github.com/Z3Prover/z3</a><p>[2] <a href="https://arxiv.org/abs/2210.08404" rel="nofollow">https://arxiv.org/abs/2210.08404</a>, <a href="https://dl.acm.org/doi/abs/10.5555/3571885.3571931" rel="nofollow">https://dl.acm.org/doi/abs/10.5555/3571885.3571931</a><p>[3] <a href="https://github.com/spack/spack">https://github.com/spack/spack</a>
> ... modern SAT solvers are fast, neat and criminally underused by the industry.<p>Modern SAT solvers are fast, neat and criminally <i>undertaught</i> by the universities. Seriously, why isn't this taught at the undergraduate level in CS70 [1] discrete math type courses or CS170 [2] analysis of algorithms type courses?<p>[1] <a href="https://www2.eecs.berkeley.edu/Courses/CS70/" rel="nofollow">https://www2.eecs.berkeley.edu/Courses/CS70/</a><p>[2] <a href="https://www2.eecs.berkeley.edu/Courses/CS170/" rel="nofollow">https://www2.eecs.berkeley.edu/Courses/CS170/</a>
I seem to recall that a poorly scaling sat solver in conda-forge broke so badly in 2020 that it shifted the tectonic plates underneath the entire academic python ecosystem away from conda and towards pip.<p><pre><code> Solving Environment | / - | \</code></pre>
Compiling Scala without a SAT solver is probably too difficult.<p>The CNF Converter is a gem.<p><a href="https://github.com/scala/scala/blob/v2.13.5/src/compiler/scala/tools/nsc/transform/patmat/Solving.scala#L50">https://github.com/scala/scala/blob/v2.13.5/src/compiler/sca...</a>
Just wanted to shoutout Armin Biere, one of the top contributors in this field: <a href="https://github.com/arminbiere">https://github.com/arminbiere</a><p>He has a few open source SAT solvers and tooling that provide good and proven examples on modern SAT solver techniques.
Conda uses a SAT solver. It is still very slow on degenerate cases and I’m not sure if work to replace it with Microsoft’s SAT solver has started.<p><a href="https://www.anaconda.com/blog/understanding-and-improving-condas-performance" rel="nofollow">https://www.anaconda.com/blog/understanding-and-improving-co...</a>
Has there been any effort to formalise the subset of NP that lends itself to SAT resolution (is there something between x^n and n^x)?<p>For example, what are the defining characteristics of a graphs for which the travelling salesman problem is resolvable without resorting to brute force?
Related post (and highly recommended!) from yesterday:<p>The Silent (R)evolution of SAT
<a href="https://news.ycombinator.com/item?id=36079115" rel="nofollow">https://news.ycombinator.com/item?id=36079115</a>
SAT? I had to look it up, so...<p>Boolean satisfiability problem<p><a href="https://en.wikipedia.org/wiki/Boolean_satisfiability_problem" rel="nofollow">https://en.wikipedia.org/wiki/Boolean_satisfiability_problem</a><p>"In logic and computer science, the Boolean satisfiability problem (sometimes called propositional satisfiability problem and abbreviated SATISFIABILITY, SAT or B-SAT) is the problem of determining if there exists an interpretation that satisfies a given Boolean formula. In other words, it asks whether the variables of a given Boolean formula can be consistently replaced by the values TRUE or FALSE in such a way that the formula evaluates to TRUE."
> As an example, the often-talked-about dependency management problem, is also NP-Complete and thus translates into SAT[2][3], and SAT could be translated into dependency manager.<p>This reminds me of make[0] and of being made aware that make[0] is a SAT solver. I think it was when I attended a conference. Unfortunately I cannot find an authoritative source to quote, so will rely on, and be grateful to, the HN community to correct me should this be wrong.<p>0 - <a href="https://www.gnu.org/software/make/" rel="nofollow">https://www.gnu.org/software/make/</a>
FWIW, here's a little console-mode puzzle game of SAT problems, if you want to solve some manually. The "board" is not exactly like the example table in the post, since that one was for Sudoku in particular. This grid represents variables as rows and clauses as columns.<p><a href="https://github.com/darius/sturm/blob/master/satgame.py">https://github.com/darius/sturm/blob/master/satgame.py</a> (Python 2)
This brings back memories. In early 2000s, I wrote my undergrad thesis on a survey of SAT solving techniques. I believe the most capable general solver at the time was called DPLL and used a backtracking approach. My key insight at the time was that if you knew the "shape" of the SAT problem (you had domain specific insight) then you could take some shortcuts by using a custom algorithm. Eg this clause is always false and reduce the search space.
But what do you mean “fast”? If your problem ends up on the steep side of the exponential curve, it’s going to take a while to solve.<p>I had a lot of fun making my own CDCL solver in Rust, and I’ve really enjoyed messing with Z3 for some theoretical computer science. On all of my explorations, there was a very tangible problem size beyond which the solve time was unusable.<p>In the case of Z3 with most real world problems, the typical problem size is beyond this limit.
There was a time when people thought SAT and formal logic is the way to building AI. Now you don't hear anything about it. I wonder what happened?