8 #ifdef CLI_ENABLE_OPB_PARSER
10 #include <carl-io/OPBImporter.h>
15 template<
typename Strategy>
16 int run_opb_file(Strategy& strategy,
const std::string& filename) {
17 Optimization<Strategy> optimization(strategy);
18 carl::io::OPBImporter<Poly> opb(filename);
21 auto input = opb.parse();
28 strategy.add(input->first);
29 if (!input->second.is_constant()) {
30 optimization.add_objective(input->second,
true);
31 exitCode = handleAnswer(std::get<0>(optimization.compute()));
33 exitCode = handleAnswer(strategy.check());
39 int handleAnswer(
Answer a) {
43 std::cout <<
"sat" << std::endl;
48 std::cout <<
"unsat" << std::endl;
53 std::cout <<
"unknown" << std::endl;
58 std::cerr <<
"unexpected output!";
71 template<
typename Strategy>
73 SMTRAT_LOG_ERROR(
"smtrat",
"This version of SMT-RAT was compiled without support for OPB parsing. Please enable it by setting the corresponding CMake option.");
constexpr int SMTRAT_EXIT_UNEXPECTED_ANSWER
constexpr int SMTRAT_EXIT_UNKNOWN
constexpr int SMTRAT_EXIT_SAT
constexpr int SMTRAT_EXIT_UNSAT
Class to create the formulas for axioms.
Answer
An enum with the possible answers a Module can give.
int run_opb_file(Strategy &, const std::string &)
#define SMTRAT_LOG_INFO(channel, msg)
#define SMTRAT_LOG_ERROR(channel, msg)