check_symbol_exists(strerror_r "string.h" HAVE_STRERROR_R)
check_symbol_exists(strtok_r "string.h" HAVE_STRTOK_R)
-# Check whether the verison of CaDiCaL used supports incremental solving
-if(USE_CADICAL)
- check_cxx_source_compiles(
- "
- #include <${CaDiCaL_HOME}/src/cadical.hpp>
- int main() { return sizeof(&CaDiCaL::Solver::assume); }
- "
- CVC4_INCREMENTAL_CADICAL
- )
- if(CVC4_INCREMENTAL_CADICAL)
- add_definitions(-DCVC4_INCREMENTAL_CADICAL)
- endif()
-endif()
-
# Determine if we have the POSIX (int) or GNU (char *) variant of strerror_r.
check_c_source_compiles(
"
-#!/bin/bash
+#!/usr/bin/env bash
#
source "$(dirname "$0")/get-script-header.sh"
exit 1
fi
-commit="b44ce4f0e64aa400358ae3a8adb45b24ae6e742c"
+version="rel-1.0.3"
-git clone https://github.com/arminbiere/cadical cadical
+webget "https://github.com/arminbiere/cadical/archive/$version.tar.gz" "cadical-$version.tar.gz"
+tar xfvz "cadical-$version.tar.gz"
+rm "cadical-$version.tar.gz"
+mv "cadical-$version" cadical
cd cadical
-git checkout $commit
CXXFLAGS="-fPIC" ./configure && make -j$(nproc)
}
else if (optarg == "cadical")
{
-#ifndef CVC4_INCREMENTAL_CADICAL
- if (options::incrementalSolving()
- && options::incrementalSolving.wasSetByUser())
- {
- throw OptionException(std::string(
- "CaDiCaL version used does not support incremental mode. \n\
- Update CaDiCal or Try --bv-sat-solver=cryptominisat or "
- "--bv-sat-solver=minisat"));
- }
-#endif
-
if (options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY
&& options::bitblastMode.wasSetByUser())
{
return SAT_VALUE_UNKNOWN;
}
+/* Note: CaDiCaL returns lit/-lit for true/false. Older versions returned 1/-1.
+ */
SatValue toSatValueLit(int value)
{
- if (value == 1) return SAT_VALUE_TRUE;
- Assert(value == -1);
+ if (value > 0) return SAT_VALUE_TRUE;
+ Assert(value < 0);
return SAT_VALUE_FALSE;
}
SatValue CadicalSolver::solve(const std::vector<SatLiteral>& assumptions)
{
-#ifdef CVC4_INCREMENTAL_CADICAL
TimerStat::CodeTimer codeTimer(d_statistics.d_solveTime);
for (const SatLiteral& lit : assumptions)
{
d_okay = (res == SAT_VALUE_TRUE);
++d_statistics.d_numSatCalls;
return res;
-#else
- Unimplemented("CaDiCaL version used does not support incremental solving");
-#endif
}
void CadicalSolver::interrupt() { d_solver->terminate(); }
regress0/bv/core/slice-20.smt
regress0/bv/divtest_2_5.smt2
regress0/bv/divtest_2_6.smt2
+ regress0/bv/eager-inc-cadical.smt2
regress0/bv/eager-inc-cryptominisat.smt2
regress0/bv/eager-force-logic.smt2
regress0/bv/fuzz01.smt
--- /dev/null
+; REQUIRES: cadical
+; COMMAND-LINE: --incremental --bv-sat-solver=cadical --bitblast=eager
+(set-logic QF_BV)
+(set-option :incremental true)
+(declare-fun a () (_ BitVec 16))
+(declare-fun b () (_ BitVec 16))
+(declare-fun c () (_ BitVec 16))
+
+(assert (bvult a (bvadd b c)))
+(set-info :status sat)
+(check-sat)
+
+(push 1)
+(assert (bvult c b))
+(set-info :status sat)
+(check-sat)
+
+
+(push 1)
+(assert (bvugt c b))
+(set-info :status unsat)
+(check-sat)
+(pop 2)
+
+(set-info :status sat)
+(check-sat)
+(exit)