mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Abstract function smtchecker natspec
This commit is contained in:
@@ -70,6 +70,11 @@ public:
|
||||
/// the constructor.
|
||||
std::vector<std::string> unhandledQueries() const;
|
||||
|
||||
enum class CHCNatspecOption
|
||||
{
|
||||
AbstractFunctionNondet
|
||||
};
|
||||
|
||||
private:
|
||||
/// Visitor functions.
|
||||
//@{
|
||||
@@ -123,6 +128,19 @@ private:
|
||||
std::set<unsigned> transactionVerificationTargetsIds(ASTNode const* _txRoot);
|
||||
//@}
|
||||
|
||||
/// SMT Natspec and abstraction helpers.
|
||||
//@{
|
||||
/// @returns a CHCNatspecOption enum if _option is a valid SMTChecker Natspec value
|
||||
/// or nullopt otherwise.
|
||||
static std::optional<CHCNatspecOption> natspecOptionFromString(std::string const& _option);
|
||||
/// @returns which SMTChecker options are enabled by @a _function's Natspec via
|
||||
/// `@custom:smtchecker <option>` or nullopt if none is used.
|
||||
std::set<CHCNatspecOption> smtNatspecTags(FunctionDefinition const& _function);
|
||||
/// @returns true if _function is Natspec annotated to be abstracted by
|
||||
/// nondeterministic values.
|
||||
bool abstractAsNondet(FunctionDefinition const& _function);
|
||||
//@}
|
||||
|
||||
/// Sort helpers.
|
||||
//@{
|
||||
smtutil::SortPointer sort(FunctionDefinition const& _function);
|
||||
@@ -183,6 +201,9 @@ private:
|
||||
std::vector<smtutil::Expression> currentStateVariables();
|
||||
std::vector<smtutil::Expression> currentStateVariables(ContractDefinition const& _contract);
|
||||
|
||||
/// @returns \bigwedge currentValue(_vars[i]) == initialState(_var[i])
|
||||
smtutil::Expression currentEqualInitialVarsConstraints(std::vector<VariableDeclaration const*> const& _vars) const;
|
||||
|
||||
/// @returns the predicate name for a given node.
|
||||
std::string predicateName(ASTNode const* _node, ContractDefinition const* _contract = nullptr);
|
||||
/// @returns a predicate application after checking the predicate's type.
|
||||
|
||||
Reference in New Issue
Block a user