Class Solver_cvc5
- All Implemented Interfaces:
ISolver
AbstractSolver — only the startup command line (cvc5 needs --incremental
to accept push/pop at all, and --quiet to suppress informational stderr
chatter that would otherwise fool SolverProcess's stdout/stderr-preference
heuristic) and start() (process lifecycle) are overridden. Empirically
(against cvc5 1.3.2), none of the CVC4-era workarounds a previous version of this
class used to need still apply: cvc5 handles Bool-sorted quantifiers natively (no
translate() workaround needed), get-value/
get-option return clean standard-shaped responses (no Response.Seq workaround
needed), and get-info/get-option round-trip through AbstractSolver's generic
parseResponse without issue -- with one exception, get_option(org.smtlib.IExpr.IKeyword), described
below.
One confirmed, patchable compliance gap: cvc5 answers (get-option
:regular-output-channel)/(get-option :diagnostic-output-channel) with a
bare, unquoted symbol (stdout/stderr) rather than the SMT-LIB string
literal ("stdout"/"stderr") these two options are specified to hold --
confirmed against a real cvc5 1.3.2 process. get_option(org.smtlib.IExpr.IKeyword) wraps a bare-symbol
answer for either option into a proper string literal with the same text.
One confirmed, non-workaroundable compliance gap: cvc5 self-reports
(get-info :error-behavior) as immediate-exit (not
continued-execution) and its process actually exits after a top-level parse
error. Neither (set-option :error-behavior continued-execution) (rejected
as unsupported) nor (set-info :error-behavior continued-execution)
(silently accepted but with no actual effect — get-info still reports
immediate-exit and the process still dies) can change this, so there's no way to
ask for the other mode. selfReportsImmediateExit() tells AbstractSolver.sendCommand(ICommand, boolean) about this, so once cvc5 reports one
real error, jSMTLIB pauses briefly before sending anything further, giving the
process time to actually finish exiting (if it is going to) before the next
command's liveness check runs.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.smtlib.AbstractSolver
AbstractSolver.Pending, AbstractSolver.Shape, AbstractSolver.StackChangeNested classes/interfaces inherited from interface org.smtlib.ISolver
ISolver.CreationException -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]The command-line arguments for launching the solver.protected String[]protected String[]protected String[]Fields inherited from class org.smtlib.AbstractSolver
checkSatStatus, END_WAIT_MILLIS, endedByTimeLimit, isMac, isWindows, linesOffset, options, printSuccess, printSuccessResponse, smtConfig, SOLVER_EXITED, solverProcess -
Constructor Summary
ConstructorsConstructorDescriptionSolver_cvc5(SMT.Configuration smtConfig, String executable) Creates an instance of the solverSolver_cvc5(SMT.Configuration smtConfig, String[] command) Launches the given command as is (a .command property, #147), without adding the flags the executable form adds -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanerrorStopsSolver(IResponse error) cvc5 carries on after most errors (e.g.cvc5 answers get-assertions with :produce-assertions offcvc5 answers get-assignment with :produce-assignments off (if :produce-models is on), and in assert mode after a checkcvc5 answers get-model in assert mode after a checkget_option(IExpr.IKeyword option) See the class Javadoc: wraps a bare-symbol answer for a string-typed option (Utils.stringOptions -- currently just :regular-output-channel and :diagnostic-output-channel) into a proper SMT-LIB string literal with the same text, working around cvc5 answering those two with an unquoted symbol instead.cvc5 answers get-proof in assert mode after a checkcvc5 aborts on get-unsat-assumptions in assert mode after a checkcvc5 answers get-unsat-core in assert mode after a checkcvc5 answers get-value in assert mode after a checkprotected booleanisTimeLimitResponse(String rawResponse) cvc5 reports 'cvc5 interrupted by timeout.' on stderr, with no answer, when its whole-run limit, --tlimit, ends it, and then aborts (checked with cvc5 1.3.2)Patterns matching the line numbers in this solver's messages about the command answered: group 1 is the text before the number, group 2 the number, group 3 the text after itprotected intThe solver line, as the solver numbers lines in its messages, on which the next text sent starts; overridden for a solver that does not number the lines of its whole inputreset()Resets the solver to the initial state, clearing all assertions, declarations, and options.protected booleanOverridden by a subclass whose target solver's :error-behavior is immediate-exit (e.g.protected IResponseset_option_impl(IExpr.IKeyword key, IAttributeValue value) Override in subclasses to handle solver-specific options.start()Starts the solver; this is not an SMT-LIB command, but it is convenient in some implementations to separate the starting and initialization from the construction of the solver instance.Methods inherited from class org.smtlib.AbstractSolver
assertExpr, check_sat, check_sat_assuming, checkImmediateExit, checkPrintSuccess, checkSatStatus, checkShape, checkStatus, comment, correctResponse, declare_const, declare_datatype, declare_datatypes, declare_fun, declare_sort, declare_sort_parameter, define_const, define_fun, define_fun_rec, define_funs_rec, define_sort, earlierSourceLine, echo, execute, executePipelined, exit, exitedResponse, finishPipelined, forceExit, get_info, hasPending, inSatMode, interrupt, inUnsatMode, isFlatResponse, logSolverDiagnostics, modelResponse, normalizeForTesting, outOfStep, parseResponse, pipelines, pop, proofResponse, push, readPipelined, recordChange, reportsEarlierLines, reportSeedIgnored, requireNoChangeSinceCheck, requireOptionEnabled, requireSatOrUnknown, requireUnsat, reset_assertions, responseEnd, sendChange, sendCommand, sendExitCommand, sendFailure, sendFailure, sendPipelined, sendScriptText, sendSeed, set_info, set_logic, set_option, setSourceLine, shapeOf, smt, solverName, solverPrintsSuccess, successOrEmpty, timeLimitResponse, timeLimitResponseAfterExit, translate, unsatAssumptionsElements, unsatCoreElements, withSourceLinesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.smtlib.ISolver
assertExpr, check_sat, check_sat_assuming, checkSatStatus, comment, declare_const, declare_datatype, declare_datatypes, declare_fun, declare_sort, declare_sort_parameter, define_const, define_fun, define_fun_rec, define_funs_rec, define_sort, echo, execute, exit, forceExit, get_info, pop, push, reset_assertions, set_info, set_logic, set_option, setSourceLine, smt, solverName
-
Field Details
-
cmds
The command-line arguments for launching the solver. --print-success turns on success replies from the very first command onward (confirmed: --interactive does NOT imply it by itself -- without --print-success, the first command gets no reply at all), so no priming (set-option :print-success true) is needed in start(). -
cmds_win
-
cmds_mac
-
cmds_unix
-
-
Constructor Details
-
Solver_cvc5
Creates an instance of the solver -
Solver_cvc5
Launches the given command as is (a .command property, #147), without adding the flags the executable form adds
-
-
Method Details
-
selfReportsImmediateExit
protected boolean selfReportsImmediateExit()Description copied from class:AbstractSolverOverridden by a subclass whose target solver's :error-behavior is immediate-exit (e.g. cvc5, yices2) rather than the SMT-LIB default of continued-execution -- such a solver's process may start exiting asynchronously right after it reports an error, andSolverProcess.send(boolean, String...)'s own process.isAlive() check can still read true for a brief window afterward (OS process-death bookkeeping lags the actual exit) -- seeAbstractSolver.sendCommand(ICommand, boolean), which uses this to give a solver that just reported an error a moment to actually finish dying before the next command's liveness check runs, closing that race deterministically rather than guessing from the error's content whether the process will actually exit.- Overrides:
selfReportsImmediateExitin classAbstractSolver
-
lineNumberPatterns
Description copied from class:AbstractSolverPatterns matching the line numbers in this solver's messages about the command answered: group 1 is the text before the number, group 2 the number, group 3 the text after it- Overrides:
lineNumberPatternsin classAbstractSolver
-
nextSolverLine
protected int nextSolverLine()Description copied from class:AbstractSolverThe solver line, as the solver numbers lines in its messages, on which the next text sent starts; overridden for a solver that does not number the lines of its whole input- Overrides:
nextSolverLinein classAbstractSolver
-
isTimeLimitResponse
cvc5 reports 'cvc5 interrupted by timeout.' on stderr, with no answer, when its whole-run limit, --tlimit, ends it, and then aborts (checked with cvc5 1.3.2)- Overrides:
isTimeLimitResponsein classAbstractSolver
-
errorStopsSolver
cvc5 carries on after most errors (e.g. sort errors), but after a parse error it no longer processes input, and when run interactively it does not always exit either -- so it is stopped (see AbstractSolver.checkImmediateExit).- Overrides:
errorStopsSolverin classAbstractSolver
-
start
Description copied from interface:ISolverStarts the solver; this is not an SMT-LIB command, but it is convenient in some implementations to separate the starting and initialization from the construction of the solver instance.- Specified by:
startin interfaceISolver- Overrides:
startin classAbstractSolver- Returns:
- success or an SMT error response
- See Also:
-
get_option
See the class Javadoc: wraps a bare-symbol answer for a string-typed option (Utils.stringOptions -- currently just :regular-output-channel and :diagnostic-output-channel) into a proper SMT-LIB string literal with the same text, working around cvc5 answering those two with an unquoted symbol instead.- Specified by:
get_optionin interfaceISolver- Overrides:
get_optionin classAbstractSolver- Parameters:
option- the keyword naming the option- Returns:
- the option value, or unsupported, or an SMT error response
- See Also:
-
set_option_impl
Description copied from class:AbstractSolverOverride in subclasses to handle solver-specific options. Channel options are handled by set_option and never reach here. This default handles :print-success client-side (seeAbstractSolver.checkPrintSuccess(org.smtlib.SMT.Configuration, org.smtlib.IExpr.IKeyword, org.smtlib.IAttributeValue)): the solver process is always left with :print-success true at the wire level (see start()/sendCommand()) -- without that, we'd get no acknowledgment at all for other commands once a script turns it off -- so it is answered entirely client-side, matching the local smtConfig.nosuccess flag, and is never itself forwarded to the solver process. A subclass that overrides set_option_impl for other reasons (e.g. to also track option values locally) needs its own checkPrintSuccess call, same as it always has -- this default is only reached by a subclass that doesn't override set_option_impl at all.- Overrides:
set_option_implin classAbstractSolver
-
reset
Description copied from interface:ISolverResets the solver to the initial state, clearing all assertions, declarations, and options.- Specified by:
resetin interfaceISolver- Overrides:
resetin classAbstractSolver- Returns:
- success or an SMT error response
- See Also:
-
get_assertions
cvc5 answers get-assertions with :produce-assertions off- Specified by:
get_assertionsin interfaceISolver- Overrides:
get_assertionsin classAbstractSolver- Returns:
- a sequence of asserted terms, unsupported, or an SMT error response
- See Also:
-
get_assignment
cvc5 answers get-assignment with :produce-assignments off (if :produce-models is on), and in assert mode after a check- Specified by:
get_assignmentin interfaceISolver- Overrides:
get_assignmentin classAbstractSolver- Returns:
- a list of name–Boolean pairs, unsupported, or an SMT error response
- See Also:
-
get_model
cvc5 answers get-model in assert mode after a check- Specified by:
get_modelin interfaceISolver- Overrides:
get_modelin classAbstractSolver- Returns:
- a model, unsupported, or an SMT error response
- See Also:
-
get_value
cvc5 answers get-value in assert mode after a check- Specified by:
get_valuein interfaceISolver- Overrides:
get_valuein classAbstractSolver- Parameters:
terms- expressions to evaluate- Returns:
- a list of term–value pairs, unsupported, or an SMT error response
- See Also:
-
get_proof
cvc5 answers get-proof in assert mode after a check- Specified by:
get_proofin interfaceISolver- Overrides:
get_proofin classAbstractSolver- Returns:
- a proof, unsupported, or an SMT error response
- See Also:
-
get_unsat_core
cvc5 answers get-unsat-core in assert mode after a check- Specified by:
get_unsat_corein interfaceISolver- Overrides:
get_unsat_corein classAbstractSolver- Returns:
- a list of formula names, unsupported, or an SMT error response
- See Also:
-
get_unsat_assumptions
cvc5 aborts on get-unsat-assumptions in assert mode after a check- Specified by:
get_unsat_assumptionsin interfaceISolver- Overrides:
get_unsat_assumptionsin classAbstractSolver- Returns:
- a list of assumption literals, unsupported, or an SMT error response
- See Also:
-