1 /********************* */
4 ** Top contributors (to current version):
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
8 ** in the top-level source directory and their institutional affiliations.
9 ** All rights reserved. See the file COPYING in the top-level source
10 ** directory for licensing information.\endverbatim
12 ** \brief Wrapper for Kissat SAT Solver.
14 ** Wrapper for the Kissat SAT solver (for theory of bit-vectors).
17 #include "cvc4_private.h"
19 #ifndef CVC4__PROP__KISSAT_H
20 #define CVC4__PROP__KISSAT_H
22 #ifdef CVC4_USE_KISSAT
24 #include "prop/sat_solver.h"
27 #include <kissat/kissat.h>
33 class KissatSolver
: public SatSolver
35 friend class SatSolverFactory
;
38 ~KissatSolver() override
;
40 ClauseId
addClause(SatClause
& clause
, bool removable
) override
;
42 ClauseId
addXorClause(SatClause
& clause
, bool rhs
, bool removable
) override
;
44 SatVariable
newVar(bool isTheoryAtom
= false,
45 bool preRegister
= false,
46 bool canErase
= true) override
;
48 SatVariable
trueVar() override
;
49 SatVariable
falseVar() override
;
51 SatValue
solve() override
;
52 SatValue
solve(long unsigned int&) override
;
53 SatValue
solve(const std::vector
<SatLiteral
>& assumptions
) override
;
55 void interrupt() override
;
57 SatValue
value(SatLiteral l
) override
;
59 SatValue
modelValue(SatLiteral l
) override
;
61 unsigned getAssertionLevel() const override
;
63 bool ok() const override
;
68 StatisticsRegistry
* d_registry
;
69 IntStat d_numSatCalls
;
70 IntStat d_numVariables
;
72 TimerStat d_solveTime
;
73 Statistics(StatisticsRegistry
* registry
, const std::string
& prefix
);
78 * Private to disallow creation outside of SatSolverFactory.
79 * Function init() must be called after creation.
81 KissatSolver(StatisticsRegistry
* registry
, const std::string
& name
= "");
83 * Initialize SAT solver instance.
84 * Note: Split out to not call virtual functions in constructor.
90 unsigned d_nextVarIdx
;
95 Statistics d_statistics
;
101 #endif // CVC4_USE_KISSAT
102 #endif // CVC4__PROP__KISSAT_H