Package org.smtlib.solvers
Class Solver_smtinterpol
java.lang.Object
org.smtlib.AbstractSolver
org.smtlib.solvers.Solver_smtinterpol
- All Implemented Interfaces:
ISolver
This class is an adapter for SMTInterpol (a Java SMT solver launched as
java -jar smtinterpol-VERSION.jar, not a native executable): it is a concrete,
silent inheritor of AbstractSolver -- the base launch command is declared in
jsmtlib.properties via org.smtlib.solver_smtinterpol-2.5.command (see SMT.startSolver's
%exec% placeholder substitution), so only the conditional timeout flag and
start()/AbstractSolver.exit() (process lifecycle) are handled here, besides the
get- command checks below. Otherwise empirically SMT-LIB compliant: :print-success already defaults to true (no priming
command needed), errors come back as clean (error "...") s-expressions, and
bitvector values print via the equally-valid (_ bvN W) indexed-literal
form (not #b/#x, but standard concrete syntax that the generic parser handles
without any massaging).
The -q flag is required, not cosmetic: without it, SMTInterpol writes a
large volume of "INFO - ..." solver-internal logging to its own stderr for every
check-sat (statistics, per-clause traces, model dumps). That's a separate stream
from the stdout responses SolverProcess parses, but SolverProcess's listen() has a
heuristic (see its "some cases (yices2) the prompt is on the error stream" comment)
that can prefer non-empty stderr content over stdout -- so unsilenced INFO noise
risks being returned as the response instead of the real one. -q suppresses it at
the source rather than relying on that heuristic guessing right.
-
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.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_smtinterpol(SMT.Configuration smtConfig, String[] command) Creates an instance of the solver. -
Method Summary
Modifier and TypeMethodDescriptionSMTInterpol answers get-assignment after unsat, and in assert mode after a checkSMTInterpol answers get-model with :produce-models off, and in assert mode after a checkSMTInterpol answers get-proof after sat, and in assert mode after a checkSMTInterpol answers get-unsat-assumptions in assert mode after a checkSMTInterpol answers get-unsat-core in assert mode after a checkSMTInterpol answers get-value with :produce-models off, and in assert mode after a checkPatterns 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 itstart()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, errorStopsSolver, execute, executePipelined, exit, exitedResponse, finishPipelined, forceExit, get_assertions, get_info, get_option, hasPending, inSatMode, interrupt, inUnsatMode, isFlatResponse, isTimeLimitResponse, 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, 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_assertions, get_info, get_option, pop, push, reset, reset_assertions, set_info, set_logic, set_option, setSourceLine, smt, solverName
-
Field Details
-
cmds
The command-line arguments for launching the solver.
-
-
Constructor Details
-
Solver_smtinterpol
Creates an instance of the solver. The base launch command ("java -jar <jar> -q") comes from the org.smtlib.solver_smtinterpol-2.5.command property; only the timeout flag, which is conditional on smtConfig and so can't be expressed in that static property, is still added here.
-
-
Method Details
-
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
-
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_model
SMTInterpol answers get-model with :produce-models off, and 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
SMTInterpol answers get-value with :produce-models off, and 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_assignment
SMTInterpol answers get-assignment after unsat, 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_proof
SMTInterpol answers get-proof after sat, and 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
SMTInterpol 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
SMTInterpol answers 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:
-