Skip to content

Commit c570b63

Browse files
author
Leo Alt
committed
review
1 parent 82840dd commit c570b63

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

libsmtutil/CHCSmtLib2Interface.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <boost/algorithm/string/join.hpp>
2424
#include <boost/algorithm/string/predicate.hpp>
2525

26+
#include <range/v3/view.hpp>
27+
2628
#include <array>
2729
#include <fstream>
2830
#include <iostream>
@@ -91,7 +93,7 @@ pair<CheckResult, CHCSolverInterface::CexGraph> CHCSmtLib2Interface::query(Expre
9193
swap(m_accumulatedOutput, accumulated);
9294
solAssert(m_smtlib2, "");
9395
writeHeader();
94-
for (auto const& [type, decl]: m_smtlib2->userSorts())
96+
for (auto const& decl: m_smtlib2->userSorts() | ranges::views::values)
9597
write(decl);
9698
m_accumulatedOutput += accumulated;
9799

libsmtutil/SMTLib2Interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class SMTLib2Interface: public SolverInterface
6666

6767
std::map<std::string, SortPointer> variables() { return m_variables; }
6868

69-
std::vector<std::pair<std::string, std::string>>const& userSorts() const { return m_userSorts; }
69+
std::vector<std::pair<std::string, std::string>> const& userSorts() const { return m_userSorts; }
7070

7171
private:
7272
void declareFunction(std::string const& _name, SortPointer const& _sort);

libsmtutil/SolverInterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class Expression
6464
name(std::move(_name)), arguments(std::move(_arguments)), sort(std::move(_sort)) {}
6565
Expression(size_t _number): Expression(std::to_string(_number), {}, SortProvider::sintSort) {}
6666
Expression(u256 const& _number): Expression(_number.str(), {}, SortProvider::sintSort) {}
67-
Expression(s256 const& _number): Expression(_number.sign() >= 0 ? _number.str() : "-", _number.sign() >= 0 ? std::vector<Expression>{} : std::vector<Expression>{Expression(size_t(0)), u256(-_number)}, SortProvider::sintSort) {}
68-
Expression(bigint const& _number): Expression(_number.sign() >= 0 ? _number.str() : "-", _number.sign() >= 0 ? std::vector<Expression>{} : std::vector<Expression>{Expression(size_t(0)), u256(-_number)}, SortProvider::sintSort) {}
67+
Expression(s256 const& _number): Expression(_number >= 0 ? _number.str() : "-", _number >= 0 ? std::vector<Expression>{} : std::vector<Expression>{Expression(size_t(0)), bigint(-_number)}, SortProvider::sintSort) {}
68+
Expression(bigint const& _number): Expression(_number >= 0 ? _number.str() : "-", _number >= 0 ? std::vector<Expression>{} : std::vector<Expression>{Expression(size_t(0)), bigint(-_number)}, SortProvider::sintSort) {}
6969

7070
Expression(Expression const&) = default;
7171
Expression(Expression&&) = default;

libsolidity/formal/CHC.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ void CHC::resetSourceAnalysis()
947947
{
948948
auto smtlib2Interface = dynamic_cast<CHCSmtLib2Interface*>(m_interface.get());
949949
solAssert(smtlib2Interface, "");
950+
smtlib2Interface->reset();
950951
m_context.setSolver(smtlib2Interface->smtlib2Interface());
951952
}
952953

0 commit comments

Comments
 (0)