语法奇怪的错误

时间:2014-03-11 04:59:47

标签: z3 smt satisfiability

尝试使用smtlib。我没有看到以下内容的错误......

(set-logic BV)
(declare-fun var1 () (_ BitVec 32)) ; a is a constant
(declare-fun var2 () (_ BitVec 32)) ; a is a constant
(declare-fun var3 () (_ BitVec 32)) ; a is a constant

(assert(
    (= var1 var2)
    and
    (= var3 bvsub(var1 var2) )
    ))
(check-sat)
(get-model)

使用z3运行它,错误是: (错误“第7行第2列:无效的合格/索引标识符,'_'或'作为'预期”)

1 个答案:

答案 0 :(得分:1)

后来编辑了2次,终于弄明白了:

(set-logic BV)
(declare-fun var1 () (_ BitVec 32)) ; a is a constant
(declare-fun var2 () (_ BitVec 32)) ; a is a constant
(declare-fun var3 () (_ BitVec 32)) ; a is a constant

(assert(
    and (= var1 var2) (= var3 (bvsub var1 var2))))
(check-sat)
(get-model)