GC is now eager in the cleanup of watchlists and more elaborate. It starts by marking all clauses justifying literals on the trail, because we cannot remove them yet (they might be used in resolution steps during clause analysis). Then, we sort set of learnt clauses by decreasing activity, and pop them one by one until the target size is reached. Clauses that are marked, because they are on the trail, are kept on the side so we can push them back at the end. For each clause we want to remove, we start by marking it "dead". Then we mark its two watch literals are "dirty", which means we will need to purge their watchlists from dead clauses. Then we purge watchlists (remove deadclauses entirely). At this point the dead clauses are unreachable from both trail and watchlists. We can remove all data for each such clause, and put their index for recycling so another new clause can reuse their slot. Finally we unmark dirty literals and saved-by-trail-explanation explanation clauses. |
||
|---|---|---|
| .github/workflows | ||
| doc | ||
| src | ||
| tests | ||
| .gitignore | ||
| .ocp-indent | ||
| dune | ||
| dune-project | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| sidekick | ||
| sidekick-base.opam | ||
| sidekick-bin.opam | ||
| sidekick.opam | ||
Sidekick 
Sidekick is an OCaml library with a functor to create SMT solvers following the CDCL(T) approach (so called "lazy SMT"). See below for a more detailed explanation.
It derives from Alt-Ergo Zero and its fork mSAT.
Documentation
A work-in-progress guide provides a more step-by-step introduction to how to use and modify sidekick.
Short summary
SMT solvers are automatic tools that try to assess whether a given logic formula is satisfiable (admits a model, an interpretation that makes it true) or unsatisfiable (no interpretation can make it true; it is absurd, and its negation is a theorem). Prominent solvers include Z3, cvc5, Yices 2, and others; all of them follow the CDCL(T) paradigm. Most of these solvers are implemented in C or C++.
CDCL(T) is the combination of CDCL, the leading technique for SAT solving (as popularized by Chaff, minisat, etc. in the early oughties), and a theory T. In practice, SMT solvers combine multiple theories into one before doing the combination with the SAT solver. Some examples of theories are uninterpreted functions symbols, integer linear arithmetic ("LIA"), rational nonlinear arithmetic ("NRA"), bitvectors for fixed-size arithmetic, algebraic datatypes, and others.
Sidekick is a CDCL(T) solver implemented in pure OCaml and with a strong focus on modularity and reusability of components. Almost everything in the code is functorized and generic over the concrete representation of terms, formulas, etc. The goal is for users to be able to implement their own theories and combine them with the pre-existing ones in a bespoke solver, something that is typically a lot of work in the C/C++ solvers.
Sidekick comes in several components (as in, opam packages):
sidekickis the core library, with core type definitions (seesrc/core/), an implementation of CDCL(T) based on mSat, a congruence closure, and the theories of boolean formulas, LRA (linear rational arithmetic, using a simplex algorithm), and datatypes.sidekick-baseis a library with concrete implementations for terms, arithmetic functions, and proofs. It comes with an additional dependency on zarith to represent numbers (zarith is a GMP wrapper for arbitrary precision numbers).sidekick-binis an executable that is able to parse problems in the SMT-LIB-2.6 format, in theQF_UFLRAfragment, and solves them usingsidekickinstantiated withsidekick-base. It is mostly useful as a test tool for the libraries and as a starting point for writing custom solvers.
Installation
Via opam
Once the package is on opam, just opam install sidekick.
For the development version, use:
opam pin https://github.com/c-cube/sidekick.git
Manual installation
You will need dune . The command is:
make install
Copyright
This program is distributed under the Apache Software License version
2.0. See the enclosed file LICENSE.