<?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>variable elimination on Wonderings of a SAT geek</title>
    <link>https://www.msoos.org/tags/variable-elimination/</link>
    <description>Recent content in variable elimination on Wonderings of a SAT geek</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <lastBuildDate>Wed, 16 Apr 2014 15:39:47 +0000</lastBuildDate>
    <atom:link href="https://www.msoos.org/tags/variable-elimination/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Why it&#39;s hard to eliminate variables</title>
      <link>https://www.msoos.org/2014/04/why-its-hard-to-eliminate-variables/</link>
      <pubDate>Wed, 16 Apr 2014 15:39:47 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=2434</guid> 
      <description>&lt;p&gt;Let&amp;rsquo;s examine why it&amp;rsquo;s hard to eliminate variables. I remember the code I looked at in &lt;a href=&#34;http://minisat.se/SatELite.html&#34;&gt;SatElite&lt;/a&gt; that did it: it was crazy clean code and looked like it was pretty easy to perform. In this post I&amp;rsquo;ll examine how that simple code became more than a 1&#39;000 lines of code today.&lt;/p&gt;
&lt;h3 id=&#34;what-needs-to-be-done-at-first-sight&#34;&gt;What needs to be done, at first sight&lt;/h3&gt;
&lt;p&gt;At first sight, variable elimination is easy. We just:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Build occurrence lists&lt;/li&gt;
&lt;li&gt;Pick a variable to eliminate&lt;/li&gt;
&lt;li&gt;Resolve every clause having the positive literal of the variable with negative ones.&lt;/li&gt;
&lt;li&gt;Add newly resolved clauses into the system&lt;/li&gt;
&lt;li&gt;Remove original clauses.&lt;/li&gt;
&lt;li&gt;Goto 2.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These are all pretty simple steps at first sight, and one can imagine that implementing them is maybe 50-100 lines of code, no more. So, let&amp;rsquo;s examine them one-by-one to see how they get complicated.&lt;/p&gt;</description>
    </item>
    <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>A note on learnt clauses</title>
      <link>https://www.msoos.org/2013/12/a-note-on-learnt-clauses/</link>
      <pubDate>Fri, 06 Dec 2013 17:29:24 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=2172</guid> 
      <description>&lt;p&gt;Learnt clauses are clauses derived while searching for a solution with a &lt;a href=&#34;https://en.wikipedia.org/wiki/Boolean_satisfiability_problem&#34;&gt;SAT solver&lt;/a&gt; in a &lt;a href=&#34;https://en.wikipedia.org/wiki/Conjunctive_normal_form&#34;&gt;CNF&lt;/a&gt;. They are at the heart of every modern so-called &amp;ldquo;CDCL&amp;rdquo; or &amp;ldquo;&lt;a href=&#34;https://en.wikipedia.org/wiki/Conflict_Driven_Clause_Learning&#34;&gt;Conflict-Driven Clause-Learning&lt;/a&gt;&amp;rdquo; SAT solver. SAT solver writers make a very important difference between learnt and original clauses. In this blog post I&amp;rsquo;ll talk a little bit about this distinction, why it is important to make it, and why we might want to relax that distinction in the future.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A variable elimination improvement</title>
      <link>https://www.msoos.org/2013/04/a-variable-elimination-improvement/</link>
      <pubDate>Sun, 21 Apr 2013 15:55:57 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/?p=1643</guid> 
      <description>&lt;p&gt;Lately, I have been thinking about how to improve &lt;a href=&#34;http://link.springer.com/chapter/10.1007%2F11499107_5&#34;&gt;variable elimination&lt;/a&gt;. It&amp;rsquo;s one of the most important things in SAT solvers, and it&amp;rsquo;s not exactly easy to do right.&lt;/p&gt;
&lt;h3 id=&#34;variable-elimination&#34;&gt;Variable elimination&lt;/h3&gt;
&lt;p&gt;Variable elimination simply resolves every occurrence of a literal &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;v&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;v1&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:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; with every occurrence of the literal &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 mathvariant=&#34;normal&#34;&gt;¬&lt;/mi&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;\neg v1&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:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;¬&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; , removes the original clauses and adds the resolvents. For example, let&amp;rsquo;s take the clauses&lt;/p&gt;
&lt;p&gt;&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;v&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∨&lt;/mo&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;∨&lt;/mo&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;v1 \vee v2 \vee v3&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:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;∨&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;∨&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&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;v&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∨&lt;/mo&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mo&gt;∨&lt;/mo&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;v1 \vee v4 \vee v5&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:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;∨&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;∨&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&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 mathvariant=&#34;normal&#34;&gt;¬&lt;/mi&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∨&lt;/mo&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;10&lt;/mn&gt;&lt;mo&gt;∨&lt;/mo&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;11&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;\neg v1 \vee v10 \vee v11&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:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;¬&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;∨&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;∨&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;11&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&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 mathvariant=&#34;normal&#34;&gt;¬&lt;/mi&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;∨&lt;/mo&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;12&lt;/mn&gt;&lt;mo&gt;∨&lt;/mo&gt;&lt;mi&gt;v&lt;/mi&gt;&lt;mn&gt;13&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;\neg v1 \vee v12 \vee v13&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:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;¬&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;∨&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mbin&#34;&gt;∨&lt;/span&gt;&lt;span class=&#34;mspace&#34; style=&#34;margin-right:0.2222em;&#34;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:0.6444em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord mathnormal&#34; style=&#34;margin-right:0.0359em;&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;mord&#34;&gt;13&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why programs fail</title>
      <link>https://www.msoos.org/2010/05/why-programs-fail/</link>
      <pubDate>Sat, 29 May 2010 18:18:00 +0000</pubDate>
       <guid isPermaLink="false">http://www.msoos.org/wordpress/?p=16</guid> 
      <description>&lt;p&gt;I just bought the &lt;a href=&#34;http://www.whyprogramsfail.com/&#34;&gt;book&lt;/a&gt; with the title of the blogpost by Andreas Zeller. Essentially, it&amp;rsquo;s about debugging, where the author analyses the chain of program defect leading to infected program state, finally leading to program failure. I bought the book because while working with CryptoMiniSat, I have encountered so many bugs that they could fill a book.&lt;/p&gt;
&lt;p&gt;The problem with chasing bugs in CryptoMiniSat is that SAT solvers employ a very optimised algorithm that makes a lot of decisions per second, so recording all interesting events makes for a very big dump file. I have per-module verbosity settings, so if I can narrow down what module(s) are causing the failure, there is less debug output to go through, but sometimes I still have to wade through 10-20GB dumps to see how the program state got infected.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
