Coverage Report

Created: 2025-06-24 07:59

/src/solidity/libsolidity/interface/SMTSolverCommand.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
  This file is part of solidity.
3
4
  solidity is free software: you can redistribute it and/or modify
5
  it under the terms of the GNU General Public License as published by
6
  the Free Software Foundation, either version 3 of the License, or
7
  (at your option) any later version.
8
9
  solidity is distributed in the hope that it will be useful,
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
  GNU General Public License for more details.
13
14
  You should have received a copy of the GNU General Public License
15
  along with solidity.  If not, see <http://www.gnu.org/licenses/>.
16
*/
17
// SPDX-License-Identifier: GPL-3.0
18
#pragma once
19
20
#include <libsolidity/interface/ReadFile.h>
21
22
#include <boost/filesystem.hpp>
23
24
namespace solidity::frontend
25
{
26
27
/// SMTSolverCommand wraps an SMT solver called via its binary in the OS.
28
class SMTSolverCommand
29
{
30
public:
31
  /// Calls an SMT solver with the given query.
32
  frontend::ReadCallback::Result solve(std::string const& _kind, std::string const& _query) const;
33
34
  frontend::ReadCallback::Callback solver() const
35
0
  {
36
0
    return [this](std::string const& _kind, std::string const& _query) { return solve(_kind, _query); };
37
0
  }
38
39
  void setEldarica(std::optional<unsigned int> timeoutInMilliseconds, bool computeInvariants);
40
  void setCvc5(std::optional<unsigned int> timeoutInMilliseconds);
41
  void setZ3(std::optional<unsigned int> timeoutInMilliseconds, bool _preprocessing, bool _computeInvariants);
42
43
private:
44
  /// The name of the solver's binary.
45
  std::string m_solverCmd;
46
  std::vector<std::string> m_arguments;
47
};
48
49
}