bool SmtEngine::isInternalSubsolver() const { return d_isInternalSubsolver; }
-Node SmtEngine::getOption(const std::string& key) const
+std::string SmtEngine::getOption(const std::string& key) const
{
NodeManagerScope nms(getNodeManager());
NodeManager* nm = d_env->getNodeManager();
d_commandVerbosity.find(key.c_str() + 18);
if (i != d_commandVerbosity.end())
{
- return nm->mkConst(Rational(i->second));
+ return i->second.toString();
}
i = d_commandVerbosity.find("*");
if (i != d_commandVerbosity.end())
{
- return nm->mkConst(Rational(i->second));
+ return i->second.toString();
}
- return nm->mkConst(Rational(2));
+ return "2";
}
if (Dump.isOn("benchmark"))
nm->mkConst(Rational(2)));
}
result.push_back(defaultVerbosity);
- return nm->mkNode(Kind::SEXPR, result);
+ return nm->mkNode(Kind::SEXPR, result).toString();
}
- // parse atom string
std::string atom = getOptions().getOption(key);
- if (atom == "true")
+ if (atom != "true" && atom != "false")
{
- return nm->mkConst<bool>(true);
- }
- else if (atom == "false")
- {
- return nm->mkConst<bool>(false);
- }
- try
- {
- Integer z(atom);
- return nm->mkConst(Rational(z));
- }
- catch (std::invalid_argument&)
- {
- // Fall through to the next case
+ try
+ {
+ Integer z(atom);
+ }
+ catch (std::invalid_argument&)
+ {
+ atom = "\"" + atom + "\"";
+ }
}
- return nm->mkConst(String(atom));
+
+ return atom;
}
Options& SmtEngine::getOptions() { return d_env->d_options; }
regress0/nl/very-easy-sat.smt2
regress0/nl/very-simple-unsat.smt2
regress0/opt-abd-no-use.smt2
+ regress0/options/ast-and-sexpr.smt2
regress0/options/invalid_dump.smt2
regress0/options/set-and-get-options.smt2
regress0/parallel-let.smt2
--- /dev/null
+; EXPECT: (SEXPR (SEXPR check-sat (CONST_RATIONAL 2)) (SEXPR * (CONST_RATIONAL 1)))
+; EXPECT: (:status unknown)
+
+; This regression tests uses of s-expressions when the output-language is AST
+
+(set-option :output-language ast)
+
+; Set the verbosity of all commands to 1
+(set-option :command-verbosity (* 1))
+; Set the verbosity of (check-sat) command to 2
+(set-option :command-verbosity (check-sat 2))
+; Get the verbosity of all commands
+(get-option :command-verbosity)
+; There is no SMT option to get the verbosity of a specific command
+
+(set-info :source (0 1 True False x ""))
+(get-info :status)