Robert
Robert

Reputation: 211

How use forall in bit-vector

I intend to do is go all the vector, and do different things on each bit.

What I want to know is if I'm doing well forall (in define-fun LT....)?

Because the results do not match the expected: S

Code found in this link: http://rise4fun.com/Z3/xrFK

Upvotes: 0

Views: 126

Answers (1)

Christoph Wintersteiger
Christoph Wintersteiger

Reputation: 8392

I'm not sure what the intended semantics of your formula is, but intuitively it seems that your definition of is_in may be the culprit:

(define-fun is_in ((e (_ BitVec 9)) (S (_ BitVec 9))) Bool
    ;; True if e is an element of the "set" S.
    (= (bvand e S) e))

The constraint (= (bvand e S) e)) means that this function can only return true when S is equal to e. Going by the name of the function, I would expect the definition to be (not (= (bvand e S) Empty)).

Upvotes: 0

Related Questions