-
Notifications
You must be signed in to change notification settings - Fork 277
add index type to the array type #7140
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
Codecov Report
@@ Coverage Diff @@
## develop #7140 +/- ##
========================================
Coverage 77.86% 77.87%
========================================
Files 1576 1576
Lines 181805 181812 +7
========================================
+ Hits 141571 141578 +7
Misses 40234 40234
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
out << "(Array "; | ||
convert_type(array_type.size().type()); | ||
convert_type(array_type.index_type()); |
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.
Wasn't .size().type()
correct here?
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.
It only works when the array has a size.
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.
What information does SMT-LIB require at this point? Agreed that not all arrays have a size, which may be a problem, but I'm just not sufficiently knowledgable in SMT-LIB to tell whether this change really makes sense. If that's just a workaround for a missing size then I remain unconvinced this is the right change to make.
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.
SMT-LIB does require the index type; arrays are maps from indices to the codomain type. Using the type of the size was a workaround.
4ff8b38
to
adc0bf6
Compare
This commit addresses a gap between the arrays of the C programming language and standard array theories. In C, array indices are subject to arithmetic promotion, and thus, may have a variety of types, depending on the operand type. Standard array theories expect one specific index type per array type. The C front-end now annotates the array type with that index type. We will eventually enforce that all index expressions use this type.
adc0bf6
to
80f9834
Compare
This commit addresses a gap between the arrays of the C programming language and standard array theories. In C, array indices are subject to arithmetic promotion, and thus, may have a variety of types, depending on the operand type. Standard array theories expect one specific index type per array type.
The C front-end now annotates the array type with that index type. We will eventually enforce that all index expressions use this type.