-
Notifications
You must be signed in to change notification settings - Fork 274
Translation of array_of_exprt to SMT 2 backend #7079
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
719a88e
to
f040f77
Compare
f040f77
to
00a791b
Compare
Codecov Report
@@ Coverage Diff @@
## develop #7079 +/- ##
========================================
Coverage 77.84% 77.85%
========================================
Files 1574 1574
Lines 181181 181235 +54
========================================
+ Hits 141045 141099 +54
Misses 40136 40136
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -906,6 +906,9 @@ static smt_termt convert_expr_to_smt( | |||
const array_of_exprt &array_of, | |||
const sub_expression_mapt &converted) | |||
{ | |||
// This function is left unimplemented as the `array_of_exprt` nodes are fully |
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.
unimplemented
is the wrong description of this IMO. This is because it implies an intention to implement it at some point in the future. The expectation should really be that this is UNREACHABLE
due to already having been converted separately in the decision procedure.
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.
or possibly "UNEXPECTEDCASE"
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.
Changed the comment accordingly This function is unreachable as the
array_of_exprt nodes are already
.
Changed the UNIMPLEMENTED_FEATURE
to UNHANDLED_CASE
.
void define_array_function(const array_exprt &array); | ||
/// \note Statically fails if the template type is not a `array_exprt` or | ||
/// `array_of_exprt`. | ||
template <typename EXPRT> |
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.
Can you not make the template type all caps? All caps is usually reserved for the names of macros. I'd also prefer to use something other than capitalisation to distinguish this template parameter from the exprt
class. Maybe something like array_typed_exprt
? Please have a quick re-read of the "Naming" section of CODING_STANDARD.md
, as I usually apply the same naming rules to template parameters as any other (non-macro) identifier in cbmc.
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.
Changed to t_exprt
src/solvers/smt2_incremental/smt2_incremental_decision_procedure.h
Outdated
Show resolved
Hide resolved
src/solvers/smt2_incremental/smt2_incremental_decision_procedure.h
Outdated
Show resolved
Hide resolved
smt_set_logic_commandt{ | ||
// NOLINTNEXTLINE(whitespace/line_length) | ||
smt_logic_quantifier_free_arrays_uninterpreted_functions_bit_vectorst{}}, | ||
smt_set_logic_commandt{// NOLINTNEXTLINE(whitespace/line_length) |
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.
The // NOLINTNEXTLINE(whitespace/line_length)
comment should be removed as the updated code should now fit on one line.
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 missed it.
Changed
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 like the fix was squashed into the wrong commit.
src/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp
Outdated
Show resolved
Hide resolved
src/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp
Outdated
Show resolved
Hide resolved
src/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp
Outdated
Show resolved
Hide resolved
unit/solvers/smt2_incremental/smt2_incremental_decision_procedure.cpp
Outdated
Show resolved
Hide resolved
00a791b
to
3502fc1
Compare
# remove libgcc-s1, which isn't normally available in Ubuntu 18.04 | ||
target=$(dpkg-query -W --showformat='${Version}\n' gcc-8-base | head -n 1) | ||
# libgcc1 uses an epoch, thus the extra 1: | ||
sudo apt-get install -y --allow-downgrades --reinstall gcc g++ libgcc-s1- libstdc++6=$target liblsan0=$target libtsan0=$target libcc1-0=$target libgcc1=1:$target gdb=8.1.1-0ubuntu1 | ||
- name: Confirm z3 solver is available and log the version installed |
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'd prefer to leave this as a separate step, as it makes it easier to find the version number and keeps this job consistent with the others.
# download the z3 python wheel package | ||
wget -O z3.4.11.0.whl https://github.com/Z3Prover/z3/releases/download/z3-4.11.0/z3_solver-4.11.0.0-py2.py3-none-manylinux1_x86_64.whl | ||
# unpack the bundle using python | ||
python -m zipfile -e z3.4.11.0.whl z3-4.11.0-content |
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.
Why use python rather than unzip
?
51abfa8
to
9bbce17
Compare
9bbce17
to
8858379
Compare
8858379
to
4f070cd
Compare
Translation of array_of_exprt to SMT 2 backend