You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is a new indexed operator, which is indexed by a positive numeral N and converts an integer to a bitvector of size N. The semantics here is that given an input x, the value x mod 2^N is computed and then the unsigned bitvector corresponding to this value (which is a positive integer) is returned. Note that this same definition also correctly converts negative integers to their signed bitvector representation, so only a single integer to bitvector operator is needed. Please refer to the theory documentation for more details.
One other note: there are two functions, bv2nat and nat2bv, that appear in the theory documentation (and indeed were already there in version 2.6) . However, these functions are NOT operators in the SMT-LIB theory - they are only used to help define the semantics of certain operators. Some solvers have implemented support for operators with these or similar names. Such implementations should be viewed as solver-specific extensions and are not part of the standard. The new operators mentioned here are the ones that should be supported to be compliant with version 2.7. The rationale for the new names (as opposed to the semantic function names) is that natural numbers are not part of SMT-LIB, so those names would be misnomers. Additionally, the use of "2" as opposed to "to" is not consistent with other conversion operators in SMT-LIB (in strings and floating point, for example).
The text was updated successfully, but these errors were encountered:
SMTLib 2.7 has standardized on conversions, which I quote below.
Good news is that most of the functionality is already in z3. If I read the code correctly:
ubv_to_int
is z3'sbv2nat
sbv_to_int
doesn't seem to exist. (Note that z3'sbv2int
is actually an alias tobv2nat
, which is rather confusing.)int_to_bv
is z3'sint2bv
Here's Clark's message:
The text was updated successfully, but these errors were encountered: