Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SMTChecker: Fix parsing bv2int expression from solver's response #15810

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libsmtutil/CHCSmtLib2Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ smtutil::Expression CHCSmtLib2Interface::ScopedParser::toSMTUtilExpression(SMTLi
smtSolverInteractionRequire(arguments.size() == 3, "Store has three arguments: array, index and element");
return smtutil::Expression::store(arguments[0], arguments[1], arguments[2]);
}
if (op == "bv2int")
{
smtSolverInteractionRequire(arguments.size() == 1, "bv2int has one argument");
return smtutil::Expression::bv2int(arguments[0]);
}
else
{
std::set<std::string> boolOperators{"and", "or", "not", "=", "<", ">", "<=", ">=", "=>"};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Taken from issue #15770
contract c {
function f(uint len) public pure returns (bytes memory) {
bytes memory x = new bytes(len);
for (uint i = 0; i < len; i++) {
x[i] = bytes1(uint8(i));
}
return x;
}
}
// ====
// SMTEngine: chc
// SMTIgnoreInv: no
// SMTSolvers: z3
// ----
// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.