mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add CLI and JSON option to select SMTChecker targets
This commit is contained in:
@@ -26,14 +26,13 @@
|
||||
#include <libsolidity/formal/BMC.h>
|
||||
#include <libsolidity/formal/CHC.h>
|
||||
#include <libsolidity/formal/EncodingContext.h>
|
||||
#include <libsolidity/formal/ModelCheckerSettings.h>
|
||||
|
||||
#include <libsolidity/interface/ReadFile.h>
|
||||
|
||||
#include <libsmtutil/SolverInterface.h>
|
||||
#include <liblangutil/ErrorReporter.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace solidity::langutil
|
||||
{
|
||||
class ErrorReporter;
|
||||
@@ -43,40 +42,6 @@ struct SourceLocation;
|
||||
namespace solidity::frontend
|
||||
{
|
||||
|
||||
struct ModelCheckerEngine
|
||||
{
|
||||
bool bmc = false;
|
||||
bool chc = false;
|
||||
|
||||
static constexpr ModelCheckerEngine All() { return {true, true}; }
|
||||
static constexpr ModelCheckerEngine BMC() { return {true, false}; }
|
||||
static constexpr ModelCheckerEngine CHC() { return {false, true}; }
|
||||
static constexpr ModelCheckerEngine None() { return {false, false}; }
|
||||
|
||||
bool none() const { return !any(); }
|
||||
bool any() const { return bmc || chc; }
|
||||
bool all() const { return bmc && chc; }
|
||||
|
||||
static std::optional<ModelCheckerEngine> fromString(std::string const& _engine)
|
||||
{
|
||||
static std::map<std::string, ModelCheckerEngine> engineMap{
|
||||
{"all", All()},
|
||||
{"bmc", BMC()},
|
||||
{"chc", CHC()},
|
||||
{"none", None()}
|
||||
};
|
||||
if (engineMap.count(_engine))
|
||||
return engineMap.at(_engine);
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
struct ModelCheckerSettings
|
||||
{
|
||||
ModelCheckerEngine engine = ModelCheckerEngine::All();
|
||||
std::optional<unsigned> timeout;
|
||||
};
|
||||
|
||||
class ModelChecker
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user