Z3 int2bv operation

回眸只為那壹抹淺笑 提交于 2019-12-24 04:59:14

问题


I am experiencing some issues with the bitvector operations. In particular, given the following model. I was expecting var0 to be 11.

(declare-const var1 Int)
(declare-const var0 Int)
(assert (= var1 10))
(assert (= var0 ((_ bv2int 32) (bvor ((_ int2bv 32) var1) ((_ int2bv 32) 1)))))
(check-sat)
(get-model)
(exit)

However, the solution given by Z3 for fun was:

sat (model 
(define-fun var1 () Int 10) 
(define-fun var0 () Int (- 1)) 
)

This means, -1 instead of 10. Am I doing something wrong?


回答1:


Unfortunately, int2bv and bv2int are uninterpreted functions. The semantics might not work as you expected.

See Z3 : Questions About Z3 int2bv?



来源:https://stackoverflow.com/questions/30986454/z3-int2bv-operation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!