Skip to content

Commit be5d15a

Browse files
committed
replaced almost all instances of SMTchecker to SolCMC
1 parent 3bc3b64 commit be5d15a

10 files changed

+27
-27
lines changed

libsolidity/ast/ExperimentalFeatures.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace solidity::frontend
3030
enum class ExperimentalFeature
3131
{
3232
ABIEncoderV2, // new ABI encoder that makes use of Yul
33-
SMTChecker,
33+
SolCMC,
3434
Test,
3535
TestOnlyAnalysis,
3636
Solidity
@@ -39,14 +39,14 @@ enum class ExperimentalFeature
3939
static std::set<ExperimentalFeature> const ExperimentalFeatureWithoutWarning =
4040
{
4141
ExperimentalFeature::ABIEncoderV2,
42-
ExperimentalFeature::SMTChecker,
42+
ExperimentalFeature::SolCMC,
4343
ExperimentalFeature::TestOnlyAnalysis,
4444
};
4545

4646
static std::map<std::string, ExperimentalFeature> const ExperimentalFeatureNames =
4747
{
4848
{ "ABIEncoderV2", ExperimentalFeature::ABIEncoderV2 },
49-
{ "SMTChecker", ExperimentalFeature::SMTChecker },
49+
{ "SolCMC", ExperimentalFeature::SolCMC },
5050
{ "__test", ExperimentalFeature::Test },
5151
{ "__testOnlyAnalysis", ExperimentalFeature::TestOnlyAnalysis },
5252
{ "solidity", ExperimentalFeature::Solidity }

libsolidity/formal/CHC.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ class CHC: public SMTEncoder
179179

180180
/// SMT Natspec and abstraction helpers.
181181
//@{
182-
/// @returns a CHCNatspecOption enum if _option is a valid SMTChecker Natspec value
182+
/// @returns a CHCNatspecOption enum if _option is a valid SolCMC Natspec value
183183
/// or nullopt otherwise.
184184
static std::optional<CHCNatspecOption> natspecOptionFromString(std::string const& _option);
185-
/// @returns which SMTChecker options are enabled by @a _function's Natspec via
186-
/// `@custom:smtchecker <option>` or nullopt if none is used.
185+
/// @returns which SolCMC options are enabled by @a _function's Natspec via
186+
/// `@custom:SolCMC <option>` or nullopt if none is used.
187187
std::set<CHCNatspecOption> smtNatspecTags(FunctionDefinition const& _function);
188188
/// @returns true if _function is Natspec annotated to be abstracted by
189189
/// nondeterministic values.

libsolidity/formal/ModelChecker.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ModelChecker::ModelChecker(
5555
bool ModelChecker::isPragmaPresent(std::vector<std::shared_ptr<SourceUnit>> const& _sources)
5656
{
5757
return ranges::any_of(_sources, [](auto _source) {
58-
return _source && _source->annotation().experimentalFeatures.count(ExperimentalFeature::SMTChecker);
58+
return _source && _source->annotation().experimentalFeatures.count(ExperimentalFeature::SolCMC);
5959
});
6060
}
6161

@@ -94,14 +94,14 @@ void ModelChecker::checkRequestedSourcesAndContracts(std::vector<std::shared_ptr
9494
void ModelChecker::analyze(SourceUnit const& _source)
9595
{
9696
// TODO This should be removed for 0.9.0.
97-
if (_source.annotation().experimentalFeatures.count(ExperimentalFeature::SMTChecker))
97+
if (_source.annotation().experimentalFeatures.count(ExperimentalFeature::SolCMC))
9898
{
9999
PragmaDirective const* smtPragma = nullptr;
100100
for (auto node: _source.nodes())
101101
if (auto pragma = std::dynamic_pointer_cast<PragmaDirective>(node))
102102
if (
103103
pragma->literals().size() >= 2 &&
104-
pragma->literals().at(1) == "SMTChecker"
104+
pragma->literals().at(1) == "SolCMC"
105105
)
106106
{
107107
smtPragma = pragma.get();
@@ -111,8 +111,8 @@ void ModelChecker::analyze(SourceUnit const& _source)
111111
m_uniqueErrorReporter.warning(
112112
5523_error,
113113
smtPragma->location(),
114-
"The SMTChecker pragma has been deprecated and will be removed in the future. "
115-
"Please use the \"model checker engine\" compiler setting to activate the SMTChecker instead. "
114+
"The SolCMC pragma has been deprecated and will be removed in the future. "
115+
"Please use the \"model checker engine\" compiler setting to activate the SolCMC instead. "
116116
"If the pragma is enabled, all engines will be used."
117117
);
118118
}
@@ -144,7 +144,7 @@ void ModelChecker::analyze(SourceUnit const& _source)
144144
m_errorReporter.warning(
145145
5724_error,
146146
{},
147-
"SMTChecker: " +
147+
"SolCMC: " +
148148
std::to_string(m_unsupportedErrorReporter.errors().size()) +
149149
" unsupported language feature(s)."
150150
" Enable the model checker option \"show unsupported\" to see all of them."
@@ -188,7 +188,7 @@ SMTSolverChoice ModelChecker::checkRequestedSolvers(SMTSolverChoice _enabled, Er
188188
_errorReporter.warning(
189189
4902_error,
190190
SourceLocation(),
191-
"Solver cvc5 was selected for SMTChecker but it is not available."
191+
"Solver cvc5 was selected for SolCMC but it is not available."
192192
);
193193
}
194194

@@ -199,9 +199,9 @@ SMTSolverChoice ModelChecker::checkRequestedSolvers(SMTSolverChoice _enabled, Er
199199
4458_error,
200200
SourceLocation(),
201201
#if defined(__linux) || defined(__APPLE__)
202-
"Solver Eldarica was selected for SMTChecker but it was not found in the system."
202+
"Solver Eldarica was selected for SolCMC but it was not found in the system."
203203
#else
204-
"Solver Eldarica was selected for SMTChecker but it is only supported on Linux and MacOS."
204+
"Solver Eldarica was selected for SolCMC but it is only supported on Linux and MacOS."
205205
#endif
206206
);
207207
}
@@ -212,7 +212,7 @@ SMTSolverChoice ModelChecker::checkRequestedSolvers(SMTSolverChoice _enabled, Er
212212
_errorReporter.warning(
213213
8158_error,
214214
SourceLocation(),
215-
"Solver z3 was selected for SMTChecker but it is not available."
215+
"Solver z3 was selected for SolCMC but it is not available."
216216
);
217217
}
218218

libsolidity/formal/ModelCheckerSettings.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct ModelCheckerContracts
4747
bool operator!=(ModelCheckerContracts const& _other) const noexcept { return !(*this == _other); }
4848
bool operator==(ModelCheckerContracts const& _other) const noexcept { return contracts == _other.contracts; }
4949

50-
/// Represents which contracts should be analyzed by the SMTChecker
50+
/// Represents which contracts should be analyzed by the SolCMC
5151
/// as the most derived.
5252
/// The key is the source file. If the map is empty, all sources must be analyzed.
5353
/// For each source, contracts[source] represents the contracts in that source

libsolidity/formal/SMTEncoder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ bool SMTEncoder::visit(InlineAssembly const& _inlineAsm)
347347
m_unsupportedErrors.warning(
348348
7737_error,
349349
_inlineAsm.location(),
350-
"Inline assembly may cause SMTChecker to produce spurious warnings (false positives)."
350+
"Inline assembly may cause SolCMC to produce spurious warnings (false positives)."
351351
);
352352
return false;
353353
}

libsolidity/interface/CompilerStack.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ bool CompilerStack::analyzeLegacy(bool _noErrorsSoFar)
654654

655655
if (noErrors)
656656
{
657-
// Run SMTChecker
657+
// Run SolCMC
658658

659659
auto allSources = util::applyMap(m_sourceOrder, [](Source const* _source) { return _source->ast; });
660660
if (ModelChecker::isPragmaPresent(allSources))

solc/CommandLineParser.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,8 @@ General Information)").c_str(),
860860
;
861861
desc.add(optimizerOptions);
862862

863-
po::options_description smtCheckerOptions("Model Checker Options");
864-
smtCheckerOptions.add_options()
863+
po::options_description SolCMCOptions("Model Checker Options");
864+
SolCMCOptions.add_options()
865865
(
866866
g_strModelCheckerContracts.c_str(),
867867
po::value<std::string>()->value_name("default,<source>:<contract>")->default_value("default"),
@@ -894,7 +894,7 @@ General Information)").c_str(),
894894
)
895895
(
896896
g_strModelCheckerPrintQuery.c_str(),
897-
"Print the queries created by the SMTChecker in the SMTLIB2 format."
897+
"Print the queries created by the SolCMC in the SMTLIB2 format."
898898
)
899899
(
900900
g_strModelCheckerShowProvedSafe.c_str(),
@@ -934,7 +934,7 @@ General Information)").c_str(),
934934
"Default is 1."
935935
)
936936
;
937-
desc.add(smtCheckerOptions);
937+
desc.add(SolCMCOptions);
938938

939939
desc.add_options()(g_strInputFile.c_str(), po::value<std::vector<std::string>>(), "input file");
940940
return desc;

test/InteractiveTests.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <test/libsolidity/OptimizedIRCachingTest.h>
3030
#include <test/libsolidity/SyntaxTest.h>
3131
#include <test/libsolidity/SemanticTest.h>
32-
#include <test/libsolidity/SMTCheckerTest.h>
32+
#include <test/libsolidity/SolCMCTest.h>
3333
#include <test/libyul/ControlFlowGraphTest.h>
3434
#include <test/libyul/SSAControlFlowGraphTest.h>
3535
#include <test/libyul/EVMCodeTransformTest.h>
@@ -83,7 +83,7 @@ Testsuite const g_interactiveTestsuites[] = {
8383
{"JSON AST", "libsolidity", "ASTJSON", false, false, &ASTJSONTest::create},
8484
{"JSON ABI", "libsolidity", "ABIJson", false, false, &ABIJsonTest::create},
8585
{"JSON Natspec", "libsolidity", "natspecJSON", false, false, &NatspecJSONTest::create},
86-
{"SMT Checker", "libsolidity", "smtCheckerTests", true, false, &SMTCheckerTest::create},
86+
{"SMT Checker", "libsolidity", "SolCMCTests", true, false, &SolCMCTest::create},
8787
{"Gas Estimates", "libsolidity", "gasTests", false, false, &GasTest::create},
8888
{"Memory Guard", "libsolidity", "memoryGuardTests", false, false, &MemoryGuardTest::create},
8989
{"AST Properties", "libsolidity", "astPropertyTests", false, false, &ASTPropertyTest::create},

test/tools/fuzzer_common.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void FuzzerUtil::testCompilerJsonInterface(std::string const& _input, bool _opti
6868
void FuzzerUtil::forceSMT(StringMap& _input)
6969
{
7070
// Add SMT checker pragma if not already present in source
71-
static auto constexpr smtPragma = "pragma experimental SMTChecker;";
71+
static auto constexpr smtPragma = "pragma experimental SolCMC;";
7272
for (auto &sourceUnit: _input)
7373
if (sourceUnit.second.find(smtPragma) == std::string::npos)
7474
sourceUnit.second += smtPragma;

test/tools/ossfuzz/SolidityGenerator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ std::string PragmaGenerator::visit()
134134
{
135135
static constexpr const char* preamble = R"(
136136
pragma solidity >= 0.0.0;
137-
pragma experimental SMTChecker;
137+
pragma experimental SolCMC;
138138
)";
139139
// Choose equally at random from coder v1 and v2
140140
std::string abiPragma = "pragma abicoder v" +

0 commit comments

Comments
 (0)