Package org.smtlib.command
Class C_set_option
java.lang.Object
org.smtlib.impl.Pos.Posable
org.smtlib.impl.Pos.Printable
org.smtlib.impl.Command
org.smtlib.command.C_set_option
- All Implemented Interfaces:
ICommand,ICommand.Iset_option,INode,IPos.IPosable
Implements the set-option command
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.smtlib.ICommand
ICommand.Iassert, ICommand.Icheck_sat, ICommand.Icheck_sat_assuming, ICommand.Icomment, ICommand.Ideclare_const, ICommand.Ideclare_datatype, ICommand.Ideclare_datatypes, ICommand.Ideclare_fun, ICommand.Ideclare_sort, ICommand.Ideclare_sort_parameter, ICommand.Idefine_const, ICommand.Idefine_fun, ICommand.Idefine_fun_rec, ICommand.Idefine_funs_rec, ICommand.Idefine_sort, ICommand.Iecho, ICommand.Iexit, ICommand.IFactory, ICommand.IFinder, ICommand.Iget_assertions, ICommand.Iget_assignment, ICommand.Iget_info, ICommand.Iget_model, ICommand.Iget_option, ICommand.Iget_proof, ICommand.Iget_unsat_assumptions, ICommand.Iget_unsat_core, ICommand.Iget_value, ICommand.Ipop, ICommand.Ipush, ICommand.Ireset, ICommand.Ireset_assertions, ICommand.IScript, ICommand.Iset_info, ICommand.Iset_logic, ICommand.Iset_option -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe command nameprotected IExpr.IKeywordThe keyword for the option to setprotected IAttributeValueThe value of the optionFields inherited from class org.smtlib.impl.Command
trailingTextFields inherited from class org.smtlib.impl.Pos.Posable
pos -
Constructor Summary
ConstructorsConstructorDescriptionC_set_option(IExpr.IKeyword keyword, IAttributeValue value) Construct an instance of the command -
Method Summary
Modifier and TypeMethodDescription<T> TThe accept method corresponding to IVisitor, to be implemented in each subclass as { return v.visit(this); }checkOptionType(SMT.Configuration smtConfig, IExpr.IKeyword keyword, IAttributeValue t) This method checks that the value for the given keyword has the correct type, when the keyword is used as the key for an SMT-LIB option.The command nameExecutes the command on the given solver; presumes that the command type-checked successfully.option()The keyword for the option to setstatic C_set_optionCreates a command instance by parsing the concrete S-expression syntaxvalue()The new value of the option being setMethods inherited from class org.smtlib.impl.Command
error, setTrailingText, trailingText, write, writeArgsMethods inherited from class org.smtlib.impl.Pos.Printable
toStringMethods inherited from class org.smtlib.impl.Pos.Posable
equals, hashCode, pos, setPosMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.smtlib.IPos.IPosable
pos, setPos
-
Field Details
-
commandName
The command name- See Also:
-
option
The keyword for the option to set -
value
The value of the option
-
-
Constructor Details
-
C_set_option
Construct an instance of the command
-
-
Method Details
-
commandName
The command name- Specified by:
commandNamein interfaceICommand- Specified by:
commandNamein classCommand
-
option
The keyword for the option to set- Specified by:
optionin interfaceICommand.Iset_option
-
value
The new value of the option being set- Specified by:
valuein interfaceICommand.Iset_option
-
parse
Creates a command instance by parsing the concrete S-expression syntax- Throws:
IParser.ParserException
-
execute
Description copied from interface:ICommandExecutes the command on the given solver; presumes that the command type-checked successfully. -
checkOptionType
public IResponse.IError checkOptionType(SMT.Configuration smtConfig, IExpr.IKeyword keyword, IAttributeValue t) This method checks that the value for the given keyword has the correct type, when the keyword is used as the key for an SMT-LIB option. Called eagerly from parse() above, unlike most other commands (e.g. C_declare_fun's non-standard extensions, C_define_fun's result-sort check -- see issue #40), which defer semantic validation to type-checking/execute time. That's deliberate here, not an inconsistency to remove: unlike commands whose semantics are checked uniformly regardless of solver (TypeChecker.validate()'s job), no real solver adapter validates option-value types at all -- they forward set-option straight to the real process (see AbstractSolver#set_option) -- so parse time is the only point that would otherwise ever be reached for every solver alike. It is not, however, the *only* layer: Solver_test.set_option() and AbstractSolver#checkPrintSuccess() both separately validate :print-success's value too, since smtConfig.commandFactory.set_option(key,value) can construct and execute a C_set_option directly, bypassing this parse-time check entirely (see issue #41) -- AbstractSolver#set_option_impl() itself calls exactly that factory method.- Parameters:
keyword- the keyword controlling the typet- the value being tested- Returns:
- null or an error response
-
accept
Description copied from interface:INodeThe accept method corresponding to IVisitor, to be implemented in each subclass as { return v.visit(this); }- Specified by:
acceptin interfaceINode- Type Parameters:
T- the return type desired from the visit methods- Parameters:
v- the visitor class- Returns:
- the value returned by the visit method
- Throws:
IVisitor.VisitorException
-