Storm 2.0.0.3
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SmtSolverTestUtils.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <string>
5#include <vector>
6#include "storm-config.h"
7#include "test/storm_gtest.h"
8
11
12namespace storm::test {
13
14// The SMT solvers that tests are run against.
15inline std::vector<storm::solver::SmtSolverType> smtSolversUnderTest() {
16 std::vector<storm::solver::SmtSolverType> solvers;
17#if defined STORM_HAVE_Z3
18 solvers.push_back(storm::solver::SmtSolverType::Z3);
19#endif
20#if defined STORM_HAVE_MATHSAT
21 solvers.push_back(storm::solver::SmtSolverType::Mathsat);
22#endif
23#if defined STORM_HAVE_CVC5
24 solvers.push_back(storm::solver::SmtSolverType::Cvc5);
25#endif
26 return solvers;
27}
28
29// A factory that always creates a solver of the given type.
30inline std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory(storm::solver::SmtSolverType type) {
31 switch (type) {
32 case storm::solver::SmtSolverType::Z3:
33 return std::make_shared<storm::utility::solver::Z3SmtSolverFactory>();
34 case storm::solver::SmtSolverType::Mathsat:
35 return std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>();
36 case storm::solver::SmtSolverType::Cvc5:
37 return std::make_shared<storm::utility::solver::Cvc5SmtSolverFactory>();
38 }
39 return nullptr;
40}
41
42inline std::string smtSolverName(testing::TestParamInfo<storm::solver::SmtSolverType> const& info) {
43 return storm::solver::toString(info.param);
44}
45
46} // namespace storm::test
std::string toString(GurobiSolverMethod const &method)
Yields a string representation of the GurobiSolverMethod.
std::string smtSolverName(testing::TestParamInfo< storm::solver::SmtSolverType > const &info)
std::shared_ptr< storm::utility::solver::SmtSolverFactory > smtSolverFactory(storm::solver::SmtSolverType type)
std::vector< storm::solver::SmtSolverType > smtSolversUnderTest()