A modular library for CDCL(T) SMT solvers, with [wip] proof generation.
Find a file
Simon Cruanes a313918e74
doc
2022-09-19 22:27:43 -04:00
.github/workflows actions: run tests on 4.14 only 2022-08-29 21:05:48 -04:00
doc update guide 2022-09-10 22:22:30 -04:00
examples/sudoku feat(const): add opaque_to_cc property, to control CC 2022-08-31 00:41:42 -04:00
src doc 2022-09-19 22:27:43 -04:00
tests add regression test 2022-09-10 21:55:49 -04:00
unittest test: update expected results 2022-08-29 20:28:42 -04:00
.gitignore gitignore 2022-07-18 23:27:07 -04:00
.ocamlformat use ocamlformat 2022-07-14 22:09:13 -04:00
.ocp-indent ocpindent config 2017-12-28 18:55:01 +01:00
dune perf: dune flags 2022-08-14 22:32:21 -04:00
dune-project use ocamlformat 2022-07-14 22:09:13 -04:00
LICENSE update of license 2014-10-29 13:42:53 +01:00
Makefile chore: makefile targets for some incremental benchs 2022-09-16 21:08:58 -04:00
proof-trace-dump.sh add a simple binary to dump proof traces 2021-10-21 20:33:10 -04:00
README.md doc: update readme 2021-07-04 00:27:31 -04:00
sidekick-base.opam try to fix CI 2021-11-28 19:08:26 -05:00
sidekick-bin.opam bump min requirement to 4.08 2021-10-12 23:05:25 -04:00
sidekick.opam use ocamlformat 2022-07-14 22:09:13 -04:00
sidekick.sh sidekick.sh: make dune phase silent 2022-07-18 23:28:45 -04:00
sudoku_solve.sh refactor sudoku solver; make it compile; use new term repr 2022-08-13 13:30:21 -04:00

Sidekick Build

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

See the API 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):

  • sidekick is the core library, with core type definitions (see src/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-base is 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-bin is an executable that is able to parse problems in the SMT-LIB-2.6 format, in the QF_UFLRA fragment, and solves them using sidekick instantiated with sidekick-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

This program is distributed under the Apache Software License version 2.0. See the enclosed file LICENSE.