15#ifndef MCRL2_PBES_TOOLS_PBESBACKELM_H
16#define MCRL2_PBES_TOOLS_PBESBACKELM_H
18#include "mcrl2/pbes/algorithms.h"
19#include "mcrl2/pbes/rewrite.h"
20#include "mcrl2/pbes/rewriter.h"
21#include "mcrl2/pbes/io.h"
33
34
35
36
37template <
template <
class>
class Builder>
79 data::data_expression_list pars=x.parameters();
80 for(
const data::variable& v: m_eq.variable().parameters())
82 data::data_expression par=pars.front();
84 if (par.sort()!=v.sort())
93 std::set<propositional_variable_instantiation> set=find_propositional_variable_instantiations(p);
94 if (std::all_of(set.begin(),
96 [
this](
const propositional_variable_instantiation& v){
return v.name()!=m_eq.variable().name(); }))
99 mCRL2log(log::log_level_t::verbose) <<
"Replaced in PBES equation for " << name <<
":\n" << x <<
" --> " << p <<
"\n";
104 mCRL2log(log::log_level_t::debug) <<
"No Replacement in PBES equation for " << name <<
":\n" << x <<
" --> " << p <<
"\n";
115 substituter.set_stable(
false);
116 while (!substituter.stable())
118 substituter.set_equation(equation);
119 substituter.set_name(equation.variable().name());
120 substituter.set_stable(
true);
122 substituter.apply(p, equation.formula());
123 equation.formula()=p;
130 substituter.set_equation(by);
131 substituter.set_name(into.variable().name());
133 substituter.apply(p, into.formula());
143 data::
rewriter data_rewriter(p.data(),options.rewrite_strategy);
145 substitute_propositional_variables_builder<pbes_system::pbes_expression_builder> substituter(pbes_rewriter);
146 for(std::vector<pbes_equation>::reverse_iterator i=p.equations().rbegin(); i!=p.equations().rend(); i++)
149 mCRL2log(log::log_level_t::verbose) <<
"Investigating the equation for " << i->variable().name() <<
"\n";
150 self_substitute(*i,substituter);
151 for(std::vector<pbes_equation>::reverse_iterator j=i+1; j!=p.equations().rend(); j++)
153 substitute(*j, *i, substituter);
156 pbes_rewrite(p, pbes_rewriter);
aterm_string & operator=(const aterm_string &t) noexcept=default
Generic substitution function.
Rewriter that operates on data expressions.
propositional_variable & variable()
Returns the pbes variable of the equation.
pbes_expression & formula()
Returns the predicate formula on the right hand side of the equation.
pbes_expression & operator=(const pbes_expression &) noexcept=default
parameterized boolean equation system
\brief A propositional variable instantiation
const core::identifier_string & name() const
const core::identifier_string & name() const
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
void self_substitute(pbes_equation &equation, substitute_propositional_variables_builder< pbes_system::pbes_expression_builder > &substituter)
void substitute(pbes_equation &into, const pbes_equation &by, substitute_propositional_variables_builder< pbes_system::pbes_expression_builder > &substituter)
data::rewrite_strategy rewrite_strategy
void run(pbes &p, pbesbackelm_options options)
A rewriter that simplifies boolean expressions and quantifiers, and rewrites data expressions.
void set_name(const core::identifier_string &s)
simplify_quantifiers_data_rewriter< data::rewriter > m_pbes_rewriter
void apply(T &result, const propositional_variable_instantiation &x)
substitute_propositional_variables_builder(simplify_quantifiers_data_rewriter< data::rewriter > &r)
core::identifier_string name
void set_equation(const pbes_equation &eq)