SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Minisat.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 a Minisat solver.
16  */
17 class Minisat: public Tool {
18 public:
19  /// Create tool.
20  Minisat(const fs::path& binary, const std::string& arguments): Tool("Minisat", binary, arguments) {}
21 
22  /// Only handles .opb files.
23  virtual bool canHandle(const fs::path& path) const override {
24  return is_extension(path, ".cnf") || is_extension(path, ".dimacs");
25  }
26 
27  /// Parse results from stdout.
28  virtual void additionalResults(const fs::path&, BenchmarkResult& result) const override {
29  if (result.exitCode == 10) result.answer = "sat";
30  else if (result.exitCode == 20) result.answer = "unsat";
31  else result.answer = "unknown";
32  }
33 };
34 
35 }
virtual bool canHandle(const fs::path &path) const override
Only handles .opb files.
Definition: Minisat.h:23
virtual void additionalResults(const fs::path &, BenchmarkResult &result) const override
Parse results from stdout.
Definition: Minisat.h:28
Minisat(const fs::path &binary, const std::string &arguments)
Create tool.
Definition: Minisat.h:20
Base class for any tool.
Definition: Tool.h:38
fs::path binary() const
Full path to the binary.
Definition: Tool.h:67
Definition: Alg.h:27
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.