TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Modern SAT solvers: fast, neat and underused – part 2

154 点作者 aw1621107将近 7 年前

6 条评论

orlp将近 7 年前
All I can do is recommend people to try out the z3 solver, especially through the Python API. There&#x27;s no better resource than <a href="https:&#x2F;&#x2F;yurichev.com&#x2F;writings&#x2F;SAT_SMT_by_example.pdf" rel="nofollow">https:&#x2F;&#x2F;yurichev.com&#x2F;writings&#x2F;SAT_SMT_by_example.pdf</a>.
评论 #17779525 未加载
评论 #17779183 未加载
评论 #17779240 未加载
dragontamer将近 7 年前
A closely related technique to SAT solvers is the &quot;Constraint Satisfaction Problem&quot; which I&#x27;ve been looking into recently.<p>Constraint Programming and SAT are BOTH NP-complete problems, and as such, they are mathematically equivalent. However, its sometimes more &quot;obvious&quot; to write problems in one form vs the other.<p>For example, Sudoku is simply written 27 constraints:<p>* All Different (X11, X12, X13, X14, X15, X16, X17, X18, X19)<p>* All Different (X21, X22, X23, X24, X25, X26, X27, X28, X29)<p>...<p>* All Different (X11, X21, X31, X41, X51, X61, X71, X81, X91)<p>...<p>* All Different (X11, X12, X13, X21, X22, X23, X31, X32, X34)<p>...<p>etc. etc.<p>Then define each &quot;X&quot; variable as &quot;between 1 and 9&quot; and bam, you&#x27;re done with defining the problem in terms of &quot;Constraints&quot;.<p>Representing Sudoku as a SAT problem is possible of course, but its just... harder. It just feels more humanly natural to represent Sudoku in terms of constraints. Or maybe not. Read &quot;Part 1&quot; if you want to see how the original blogger solved it in terms of 3-SAT (<a href="https:&#x2F;&#x2F;codingnest.com&#x2F;modern-sat-solvers-fast-neat-underused-part-1-of-n&#x2F;" rel="nofollow">https:&#x2F;&#x2F;codingnest.com&#x2F;modern-sat-solvers-fast-neat-underuse...</a>)<p>----------<p>Here&#x27;s an article from IBM hyping up their &quot;CPLEX&quot; Constraint solver for Sudoku for example: <a href="https:&#x2F;&#x2F;www.ibm.com&#x2F;developerworks&#x2F;community&#x2F;blogs&#x2F;jfp&#x2F;entry&#x2F;solving_the_hardest_sudoku?lang=en" rel="nofollow">https:&#x2F;&#x2F;www.ibm.com&#x2F;developerworks&#x2F;community&#x2F;blogs&#x2F;jfp&#x2F;entry...</a><p>----------<p>Anyway, just plugging in a similarly fast, neat, and underused (and mathematically equivalent) solver to what the blogpost talks about. I personally don&#x27;t know too much about SAT-solvers or their algorithms, aside from &quot;They&#x27;re same same, but different&quot; to Constraint Programming.
评论 #17780848 未加载
评论 #17780504 未加载
jwilk将近 7 年前
Part 1: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17684502" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17684502</a>
sushisource将近 7 年前
Why would MKS with 4k keys matter? Is that really a real thing that people do? Seems nuts vs just using an electronic system at that point.<p>Alternatively - can MKS be applied to cool permissions problems not involving physical keys?
评论 #17781288 未加载
Karrot_Kream将近 7 年前
Rather than encoding this as SAT, would it be easier to use an actual constrain solver environment here? Like MiniZinc or PiCat.
评论 #17779567 未加载
eggy将近 7 年前
I have been delving into Fstar [1] which has an SMT backend and provides a means of program verification. Fstar programs can then be code extracted to OCaml or Fsharp.<p>I think the combination of SAT solving, and a formal language like F* that can create executable OCaml or Fsharp code will be very useful in creating a pragmatic path to verified programs.<p><pre><code> [1] https:&#x2F;&#x2F;www.fstar-lang.org&#x2F; </code></pre> Edit: I wanted to add that I prefer the Lisp syntax of SMT to the python, but that&#x27;s based upon personal bias. However, a Lisp-like syntax was chosen due to the ease of parsing Lisp s-expressions.