-
Notifications
You must be signed in to change notification settings - Fork 274
Add an Array
sort in the new SMT backend
#6965
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
Add an Array
sort in the new SMT backend
#6965
Conversation
52e8111
to
498f3b5
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6965 +/- ##
===========================================
+ Coverage 77.79% 77.83% +0.03%
===========================================
Files 1568 1569 +1
Lines 180329 180429 +100
===========================================
+ Hits 140290 140432 +142
+ Misses 40039 39997 -42
Continue to review full report at Codecov.
|
const smt_array_sortt array_sort{smt_bool_sortt{}, smt_bool_sortt{}}; | ||
CHECK(array_sort != bool_sort1); | ||
CHECK(array_sort != bit_vector8); | ||
const smt_array_sortt array_sort_bv{bit_vector16, bit_vector16}; | ||
CHECK(array_sort_bv != array_sort); |
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.
Also need some equality tests, including of different argument sorts (and recursive array of array sorts)?
CHECK( | ||
smt_to_smt2_string(smt_array_sortt{smt_bool_sortt{}, smt_bool_sortt{}}) == | ||
"(Array Bool Bool)"); |
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.
Good to check more than one single sort here, recursive and bitvector sorts would be good to check.
498f3b5
to
11efae6
Compare
REQUIRE_FALSE(visitor.bit_vec_visited); | ||
REQUIRE(visitor.array_visited); | ||
|
||
smt_array_sortt{smt_bit_vector_sortt{64}, smt_bit_vector_sortt{32}}.accept( |
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.
💡 I suggest you use GENERATE
or GENERATE_REF
as needed to duplicate the test with differing index and element sorts. That way you don't need to duplicate the requirements for each test.
11efae6
to
e0ace86
Compare
@thomasspriggs @TGWDB We have now addressed all of your concerns, could you please have another look at this PR? |
@@ -70,7 +89,6 @@ void accept(const smt_sortt &sort, const irep_idt &id, visitort &&visitor) | |||
return visitor.visit(static_cast<const smt_##the_id##_sortt &>(sort)); | |||
#include "smt_sorts.def" | |||
#undef SORT_ID | |||
UNREACHABLE; |
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.
🚫 This should not be deleted as it is indeed unreachable for well-formed sorts.
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.
Oh yes, sorry this was a mistake - will re-add it ASAP.
e0ace86
to
a5fc2df
Compare
const smt_sortt &index_sort, | ||
const smt_sortt &element_sort); | ||
const smt_sortt &get_index_sort() const; | ||
const smt_sortt &get_element_sort() const; |
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.
Could you rename get_index_sort
and get_element_sort
to element_sort
and element_sort
respectively? This would make it more consistent with the naming conventions used for getters elsewhere such as smt_bit_vector_sortt::bit_width
. This comment should have been in my initial review, but it went awol somewhere, sorry.
… the sort and its printing. Co-authored-by: Fotis Koutoulakis <[email protected]> Co-authored-by: Enrico Steffinlongo <[email protected]>
a5fc2df
to
3d485f8
Compare
Along with that, add unit tests the sort and its printing.
Co-authored-by: Fotis Koutoulakis [email protected]
Co-authored-by: Enrico Steffinlongo [email protected]