mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add SMTCheckerTest isoltest option to ignore invariants
This commit is contained in:
parent
3118fb3666
commit
37215ffcfd
@ -95,6 +95,7 @@ struct ModelCheckerInvariants
|
||||
static ModelCheckerInvariants Default() { return *fromString("default"); }
|
||||
/// Adds all targets, including underflow and overflow.
|
||||
static ModelCheckerInvariants All() { return *fromString("all"); }
|
||||
static ModelCheckerInvariants None() { return {{}}; }
|
||||
|
||||
static std::optional<ModelCheckerInvariants> fromString(std::string const& _invs);
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
#include <test/libsolidity/SMTCheckerTest.h>
|
||||
#include <test/Common.h>
|
||||
|
||||
#include <range/v3/action/remove_if.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
using namespace solidity::langutil;
|
||||
@ -67,6 +69,14 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E
|
||||
else
|
||||
BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT counterexample choice."));
|
||||
|
||||
auto const& ignoreInv = m_reader.stringSetting("SMTIgnoreInv", "no");
|
||||
if (ignoreInv == "no")
|
||||
m_modelCheckerSettings.invariants = ModelCheckerInvariants::All();
|
||||
else if (ignoreInv == "yes")
|
||||
m_modelCheckerSettings.invariants = ModelCheckerInvariants::None();
|
||||
else
|
||||
BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT invariant choice."));
|
||||
|
||||
auto const& ignoreOSSetting = m_reader.stringSetting("SMTIgnoreOS", "none");
|
||||
for (string const& os: ignoreOSSetting | ranges::views::split(',') | ranges::to<vector<string>>())
|
||||
{
|
||||
|
@ -49,6 +49,8 @@ protected:
|
||||
Set in m_modelCheckerSettings.
|
||||
SMTIgnoreCex: `yes`, `no`, where the default is `no`.
|
||||
Set in m_ignoreCex.
|
||||
SMTIgnoreInv: `yes`, `no`, where the default is `no`.
|
||||
Set in m_modelCheckerSettings.
|
||||
SMTShowUnproved: `yes`, `no`, where the default is `yes`.
|
||||
Set in m_modelCheckerSettings.
|
||||
SMTSolvers: `all`, `cvc4`, `z3`, `none`, where the default is `all`.
|
||||
|
Loading…
Reference in New Issue
Block a user