12#ifndef MCRL2_PBES_DETAIL_BES_ALGORITHM_H
13#define MCRL2_PBES_DETAIL_BES_ALGORITHM_H
15#include "mcrl2/pbes/find.h"
16#include "mcrl2/pbes/print.h"
37 return mCRL2logEnabled(log::log_level_t::verbose);
44 std::deque<propositional_variable_instantiation> todo;
45 std::set<propositional_variable_instantiation> reachable;
48 std::map<propositional_variable_instantiation, pbes_equation> equations;
49 for(
const pbes_equation& e: m_bes.equations())
51 equations[propositional_variable_instantiation(e.variable().name())] = e;
54 reachable = find_propositional_variable_instantiations(m_bes.initial_state());
55 todo.insert(todo.end(), reachable.begin(), reachable.end());
59 pbes_equation eqn = equations[todo.front()];
61 std::set<propositional_variable_instantiation> occ = find_propositional_variable_instantiations(eqn.formula());
62 for(
const propositional_variable_instantiation& v: occ)
64 bool fresh = reachable.insert(v).second;
72 if(reachable.size() == m_bes.equations().size())
77 std::vector<pbes_equation> reachable_equations;
78 std::set<propositional_variable> unreachable_equations;
79 for (
auto& i: m_bes.equations())
81 if (reachable.find(propositional_variable_instantiation(i.variable().name())) != reachable.end())
83 reachable_equations.insert(reachable_equations.end(), i);
87 unreachable_equations.insert(i.variable());
91 m_bes.equations() = reachable_equations;
93 mCRL2log(log::log_level_t::verbose) <<
"Removed the following unreachable equations: " << pbes_system::pp(unreachable_equations) << std::endl;
Algorithm class for algorithms on linear process specifications.
bool verbose() const
Flag for verbose output.
pbes & m_bes
The specification that is processed by the algorithm.
bes_algorithm(pbes &bes)
Constructor.
bool remove_unreachable_equations()
Perform reachability analysis on equations of m_bes, and remove those that are unreachable.
parameterized boolean equation system
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.