<?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>BCP on Wonderings of a SAT geek</title>
    <link>https://www.msoos.org/tags/bcp/</link>
    <description>Recent content in BCP on Wonderings of a SAT geek</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <lastBuildDate>Wed, 18 Dec 2013 01:34:15 +0000</lastBuildDate>
    <atom:link href="https://www.msoos.org/tags/bcp/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>On variable renumbering</title>
      <link>https://www.msoos.org/2013/12/on-variable-renumbering/</link>
      <pubDate>Wed, 18 Dec 2013 01:34:15 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=2198</guid> 
      <description>&lt;p&gt;Variable renumbering in SAT solvers keeps a mapping between the external variable numbers that is visible to the users and the internal variable numbers that is visible the to the system. The trivial mapping that most SAT solvers use is the one-to-one mapping where there is no difference between outer and internal variables. A smart mapping doesn&amp;rsquo;t keep track of all data related to variables that have been set or eliminated internally, so the internal datastructures can be smaller.&lt;/p&gt;</description>
    </item>
    <item>
      <title>CryptoMinisat 3.1 released</title>
      <link>https://www.msoos.org/2013/04/cryptominisat-3-1-released/</link>
      <pubDate>Sun, 14 Apr 2013 17:29:50 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=1624</guid> 
      <description>&lt;p&gt;CryptoMinisat 3.1 has been &lt;a href=&#34;https://gforge.inria.fr/frs/?group_id=1992&amp;amp;release_id=8008&#34;&gt;released&lt;/a&gt;. The short changelog is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ git diff cryptoms-3.0 cryptoms-3.1 --shortstat
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; 84 files changed, 3079 insertions(+), 2751 deletions(-)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The changes made were threefold. First, memory usage has been greatly reduced. This is crucial, because memory usage was over 7GB on certain instances. Secondly, the implication cache wasn&amp;rsquo;t very well-used and an idea that came to my mind &lt;em&gt;greatly&lt;/em&gt; improved performance on most problems. Finally, time limiting of some inprocessing techniques on certain types of problems has been improved.&lt;/p&gt;</description>
    </item>
    <item>
      <title>On benchmark randomization</title>
      <link>https://www.msoos.org/2013/03/on-benchmark-randomization/</link>
      <pubDate>Sun, 10 Mar 2013 14:10:11 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=1497</guid> 
      <description>&lt;p&gt;As many of you have heard, the SAT Competition for this year has been &lt;a href=&#34;http://satcompetition.org/2013/&#34;&gt;announced&lt;/a&gt;. You can send in your benchmarks between the 12th and the 22nd of April, so get started. I have a &lt;a href=&#34;https://gforge.inria.fr/frs/?group_id=1476&amp;amp;release_id=5351&#34;&gt;bunch of benchmarks&lt;/a&gt; I have already submitted about 2 years ago, still waiting for any reply from those organizers &amp;ndash; but the organizers are different this year, so fingers crossed.&lt;/p&gt;
&lt;p&gt;What I want to talk about today is benchmark randomization. This is a very-very touchy topic. However, I fear that it&amp;rsquo;s touchy for the wrong reasons, and so I think it&amp;rsquo;s important to talk about it in detail.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Failed literal probing and UIP</title>
      <link>https://www.msoos.org/2011/08/failed-literal-probing-and-uip/</link>
      <pubDate>Thu, 04 Aug 2011 09:50:02 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=957</guid> 
      <description>&lt;p&gt;I have just realised that &lt;a href=&#34;https://www.msoos.org/cryptominisat2&#34;&gt;CryptoMiniSat&lt;/a&gt;, having won a number of medals, does one of the most basic things, &lt;a href=&#34;http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=CF33EFCD2F8DC2595B3CB93AB4B02833?doi=10.1.1.1.1941&amp;amp;rep=rep1&amp;amp;type=pdf&#34;&gt;failed literal probing&lt;/a&gt;, &lt;em&gt;all wrong&lt;/em&gt;. Let me tell you why it&amp;rsquo;s all wrong. In essence, failed literal probing is trivial. We enqueue a fact, such as &lt;code&gt;a&lt;/code&gt;, and then propagate it. If this fails, i.e. if two opposing facts such as &lt;code&gt;g&lt;/code&gt; and &lt;code&gt;-g&lt;/code&gt; are derived, we know that &lt;code&gt;a&lt;/code&gt; cannot be true, so we set &lt;code&gt;-a&lt;/code&gt;. Easy. Or maybe not so easy.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding Implication Graphs</title>
      <link>https://www.msoos.org/2011/05/understanding-implication-graphs/</link>
      <pubDate>Fri, 27 May 2011 22:18:17 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=738</guid> 
      <description>&lt;p&gt;Having won the &lt;a href=&#34;http://baldur.iti.uka.de/sat-race-2010/results.html&#34;&gt;SAT Race&lt;/a&gt; with CryptoMiniSat, I think I can now confess that I still don&amp;rsquo;t understand conflict generation. So today, I sat down and I tried to understand it. The result is some fun code, a lot of reading, and great pictures. Let me share with you these auto-generated graphs &amp;ndash; the generator will be released with CMSat 3.0.0, so you will be able to generate them, too. These graphs show something called an &amp;lsquo;implication graph&amp;rsquo;, which is nothing more than a graphical way to show how propagations were made by the reasoning engine. For instance, if variable x1 and x2 are both FALSE, then clause &amp;lsquo;x1 V x2 V x3&amp;rsquo; will force x3 to be TRUE to satisfy the clause. Okay, so much for talk, let&amp;rsquo;s see the graphs!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Visiting Linz</title>
      <link>https://www.msoos.org/2011/02/visiting-linz/</link>
      <pubDate>Tue, 15 Feb 2011 13:52:40 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=682</guid> 
      <description>&lt;p&gt;&lt;a href=&#34;https://www.msoos.org/wordpress/wp-content/uploads/2011/06/Linz.png&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://www.msoos.org/wordpress/wp-content/uploads/2011/06/Linz.png&#34;&gt;&lt;/a&gt; Lately I had the pleasure of visiting Linz, Armin Biere&amp;rsquo;s workplace, where I gave a quick &lt;a href=&#34;https://www.msoos.org/wordpress/wp-content/uploads/2011/02/SAT_solver_architectures_Linz.pdf&#34;&gt;talk&lt;/a&gt; on SAT solver architectures. To me, it was really interesting to think through that presentation &amp;mdash; not because it was entirely new or exciting, but because it recapped on many issues that have been bothering me lately. Namely, that it&amp;rsquo;s difficult to make a really versatile SAT solver, because the low-level choices that must be made (e.g. watchlist scheme) determines so many things when one must make higher-level architectural decisions such as &lt;a href=&#34;https://www.msoos.org/changing-the-watchlist-scheme&#34;&gt;clause sharing&lt;/a&gt; or even something as simple as &lt;a href=&#34;https://www.msoos.org/hyper-binary-resolution-i-was-wrong-again&#34;&gt;hyper-binary resolution&lt;/a&gt;. As for this latter, thanks to Armin Biere&amp;rsquo;s thoughts I have finally managed to realise why my hyper-binary resolution was so slow: I lately took the decision not to fully propagate binary clauses before propagating normal (i.e. larger) clauses, which meant that doing hyper-binary resolution was much slower as I had to re-calculate the binary graph. The fact of not fully propagating binary clauses before normal clauses seemed also to influence my much higher-level choice of using cached implications, as they (intuitively, and also in practice) help much more if binary clauses are not fully propagated before normal clauses. This latter influence is interesting to think through, as something this trivial shouldn&amp;rsquo;t &amp;ndash; at least in principle &amp;ndash; influence such a high-level decision.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Delayed updates</title>
      <link>https://www.msoos.org/2011/02/delayed-updates/</link>
      <pubDate>Sat, 05 Feb 2011 21:38:50 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=652</guid> 
      <description>&lt;p&gt;In this post I will try to explain how &lt;a href=&#34;http://en.wikipedia.org/wiki/Locality_of_reference&#34;&gt;locality of reference&lt;/a&gt; could be exploited by grouping operations that access different memory locations. In the SAT solver program I write, there is a loop that does a something called propagation. The goal of propagation is to set a number of variables to a given value through a pretty cache-intensive process. While doing this, as the variables are set, some statistics are calculated. For example, I used to have something like this called for every variable set:&lt;/p&gt;</description>
    </item>
    <item>
      <title>On the New Watchlist Scheme</title>
      <link>https://www.msoos.org/2011/01/on-the-new-watchlist-scheme/</link>
      <pubDate>Sun, 23 Jan 2011 10:12:24 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=640</guid> 
      <description>&lt;p&gt;All right, so I am not so cool because I work on weekends, but I got &lt;a href=&#34;https://www.msoos.org/changing-the-watchlist-scheme&#34;&gt;this&lt;/a&gt; new watchlist scheme implemented. First off, let me say it was relatively easy to implement, which is a testament to the extensibility of CryptoMiniSat: it only took me ~4 hours to get it done. Secondly, I realised that I have forgotten XOR clauses when I thought through the new scheme. I used to store the current value of the XOR clause at the XOR clause itself (using the sings of the literals, being the hacker I am), and update it at every call to propXorClause(). Since we need to keep XOR clauses static just like normal clauses, this is no longer possible, so a separate data-structure needs to be built up for this. However, it won&amp;rsquo;t need too many updates, so all is fine, but it does make things a tad more complicated.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Changing the Watchlist Scheme</title>
      <link>https://www.msoos.org/2011/01/changing-the-watchlist-scheme/</link>
      <pubDate>Fri, 14 Jan 2011 12:18:59 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=613</guid> 
      <description>&lt;p&gt;Okay, what if we changed the &lt;a href=&#34;http://www.ece.ucsb.edu/bears/class/256bd/RCFB256B3450-Zchoff.pdf&#34;&gt;watchlist scheme&lt;/a&gt;&amp;hellip; a bit? The way the watchlist scheme operates in SAT solvers is the following. We have a set of literals &lt;code&gt;lit1, lit2, lit3, lit4&lt;/code&gt; that defines the clause we want to be watched for propagation and conflict. We take two literals from this set of literals, and put them in a datastructure. It&amp;rsquo;s not important which ones we take, but we have to know which are the ones we took. So, we take the 1st and the 2nd (because we are lazy), and we put them in a set of lists called the watchlists. We now have a pointer to the clause in &lt;code&gt;watchlist[~lit1]&lt;/code&gt; and in &lt;code&gt;watchlist[~lit2]&lt;/code&gt;, where &lt;code&gt;~&lt;/code&gt; is the binary negation. If we now set &lt;code&gt;lit1 = false&lt;/code&gt; we have to have a look at the clauses in &lt;code&gt;watchlist[~lit1]&lt;/code&gt;, see if any of the clauses forces a propagation. If not, then we remove the corresponding &lt;code&gt;lit1&lt;/code&gt; from the watchlist, find another literal that is unset, e.g. &lt;code&gt;lit3&lt;/code&gt;, and put that into the watchlist[~lit3]. It is important that &lt;code&gt;lit3&lt;/code&gt; must not be &lt;code&gt;lit1&lt;/code&gt; or &lt;code&gt;lit2&lt;/code&gt;. Obviously, we know what &lt;code&gt;lit1&lt;/code&gt; is (we are visiting its watchlist, after all), but how could we know what &lt;code&gt;lit2&lt;/code&gt; is? Well, we always update the clause such that &lt;code&gt;lit1&lt;/code&gt; and &lt;code&gt;lit2&lt;/code&gt; are the first two literals. We do this for every clause in every watchlist, and until a conflict is found, or all clauses are satisfied.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Caching</title>
      <link>https://www.msoos.org/2010/11/caching/</link>
      <pubDate>Tue, 23 Nov 2010 13:43:50 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=524</guid> 
      <description>&lt;p&gt;&amp;ldquo;Representation &lt;em&gt;is&lt;/em&gt; the essence of programming&amp;rdquo;
Frederic P. Brooks Jr., &amp;ldquo;The Mythical Man-month&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.msoos.org/wordpress/wp-content/uploads/2010/11/memory.png&#34;&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://www.msoos.org/wordpress/wp-content/uploads/2010/11/memory.png&#34;&gt;&lt;/a&gt; Looking through the literature on SAT solvers, it is rare to find any algorithm that uses a form of time-memory trade-off. In fact, it is rare to find any algorithm that uses too much memory. This also shows up in practice, as it&amp;rsquo;s rare to find a SAT solver using too much memory. This translates to the following: if a SAT solver can in an effective way utilize the typically abundant memory, that SAT solver will have an advantage. Based on this logic, I think CryptoMiniSat is doing good.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Propagating faster</title>
      <link>https://www.msoos.org/2010/07/propagating-faster/</link>
      <pubDate>Mon, 26 Jul 2010 16:13:00 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/wordpress/?p=7</guid> 
      <description>&lt;p&gt;Propagation (BCP) in SAT is the single most expensive operation. The algorithm essentially does the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;while (queue_head &amp;lt; trail.size()) {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Literal p = trail[queue_head];
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  vector&amp;lt;Watch&amp;gt;&amp;amp; thiswatch = watches[p];
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  for (i = thiswatch.begin(); i!=thiswatch[p].end(); i++) {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    confl = prop_confl(i-&amp;gt;clause);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    if (confl != NULL) return confl;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  queue_head++;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;where the function &lt;code&gt;prop_confl()&lt;/code&gt; executes the propagation or returns a conflict, if necessary.&lt;/p&gt;
&lt;p&gt;The problem with the above function is that clauses come in all shapes and sizes. In &lt;a href=&#34;http://planete.inrialpes.fr/%7Esoos/CryptoMiniSat2/index.php&#34;&gt;CryptoMiniSat&lt;/a&gt;, there are two kinds of clauses, normal clauses and XOR clauses. Naturally, these need to be handled differently. Furthermore, if the clause&amp;rsquo;s size is small, it is more efficient to handle it differently. The way CryptoMiniSat has done this before was to have a separate &amp;quot; &lt;code&gt;watches&lt;/code&gt;&amp;quot; for each of these. As you can guess, this is very suboptimal.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
