6 #include <initializer_list>
12 const std::string::const_iterator
m_end;
71 virtual bool canHandle(
const fs::path& path)
const override {
77 if (
result.stderr.find(
"GNU MP: Cannot allocate memory") != std::string::npos)
return "memout";
78 if (
result.stderr.find(
"Minisat::OutOfMemoryException") != std::string::npos)
return "memout";
83 auto first_colon =
result.stdout.find(
':');
84 if (first_colon == std::string::npos)
return true;
85 assert(first_colon>0);
87 auto str =
result.stdout.substr(first_colon);
91 if (!p.
expect(
':'))
return false;
95 if (!p.
expect(
'('))
return false;
99 if (!key)
return false;
102 if (!value)
return false;
103 result.additional.emplace(*
prefix +
"_" + *key, *value);
106 if (!p.
expect(
')'))
return false;
108 if (!p.
expect(
')'))
return false;
116 switch (
result.exitCode) {
117 case 2:
result.answer =
"sat";
break;
118 case 3:
result.answer =
"unsat";
break;
119 case 4:
result.answer =
"unknown";
break;
120 case 5:
result.answer =
"wrong";
break;
121 case 9:
result.answer =
"nosuchfile";
break;
122 case 10:
result.answer =
"parsererror";
break;
123 case 11:
result.answer =
"timeout";
break;
124 case 12:
result.answer =
"memout";
break;
133 std::regex topRegex(
"\\(\\:(\\S+)\\s*\\(\\s*((?:\\:\\S+\\s*\\S+\\s*)+)\\)\\)");
134 std::regex subRegex(
"\\s*\\:(\\S+)\\s*(\\S+)");
136 auto topBegin = std::sregex_iterator(
result.stdout.begin(),
result.stdout.end(), topRegex);
137 auto topEnd = std::sregex_iterator();
138 for (
auto i = topBegin; i != topEnd; ++i) {
139 const std::string&
prefix = (*i)[1];
140 const std::string& subStdout = (*i)[2];
142 auto subBegin = std::sregex_iterator(subStdout.begin(), subStdout.end(), subRegex);
143 auto subEnd = std::sregex_iterator();
144 for (
auto j = subBegin; j != subEnd; ++j) {
145 std::string
name =
prefix +
"_" + std::string((*j)[1]);
#define BENCHMAX_LOG_WARN(channel, msg)
Log warnings.
Tool wrapper for SMT-RAT for SMT-LIB.
std::string getStatusFromOutput(const BenchmarkResult &result) const
Try to parse memouts from stderr.
virtual bool canHandle(const fs::path &path) const override
Only handle .smt2 files.
SMTRAT(const fs::path &binary, const std::string &arguments)
New SMT-RAT tool.
bool parse_stats(BenchmarkResult &result) const
virtual void additionalResults(const fs::path &, BenchmarkResult &result) const override
Computes the answer string from the exit code and parses statistics output.
void skip_excluding(const char c)
std::optional< std::string > read_until_whitespace_or(const std::initializer_list< char > cs)
std::string::const_iterator m_iter
simple_parser(const std::string &content)
std::optional< std::string > read_until_whitespace()
std::optional< std::string > read_until(const char c)
const std::string::const_iterator m_end
bool expect(const char c)
static bool find(V &ts, const T &t)
bool is_extension(const std::filesystem::path &path, const std::string &extension)
Checks whether the extension of the filename is as specified.
const auto & settings_tools()
Returns the tool settings.
std::vector< T > prefix(const std::vector< T > vars, std::size_t prefixSize)
Results for a single benchmark run.