12#ifndef FORMULA_CHECKER_H
13#define FORMULA_CHECKER_H
15#include "mcrl2/data/detail/prover/bdd_prover.h"
16#include "mcrl2/data/detail/prover/bdd2dot.h"
85 throw mcrl2::runtime_error(
86 "Cannot print witness. This is probably caused by an abrupt stop of the\n"
87 "conversion from expression to EQ-BDD. This typically occurs when a time limit is set.\n"
92 mCRL2log(log::log_level_t::info) <<
" Witness: " << v_witness << std::endl;
102 const data_expression v_counter_example = f_bdd_prover.get_counter_example();
105 throw mcrl2::runtime_error(
106 "Cannot print counter example. This is probably caused by an abrupt stop of the\n"
107 "conversion from expression to EQ-BDD. This typically occurs when a time limit is set.\n"
112 mCRL2log(log::log_level_t::info) <<
" Counter-example: " << v_counter_example << std::endl;
120 if (!f_dot_file_name.empty())
122 f_bdd2dot.output_bdd(f_bdd_prover.get_bdd(), f_dot_file_name +
"-" + std::to_string(a_formula_number) +
".dot");
133 int a_time_limit = 0,
134 bool a_path_eliminator =
false,
135 mcrl2::
data::
detail::smt_solver_type a_solver_type = mcrl2::
data::
detail::smt_solver_type::solver_type_cvc,
136 bool a_apply_induction =
false,
137 bool a_counter_example =
false,
138 bool a_witness =
false,
139 char const* a_dot_file_name =
nullptr)
160 int v_formula_number = 1;
162 for (
const auto& v_formula: a_formulas)
164 mCRL2log(log::log_level_t::info) <<
"'" << v_formula <<
"'";
165 f_bdd_prover.set_formula(v_formula);
166 Answer v_is_tautology = f_bdd_prover.is_tautology();
167 Answer v_is_contradiction = f_bdd_prover.is_contradiction();
168 if (v_is_tautology == Answer::answer_yes)
170 mCRL2log(log::log_level_t::info) <<
"Tautology" << std::endl;
172 else if (v_is_contradiction == Answer::answer_yes)
174 mCRL2log(log::log_level_t::info) <<
"Contradiction" << std::endl;
178 mCRL2log(log::log_level_t::info) <<
"Undeterminable" << std::endl;
179 print_counter_example();
181 save_dot_file(v_formula_number);
data_expression()
\brief Default constructor X3.
The class BDD2Dot offers the ability to write binary decision diagrams to dot files....
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.