Merge remote-tracking branch 'origin/develop' into breaking

This commit is contained in:
chriseth 2020-12-10 12:15:52 +01:00
commit 482bda6887
481 changed files with 1308 additions and 972 deletions

View File

@ -347,7 +347,7 @@ jobs:
chk_pylint: chk_pylint:
docker: docker:
- image: buildpack-deps:eoan - image: buildpack-deps:focal
steps: steps:
- checkout - checkout
- run: - run:
@ -363,7 +363,7 @@ jobs:
chk_antlr_grammar: chk_antlr_grammar:
docker: docker:
- image: buildpack-deps:eoan - image: buildpack-deps:focal
steps: steps:
- checkout - checkout
- run: - run:
@ -802,172 +802,42 @@ jobs:
npm --version npm --version
test/externalTests/solc-js/solc-js.sh /tmp/workspace/soljson.js $(cat /tmp/workspace/version.txt) test/externalTests/solc-js/solc-js.sh /tmp/workspace/soljson.js $(cat /tmp/workspace/version.txt)
t_ems_compile_ext_gnosis: t_ems_ext:
parameters:
project:
type: string
compile_only:
type: integer
default: 0
nodejs_version:
type: integer
default: 14
gitter_notify:
type: boolean
default: no
docker: docker:
- image: circleci/node:14 - image: circleci/node:<<parameters.nodejs_version>>
environment: environment:
TERM: xterm TERM: xterm
COMPILE_ONLY: <<parameters.compile_only>>
steps: steps:
- checkout - checkout
- attach_workspace: - attach_workspace:
at: /tmp/workspace at: /tmp/workspace
- run: - run:
name: External GnosisSafe compilation name: Install dependencies
command: |
export COMPILE_ONLY=1
test/externalTests/gnosis.sh /tmp/workspace/soljson.js
t_ems_test_ext_gnosis:
docker:
# NOTE: Tests do not start on node.js 14 ("ganache-cli exited early with code 1").
- image: circleci/node:12
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: External GnosisSafe tests
command: |
test/externalTests/gnosis.sh /tmp/workspace/soljson.js
t_ems_compile_ext_gnosis_v2:
docker:
- image: circleci/node:14
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: External GnosisSafe v2 compilation
command: |
export COMPILE_ONLY=1
test/externalTests/gnosis-v2.sh /tmp/workspace/soljson.js
t_ems_test_ext_gnosis_v2:
docker:
# NOTE: Tests do not start on node.js 14 ("ganache-cli exited early with code 1").
- image: circleci/node:12
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: External GnosisSafe v2 tests
command: |
test/externalTests/gnosis-v2.sh /tmp/workspace/soljson.js
t_ems_compile_ext_zeppelin:
docker:
- image: circleci/node:14
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: External Zeppelin compilation
command: |
export COMPILE_ONLY=1
test/externalTests/zeppelin.sh /tmp/workspace/soljson.js
t_ems_test_ext_zeppelin:
docker:
- image: circleci/node:14
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: External Zeppelin tests
command: |
test/externalTests/zeppelin.sh /tmp/workspace/soljson.js
t_ems_compile_ext_colony:
docker:
- image: circleci/node:14
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Install test dependencies
command: | command: |
# lsof is used by Colony in its stop-blockchain-client.sh script
sudo apt-get -qy install lsof sudo apt-get -qy install lsof
- run: - run:
name: External ColonyNetworks compilation name: External <<parameters.project>> tests
command: | command: |
export COMPILE_ONLY=1 test/externalTests/<<parameters.project>>.sh /tmp/workspace/soljson.js
test/externalTests/colony.sh /tmp/workspace/soljson.js - when:
condition: <<parameters.gitter_notify>>
t_ems_test_ext_colony: steps:
docker: - run: *gitter_notify_failure
- image: circleci/node:14 - run: *gitter_notify_success
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Install test dependencies
command: |
sudo apt-get -qy install lsof
- run:
name: External ColonyNetworks tests
command: |
test/externalTests/colony.sh /tmp/workspace/soljson.js
- run: *gitter_notify_failure
- run: *gitter_notify_success
t_ems_compile_ext_ens:
docker:
# NOTE: One of the dependencies (fsevents) fails to build its native extension on node.js 12+.
- image: circleci/node:10
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Install test dependencies
command: |
sudo apt-get -qy install lsof
- run:
name: External Ens compilation
command: |
export COMPILE_ONLY=1
test/externalTests/ens.sh /tmp/workspace/soljson.js
t_ems_test_ext_ens:
docker:
# NOTE: One of the dependencies (fsevents) fails to build its native extension on node.js 12+.
- image: circleci/node:10
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Install test dependencies
command: |
sudo apt-get -qy install lsof
- run:
name: External Ens compilation
command: |
test/externalTests/ens.sh /tmp/workspace/soljson.js
b_win: &b_win b_win: &b_win
executor: executor:
@ -1149,17 +1019,59 @@ workflows:
# Emscripten build and tests that take 15 minutes or less # Emscripten build and tests that take 15 minutes or less
- b_ems: *workflow_trigger_on_tags - b_ems: *workflow_trigger_on_tags
- t_ems_solcjs: *workflow_emscripten - t_ems_solcjs: *workflow_emscripten
- t_ems_compile_ext_colony: *workflow_emscripten
- t_ems_compile_ext_gnosis: *workflow_emscripten - t_ems_ext:
- t_ems_compile_ext_gnosis_v2: *workflow_emscripten <<: *workflow_emscripten
- t_ems_compile_ext_zeppelin: *workflow_emscripten name: t_ems_compile_ext_colony
- t_ems_compile_ext_ens: *workflow_emscripten project: colony
compile_only: 1
- t_ems_ext:
<<: *workflow_emscripten
name: t_ems_compile_ext_gnosis
project: gnosis
compile_only: 1
- t_ems_ext:
<<: *workflow_emscripten
name: t_ems_compile_ext_gnosis_v2
project: gnosis-v2
compile_only: 1
- t_ems_ext:
<<: *workflow_emscripten
name: t_ems_compile_ext_zeppelin
project: zeppelin
compile_only: 1
- t_ems_ext:
<<: *workflow_emscripten
name: t_ems_compile_ext_ens
project: ens
compile_only: 1
# NOTE: One of the dependencies (fsevents) fails to build its native extension on node.js 12+.
nodejs_version: 10
# FIXME: Gnosis tests are pretty flaky right now. They often fail on CircleCI due to random ProviderError # FIXME: Gnosis tests are pretty flaky right now. They often fail on CircleCI due to random ProviderError
# and there are also other less frequent problems. See https://github.com/gnosis/safe-contracts/issues/216. # and there are also other less frequent problems. See https://github.com/gnosis/safe-contracts/issues/216.
#- t_ems_test_ext_gnosis: *workflow_emscripten #- t_ems_ext:
- t_ems_test_ext_gnosis_v2: *workflow_emscripten # <<: *workflow_emscripten
- t_ems_test_ext_zeppelin: *workflow_emscripten # name: t_ems_test_ext_gnosis
- t_ems_test_ext_ens: *workflow_emscripten # project: gnosis
# # NOTE: Tests do not start on node.js 14 ("ganache-cli exited early with code 1").
# nodejs_version: 12
- t_ems_ext:
<<: *workflow_emscripten
name: t_ems_test_ext_gnosis_v2
project: gnosis-v2
# NOTE: Tests do not start on node.js 14 ("ganache-cli exited early with code 1").
nodejs_version: 12
- t_ems_ext:
<<: *workflow_emscripten
name: t_ems_test_ext_zeppelin
project: zeppelin
- t_ems_ext:
<<: *workflow_emscripten
name: t_ems_test_ext_ens
project: ens
# NOTE: One of the dependencies (fsevents) fails to build its native extension on node.js 12+.
nodejs_version: 10
# Windows build and tests # Windows build and tests
- b_win: *workflow_trigger_on_tags - b_win: *workflow_trigger_on_tags
@ -1216,4 +1128,8 @@ workflows:
# Emscripten build and tests that take more than 15 minutes to execute # Emscripten build and tests that take more than 15 minutes to execute
- b_ems: *workflow_trigger_on_tags - b_ems: *workflow_trigger_on_tags
- t_ems_test_ext_colony: *workflow_emscripten - t_ems_ext:
<<: *workflow_emscripten
name: t_ems_test_ext_colony
project: colony
gitter_notify: yes

View File

@ -46,19 +46,21 @@ Language Features:
Compiler Features: Compiler Features:
* Code Generator: Avoid memory allocation for default value if it is not used. * Code Generator: Avoid memory allocation for default value if it is not used.
* SMTChecker: Report struct values in counterexamples from CHC engine.
* SMTChecker: Support early returns in the CHC engine.
* SMTChecker: Support getters.
* SMTChecker: Support named arguments in function calls. * SMTChecker: Support named arguments in function calls.
* SMTChecker: Support struct constructor. * SMTChecker: Support struct constructor.
* SMTChecker: Support getters. * Standard-Json: Move the recently introduced ``modelCheckerSettings`` key to ``settings.modelChecker``.
* SMTChecker: Support early returns in the CHC engine.
* SMTChecker: Report struct values in counterexamples from CHC engine.
* Standard-Json: Properly filter the requested output artifacts. * Standard-Json: Properly filter the requested output artifacts.
Bugfixes: Bugfixes:
* Code generator: Do not pad empty string literals with a single 32-byte zero field in the ABI coder v1. * Code generator: Do not pad empty string literals with a single 32-byte zero field in the ABI coder v1.
* NatSpec: Fix segfault when inheriting return parameter documentation for modifiers with no parameters.
* SMTChecker: Fix cast string literals to byte arrays.
* SMTChecker: Fix internal compiler error when doing bitwise compound assignment with string literals. * SMTChecker: Fix internal compiler error when doing bitwise compound assignment with string literals.
* SMTChecker: Fix internal error when trying to generate counterexamples with old z3. * SMTChecker: Fix internal error when trying to generate counterexamples with old z3.
* SMTChecker: Fix segmentation fault that could occur on certain SMT-enabled sources when no SMT solver was available. * SMTChecker: Fix segmentation fault that could occur on certain SMT-enabled sources when no SMT solver was available.
* SMTChecker: Fix cast string literals to byte arrays.
* Type Checker: ``super`` is not available in libraries. * Type Checker: ``super`` is not available in libraries.
* Yul Optimizer: Fix a bug in NameSimplifier where a new name created by NameSimplifier could also be created by NameDispenser. * Yul Optimizer: Fix a bug in NameSimplifier where a new name created by NameSimplifier could also be created by NameDispenser.
* Yul Optimizer: Removed NameSimplifier from optimization steps available to users. * Yul Optimizer: Removed NameSimplifier from optimization steps available to users.

View File

@ -368,16 +368,16 @@ Input Description
"MyContract": [ "abi", "evm.bytecode.opcodes" ] "MyContract": [ "abi", "evm.bytecode.opcodes" ]
} }
}, },
}, "modelChecker":
"modelCheckerSettings": {
{ // Choose which model checker engine to use: all (default), bmc, chc, none.
// Choose which model checker engine to use: all (default), bmc, chc, none. "engine": "chc",
"engine": "chc", // Timeout for each SMT query in milliseconds.
// Timeout for each SMT query in milliseconds. // If this option is not given, the SMTChecker will use a deterministic
// If this option is not given, the SMTChecker will use a deterministic // resource limit by default.
// resource limit by default. // A given timeout of 0 means no resource/time restrictions for any query.
// A given timeout of 0 means no resource/time restrictions for any query. "timeout": 20000
"timeout": 20000 }
} }
} }

View File

@ -42,7 +42,15 @@ void copyMissingTags(set<CallableDeclaration const*> const& _baseFunctions, Stru
if (_baseFunctions.size() != 1) if (_baseFunctions.size() != 1)
return; return;
auto& sourceDoc = dynamic_cast<StructurallyDocumentedAnnotation const&>((*_baseFunctions.begin())->annotation()); CallableDeclaration const& baseFunction = **_baseFunctions.begin();
auto hasReturnParameter = [](CallableDeclaration const& declaration, size_t _n)
{
return declaration.returnParameterList() &&
declaration.returnParameters().size() > _n;
};
auto& sourceDoc = dynamic_cast<StructurallyDocumentedAnnotation const&>(baseFunction.annotation());
for (auto it = sourceDoc.docTags.begin(); it != sourceDoc.docTags.end();) for (auto it = sourceDoc.docTags.begin(); it != sourceDoc.docTags.end();)
{ {
@ -66,9 +74,15 @@ void copyMissingTags(set<CallableDeclaration const*> const& _baseFunctions, Stru
size_t docParaNameEndPos = content.content.find_first_of(" \t"); size_t docParaNameEndPos = content.content.find_first_of(" \t");
string const docParameterName = content.content.substr(0, docParaNameEndPos); string const docParameterName = content.content.substr(0, docParaNameEndPos);
if (docParameterName != _declaration->returnParameters().at(n)->name()) if (
hasReturnParameter(*_declaration, n) &&
docParameterName != _declaration->returnParameters().at(n)->name()
)
{ {
bool baseHasNoName = (*_baseFunctions.begin())->returnParameters().at(n)->name().empty(); bool baseHasNoName =
hasReturnParameter(baseFunction, n) &&
baseFunction.returnParameters().at(n)->name().empty();
string paramName = _declaration->returnParameters().at(n)->name(); string paramName = _declaration->returnParameters().at(n)->name();
content.content = content.content =
(paramName.empty() ? "" : std::move(paramName) + " ") + ( (paramName.empty() ? "" : std::move(paramName) + " ") + (

View File

@ -127,10 +127,13 @@ void DocStringTagParser::handleCallable(
) )
{ {
static set<string> const validEventTags = set<string>{"dev", "notice", "return", "param"}; static set<string> const validEventTags = set<string>{"dev", "notice", "return", "param"};
static set<string> const validModifierTags = set<string>{"dev", "notice", "param", "inheritdoc"};
static set<string> const validTags = set<string>{"dev", "notice", "return", "param", "inheritdoc"}; static set<string> const validTags = set<string>{"dev", "notice", "return", "param", "inheritdoc"};
if (dynamic_cast<EventDefinition const*>(&_callable)) if (dynamic_cast<EventDefinition const*>(&_callable))
parseDocStrings(_node, _annotation, validEventTags, "events"); parseDocStrings(_node, _annotation, validEventTags, "events");
else if (dynamic_cast<ModifierDefinition const*>(&_callable))
parseDocStrings(_node, _annotation, validModifierTags, "modifiers");
else else
parseDocStrings(_node, _annotation, validTags, "functions"); parseDocStrings(_node, _annotation, validTags, "functions");

View File

@ -58,13 +58,18 @@ void BMC::analyze(SourceUnit const& _source, map<ASTNode const*, set<Verificatio
{ {
solAssert(_source.annotation().experimentalFeatures.count(ExperimentalFeature::SMTChecker), ""); solAssert(_source.annotation().experimentalFeatures.count(ExperimentalFeature::SMTChecker), "");
m_solvedTargets = move(_solvedTargets); /// This is currently used to abort analysis of SourceUnits
m_context.setSolver(m_interface.get()); /// containing file level functions or constants.
m_context.clear(); if (SMTEncoder::analyze(_source))
m_context.setAssertionAccumulation(true); {
m_variableUsage.setFunctionInlining(shouldInlineFunctionCall); m_solvedTargets = move(_solvedTargets);
m_context.setSolver(m_interface.get());
m_context.clear();
m_context.setAssertionAccumulation(true);
m_variableUsage.setFunctionInlining(shouldInlineFunctionCall);
_source.accept(*this); _source.accept(*this);
}
solAssert(m_interface->solvers() > 0, ""); solAssert(m_interface->solvers() > 0, "");
// If this check is true, Z3 and CVC4 are not available // If this check is true, Z3 and CVC4 are not available

View File

@ -69,18 +69,23 @@ void CHC::analyze(SourceUnit const& _source)
{ {
solAssert(_source.annotation().experimentalFeatures.count(ExperimentalFeature::SMTChecker), ""); solAssert(_source.annotation().experimentalFeatures.count(ExperimentalFeature::SMTChecker), "");
resetSourceAnalysis(); /// This is currently used to abort analysis of SourceUnits
/// containing file level functions or constants.
if (SMTEncoder::analyze(_source))
{
resetSourceAnalysis();
set<SourceUnit const*, EncodingContext::IdCompare> sources; set<SourceUnit const*, EncodingContext::IdCompare> sources;
sources.insert(&_source); sources.insert(&_source);
for (auto const& source: _source.referencedSourceUnits(true)) for (auto const& source: _source.referencedSourceUnits(true))
sources.insert(source); sources.insert(source);
for (auto const* source: sources) for (auto const* source: sources)
defineInterfacesAndSummaries(*source); defineInterfacesAndSummaries(*source);
for (auto const* source: sources) for (auto const* source: sources)
source->accept(*this); source->accept(*this);
checkVerificationTargets(); checkVerificationTargets();
}
bool ranSolver = true; bool ranSolver = true;
#ifndef HAVE_Z3 #ifndef HAVE_Z3
@ -1382,8 +1387,7 @@ void CHC::checkAndReportTarget(
m_errorReporter.warning( m_errorReporter.warning(
_errorReporterId, _errorReporterId,
location, location,
"CHC: " + _satMsg, "CHC: " + _satMsg + "\nCounterexample:\n" + *cex
SecondarySourceLocation().append("Counterexample:\n" + *cex, SourceLocation{})
); );
else else
m_errorReporter.warning( m_errorReporter.warning(

View File

@ -40,6 +40,38 @@ SMTEncoder::SMTEncoder(smt::EncodingContext& _context):
{ {
} }
bool SMTEncoder::analyze(SourceUnit const& _source)
{
set<SourceUnit const*, smt::EncodingContext::IdCompare> sources;
sources.insert(&_source);
for (auto const& source: _source.referencedSourceUnits(true))
sources.insert(source);
bool analysis = true;
for (auto source: sources)
for (auto node: source->nodes())
if (auto function = dynamic_pointer_cast<FunctionDefinition>(node))
{
m_errorReporter.warning(
6660_error,
function->location(),
"Model checker analysis was not possible because file level functions are not supported."
);
analysis = false;
}
else if (auto var = dynamic_pointer_cast<VariableDeclaration>(node))
{
m_errorReporter.warning(
8195_error,
var->location(),
"Model checker analysis was not possible because file level constants are not supported."
);
analysis = false;
}
return analysis;
}
bool SMTEncoder::visit(ContractDefinition const& _contract) bool SMTEncoder::visit(ContractDefinition const& _contract)
{ {
solAssert(m_currentContract, ""); solAssert(m_currentContract, "");

View File

@ -52,6 +52,9 @@ class SMTEncoder: public ASTConstVisitor
public: public:
SMTEncoder(smt::EncodingContext& _context); SMTEncoder(smt::EncodingContext& _context);
/// @returns true if engine should proceed with analysis.
bool analyze(SourceUnit const& _sources);
/// @returns the leftmost identifier in a multi-d IndexAccess. /// @returns the leftmost identifier in a multi-d IndexAccess.
static Expression const* leftmostBase(IndexAccess const& _indexAccess); static Expression const* leftmostBase(IndexAccess const& _indexAccess);

View File

@ -410,7 +410,7 @@ std::optional<Json::Value> checkKeys(Json::Value const& _input, set<string> cons
std::optional<Json::Value> checkRootKeys(Json::Value const& _input) std::optional<Json::Value> checkRootKeys(Json::Value const& _input)
{ {
static set<string> keys{"auxiliaryInput", "language", "modelCheckerSettings", "settings", "sources"}; static set<string> keys{"auxiliaryInput", "language", "settings", "sources"};
return checkKeys(_input, keys, "root"); return checkKeys(_input, keys, "root");
} }
@ -428,14 +428,14 @@ std::optional<Json::Value> checkAuxiliaryInputKeys(Json::Value const& _input)
std::optional<Json::Value> checkSettingsKeys(Json::Value const& _input) std::optional<Json::Value> checkSettingsKeys(Json::Value const& _input)
{ {
static set<string> keys{"parserErrorRecovery", "debug", "evmVersion", "libraries", "metadata", "optimizer", "outputSelection", "remappings", "stopAfter", "viaIR"}; static set<string> keys{"parserErrorRecovery", "debug", "evmVersion", "libraries", "metadata", "modelChecker", "optimizer", "outputSelection", "remappings", "stopAfter", "viaIR"};
return checkKeys(_input, keys, "settings"); return checkKeys(_input, keys, "settings");
} }
std::optional<Json::Value> checkModelCheckerSettingsKeys(Json::Value const& _input) std::optional<Json::Value> checkModelCheckerSettingsKeys(Json::Value const& _input)
{ {
static set<string> keys{"engine", "timeout"}; static set<string> keys{"engine", "timeout"};
return checkKeys(_input, keys, "modelCheckerSettings"); return checkKeys(_input, keys, "modelChecker");
} }
std::optional<Json::Value> checkOptimizerKeys(Json::Value const& _input) std::optional<Json::Value> checkOptimizerKeys(Json::Value const& _input)
@ -893,7 +893,7 @@ std::variant<StandardCompiler::InputsAndSettings, Json::Value> StandardCompiler:
"Requested output selection conflicts with \"settings.stopAfter\"." "Requested output selection conflicts with \"settings.stopAfter\"."
); );
Json::Value const& modelCheckerSettings = _input.get("modelCheckerSettings", Json::Value()); Json::Value const& modelCheckerSettings = settings.get("modelChecker", Json::Value());
if (auto result = checkModelCheckerSettingsKeys(modelCheckerSettings)) if (auto result = checkModelCheckerSettingsKeys(modelCheckerSettings))
return *result; return *result;
@ -901,7 +901,7 @@ std::variant<StandardCompiler::InputsAndSettings, Json::Value> StandardCompiler:
if (modelCheckerSettings.isMember("engine")) if (modelCheckerSettings.isMember("engine"))
{ {
if (!modelCheckerSettings["engine"].isString()) if (!modelCheckerSettings["engine"].isString())
return formatFatalError("JSONError", "modelCheckerSettings.engine must be a string."); return formatFatalError("JSONError", "settings.modelChecker.engine must be a string.");
std::optional<ModelCheckerEngine> engine = ModelCheckerEngine::fromString(modelCheckerSettings["engine"].asString()); std::optional<ModelCheckerEngine> engine = ModelCheckerEngine::fromString(modelCheckerSettings["engine"].asString());
if (!engine) if (!engine)
return formatFatalError("JSONError", "Invalid model checker engine requested."); return formatFatalError("JSONError", "Invalid model checker engine requested.");
@ -911,7 +911,7 @@ std::variant<StandardCompiler::InputsAndSettings, Json::Value> StandardCompiler:
if (modelCheckerSettings.isMember("timeout")) if (modelCheckerSettings.isMember("timeout"))
{ {
if (!modelCheckerSettings["timeout"].isUInt()) if (!modelCheckerSettings["timeout"].isUInt())
return formatFatalError("JSONError", "modelCheckerSettings.timeout must be an unsigned integer."); return formatFatalError("JSONError", "settings.modelChecker.timeout must be an unsigned integer.");
ret.modelCheckerSettings.timeout = modelCheckerSettings["timeout"].asUInt(); ret.modelCheckerSettings.timeout = modelCheckerSettings["timeout"].asUInt();
} }

View File

@ -163,6 +163,22 @@ auto applyMap(Container const& _c, Callable&& _op, OutputContainer _oc = OutputC
return _oc; return _oc;
} }
/// Filter a vector.
/// Returns a copy of the vector after only taking indices `i` such that `_mask[i]` is true.
template<typename T>
std::vector<T> filter(std::vector<T> const& _vec, std::vector<bool> const& _mask)
{
assert(_vec.size() == _mask.size());
std::vector<T> ret;
for (size_t i = 0; i < _mask.size(); ++i)
if (_mask[i])
ret.push_back(_vec[i]);
return ret;
}
/// Functional fold. /// Functional fold.
/// Given a container @param _c, an initial value @param _acc, /// Given a container @param _c, an initial value @param _acc,
/// and a binary operator @param _binaryOp(T, U), accumulate /// and a binary operator @param _binaryOp(T, U), accumulate

View File

@ -189,6 +189,7 @@ add_library(yul
optimiser/UnusedFunctionParameterPruner.cpp optimiser/UnusedFunctionParameterPruner.cpp
optimiser/UnusedFunctionParameterPruner.h optimiser/UnusedFunctionParameterPruner.h
optimiser/UnusedFunctionsCommon.h optimiser/UnusedFunctionsCommon.h
optimiser/UnusedFunctionsCommon.cpp
optimiser/UnusedPruner.cpp optimiser/UnusedPruner.cpp
optimiser/UnusedPruner.h optimiser/UnusedPruner.h
optimiser/VarDeclInitializer.cpp optimiser/VarDeclInitializer.cpp

View File

@ -0,0 +1,77 @@
/*
This file is part of solidity.
solidity is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
solidity is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with solidity. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-License-Identifier: GPL-3.0
#include <libyul/optimiser/UnusedFunctionsCommon.h>
#include <libyul/Dialect.h>
#include <liblangutil/SourceLocation.h>
#include <libsolutil/CommonData.h>
using namespace solidity;
using namespace solidity::util;
using namespace solidity::yul;
using namespace solidity::yul::unusedFunctionsCommon;
FunctionDefinition unusedFunctionsCommon::createLinkingFunction(
FunctionDefinition const& _original,
std::pair<std::vector<bool>, std::vector<bool>> const& _usedParametersAndReturns,
YulString const& _originalFunctionName,
YulString const& _linkingFunctionName,
NameDispenser& _nameDispenser
)
{
auto generateTypedName = [&](TypedName t)
{
return TypedName{
t.location,
_nameDispenser.newName(t.name),
t.type
};
};
langutil::SourceLocation loc = _original.location;
FunctionDefinition linkingFunction{
loc,
_linkingFunctionName,
util::applyMap(_original.parameters, generateTypedName),
util::applyMap(_original.returnVariables, generateTypedName),
{loc, {}} // body
};
FunctionCall call{loc, Identifier{loc, _originalFunctionName}, {}};
for (auto const& p: filter(linkingFunction.parameters, _usedParametersAndReturns.first))
call.arguments.emplace_back(Identifier{loc, p.name});
Assignment assignment{loc, {}, nullptr};
for (auto const& r: filter(linkingFunction.returnVariables, _usedParametersAndReturns.second))
assignment.variableNames.emplace_back(Identifier{loc, r.name});
if (assignment.variableNames.empty())
linkingFunction.body.statements.emplace_back(ExpressionStatement{loc, std::move(call)});
else
{
assignment.value = std::make_unique<Expression>(std::move(call));
linkingFunction.body.statements.emplace_back(std::move(assignment));
}
return linkingFunction;
}

View File

@ -19,85 +19,42 @@
#include <libyul/optimiser/Metrics.h> #include <libyul/optimiser/Metrics.h>
#include <libyul/optimiser/NameDispenser.h> #include <libyul/optimiser/NameDispenser.h>
#include <libyul/AST.h> #include <libyul/AST.h>
#include <libyul/Dialect.h>
#include <libyul/Exceptions.h>
#include <liblangutil/SourceLocation.h>
#include <libsolutil/CommonData.h>
#include <variant>
namespace solidity::yul::unusedFunctionsCommon namespace solidity::yul::unusedFunctionsCommon
{ {
template<typename T>
std::vector<T> filter(std::vector<T> const& _vec, std::vector<bool> const& _mask)
{
yulAssert(_vec.size() == _mask.size(), "");
std::vector<T> ret;
for (size_t i = 0; i < _mask.size(); ++i)
if (_mask[i])
ret.push_back(_vec[i]);
return ret;
}
/// Returns true if applying UnusedFunctionParameterPruner is not helpful or redundant because the /// Returns true if applying UnusedFunctionParameterPruner is not helpful or redundant because the
/// inliner will be able to handle it anyway. /// inliner will be able to handle it anyway.
bool tooSimpleToBePruned(FunctionDefinition const& _f) inline bool tooSimpleToBePruned(FunctionDefinition const& _f)
{ {
return _f.body.statements.size() <= 1 && CodeSize::codeSize(_f.body) <= 1; return _f.body.statements.size() <= 1 && CodeSize::codeSize(_f.body) <= 1;
} }
/// Given a function definition `_original`, this function returns a 'linking' function that calls
/// `_originalFunctionName` (with reduced parameters and return values).
///
/// The parameter `_usedParametersAndReturnVariables` is a pair of boolean-vectors. Its `.first`
/// corresponds to function parameters and its `.second` corresponds to function return-variables. A
/// false value at index `i` means that the corresponding function parameter / return-variable at
/// index `i` is unused.
///
/// Example:
///
/// Let `_original` be the function `function f_1() -> y { }`. (In practice, this function usually cannot
/// be inlined and has parameters / return-variables that are unused.)
/// Let `_usedParametersAndReturnVariables` be `({}, {false})`
/// Let `_originalFunctionName` be `f`.
/// Let `_linkingFunctionName` be `f_1`.
///
/// Then the returned linking function would be `function f_1() -> y_1 { f() }`
FunctionDefinition createLinkingFunction( FunctionDefinition createLinkingFunction(
FunctionDefinition const& _original, FunctionDefinition const& _original,
std::pair<std::vector<bool>, std::vector<bool>> const& _usedParametersAndReturns, std::pair<std::vector<bool>, std::vector<bool>> const& _usedParametersAndReturns,
YulString const& _originalFunctionName, YulString const& _originalFunctionName,
YulString const& _linkingFunctionName, YulString const& _linkingFunctionName,
NameDispenser& _nameDispenser NameDispenser& _nameDispenser
) );
{
auto generateTypedName = [&](TypedName t)
{
return TypedName{
t.location,
_nameDispenser.newName(t.name),
t.type
};
};
langutil::SourceLocation loc = _original.location;
FunctionDefinition linkingFunction{
loc,
_linkingFunctionName,
util::applyMap(_original.parameters, generateTypedName),
util::applyMap(_original.returnVariables, generateTypedName),
{loc, {}} // body
};
FunctionCall call{loc, Identifier{loc, _originalFunctionName}, {}};
for (auto const& p: filter(linkingFunction.parameters, _usedParametersAndReturns.first))
call.arguments.emplace_back(Identifier{loc, p.name});
Assignment assignment{loc, {}, nullptr};
for (auto const& r: filter(linkingFunction.returnVariables, _usedParametersAndReturns.second))
assignment.variableNames.emplace_back(Identifier{loc, r.name});
if (assignment.variableNames.empty())
linkingFunction.body.statements.emplace_back(ExpressionStatement{loc, std::move(call)});
else
{
assignment.value = std::make_unique<Expression>(std::move(call));
linkingFunction.body.statements.emplace_back(std::move(assignment));
}
return linkingFunction;
}
} }

View File

@ -19,10 +19,8 @@ for optimize in [False, True]:
'optimizer': { 'optimizer': {
'enabled': optimize 'enabled': optimize
}, },
'outputSelection': {'*': {'*': ['evm.bytecode.object', 'metadata']}} 'outputSelection': {'*': {'*': ['evm.bytecode.object', 'metadata']}},
}, 'modelChecker': { "engine": 'none' }
'modelCheckerSettings': {
"engine": 'none'
} }
} }
args = [SOLC_BIN, '--standard-json'] args = [SOLC_BIN, '--standard-json']

View File

@ -66,10 +66,8 @@ for (var optimize of [false, true])
sources: inputs, sources: inputs,
settings: { settings: {
optimizer: { enabled: optimize }, optimizer: { enabled: optimize },
outputSelection: { '*': { '*': ['evm.bytecode.object', 'metadata'] } } outputSelection: { '*': { '*': ['evm.bytecode.object', 'metadata'] } },
}, "modelChecker": { "engine": "none" }
"modelCheckerSettings": {
"engine": "none"
} }
} }
var result = JSON.parse(compiler.compile(JSON.stringify(input))) var result = JSON.parse(compiler.compile(JSON.stringify(input)))

View File

@ -1,9 +1,5 @@
Warning: CHC: Assertion violation happens here. Warning: CHC: Assertion violation happens here.
--> model_checker_engine_all/input.sol:6:3: Counterexample:
|
6 | assert(x > 0);
| ^^^^^^^^^^^^^
Note: Counterexample:
x = 0 x = 0
@ -11,3 +7,7 @@ x = 0
Transaction trace: Transaction trace:
constructor() constructor()
f(0) f(0)
--> model_checker_engine_all/input.sol:6:3:
|
6 | assert(x > 0);
| ^^^^^^^^^^^^^

View File

@ -1,9 +1,5 @@
Warning: CHC: Assertion violation happens here. Warning: CHC: Assertion violation happens here.
--> model_checker_engine_chc/input.sol:6:3: Counterexample:
|
6 | assert(x > 0);
| ^^^^^^^^^^^^^
Note: Counterexample:
x = 0 x = 0
@ -11,3 +7,7 @@ x = 0
Transaction trace: Transaction trace:
constructor() constructor()
f(0) f(0)
--> model_checker_engine_chc/input.sol:6:3:
|
6 | assert(x > 0);
| ^^^^^^^^^^^^^

View File

@ -7,8 +7,11 @@
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }" "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
} }
}, },
"modelCheckerSettings": "settings":
{ {
"engine": "all" "modelChecker":
{
"engine": "all"
}
} }
} }

View File

@ -1,9 +1,5 @@
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here. {"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
--> A:4:47: Counterexample:
|
4 | contract C { function f(uint x) public pure { assert(x > 0); } }
| ^^^^^^^^^^^^^
Note: Counterexample:
x = 0 x = 0
@ -11,12 +7,17 @@ x = 0
Transaction trace: Transaction trace:
constructor() constructor()
f(0) f(0)
--> A:4:47:
|
4 | contract C { function f(uint x) public pure { assert(x > 0); } }
| ^^^^^^^^^^^^^
","message":"CHC: Assertion violation happens here.","secondarySourceLocations":[{"message":"Counterexample: ","message":"CHC: Assertion violation happens here.
Counterexample:
x = 0 x = 0
Transaction trace: Transaction trace:
constructor() constructor()
f(0)"}],"severity":"warning","sourceLocation":{"end":150,"file":"A","start":137},"type":"Warning"}],"sources":{"A":{"id":0}}} f(0)","severity":"warning","sourceLocation":{"end":150,"file":"A","start":137},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -7,8 +7,11 @@
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }" "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
} }
}, },
"modelCheckerSettings": "settings":
{ {
"engine": "bmc" "modelChecker":
{
"engine": "bmc"
}
} }
} }

View File

@ -7,8 +7,11 @@
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }" "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
} }
}, },
"modelCheckerSettings": "settings":
{ {
"engine": "chc" "modelChecker":
{
"engine": "chc"
}
} }
} }

View File

@ -1,9 +1,5 @@
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here. {"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
--> A:4:47: Counterexample:
|
4 | contract C { function f(uint x) public pure { assert(x > 0); } }
| ^^^^^^^^^^^^^
Note: Counterexample:
x = 0 x = 0
@ -11,12 +7,17 @@ x = 0
Transaction trace: Transaction trace:
constructor() constructor()
f(0) f(0)
--> A:4:47:
|
4 | contract C { function f(uint x) public pure { assert(x > 0); } }
| ^^^^^^^^^^^^^
","message":"CHC: Assertion violation happens here.","secondarySourceLocations":[{"message":"Counterexample: ","message":"CHC: Assertion violation happens here.
Counterexample:
x = 0 x = 0
Transaction trace: Transaction trace:
constructor() constructor()
f(0)"}],"severity":"warning","sourceLocation":{"end":150,"file":"A","start":137},"type":"Warning"}],"sources":{"A":{"id":0}}} f(0)","severity":"warning","sourceLocation":{"end":150,"file":"A","start":137},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -7,8 +7,11 @@
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }" "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
} }
}, },
"modelCheckerSettings": "settings":
{ {
"engine": "none" "modelChecker":
{
"engine": "none"
}
} }
} }

View File

@ -7,8 +7,11 @@
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract test {\nfunction f(uint x, uint y, uint k) public pure {\nrequire(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}" "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract test {\nfunction f(uint x, uint y, uint k) public pure {\nrequire(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}"
} }
}, },
"modelCheckerSettings": "settings":
{ {
"timeout": 1000 "modelChecker":
{
"timeout": 1000
}
} }
} }

View File

@ -7,9 +7,12 @@
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract test {\nfunction f(uint x, uint y, uint k) public pure {\nrequire(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}" "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract test {\nfunction f(uint x, uint y, uint k) public pure {\nrequire(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}"
} }
}, },
"modelCheckerSettings": "settings":
{ {
"engine": "bmc", "modelChecker":
"timeout": 1000 {
"engine": "bmc",
"timeout": 1000
}
} }
} }

View File

@ -7,9 +7,12 @@
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract test {\nfunction f(uint x, uint y, uint k) public pure {\nrequire(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}" "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract test {\nfunction f(uint x, uint y, uint k) public pure {\nrequire(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}"
} }
}, },
"modelCheckerSettings": "settings":
{ {
"engine": "chc", "modelChecker":
"timeout": 1000 {
"engine": "chc",
"timeout": 1000
}
} }
} }

View File

@ -7,9 +7,12 @@
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }" "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
} }
}, },
"modelCheckerSettings": "settings":
{ {
"engine": "chc", "modelChecker":
"atimeout": 1 {
"engine": "chc",
"atimeout": 1
}
} }
} }

View File

@ -7,8 +7,11 @@
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }" "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
} }
}, },
"modelCheckerSettings": "settings":
{ {
"timeout": "asd" "modelChecker":
{
"timeout": "asd"
}
} }
} }

View File

@ -1 +1 @@
{"errors":[{"component":"general","formattedMessage":"modelCheckerSettings.timeout must be an unsigned integer.","message":"modelCheckerSettings.timeout must be an unsigned integer.","severity":"error","type":"JSONError"}]} {"errors":[{"component":"general","formattedMessage":"settings.modelChecker.timeout must be an unsigned integer.","message":"settings.modelChecker.timeout must be an unsigned integer.","severity":"error","type":"JSONError"}]}

View File

@ -53,6 +53,14 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E
if (m_enabledSolvers.none() || m_modelCheckerSettings.engine.none()) if (m_enabledSolvers.none() || m_modelCheckerSettings.engine.none())
m_shouldRun = false; m_shouldRun = false;
auto const& ignoreCex = m_reader.stringSetting("SMTIgnoreCex", "no");
if (ignoreCex == "no")
m_ignoreCex = false;
else if (ignoreCex == "yes")
m_ignoreCex = true;
else
BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT counterexample choice."));
} }
TestCase::TestResult SMTCheckerTest::run(ostream& _stream, string const& _linePrefix, bool _formatted) TestCase::TestResult SMTCheckerTest::run(ostream& _stream, string const& _linePrefix, bool _formatted)
@ -65,3 +73,20 @@ TestCase::TestResult SMTCheckerTest::run(ostream& _stream, string const& _linePr
return conclude(_stream, _linePrefix, _formatted); return conclude(_stream, _linePrefix, _formatted);
} }
void SMTCheckerTest::filterObtainedErrors()
{
SyntaxTest::filterObtainedErrors();
static auto removeCex = [](vector<SyntaxTestError>& errors) {
for (auto& e: errors)
if (
auto cexPos = e.message.find("\\nCounterexample");
cexPos != string::npos
)
e.message = e.message.substr(0, cexPos);
};
if (m_ignoreCex)
removeCex(m_errorList);
}

View File

@ -40,6 +40,8 @@ public:
TestResult run(std::ostream& _stream, std::string const& _linePrefix = "", bool _formatted = false) override; TestResult run(std::ostream& _stream, std::string const& _linePrefix = "", bool _formatted = false) override;
void filterObtainedErrors() override;
protected: protected:
/// This contains engine and timeout. /// This contains engine and timeout.
/// The engine can be set via option SMTEngine in the test. /// The engine can be set via option SMTEngine in the test.
@ -51,6 +53,8 @@ protected:
/// The possible options are `all`, `z3`, `cvc4`, `none`, /// The possible options are `all`, `z3`, `cvc4`, `none`,
/// where if none is given the default used option is `all`. /// where if none is given the default used option is `all`.
smtutil::SMTSolverChoice m_enabledSolvers; smtutil::SMTSolverChoice m_enabledSolvers;
bool m_ignoreCex = false;
}; };
} }

View File

@ -52,7 +52,7 @@ public:
protected: protected:
void setupCompiler(); void setupCompiler();
void parseAndAnalyze() override; void parseAndAnalyze() override;
void filterObtainedErrors(); virtual void filterObtainedErrors();
bool m_optimiseYul = true; bool m_optimiseYul = true;
bool m_parserErrorRecovery = false; bool m_parserErrorRecovery = false;

View File

@ -8,4 +8,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (82-89): CHC: Empty array "pop" happens here. // Warning 2529: (82-89): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -8,4 +8,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (82-89): CHC: Empty array "pop" happens here. // Warning 2529: (82-89): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -8,5 +8,5 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (82-89): CHC: Empty array "pop" happens here. // Warning 2529: (82-89): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()
// Warning 2529: (93-100): CHC: Empty array "pop" happens here. // Warning 2529: (93-100): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -8,4 +8,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (94-101): CHC: Empty array "pop" happens here. // Warning 2529: (94-101): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -11,4 +11,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (122-129): CHC: Empty array "pop" happens here. // Warning 2529: (122-129): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -11,4 +11,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (127-134): CHC: Empty array "pop" happens here. // Warning 2529: (127-134): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -13,4 +13,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (82-89): CHC: Empty array "pop" happens here. // Warning 2529: (82-89): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -10,4 +10,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (153-176): CHC: Assertion violation happens here. // Warning 6328: (153-176): CHC: Assertion violation happens here.\nCounterexample:\narr = []\n\n\n\nTransaction trace:\nconstructor()\nState: arr = []\nf()

View File

@ -14,6 +14,6 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (198-224): CHC: Assertion violation happens here. // Warning 6328: (198-224): CHC: Assertion violation happens here.\nCounterexample:\narr = [], arr2 = []\n\n\n\nTransaction trace:\nconstructor()\nState: arr = [], arr2 = []\nf()
// Warning 6328: (228-254): CHC: Assertion violation happens here. // Warning 6328: (228-254): CHC: Assertion violation happens here.\nCounterexample:\narr = [], arr2 = []\n\n\n\nTransaction trace:\nconstructor()\nState: arr = [], arr2 = []\nf()
// Warning 6328: (258-281): CHC: Assertion violation happens here. // Warning 6328: (258-281): CHC: Assertion violation happens here.\nCounterexample:\narr = [], arr2 = []\n\n\n\nTransaction trace:\nconstructor()\nState: arr = [], arr2 = []\nf()

View File

@ -16,7 +16,7 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (222-248): CHC: Assertion violation happens here. // Warning 6328: (222-248): CHC: Assertion violation happens here.\nCounterexample:\narr = [], arr2 = []\n\n\n\nTransaction trace:\nconstructor()\nState: arr = [], arr2 = []\nf()
// Warning 6328: (252-278): CHC: Assertion violation happens here. // Warning 6328: (252-278): CHC: Assertion violation happens here.\nCounterexample:\narr = [], arr2 = []\n\n\n\nTransaction trace:\nconstructor()\nState: arr = [], arr2 = []\nf()
// Warning 6328: (282-305): CHC: Assertion violation happens here. // Warning 6328: (282-305): CHC: Assertion violation happens here.\nCounterexample:\narr = [], arr2 = []\n\n\n\nTransaction trace:\nconstructor()\nState: arr = [], arr2 = []\nf()
// Warning 6328: (309-335): CHC: Assertion violation happens here. // Warning 6328: (309-335): CHC: Assertion violation happens here.\nCounterexample:\narr = [], arr2 = []\n\n\n\nTransaction trace:\nconstructor()\nState: arr = [], arr2 = []\nf()

View File

@ -7,4 +7,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (82-89): CHC: Empty array "pop" happens here. // Warning 2529: (82-89): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -9,4 +9,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (111-121): CHC: Empty array "pop" happens here. // Warning 2529: (111-121): CHC: Empty array "pop" happens here.\nCounterexample:\na = [[0]]\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -7,4 +7,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (76-83): CHC: Empty array "pop" happens here. // Warning 2529: (76-83): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\n\n\nTransaction trace:\nconstructor()

View File

@ -11,4 +11,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 2529: (150-157): CHC: Empty array "pop" happens here. // Warning 2529: (150-157): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\nl = 0\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf(0)

View File

@ -9,6 +9,8 @@ contract C {
assert(a[0][a[0].length - 1] == y); assert(a[0][a[0].length - 1] == y);
} }
} }
// ====
// SMTIgnoreCex: yes
// ---- // ----
// Warning 3944: (162-177): CHC: Underflow (resulting value less than 0) happens here. // Warning 3944: (162-177): CHC: Underflow (resulting value less than 0) happens here.
// Warning 6328: (150-184): CHC: Assertion violation happens here. // Warning 6328: (150-184): CHC: Assertion violation happens here.

View File

@ -18,4 +18,4 @@ contract C {
} }
// ---- // ----
// Warning 6328: (232-262): CHC: Assertion violation happens here. // Warning 6328: (232-262): CHC: Assertion violation happens here.\nCounterexample:\nb = [1]\n\n\n\nTransaction trace:\nconstructor()\nState: b = []\ng()

View File

@ -21,4 +21,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (395-453): CHC: Assertion violation happens here. // Warning 6328: (395-453): CHC: Assertion violation happens here.\nCounterexample:\nc = [[2]]\n\n\n\nTransaction trace:\nconstructor()\nState: c = []\ng()

View File

@ -13,4 +13,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (237-263): CHC: Assertion violation happens here. // Warning 6328: (237-263): CHC: Assertion violation happens here.\nCounterexample:\nb = [0, 0]\n\n\n\nTransaction trace:\nconstructor()\nState: b = []\nf()

View File

@ -16,4 +16,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (317-343): CHC: Assertion violation happens here. // Warning 6328: (317-343): CHC: Assertion violation happens here.\nCounterexample:\nb = [[0], [0]]\n\n\n\nTransaction trace:\nconstructor()\nState: b = []\nf()

View File

@ -8,5 +8,5 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (113-139): CHC: Assertion violation happens here. // Warning 6328: (113-139): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[0]]\n\n\n\nTransaction trace:\nconstructor()\nState: array2d = []\nl()
// Warning 6328: (143-189): CHC: Assertion violation happens here. // Warning 6328: (143-189): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[0]]\n\n\n\nTransaction trace:\nconstructor()\nState: array2d = []\nl()

View File

@ -10,6 +10,6 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (122-148): CHC: Assertion violation happens here. // Warning 6328: (122-148): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[[0]]]\n\n\n\nTransaction trace:\nconstructor()\nState: array2d = []\nl()
// Warning 6328: (202-218): CHC: Assertion violation happens here. // Warning 6328: (202-218): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[[0]]]\n\n\n\nTransaction trace:\nconstructor()\nState: array2d = []\nl()
// Warning 6328: (222-278): CHC: Assertion violation happens here. // Warning 6328: (222-278): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[[0]]]\n\n\n\nTransaction trace:\nconstructor()\nState: array2d = []\nl()

View File

@ -11,6 +11,8 @@ contract C {
assert(a[0][a[0].length - 1] == 8); assert(a[0][a[0].length - 1] == 8);
} }
} }
// ====
// SMTIgnoreCex: yes
// ---- // ----
// Warning 3944: (217-232): CHC: Underflow (resulting value less than 0) happens here. // Warning 3944: (217-232): CHC: Underflow (resulting value less than 0) happens here.
// Warning 6328: (205-239): CHC: Assertion violation happens here. // Warning 6328: (205-239): CHC: Assertion violation happens here.

View File

@ -12,4 +12,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (167-188): CHC: Assertion violation happens here. // Warning 6328: (167-188): CHC: Assertion violation happens here.\nCounterexample:\na = [[17, 12, 12, 12, 12], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15], [15, 15]]\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

File diff suppressed because one or more lines are too long

View File

@ -9,4 +9,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (111-144): CHC: Assertion violation happens here. // Warning 6328: (111-144): CHC: Assertion violation happens here.\nCounterexample:\na = [[0]]\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -8,4 +8,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (94-124): CHC: Assertion violation happens here. // Warning 6328: (94-124): CHC: Assertion violation happens here.\nCounterexample:\na = [0]\n\n\n\nTransaction trace:\nconstructor()\nState: a = []\nf()

View File

@ -15,4 +15,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (184-213): CHC: Assertion violation happens here. // Warning 6328: (184-213): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[], [], []]\n\n\n\nTransaction trace:\nconstructor()\nState: array2d = []\nl()

View File

@ -10,4 +10,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (199-234): CHC: Assertion violation happens here. // Warning 6328: (199-234): CHC: Assertion violation happens here.\nCounterexample:\n\na = 2437\n\n\nTransaction trace:\nconstructor()\nf(2437)

View File

@ -53,4 +53,4 @@ contract MyConc{
// ---- // ----
// Warning 2519: (773-792): This declaration shadows an existing declaration. // Warning 2519: (773-792): This declaration shadows an existing declaration.
// Warning 2018: (1009-1086): Function state mutability can be restricted to view // Warning 2018: (1009-1086): Function state mutability can be restricted to view
// Warning 4984: (985-1002): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 4984: (985-1002): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\nA = 1, should_be_constant = 0, should_be_constant_2 = 2, not_constant = 0, not_constant_2 = 115792089237316195423570985008687907853269984665640564039457584007913129639926, not_constant_3 = 0\n\nTransaction trace:\nconstructor()

View File

@ -21,4 +21,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (359-373): CHC: Assertion violation happens here. // Warning 6328: (359-373): CHC: Assertion violation happens here.\nCounterexample:\nx = 7\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()

View File

@ -21,4 +21,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (365-379): CHC: Assertion violation happens here. // Warning 6328: (365-379): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()

View File

@ -21,4 +21,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (358-372): CHC: Assertion violation happens here. // Warning 6328: (358-372): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()

View File

@ -21,4 +21,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (365-379): CHC: Assertion violation happens here. // Warning 6328: (365-379): CHC: Assertion violation happens here.\nCounterexample:\nx = 7\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()

View File

@ -23,4 +23,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (103-117): CHC: Assertion violation happens here. // Warning 6328: (103-117): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0\ntest()

View File

@ -42,6 +42,6 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (384-398): CHC: Assertion violation happens here. // Warning 6328: (384-398): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0\ntest()
// Warning 6328: (635-652): CHC: Assertion violation happens here. // Warning 6328: (635-652): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0\nset(1)\nState: x = 1\ntest()
// Warning 6328: (781-795): CHC: Assertion violation happens here. // Warning 6328: (781-795): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0\nset(10)\nState: x = 10\ntest()

View File

@ -35,7 +35,7 @@ contract C is B {
} }
} }
// ---- // ----
// Warning 6328: (330-344): CHC: Assertion violation happens here. // Warning 6328: (330-344): CHC: Assertion violation happens here.\nCounterexample:\ny = 2, x = (- 1)\na = 1\n\n\nTransaction trace:\nconstructor(1)
// Warning 6328: (422-445): CHC: Assertion violation happens here. // Warning 6328: (422-445): CHC: Assertion violation happens here.\nCounterexample:\ny = 2, x = (- 1)\na = 1\n\n\nTransaction trace:\nconstructor(1)
// Warning 6328: (522-546): CHC: Assertion violation happens here. // Warning 6328: (522-546): CHC: Assertion violation happens here.\nCounterexample:\ny = 4, x = 0\na = 0\n\n\nTransaction trace:\nconstructor(0)
// Warning 6328: (566-579): CHC: Assertion violation happens here. // Warning 6328: (566-579): CHC: Assertion violation happens here.\nCounterexample:\ny = 4, x = 0\na = 0\n\n\nTransaction trace:\nconstructor(0)

View File

@ -25,4 +25,4 @@ contract D is C {
} }
} }
// ---- // ----
// Warning 6328: (319-333): CHC: Assertion violation happens here. // Warning 6328: (319-333): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\na = 0\n\n\nTransaction trace:\nconstructor(0)

View File

@ -60,11 +60,11 @@ contract D4 is B, C {
} }
} }
// ---- // ----
// Warning 6328: (370-384): CHC: Assertion violation happens here. // Warning 6328: (370-384): CHC: Assertion violation happens here.\nCounterexample:\nz = 1, y = 1, x = 0\n\n\n\nTransaction trace:\nconstructor()
// Warning 6328: (403-418): CHC: Assertion violation happens here. // Warning 6328: (403-418): CHC: Assertion violation happens here.\nCounterexample:\nz = 1, y = 1, x = 0\n\n\n\nTransaction trace:\nconstructor()
// Warning 6328: (493-507): CHC: Assertion violation happens here. // Warning 6328: (493-507): CHC: Assertion violation happens here.\nCounterexample:\nz = 2, y = 1, x = (- 1)\n\n\n\nTransaction trace:\nconstructor()
// Warning 6328: (526-540): CHC: Assertion violation happens here. // Warning 6328: (526-540): CHC: Assertion violation happens here.\nCounterexample:\nz = 2, y = 1, x = (- 1)\n\n\n\nTransaction trace:\nconstructor()
// Warning 6328: (703-717): CHC: Assertion violation happens here. // Warning 6328: (703-717): CHC: Assertion violation happens here.\nCounterexample:\nz = 1, y = 2, x = 1\n\n\n\nTransaction trace:\nconstructor()
// Warning 6328: (769-784): CHC: Assertion violation happens here. // Warning 6328: (769-784): CHC: Assertion violation happens here.\nCounterexample:\nz = 1, y = 2, x = 1\n\n\n\nTransaction trace:\nconstructor()
// Warning 6328: (860-874): CHC: Assertion violation happens here. // Warning 6328: (860-874): CHC: Assertion violation happens here.\nCounterexample:\nz = 2, y = 2, x = (- 1)\n\n\n\nTransaction trace:\nconstructor()
// Warning 6328: (893-907): CHC: Assertion violation happens here. // Warning 6328: (893-907): CHC: Assertion violation happens here.\nCounterexample:\nz = 2, y = 2, x = (- 1)\n\n\n\nTransaction trace:\nconstructor()

View File

@ -26,6 +26,6 @@ contract C is B {
} }
// ---- // ----
// Warning 5740: (152-157): Unreachable code. // Warning 5740: (152-157): Unreachable code.
// Warning 6328: (310-324): CHC: Assertion violation happens here. // Warning 6328: (310-324): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\na = 1\n\n\nTransaction trace:\nconstructor(1)
// Warning 6328: (343-357): CHC: Assertion violation happens here. // Warning 6328: (343-357): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\na = 1\n\n\nTransaction trace:\nconstructor(1)
// Warning 6328: (376-390): CHC: Assertion violation happens here. // Warning 6328: (376-390): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\na = 0\n\n\nTransaction trace:\nconstructor(0)

View File

@ -22,5 +22,5 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (147-174): CHC: Assertion violation happens here. // Warning 6328: (147-174): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0\nb = 2\n\n\nTransaction trace:\nconstructor()\ntest(0, 2)
// Warning 6838: (332-348): BMC: Condition is always false. // Warning 6838: (332-348): BMC: Condition is always false.

View File

@ -14,4 +14,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (89-114): CHC: Assertion violation happens here. // Warning 6328: (89-114): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0\n\n\nTransaction trace:\nconstructor()\ntest(0)

View File

@ -25,4 +25,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (205-222): CHC: Assertion violation happens here. // Warning 6328: (205-222): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0]\n\n\n\nTransaction trace:\nconstructor()\nState: a = [0, 0]\ncheck()

View File

@ -19,4 +19,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (132-146): CHC: Assertion violation happens here. // Warning 6328: (132-146): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0\ncheck()

View File

@ -22,4 +22,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (156-172): CHC: Assertion violation happens here. // Warning 6328: (156-172): CHC: Assertion violation happens here.\nCounterexample:\ns = {x: 0}\n\n\n\nTransaction trace:\nconstructor()\nState: s = {x: 0}\ncheck()

View File

@ -22,4 +22,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (156-172): CHC: Assertion violation happens here. // Warning 6328: (156-172): CHC: Assertion violation happens here.\nCounterexample:\ns = {x: 0}\n\n\n\nTransaction trace:\nconstructor()\nState: s = {x: 0}\ncheck()

View File

@ -23,5 +23,5 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (160-174): CHC: Assertion violation happens here. // Warning 6328: (160-174): CHC: Assertion violation happens here.\nCounterexample:\nx = 2, y = 2\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0, y = 0\ncheck()
// Warning 6328: (194-208): CHC: Assertion violation happens here. // Warning 6328: (194-208): CHC: Assertion violation happens here.\nCounterexample:\nx = 2, y = 2\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0, y = 0\ncheck()

View File

@ -31,4 +31,4 @@ contract C {
} }
// ---- // ----
// Warning 6321: (429-442): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. // Warning 6321: (429-442): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6328: (448-465): CHC: Assertion violation happens here. // Warning 6328: (448-465): CHC: Assertion violation happens here.\nCounterexample:\nx = true\n\n\n\nTransaction trace:\nconstructor()\nState: x = false\ni()

View File

@ -19,8 +19,8 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (244-270): CHC: Assertion violation happens here. // Warning 6328: (244-270): CHC: Assertion violation happens here.\nCounterexample:\n\n\n\n\nTransaction trace:\nconstructor()\nf()
// Warning 6328: (274-300): CHC: Assertion violation happens here. // Warning 6328: (274-300): CHC: Assertion violation happens here.\nCounterexample:\n\n\n\n\nTransaction trace:\nconstructor()\nf()
// Warning 6328: (304-330): CHC: Assertion violation happens here. // Warning 6328: (304-330): CHC: Assertion violation happens here.\nCounterexample:\n\n\n\n\nTransaction trace:\nconstructor()\nf()
// Warning 6328: (334-362): CHC: Assertion violation happens here. // Warning 6328: (334-362): CHC: Assertion violation happens here.\nCounterexample:\n\n\n\n\nTransaction trace:\nconstructor()\nf()
// Warning 2661: (158-161): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 2661: (158-161): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.

View File

@ -27,6 +27,8 @@ contract C {
assert(c != 0xffffffff); assert(c != 0xffffffff);
} }
} }
// ====
// SMTIgnoreCex: yes
// ---- // ----
// Warning 6328: (303-329): CHC: Assertion violation happens here. // Warning 6328: (303-329): CHC: Assertion violation happens here.
// Warning 6328: (333-350): CHC: Assertion violation happens here. // Warning 6328: (333-350): CHC: Assertion violation happens here.

View File

@ -33,4 +33,4 @@ contract C {
// Warning 5740: (116-129): Unreachable code. // Warning 5740: (116-129): Unreachable code.
// Warning 5740: (221-234): Unreachable code. // Warning 5740: (221-234): Unreachable code.
// Warning 6321: (408-421): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. // Warning 6321: (408-421): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6328: (427-444): CHC: Assertion violation happens here. // Warning 6328: (427-444): CHC: Assertion violation happens here.\nCounterexample:\nx = true\n\n\n\nTransaction trace:\nconstructor()\nState: x = false\ni()

View File

@ -14,5 +14,5 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (183-197): CHC: Assertion violation happens here. // Warning 6328: (183-197): CHC: Assertion violation happens here.\nCounterexample:\n\nb = false\na = 0\n\n\nTransaction trace:\nconstructor()\nf(false, 0)
// Warning 6838: (155-156): BMC: Condition is always false. // Warning 6838: (155-156): BMC: Condition is always false.

View File

@ -15,4 +15,4 @@ contract c {
} }
} }
// ---- // ----
// Warning 6328: (227-236): CHC: Assertion violation happens here. // Warning 6328: (227-236): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\n = false\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()

View File

@ -17,5 +17,5 @@ contract c {
} }
} }
// ---- // ----
// Warning 6328: (202-218): CHC: Assertion violation happens here. // Warning 6328: (202-218): CHC: Assertion violation happens here.\nCounterexample:\nx = 101\n\n = false\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()
// Warning 6328: (242-252): CHC: Assertion violation happens here. // Warning 6328: (242-252): CHC: Assertion violation happens here.\nCounterexample:\nx = 101\n\n = false\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()

View File

@ -15,4 +15,4 @@ contract c {
} }
} }
// ---- // ----
// Warning 6328: (225-235): CHC: Assertion violation happens here. // Warning 6328: (225-235): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\n = false\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()

View File

@ -15,4 +15,4 @@ contract c {
} }
} }
// ---- // ----
// Warning 6328: (225-235): CHC: Assertion violation happens here. // Warning 6328: (225-235): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\n = false\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()

View File

@ -24,4 +24,4 @@ contract c {
} }
} }
// ---- // ----
// Warning 6328: (360-370): CHC: Assertion violation happens here. // Warning 6328: (360-370): CHC: Assertion violation happens here.\nCounterexample:\nx = 102\na = false\n = false\n\nTransaction trace:\nconstructor()\nState: x = 0\ng(false)

View File

@ -15,4 +15,4 @@ contract c {
} }
} }
// ---- // ----
// Warning 6328: (225-235): CHC: Assertion violation happens here. // Warning 6328: (225-235): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\n = false\n\nTransaction trace:\nconstructor()\nState: x = 0\ng()

View File

@ -9,4 +9,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (159-173): CHC: Assertion violation happens here. // Warning 6328: (159-173): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 11\n\n\nTransaction trace:\nconstructor()\nf(11)

View File

@ -9,4 +9,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (159-173): CHC: Assertion violation happens here. // Warning 6328: (159-173): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 11\n\n\nTransaction trace:\nconstructor()\nf(11)

View File

@ -9,4 +9,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (161-175): CHC: Assertion violation happens here. // Warning 6328: (161-175): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 11\n\n\nTransaction trace:\nconstructor()\nf(11)

View File

@ -11,6 +11,6 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (183-197): CHC: Assertion violation happens here. // Warning 6328: (183-197): CHC: Assertion violation happens here.\nCounterexample:\n\ndata = [7, 7]\n\n\nTransaction trace:\nconstructor()\nf([7, 7])
// Warning 6328: (201-215): CHC: Assertion violation happens here. // Warning 6328: (201-215): CHC: Assertion violation happens here.\nCounterexample:\n\ndata = [9, 9]\n\n\nTransaction trace:\nconstructor()\nf([9, 9])
// Warning 6328: (219-233): CHC: Assertion violation happens here. // Warning 6328: (219-233): CHC: Assertion violation happens here.\nCounterexample:\n\ndata = [7, 7]\n\n\nTransaction trace:\nconstructor()\nf([7, 7])

View File

@ -29,7 +29,7 @@ contract C {
// Warning 6328: (305-321): CHC: Assertion violation might happen here. // Warning 6328: (305-321): CHC: Assertion violation might happen here.
// Warning 1218: (448-464): CHC: Error trying to invoke SMT solver. // Warning 1218: (448-464): CHC: Error trying to invoke SMT solver.
// Warning 6328: (448-464): CHC: Assertion violation might happen here. // Warning 6328: (448-464): CHC: Assertion violation might happen here.
// Warning 6328: (673-689): CHC: Assertion violation happens here. // Warning 6328: (673-689): CHC: Assertion violation happens here.\nCounterexample:\n\nh0 = 21238\nv0 = 173\nr0 = 30612\ns0 = 32285\nh1 = 7719\nv1 = 21\nr1 = 10450\ns1 = 8855\n\n\nTransaction trace:\nconstructor()\ne(21238, 173, 30612, 32285, 7719, 21, 10450, 8855)
// Warning 4661: (168-184): BMC: Assertion violation happens here. // Warning 4661: (168-184): BMC: Assertion violation happens here.
// Warning 4661: (305-321): BMC: Assertion violation happens here. // Warning 4661: (305-321): BMC: Assertion violation happens here.
// Warning 4661: (448-464): BMC: Assertion violation happens here. // Warning 4661: (448-464): BMC: Assertion violation happens here.

View File

@ -11,4 +11,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (229-243): CHC: Assertion violation happens here. // Warning 6328: (229-243): CHC: Assertion violation happens here.\nCounterexample:\n\ndata = [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]\n\n\nTransaction trace:\nconstructor()\nf([7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7])

View File

@ -17,4 +17,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (200-214): CHC: Assertion violation happens here. // Warning 6328: (200-214): CHC: Assertion violation happens here.\nCounterexample:\nx = 10, d = 0\n\n\n\nTransaction trace:\nconstructor()\nState: x = 0, d = 0\nf()\nState: x = 1, d = 0\nf()\nState: x = 2, d = 0\ng()

View File

@ -25,5 +25,7 @@ contract C {
assert(sig_1 == sig_2); assert(sig_1 == sig_2);
} }
} }
// ====
// SMTIgnoreCex: yes
// ---- // ----
// Warning 6328: (423-445): CHC: Assertion violation happens here. // Warning 6328: (423-445): CHC: Assertion violation happens here.

View File

@ -27,5 +27,7 @@ contract C {
assert(sig_1 == sig_2); assert(sig_1 == sig_2);
} }
} }
// ====
// SMTIgnoreCex: yes
// ---- // ----
// Warning 6328: (431-453): CHC: Assertion violation happens here. // Warning 6328: (431-453): CHC: Assertion violation happens here.

View File

@ -34,4 +34,4 @@ contract C {
} }
} }
// ---- // ----
// Warning 6328: (528-565): CHC: Assertion violation happens here. // Warning 6328: (528-565): CHC: Assertion violation happens here.\nCounterexample:\nowner = 1, y = 0, z = 0, s = 0\n\n\n\nTransaction trace:\nconstructor()\nState: owner = 1, y = 0, z = 0, s = 0\ninv()

Some files were not shown because too many files have changed in this diff Show More