12#ifndef MCRL2_PBES_DETAIL_STATEGRAPH_SIMPLIFY_REWRITER_H
13#define MCRL2_PBES_DETAIL_STATEGRAPH_SIMPLIFY_REWRITER_H
15#include "mcrl2/data/consistency.h"
16#include "mcrl2/data/rewriters/simplify_rewriter.h"
17#include "mcrl2/pbes/detail/stategraph_split.h"
18#include "mcrl2/pbes/rewriters/simplify_quantifiers_rewriter.h"
34 return atermpp::down_cast<pbes_expression>(data::unary_operand1(x1));
40 return atermpp::down_cast<pbes_expression>(data::equal_to(left, right));
46 return atermpp::down_cast<pbes_expression>(data::not_equal_to(left, right));
50 return atermpp::down_cast<pbes_expression>(data::not_(x1));
61 return atermpp::down_cast<pbes_expression>(data::and_(atermpp::down_cast<data::data_expression>(x), atermpp::down_cast<data::data_expression>(y)));
71 return atermpp::down_cast<pbes_expression>(data::or_(atermpp::down_cast<data::data_expression>(x), atermpp::down_cast<data::data_expression>(y)));
76template <
typename Derived,
typename DataRewriter,
typename SubstitutionFunction>
90 return static_cast<Derived&>(*
this);
98 return atermpp::down_cast<pbes_expression>(*data::application(x).begin());
102 return atermpp::down_cast<not_>(x).operand();
109 return utilities::detail::join(terms.begin(), terms.end(), smart_or, F);
115 return utilities::detail::join(terms.begin(), terms.end(), smart_and, T);
130 std::vector<pbes_expression> terms;
131 detail::stategraph_split_or(arg, terms);
132 for (pbes_expression& term: terms)
134 term = stategraph_not(term);
136 result = stategraph_join_and(terms);
141 std::vector<pbes_expression> terms;
142 detail::stategraph_split_and(arg, terms);
143 for (pbes_expression& term: terms)
145 term = stategraph_not(term);
147 result = stategraph_join_or(terms);
154 mCRL2log(log::log_level_t::trace) <<
" simplify-postprocess " << x <<
" -> " << result << std::endl;
161 super::apply(result, data::simplify(x));
168 super::apply(result, x);
176 super::apply(result, x);
183 super::apply(result, x);
196 super::apply(result, x);
203 super::apply(result, x);
210 super::apply(result, x);
216template <
typename DataRewriter>
251 template <
typename SubstitutionFunction>
\brief The and operator for pbes expressions
and_(const pbes_expression &left, const pbes_expression &right)
\brief Constructor Z14.
A rewriter that simplifies expressions that simplifies quantifiers.
pbes_expression operator()(const pbes_expression &x, SubstitutionFunction &sigma) const
Rewrites a pbes expression.
const DataRewriter & m_rewriter
The data rewriter.
stategraph_simplify_rewriter(const DataRewriter &rewriter)
Constructor.
pbes_expression operator()(const pbes_expression &x) const
Rewrites a pbes expression.
\brief The existential quantification operator for pbes expressions
\brief The universal quantification operator for pbes expressions
\brief The implication operator for pbes expressions
const pbes_expression & left() const
const pbes_expression & right() const
\brief The not operator for pbes expressions
not_(const pbes_expression &operand)
\brief Constructor Z14.
\brief The or operator for pbes expressions
or_(const pbes_expression &left, const pbes_expression &right)
\brief Constructor Z14.
pbes_expression & operator=(pbes_expression &&) noexcept=default
\brief A propositional variable instantiation
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
bool is_not(const data_expression &x)
Test if x is a negation.
bool is_not_equal_to(const data_expression &x)
Test if x is an inequality.
bool is_equal_to(const data_expression &x)
Test if x is an equality.
pbes_expression smart_and(const pbes_expression &x, const pbes_expression &y)
pbes_expression smart_or(const pbes_expression &x, const pbes_expression &y)
pbes_expression stategraph_not(const pbes_expression &x)
bool is_universal_or(const pbes_expression &t)
Test for a disjunction.
bool is_data(const pbes_expression &t)
Returns true if the term t is a data expression.
bool is_universal_and(const pbes_expression &t)
Test for a conjunction.
const pbes_expression & true_()
bool is_universal_not(const pbes_expression &t)
Test for a conjunction.
const pbes_expression & false_()
An empty struct that is used to denote the absence of a substitution. Used for rewriters.
pbes_expression stategraph_join_and(const std::vector< pbes_expression > &terms) const
pbes_expression post_process(const pbes_expression &x)
void apply(T &result, const propositional_variable_instantiation &x)
void apply(T &result, const imp &x)
const pbes_expression & not_arg(const pbes_expression &x)
stategraph_simplify_builder(const DataRewriter &R, SubstitutionFunction &sigma)
Constructor.
void apply(T &result, const data::data_expression &x)
void apply(T &result, const exists &x)
void apply(T &result, const forall &x)
void apply(T &result, const not_ &x)
void apply(T &result, const and_ &x)
pbes_expression stategraph_join_or(const std::vector< pbes_expression > &terms) const
void apply(T &result, const or_ &x)