<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>MiniSat on Wonderings of a SAT geek</title>
    <link>https://www.msoos.org/tags/minisat/</link>
    <description>Recent content in MiniSat on Wonderings of a SAT geek</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <lastBuildDate>Wed, 30 Mar 2016 00:30:12 +0000</lastBuildDate>
    <atom:link href="https://www.msoos.org/tags/minisat/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Memory layout of clauses in MiniSat</title>
      <link>https://www.msoos.org/2016/03/memory-layout-of-clauses-in-minisat/</link>
      <pubDate>Wed, 30 Mar 2016 00:30:12 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=2925</guid> 
      <description>&lt;p&gt;I have been trying to debug why some &lt;a href=&#34;https://github.com/niklasso/minisat&#34;&gt;MiniSat&lt;/a&gt;-based solvers perform better at &lt;a href=&#34;https://en.wikipedia.org/wiki/Unit_propagation&#34;&gt;unit propagation&lt;/a&gt; than CryptoMiniSat. It took me exactly 3 full days to find out and I&amp;rsquo;d like to share this tidbit of information with everyone, as I think it might be of interest and I hardly believe many understand it.&lt;/p&gt;
&lt;p&gt;The mystery of the faster unit propagation was that I tried my best to make my solver behave exactly as MiniSat to debug the issue, but even though it was behaving almost identically, it was still slower. It made no sense and I had to dig deeper. You have to understand that both solvers use their own memory managers. In fact, CryptoMiniSat had a memory manager before MiniSat. Memory managers are used so that the clauses are put close to one another so there is a chance that they are in the same memory page, or even better, close enough for them not to waste memory in the cache. This means that a contiguous memory space is reserved where the clauses are placed.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Faster cleaning of the learnt clause database</title>
      <link>https://www.msoos.org/2014/11/cleaning-the-learnt-clause-database-faster/</link>
      <pubDate>Sun, 16 Nov 2014 17:46:28 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=2674</guid> 
      <description>&lt;p&gt;In SAT solvers, removing unneeded learnt clauses from the clause database sounds like a trivial task: we somehow determine which clauses are not needed and we call remove() on them. However, in case performance is an issue, it can get a bit more more complicated.&lt;/p&gt;
&lt;h3 id=&#34;the-problem&#34;&gt;The problem&lt;/h3&gt;
&lt;p&gt;The issue at hand is that clauses are stored in two places: as a list of pointers to the clauses and in a list of lists called the watchlist. Removing clauses from either list can be an &lt;span class=&#34;katex&#34;&gt;&lt;span class=&#34;katex-mathml&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&#34;false&#34;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&#34;false&#34;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;O(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&#34;katex-html&#34; aria-hidden=&#34;true&#34;&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:1.0641em;vertical-align:-0.25em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0278em;&#34;&gt;O&lt;/span&gt;&lt;span class=&#34;mopen&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;&lt;span class=&#34;mord mathnormal&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;msupsub&#34;&gt;&lt;span class=&#34;vlist-t&#34;&gt;&lt;span class=&#34;vlist-r&#34;&gt;&lt;span class=&#34;vlist&#34; style=&#34;height:0.8141em;&#34;&gt;&lt;span style=&#34;top:-3.063em;margin-right:0.05em;&#34;&gt;&lt;span class=&#34;pstrut&#34; style=&#34;height:2.7em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;katex-sizing reset-size6 size3 mtight&#34;&gt;&lt;span class=&#34;mord mtight&#34;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;mclose&#34;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; operation if we e.g. remove every element from the list, one by one. In fact, an old version of the most popular SAT solver, &lt;a href=&#34;http://minisat.se/downloads/minisat2-070721.zip&#34;&gt;MiniSat2&lt;/a&gt;, used to do exactly this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Speeding up MiniSat with a one-liner</title>
      <link>https://www.msoos.org/2014/03/speeding-up-minisat-with-a-one-liner/</link>
      <pubDate>Wed, 12 Mar 2014 22:31:28 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=2343</guid> 
      <description>&lt;p&gt;All SAT solvers must have a tri-state class that can hold the values `true`, `false`, and `undefined`. Although it&amp;rsquo;s not hard to write code to represent such a class, it&amp;rsquo;s hard to write such it so that all typical operations are fast. In this blog post I will compare three different ways of doing it.&lt;/p&gt;
&lt;h3 id=&#34;the-original-minisat-20-code&#34;&gt;The original MiniSat 2.0 code&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&#34;http://minisat.se/downloads/minisat2-070721.zip&#34;&gt;original MiniSat 2.0&lt;/a&gt; used the following code for such a class:&lt;/p&gt;</description>
    </item>
    <item>
      <title>MiniSat in your browser</title>
      <link>https://www.msoos.org/2013/09/minisat-in-your-browser/</link>
      <pubDate>Sun, 29 Sep 2013 19:37:34 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=2082</guid> 
      <description>&lt;h2 id=&#34;click-hereto-run-cyrptominisat-in-your-browser&#34;&gt;**&lt;a href=&#34;http://msoos.github.io/cryptominisat_web/&#34;&gt;CLICK HERE&lt;/a&gt;**to run CyrptoMiniSat in your browser&lt;/h2&gt;
&lt;p&gt;Lately, I have become an &lt;a href=&#34;http://llvm.org/&#34;&gt;LLVM&lt;/a&gt; nut. LLVM is amazing, it can do a lot, and, weirdly enough, a system developed from it is probably one of the biggest users of SAT solvers. I&amp;rsquo;m talking about &lt;a href=&#34;http://ccadar.github.io/klee/&#34;&gt;KLEE&lt;/a&gt;, the symbolic virtual execution machine. It takes a source, compiles it with LLVM, then translates the &lt;a href=&#34;http://llvm.org/docs/LangRef.html#abstract&#34;&gt;LLVM IR&lt;/a&gt; into SMT, runs &lt;a href=&#34;https://sites.google.com/site/stpfastprover/&#34;&gt;STP&lt;/a&gt; on it, which in turn runs &lt;a href=&#34;https://www.msoos.org/cryptominisat2/&#34;&gt;CryptoMiniSat&lt;/a&gt;, and voila&amp;hellip; the user gets back a free bug report. Or &lt;a href=&#34;http://lists.debian.org/debian-devel/2013/06/msg00720.html&#34;&gt;1&#39;200 bug reports&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
