5 comments on “Changing the Watchlist Scheme

  1. The first link is invalid (though it’s not very hard to figure out what it should be).

    Are you certain that the watched literal scheme is better/faster than simply counting the number of remaining literals in each clause and scanning the clause (to find out what to propagate) only when it becomes unit? These counters could be per-thread, and would only require 1 byte each (for a maximum of 255 literals per clause).

    Or maybe I missed something (as usual ;-)).

    • That would require a full occurrence list to be maintained and checked for every assignment of every variable. An occurrence list is when you have occ[lit1] = clauseX, clauseY, etc. where both clauseX and clauseY has literal lit1 inside. Basically, you can think of the watchlist scheme as a lazy occurrence list, where we are only interested in a clause if exactly 1 or exactly 0 literals have remained unassigned. For “large” clauses (maybe even for as low as >5), this watchlist scheme means we have to go through far less data when propagating. For clauses of size >100 this is trivial to think through and the analogy _might_ work all the way down to size 6, but it would be very interesting to see where it tips in favour of one or the other.

      What you have described (a full occurrence list) is quite interesting for so-called lookahead solvers, which do (as their name suggests) lookahead, and determine not only how many assignments would be made for branching on varY but also count the number of clauses that would become binary, for example. With Gaussian elimination running in parallel, and with some ideas, CryptoMiniSat in particular is moving more and more towards being a lookahead solver in terms of speed vs. thinking time, where non-lookahead solvers typically preferred making a fast bad move than making an intelligent but expensive move.

  2. BTW, it may be interesting to look at SArTagnan:

    http://baldur.iti.uka.de/sat-race-2010/descriptions/solver_24.pdf
    http://algo.inf.uni-tuebingen.de/mitarbeiter/stephankottler/downloads/KottlerKaufmann_SArTagnanAParallelPortfolioSATSolverWithLocklessPhysicalClauseSharing.pdf

    They write:

    “However, most state–of–the–art SAT solvers implement the two watched literals scheme [30] in the way it was suggested in [35]: The two watched literals of a clause are always placed at the first two positions of the array of literals. Thus, the position of literals in a clause is permuted permanently. This idea can not be implemented when a clause is shared, since the two watching literals may differ in different solving threads.”

    It seems that they store the XOR of the two watch indices in thread-local storage, but I didn’t read the whole paper yet.

    • I don’t understand how they can detach a clause without inspecting the watchlist of every literal in that clause, though. Because in the case of detaching, you would need to know BOTH the watched literals, but using the XOR trick you can only obtain one if you have the other. Maybe detach is so rare that this is fine?

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>