Is it possible to cast a bitvector of one bit into a boolean variable in SMTLib2?
I want to have a boolean variable that test if, e.g., the third bit of a bit vector is 0. The theory of bitvector allows to extract 1 bit as a bitvector, but not a boolean type. I wonder if I can do this cast. Thank you. === Update === I'm sorry if my question is not clear. But the answer of Nikolaj Bjorner is how to test a certain bit of a bit vector. While I want to assign the value of the first bit of a bit vector to a variable. I try to modify the example as follows: (declare-fun x () (_ BitVec 5)) (declare-fun bit0 () Bool) (assert (= (= #b1 ((_ extract 0 0) x)) bit0 )) (check-sat) And z3