Skip to content

Commit

Permalink
SMTChecker: Fix parsing bv2int expression from solver's response
Browse files Browse the repository at this point in the history
  • Loading branch information
blishko committed Feb 1, 2025
1 parent 278b9e5 commit f27416e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
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.

0 comments on commit f27416e

Please sign in to comment.