https://github.com/c-cube/sidekick
A modular library for CDCL(T) SMT solvers, with [wip] proof generation.
https://github.com/c-cube/sidekick
cdcl-t congruence-closure formal-methods functor prover sat-solver smt-solver
Last synced: 4 months ago
JSON representation
A modular library for CDCL(T) SMT solvers, with [wip] proof generation.
- Host: GitHub
- URL: https://github.com/c-cube/sidekick
- Owner: c-cube
- License: apache-2.0
- Created: 2018-01-21T23:52:28.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-01-28T02:52:07.000Z (5 months ago)
- Last Synced: 2025-03-07T01:45:10.996Z (4 months ago)
- Topics: cdcl-t, congruence-closure, formal-methods, functor, prover, sat-solver, smt-solver
- Language: SMT
- Homepage: https://c-cube.github.io/sidekick/
- Size: 15.4 MB
- Stars: 24
- Watchers: 4
- Forks: 15
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sidekick [](https://github.com/c-cube/sidekick/actions/workflows/main.yml)
Sidekick is an OCaml library for creating SMT solvers following
the CDCL(T) approach (so called "lazy SMT"). See [below](#short-summary)
for a more detailed explanation.It derives from [Alt-Ergo Zero](http://cubicle.lri.fr/alt-ergo-zero)
and its fork [mSAT](https://github.com/gbury/msat).## Documentation
See [the API documentation](https://c-cube.github.io/sidekick/).
A work-in-progress [guide](doc/guide.md) provides a more step-by-step
introduction to how to use and modify sidekick.## Short summary
[SMT solvers](https://en.wikipedia.org/wiki/Satisfiability_modulo_theories)
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](https://github.com/Z3Prover/z3),
[cvc5](https://cvc5.github.io/), [Yices 2](https://github.com/SRI-CSL/yices2/),
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](https://en.wikipedia.org/wiki/Conflict-driven_clause_learning),
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](https://ocaml.org/)
and with a strong focus on modularity and reusability of components.
It _used to_ provide a functorized interface, but it now comes with its own
representation of terms, in a simple version of the Calculus of Constructions.
Users can extend that term representation by adding new custom _constants_
to model their domain theories. Most of the constants defined in sidekick are
defined exactly as outside constants would be.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](https://github.com/Gbury/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](https://github.com/ocaml/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](http://opam.ocaml.org), 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`.