Transitive OTF self-subsuming resolution

The title may be a bit long, but its essence is very simple: we try to shorten learnt clauses. The basic idea was described in this post: there is a clause we just derived, e.g. d V -e V f V g (1) where d,e,f,g are binary variables, - is binary negation, and V is the binary OR operator. We can remove a literal from this using self-subsuming resolution with e.g. the 2-long clause: ...

September 28, 2010 · 2 min · msoos

Propagating faster

Propagation (BCP) in SAT is the single most expensive operation. The algorithm essentially does the following: while (queue_head < trail.size()) { Literal p = trail[queue_head]; vector<Watch>& thiswatch = watches[p]; for (i = thiswatch.begin(); i!=thiswatch[p].end(); i++) { confl = prop_confl(i->clause); if (confl != NULL) return confl; } queue_head++; } where the function prop_confl() executes the propagation or returns a conflict, if necessary. The problem with the above function is that clauses come in all shapes and sizes. In CryptoMiniSat, there are two kinds of clauses, normal clauses and XOR clauses. Naturally, these need to be handled differently. Furthermore, if the clause’s size is small, it is more efficient to handle it differently. The way CryptoMiniSat has done this before was to have a separate " watches" for each of these. As you can guess, this is very suboptimal. ...

July 26, 2010 · 3 min · msoos

How to bit-stuff pointers

In my last post I have described a small problem I had regarding a C++ union that had to store a pointer and a value at the same time, plus an indicator that told us which of the two was active: class WhatLeadHere { public: bool wasPointer; union{Clause* pointer; uint32_t lit;}; }; Martin Maurer has wrote this enlightening email regarding this: The Clause * pointer is [..] located at least on a 4 byte boundary (at least when not forced by e.g. #pragma). If it is not at least on a 4 byte boundary, CPU must (at least some of them) do two accesses: one lower DWORD, one upper DWORD, and merge both together, which reduces speed. So the lower two bits are always zero :-) Why not move the “wasPointer” to lower two bits (i think you need only one, have one spare bit). Of course before accessing the “pointer” (Clause *), you must “and” the two lower bits back to zero. ...

June 30, 2010 · 2 min · msoos