这个Boolector程序以二进制格式打印输出。但我需要十六进制格式。 那么如何在boolector中打印十六进制格式。
(set-logic QF_BV)
(set-info :smt-lib-version 2.0)
(declare-const val1 (_ BitVec 16))
(declare-const val2 (_ BitVec 16))
(declare-const gen_mul (_ BitVec 16))
(declare-const eval1 (_ BitVec 32))
(declare-const eval2 (_ BitVec 32))
(declare-const org_mul (_ BitVec 32))
(declare-const rem17 (_ BitVec 32))
(declare-const res (_ BitVec 16))
(assert (= gen_mul (bvmul val1 val2)))
(assert (= eval1 (concat #x0000 val1)))
(assert (= eval2 (concat #x0000 val2)))
(assert (= org_mul (bvmul eval1 eval2)))
(assert (= rem17 (bvurem org_mul #x00010001)))
(assert (= res ((_ extract 15 0) rem17)))
(assert (= val1 #xb621))
(assert (= val2 #xd620))
(check-sat)
(get-value (val1))
(get-value (val2))
(get-value (org_mul))
(get-value (gen_mul))
(get-value (eval1))
(get-value (eval2))
(get-value (org_mul))
(get-value (rem17))
(get-value (res))
(exit)
执行命令 ./boolector ex.smt2
答案 0 :(得分:0)
Boolector(至少版本2.2.0)具有强制十六进制输出的-x, --hex
选项。如果位向量的大小不是4的倍数,它可能会忽略这些选项。