Skip to content

Commit eec277b

Browse files
author
Leo Alt
committed
fixup isoltest ignore invariant option
1 parent 631304c commit eec277b

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

libsolidity/formal/ModelCheckerSettings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ struct ModelCheckerInvariants
9595
static ModelCheckerInvariants Default() { return *fromString("default"); }
9696
/// Adds all targets, including underflow and overflow.
9797
static ModelCheckerInvariants All() { return *fromString("all"); }
98+
static ModelCheckerInvariants None() { return {{}}; }
9899

99100
static std::optional<ModelCheckerInvariants> fromString(std::string const& _invs);
100101

test/libsolidity/SMTCheckerTest.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E
6161
if (m_modelCheckerSettings.solvers.none() || m_modelCheckerSettings.engine.none())
6262
m_shouldRun = false;
6363

64-
m_modelCheckerSettings.invariants = ModelCheckerInvariants::All();
65-
6664
auto const& ignoreCex = m_reader.stringSetting("SMTIgnoreCex", "no");
6765
if (ignoreCex == "no")
6866
m_ignoreCex = false;
@@ -73,9 +71,9 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E
7371

7472
auto const& ignoreInv = m_reader.stringSetting("SMTIgnoreInv", "no");
7573
if (ignoreInv == "no")
76-
m_ignoreInv = false;
74+
m_modelCheckerSettings.invariants = ModelCheckerInvariants::All();
7775
else if (ignoreInv == "yes")
78-
m_ignoreInv = true;
76+
m_modelCheckerSettings.invariants = ModelCheckerInvariants::None();
7977
else
8078
BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT invariant choice."));
8179

@@ -120,9 +118,4 @@ void SMTCheckerTest::filterObtainedErrors()
120118

121119
if (m_ignoreCex)
122120
removeCex(m_errorList);
123-
124-
if (m_ignoreInv)
125-
ranges::actions::remove_if(m_errorList, [](auto&& _error) {
126-
return _error.errorId && _error.errorId->error != 1180;
127-
});
128121
}

test/libsolidity/SMTCheckerTest.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class SMTCheckerTest: public SyntaxTest
5050
SMTIgnoreCex: `yes`, `no`, where the default is `no`.
5151
Set in m_ignoreCex.
5252
SMTIgnoreInv: `yes`, `no`, where the default is `no`.
53-
Set in m_ignoreInv.
53+
Set in m_modelCheckerSettings.
5454
SMTShowUnproved: `yes`, `no`, where the default is `yes`.
5555
Set in m_modelCheckerSettings.
5656
SMTSolvers: `all`, `cvc4`, `z3`, `none`, where the default is `all`.
@@ -60,7 +60,6 @@ class SMTCheckerTest: public SyntaxTest
6060
ModelCheckerSettings m_modelCheckerSettings;
6161

6262
bool m_ignoreCex = false;
63-
bool m_ignoreInv = false;
6463
};
6564

6665
}

0 commit comments

Comments
 (0)