Package org.smtlib.solvers
Class Solver_smt
java.lang.Object
org.smtlib.AbstractSolver
org.smtlib.solvers.Solver_smt
- All Implemented Interfaces:
ISolver
- Direct Known Subclasses:
Solver_yices2
This class is an adapter that takes the SMT-LIB ASTs and translates them into SMT
commands over a solver process speaking plain SMT-LIB, for a solver assumed to be
fully SMT-LIB compliant. It is otherwise a concrete, silent inheritor of
AbstractSolver: only translate(INode) is overridden (a real, solver-
specific deviation — a Bool-quantifier workaround, see Printer), plus start()/AbstractSolver.exit() (process
lifecycle, which AbstractSolver deliberately leaves unimplemented). :verbosity is
just forwarded to the solver like any other option (via AbstractSolver's default
set_option_impl) -- an earlier version of this class instead used a script's
:verbosity value to toggle jSMTLIB's own internal --verbose debug tracing
(smtConfig.verbose), which leaked "#Command to execute: ..." trace lines into the
solver's own response stream. Every other ISolver command — including get_assertions/get_value/
get_assignment/get_unsat_core/get_unsat_assumptions, whose precondition checks and
structured-response parsing now live in AbstractSolver — is inherited unchanged.
Subclasses of a genuinely non-compliant solver should override AbstractSolver.parseResponse(String) for their own quirks rather than assuming this class's
behavior; see AbstractSolver.parseResponse(String) for an example (legacy
bitvector literal syntax, multi-fragment error text) that used to live here as a
blanket default for every Solver_smt subclass, which was more defensive than this
fully-compliant-by-default adapter should assume.
-
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
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_smt(SMT.Configuration smtConfig, String executable) Creates an instance of the adapterSolver_smt(SMT.Configuration smtConfig, String[] args) -
Method Summary
Modifier and TypeMethodDescriptionString[]prompt()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.protected StringTranslates an S-expression into SMT syntax; this solver uses the standard S-expression concrete syntax except for a Bool-quantifier workaround (seePrinter).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, errorStopsSolver, execute, executePipelined, exit, exitedResponse, finishPipelined, forceExit, get_assertions, get_assignment, get_info, get_model, get_option, get_proof, get_unsat_assumptions, get_unsat_core, get_value, hasPending, inSatMode, interrupt, inUnsatMode, isFlatResponse, isTimeLimitResponse, lineNumberPatterns, logSolverDiagnostics, modelResponse, nextSolverLine, normalizeForTesting, outOfStep, parseResponse, pipelines, pop, proofResponse, push, readPipelined, recordChange, reportsEarlierLines, reportSeedIgnored, requireNoChangeSinceCheck, requireOptionEnabled, requireSatOrUnknown, requireUnsat, reset, reset_assertions, responseEnd, selfReportsImmediateExit, sendChange, sendCommand, sendExitCommand, sendFailure, sendFailure, sendPipelined, sendScriptText, sendSeed, set_info, set_logic, set_option, set_option_impl, setSourceLine, shapeOf, smt, solverName, solverPrintsSuccess, successOrEmpty, timeLimitResponse, timeLimitResponseAfterExit, 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_assertions, get_assignment, get_info, get_model, get_option, get_proof, get_unsat_assumptions, get_unsat_core, get_value, pop, push, reset, reset_assertions, set_info, set_logic, set_option, setSourceLine, smt, solverName
-
Constructor Details
-
Solver_smt
Creates an instance of the adapter -
Solver_smt
-
-
Method Details
-
cmd
-
prompt
-
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:
-
translate
Translates an S-expression into SMT syntax; this solver uses the standard S-expression concrete syntax except for a Bool-quantifier workaround (seePrinter).- Overrides:
translatein classAbstractSolver- Throws:
IVisitor.VisitorException
-