12#ifndef MCRL2_PBES_DETAIL_GUARD_TRAVERSER_H
13#define MCRL2_PBES_DETAIL_GUARD_TRAVERSER_H
15#include "mcrl2/data/rewriter.h"
16#include "mcrl2/pbes/pbes_expression.h"
17#include "mcrl2/pbes/pbes_functions.h"
18#include "mcrl2/pbes/rewrite.h"
19#include "mcrl2/pbes/rewriters/simplify_rewriter.h"
21#ifdef MCRL2_PBES_STATEGRAPH_CHECK_GUARDS
22#include "mcrl2/pbes/find.h"
31#ifdef MCRL2_PBES_STATEGRAPH_CHECK_GUARDS
165 return guards.empty();
176 for (
auto& g: guards)
178 pbes_system::make_optimized_and(g.second, guard, g.second);
191 for (
auto& g: guards)
193 pbes_system::make_optimized_not(g.second, g.second);
202#ifdef MCRL2_PBES_STATEGRAPH_CHECK_GUARDS
233 template <
typename PbesRewriter>
246 out <<
"condition = " << pbes_system::pp(x.condition) << std::endl;
250 for (
const auto& g: x.guards)
252 out << pbes_system::pp(g.first) <<
" guard = " << pbes_system::pp(g.second) << std::endl;
275 mCRL2log(log::log_level_t::trace) <<
"<push>" <<
"\n" << x << std::endl;
276 expression_stack.push_back(x);
281 return expression_stack.back();
286 return expression_stack.back();
292 expression_stack.pop_back();
298 push(guard_expression(atermpp::down_cast<pbes_expression>(x)));
299 assert(top().check_guards(atermpp::down_cast<pbes_expression>(x), R));
307 assert(top().check_guards(x, R));
313 assert(top().check_guards(x, R));
341 left.guards.insert(left.guards.end(), right.guards.begin(), right.guards.end());
345 assert(top().check_guards(x, R));
377 left.guards.insert(left.guards.end(), right.guards.begin(), right.guards.end());
381 assert(top().check_guards(x, R));
414 left.guards.insert(left.guards.end(), right.guards.begin(), right.guards.end());
418 assert(top().check_guards(x, R));
428 assert(top().check_guards(x, R));
438 assert(top().check_guards(x, R));
Rewriter that operates on data expressions.
\brief The and operator for pbes expressions
\brief The existential quantification operator for pbes expressions
\brief The universal quantification operator for pbes expressions
\brief The implication operator for pbes expressions
\brief The not operator for pbes expressions
\brief The or operator for pbes expressions
pbes_expression & operator=(const pbes_expression &) noexcept=default
pbes_expression(const pbes_expression &) noexcept=default
Move semantics.
\brief A propositional variable instantiation
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
std::ostream & operator<<(std::ostream &out, const guard_expression &x)
void make_optimized_and(pbes_expression &result, const pbes_expression &p, const pbes_expression &q)
Make a conjunction.
const pbes_expression & true_()
void make_optimized_not(pbes_expression &result, const pbes_expression &p)
Make a negation.
void make_optimized_or(pbes_expression &result, const pbes_expression &p, const pbes_expression &q)
Make a disjunction.
pbes_expression condition
guard_expression(const pbes_expression &condition_=pbes_system::true_())
bool check_guards(const pbes_expression &, PbesRewriter) const
void add_guard(const pbes_expression &guard)
Computes a multimap of propositional variable instantiations and the corresponding guards from a PBES...
void leave(const pbes_system::forall &x)
void push(const guard_expression &x)
void leave(const pbes_system::exists &x)
void leave(const pbes_system::not_ &x)
void leave(const data::data_expression &x)
const guard_expression & top() const
simplify_data_rewriter< data::rewriter > R
void leave(const pbes_system::and_ &x)
void leave(const pbes_system::imp &x)
void leave(const pbes_system::or_ &x)
void leave(const pbes_system::propositional_variable_instantiation &x)
std::vector< guard_expression > expression_stack
guard_traverser(const data::rewriter &r)
A rewriter that simplifies boolean expressions in a term, and rewrites data expressions using DataRew...