SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Minisatp.h
Go to the documentation of this file.
1 /**
2  * @file smtratSolverTool.h
3  * @author: Sebastian Junges
4  *
5  *
6  */
7 
8 #pragma once
9 
10 #include "Tool.h"
11 
12 namespace benchmax {
13 
14 /**
15  * Tool wrapper for the Minisatp solver for pseudo-Boolean problems.
16  */
17 class Minisatp: public Tool {
18 public:
19  /// Create tool, add "-v0" to arguments.
20  Minisatp(const fs::path& binary, const std::string& arguments): Tool("Minisatp", binary, arguments) {
21  mArguments += " -v0";
22  }
23 
24  /// Only handles .opb files.
25  virtual bool canHandle(const fs::path& path) const override {
26  return is_extension(path, ".opb");
27  }
28 
29  /// Parse results from stdout.
30  virtual void additionalResults(const fs::path&, BenchmarkResult& result) const override {
31  if (result.stdout.find("s OPTIMUM FOUND") != std::string::npos) result.answer = "sat";
32  else if (result.stdout.find("s SATISFIABLE") != std::string::npos) result.answer = "sat";
33  else if (result.stdout.find("s UNSATISFIABLE") != std::string::npos) result.answer = "unsat";
34  else if (result.stdout.find("s UNKNOWN") != std::string::npos) result.answer = "unknown";
35  else result.answer = "timeout";
36  }
37 };
38 
39 }
Tool wrapper for the Minisatp solver for pseudo-Boolean problems.
Definition: Minisatp.h:17
virtual void additionalResults(const fs::path &, BenchmarkResult &result) const override
Parse results from stdout.
Definition: Minisatp.h:30
Minisatp(const fs::path &binary, const std::string &arguments)
Create tool, add "-v0" to arguments.
Definition: Minisatp.h:20
virtual bool canHandle(const fs::path &path) const override
Only handles .opb files.
Definition: Minisatp.h:25
Base class for any tool.
Definition: Tool.h:38
fs::path binary() const
Full path to the binary.
Definition: Tool.h:67
std::string mArguments
Command line arguments that should be passed to the binary.
Definition: Tool.h:45
bool is_extension(const std::filesystem::path &path, const std::string &extension)
Checks whether the extension of the filename is as specified.
Definition: filesystem.h:60
Results for a single benchmark run.