Replies: 2 comments 4 replies
-
There is no specific case for taking the length of a string literal. Everything is an expression, string literals happen to have a size that is determined, but generally string expressions don't have a determined size. For example, if you create a variable s of type String, the length of s can be anything that is consistent with constraints you may set on s. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to take the length of a Line 375 in cbc5b1f |
Beta Was this translation helpful? Give feedback.
-
Do String consts have no size? If not, how do you find it?
In the API I can see that
BV
consts have a given size:z3/src/api/c++/z3++.h
Line 3582 in ae2672f
Strings do not seem to have one:
z3/src/api/c++/z3++.h
Line 3581 in ae2672f
String literals have a size, accessible via https://z3prover.github.io/api/html/group__capi.html#ga766dc289b1b9c5884da389291025e6c7
But this function will not work for string constants.
I can, however, make a
Z3_mk_seq_length
using this as an argument, but that isn't a concrete value but rather just an AST.If string constants cannot have a size, why not? Or is it just not implemented?
Beta Was this translation helpful? Give feedback.
All reactions