-
Notifications
You must be signed in to change notification settings - Fork 274
Use proper APIs to get or set bitvector type width #3699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ID_width is an implementation detail, and even more so is whether the value is stored as a string literal noting the decimal number or some other encoding of the number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: f7eba4a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/96415387
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, though it's a shame to see various string->int->string conversions introduced for tidiness' sake. Is there a plan already to use a tagged variant instead of a string for such things?
@smowton Very late response/request for clarification:
What do you mean by "tagged variant?" Thanks! |
@tautschnig something like
(it might also update the variant with the format it just computed -- depends if you think get-with-set-kind of repeated-get-of-same-kind is more common) |
That would also be useful for integers in ireps, since it would avoid all the tedious back and forth between string and integer representations |
I understand your concern about converting back and forth, but I do not yet understand how the above proposal addresses the problem (within the current code base). Are you suggesting to replace the |
In the end yes, so that integers can be stored in native form instead of an index into a string table containing their string representation, but cmdlinet and cousins seem like an obvious place to prototype it. They already have get_integer_option etc, which are ideal places to avoid conversion. Similarly you'd have |
ID_width is an implementation detail, and even more so is whether the value is
stored as a string literal noting the decimal number or some other encoding of
the number.