summaryrefslogtreecommitdiff
path: root/src/options
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2013-05-17 09:27:55 -0400
committerMorgan Deters <mdeters@cs.nyu.edu>2013-05-17 09:27:55 -0400
commit36dd801660bad8fe1d967c887363f15dbe1bcc63 (patch)
tree948ee61a773e96ffee8d19a4a4e3599b4671c616 /src/options
parent067f3f556a84c1af54d4ef2188d1b145d02b26e3 (diff)
A couple of fixes to the get-option command for compliance with SMT-LIB.
Thanks to David Cok for reporting this issue.
Diffstat (limited to 'src/options')
-rwxr-xr-xsrc/options/mkoptions31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/options/mkoptions b/src/options/mkoptions
index fa6c4c260..2e152ee07 100755
--- a/src/options/mkoptions
+++ b/src/options/mkoptions
@@ -666,13 +666,40 @@ template <> options::${internal}__option_t::type runHandlerAndPredicates(options
if [ -n "$smtname" ]; then
if [ "$internal" != - ]; then
- smt_getoption_handlers="${smt_getoption_handlers}
+ case "$type" in
+ bool) smt_getoption_handlers="${smt_getoption_handlers}
+#line $lineno \"$kf\"
+ if(key == \"$smtname\") {
+#line $lineno \"$kf\"
+ return SExprKeyword(options::$internal() ? \"true\" : \"false\");
+ }";;
+ int|unsigned|int*_t|uint*_t|CVC4::Integer) smt_getoption_handlers="${smt_getoption_handlers}
+#line $lineno \"$kf\"
+ if(key == \"$smtname\") {
+#line $lineno \"$kf\"
+ return SExpr(Integer(options::$internal()));
+ }";;
+ float|double) smt_getoption_handlers="${smt_getoption_handlers}
+#line $lineno \"$kf\"
+ if(key == \"$smtname\") {
+#line $lineno \"$kf\"
+ stringstream ss; ss << std::fixed << options::$internal();
+ return SExpr(Rational::fromDecimal(ss.str()));
+ }";;
+ CVC4::Rational) smt_getoption_handlers="${smt_getoption_handlers}
+#line $lineno \"$kf\"
+ if(key == \"$smtname\") {
+#line $lineno \"$kf\"
+ return SExpr(options::$internal());
+ }";;
+ *) smt_getoption_handlers="${smt_getoption_handlers}
#line $lineno \"$kf\"
if(key == \"$smtname\") {
#line $lineno \"$kf\"
stringstream ss; ss << options::$internal();
return SExpr(ss.str());
- }"
+ }";;
+ esac
fi
if [ "$type" = bool ]; then
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback