@@ -1455,16 +1455,71 @@ \section{MCSAT}
14551455non-linear arithmetic are presented in a preprint~\cite {jovanovic2021interpolation }.
14561456
14571457\section {Third-Party SAT Solvers }
1458+ \label {delegates }
1459+
1460+ Yices supports using third-party Boolean satisfiability solvers as the
1461+ back-end CNF engine for QF\_ BV problems. Such solvers, called
1462+ \emph {delegates }, are optional but can provide significant performance
1463+ improvements. When a delegate is selected, Yices performs `` bit
1464+ blasting'' as usual --- converting the problem to an equisatisfiable
1465+ SAT problem in conjunctive normal form (CNF) --- and then hands the
1466+ resulting CNF to the selected delegate instead of the internal Yices
1467+ CDCL SAT solver. Bit-blasting itself is unchanged.
1468+
1469+ Yices recognizes four delegate names. \texttt {y2sat } is an internal
1470+ SAT solver always available in any Yices build. CaDiCaL,
1471+ CryptoMiniSat, and Kissat are external solvers; support for each must
1472+ be enabled at compilation time as explained in
1473+ Chapter~\ref {compilation }. The capability matrix is summarized below.
1474+ \begin {center }
1475+ \begin {tabular }{|l|c|c|c|c|}
1476+ \hline
1477+ Delegate & Always available & Incremental push/pop &
1478+ \texttt {check-sat-assuming } & Unsat core from assumptions \\
1479+ \hline
1480+ \texttt {y2sat } & yes & rebuild on each check & rebuild on each check & no \\
1481+ \texttt {cadical } & no & yes (selector frames) & yes & yes \\
1482+ \texttt {cryptominisat }& no & yes (selector frames) & yes & yes \\
1483+ \texttt {kissat } & no & rebuild on each check & rebuild on each check & no \\
1484+ \hline
1485+ \end {tabular }
1486+ \end {center }
1487+
1488+ A delegate can be selected in three ways:
1489+ \begin {itemize }
1490+ \item from the SMT-LIB~2 frontend, by passing
1491+ \texttt {--delegate=<solver> } to \texttt {yices-smt2 }
1492+ (Section~\ref {smt2-tool });
1493+ \item from the API, by setting the \texttt {sat-delegate } parameter on
1494+ the context configuration with \texttt {yices\_ set\_ config } before
1495+ the context is created;
1496+ \item from the API on a per-check basis, by setting the
1497+ \texttt {delegate } field of a search-parameter record with
1498+ \texttt {yices\_ set\_ param }, and passing that record to
1499+ \texttt {yices\_ check\_ context } (or one of its variants).
1500+ \end {itemize }
1501+ The one-shot helpers \texttt {yices\_ check\_ formula } and
1502+ \texttt {yices\_ check\_ formulas } also accept a delegate name as their
1503+ last argument; they bit-blast the input formulas into a fresh CNF and
1504+ hand it to the chosen delegate.
1505+
1506+ For incremental QF\_ BV contexts (\texttt {push-pop } or
1507+ \texttt {multi-checks } mode), CaDiCaL and CryptoMiniSat support a
1508+ \emph {selector-frames } strategy that keeps the delegate live across
1509+ \texttt {check-sat } calls and uses fresh selector literals to retract
1510+ clauses on \texttt {pop }. This strategy preserves learned clauses
1511+ between checks and is selected by setting the
1512+ \texttt {sat-delegate-selector-frames } configuration parameter to
1513+ \texttt {"true" } on the context. The default is \texttt {"false" }, in
1514+ which case the delegate is rebuilt from the current bit-blasted
1515+ problem at every mutation. The non-incremental delegates
1516+ \texttt {y2sat } and Kissat are always rebuilt on each check; the
1517+ \texttt {sat-delegate-selector-frames } option has no effect for them.
14581518
1459- In Yices 2.6.2, we have added support for using third-party Boolean
1460- satisfiability solvers. Such solvers are optional but can provide
1461- significant performance improvements on bit-vector problems. Use of
1462- these SAT solvers is enabled by a command-line option and is currently
1463- restricted to non-incremental QF\_ BV problems. If an external solver
1464- is selected, Yices will perform `` bit blasting,'' that is, convert the
1465- problem to an equisatisfiable SAT problem in conjunctive normal form
1466- (CNF) and use the third-party solver to check satisfiability of this
1467- CNF formula.
1519+ The full list of API names recognized by these mechanisms, together
1520+ with their possible values and error codes, is documented in the
1521+ \texttt {yices.h } header and on the Yices website (see
1522+ Section~\ref {full-api }).
14681523
14691524
14701525
@@ -3652,6 +3707,7 @@ \section{SMT-LIB 2.x}
36523707
36533708
36543709\subsection {Tool Invocation }
3710+ \label {smt2-tool }
36553711
36563712To run \texttt {yices-smt2 } on an input file, type
36573713\begin {small }
@@ -3772,7 +3828,13 @@ \subsubsection*{Selecting a Back-end SAT Solver}
37723828problems by preprocessing and simplification, without producing a CNF
37733829formula. In such cases, the \texttt {delegate } option is irrelevant.
37743830
3775- \paragraph {Limitation: } Currently, use of the delegates is restricted to non-incremental problems.
3831+ \paragraph {Incremental use: } Delegates can be used with
3832+ \texttt {--incremental } on QF\_ BV problems. CaDiCaL and CryptoMiniSat
3833+ support incremental delegate checks. Non-incremental delegates such as
3834+ \texttt {y2sat } and Kissat are rebuilt from the current bit-blasted
3835+ problem on each \texttt {check-sat }. The selector-frame configuration
3836+ used by the API for incremental delegates has no effect for
3837+ non-incremental delegates.
37763838
37773839\subsubsection* {Exporting to Dimacs }
37783840
@@ -3864,7 +3926,10 @@ \subsubsection*{All Command-line Options}
38643926
38653927\item [--delegate=<solver>] Select an external SAT solver for bit-vector problems,
38663928
3867- The \texttt {<solver> } can be either \texttt {cadical }, or \texttt {cryptominisat }, or \texttt {y2sat }.
3929+ The \texttt {<solver> } can be either \texttt {cadical },
3930+ \texttt {cryptominisat }, \texttt {kissat }, or \texttt {y2sat }. In
3931+ incremental mode, \texttt {y2sat } and Kissat are rebuilt from the
3932+ current bit-blasted problem on each \texttt {check-sat }.
38683933
38693934\item [--dimacs=<filename>] Bitblast then export the CNF to a file (in DIMACS format).
38703935
@@ -4641,6 +4706,7 @@ \subsection*{Building and Querying a Model}
46414706
46424707
46434708\section {Full API }
4709+ \label {full-api }
46444710
46454711The main header file \texttt {yices.h } includes documentation about all
46464712API functions. We provide more documentation on the Yices website:
0 commit comments