2017-02-03 110 views
1

這個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

+1

我懷疑Boolector是否提供這種功能 - 您可能必須自己將輸出轉換爲 –

回答

0

Boolector(至少版本2.2.0)具有-x, --hex選項強制十六進制輸出。如果位向量的大小不是4的倍數,它可能會忽略這些選項。