type = "bool"
default = "true"
help = "algebraic inferences for extended functions"
+
+[[option]]
+ name = "bvPrintConstsInBinary"
+ category = "regular"
+ long = "bv-print-consts-in-binary"
+ type = "bool"
+ default = "false"
+ help = "print bit-vector constants in binary (e.g. #b0001) instead of decimal (e.g. (_ bv1 4)), applies to SMT-LIB 2.x"
#include <vector>
#include "expr/node_manager_attributes.h"
+#include "options/bv_options.h"
#include "options/language.h"
#include "options/smt_options.h"
#include "printer/dagification_visitor.h"
const BitVector& bv = n.getConst<BitVector>();
const Integer& x = bv.getValue();
unsigned n = bv.getSize();
- if(d_variant == sygus_variant ){
+ if (d_variant == sygus_variant || options::bvPrintConstsInBinary())
+ {
out << "#b" << bv.toString();
- }else{
+ }
+ else
+ {
out << "(_ ";
- out << "bv" << x <<" " << n;
+ out << "bv" << x << " " << n;
out << ")";
}
regress0/preprocess/preprocess_14.cvc
regress0/preprocess/preprocess_15.cvc
regress0/print_lambda.cvc
+ regress0/printer/bv_consts_bin.smt2
+ regress0/printer/bv_consts_dec.smt2
regress0/push-pop/boolean/fuzz_12.smt2
regress0/push-pop/boolean/fuzz_13.smt2
regress0/push-pop/boolean/fuzz_14.smt2
regress0/strings/type001.smt2
regress0/strings/unsound-0908.smt2
regress0/strings/unsound-repl-rewrite.smt2
- regress0/sygus/array-grammar-select.sy
- regress0/sygus/array-grammar-store.sy
regress0/sygus/General_plus10.sy
regress0/sygus/aig-si.sy
+ regress0/sygus/array-grammar-select.sy
+ regress0/sygus/array-grammar-store.sy
regress0/sygus/c100.sy
regress0/sygus/ccp16.lus.sy
regress0/sygus/check-generic-red.sy
--- /dev/null
+; COMMAND-LINE: --bv-print-consts-in-binary
+; EXPECT: sat
+; EXPECT: ((x #b0001))
+(set-option :produce-models true)
+(set-logic QF_BV)
+(declare-const x (_ BitVec 4))
+(assert (= x #b0001))
+(check-sat)
+(get-value (x))
--- /dev/null
+; COMMAND-LINE: --no-bv-print-consts-in-binary
+; EXPECT: sat
+; EXPECT: ((x (_ bv1 4)))
+(set-option :produce-models true)
+(set-logic QF_BV)
+(declare-const x (_ BitVec 4))
+(assert (= x #b0001))
+(check-sat)
+(get-value (x))