1

Just experimenting with smtlib. I'm not seeing whats wrong with the following...

(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)

Running it with z3 and the error is: (error "line 7 column 2: invalid qualified/indexed identifier, '_' or 'as' expected")

user982975
  • 11
  • 2
  • 1
    The problem is Z3's input syntax is in prefix notation ( http://en.wikipedia.org/wiki/Polish_notation ), which you have for the equalities (e.g., `(= var1 var2)`, but not some of the other parts (e.g., `a and b`), where you are using infix notation ( http://en.wikipedia.org/wiki/Infix_notation ). – Taylor T. Johnson Mar 11 '14 at 15:05

1 Answers1

1

2 edits later, finally figured it out:

(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)
eduardtm
  • 76
  • 6