12#ifndef MCRL2_PRES_FIND_H
13#define MCRL2_PRES_FIND_H
15#include "mcrl2/pres/add_binding.h"
16#include "mcrl2/pres/traverser.h"
27template <
template <
class>
class Traverser,
class OutputIterator>
51template <
template <
class>
class Traverser,
class OutputIterator>
55 return find_propositional_variables_traverser<Traverser, OutputIterator>(out);
65template <
typename T,
typename OutputIterator>
77 std::set<data::variable> result;
78 pres_system::find_all_variables(x, std::inserter(result, result.end()));
86template <
typename T,
typename OutputIterator>
97template <
typename T,
typename OutputIterator,
typename VariableContainer>
109 std::set<data::variable> result;
110 pres_system::find_free_variables(x, std::inserter(result, result.end()));
118template <
typename T,
typename VariableContainer>
121 std::set<data::variable> result;
122 pres_system::find_free_variables_with_bound(x, std::inserter(result, result.end()), bound);
130template <
typename T,
typename OutputIterator>
142 std::set<core::identifier_string> result;
143 pres_system::find_identifiers(x, std::inserter(result, result.end()));
151template <
typename T,
typename OutputIterator>
163 std::set<data::sort_expression> result;
164 pres_system::find_sort_expressions(x, std::inserter(result, result.end()));
172template <
typename T,
typename OutputIterator>
184 std::set<data::function_symbol> result;
185 pres_system::find_function_symbols(x, std::inserter(result, result.end()));
195template <
typename Container,
typename OutputIterator>
204template <
typename Container>
207 std::set<propositional_variable_instantiation> result;
208 pres_system::find_propositional_variable_instantiations(container, std::inserter(result, result.end()));
219 data::detail::search_variable_traverser<pres_system::variable_traverser> f(v);
Components for generating an arbitrary element of a sort.
representative_generator(const data_specification &specification)
Constructor with data specification as context.
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
void add_identifier(const core::identifier_string &s) override
Adds the identifier s to the context.
const core::identifier_string & name() const
\brief The and operator for pres expressions
\brief The multiplication with a positive constant with the constant at the right.
\brief The multiplication with a positive constant with the constant at the left.
\brief The implication operator for pres expressions
\brief The infimum over a data type for pres expressions
const pres_expression & body() const
\brief The not operator for pres expressions
\brief The or operator for pres expressions
pres_expression & formula()
Returns the predicate formula on the right hand side of the equation.
bool is_solved() const
Returns true if the predicate formula on the right hand side contains no predicate variables.
const pres_expression & formula() const
Returns the predicate formula on the right hand side of the equation.
pres_expression & operator=(const pres_expression &) noexcept=default
parameterized boolean equation system
std::set< propositional_variable_instantiation > occurring_variable_instantiations() const
Returns the set of occurring propositional variable instantiations of the pres. This is the set of va...
\brief A propositional variable instantiation
\brief The generic sum operator for pres expressions
const pres_expression & body() const
\brief The supremeum over a data type for pres expressions
const pres_expression & body() const
D_ParserTables parser_tables_mcrl2
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
void syntax_error_fn(struct D_Parser *ap)
Custom syntax error function that prints both the line number and the column.
D_ParseNode * ambiguity_fn(struct D_Parser *, int n, struct D_ParseNode **v)
Function for resolving parser ambiguities.
void warn_and_or(const parse_node &)
Prints a warning for each occurrence of 'x && y || z' in the parse tree.
Namespace for all data library functionality.
atermpp::term_list< variable > variable_list
\brief list of variables
void instantiate_global_variables(pres &p)
Attempts to eliminate the free variables of a PRES, by substituting a constant value for them....
bool is_res(const pres &x)
Returns true if a PRES is in RES form.
data::mutable_map_substitution instantiate_global_variables(pres &p)
Eliminates the global variables of a PRES, by substituting a constant value for them....
void complete_pres(pres &x)
untyped_pres parse_pres_new(const std::string &text)
bool is_well_typed(const pres_equation &eqn)
Checks if the equation is well typed.
void replace_global_variables(pres &p, const data::mutable_map_substitution<> &sigma)
Applies a global variable substitution to a PRES.
propositional_variable parse_propositional_variable(const std::string &text)
bool has_propositional_variables(const pres_expression &x)
find_propositional_variables_traverser< Traverser, OutputIterator > make_find_propositional_variables_traverser(OutputIterator out)
pres_expression parse_pres_expression_new(const std::string &text)
pres_expression parse_pres_expression(const std::string &text)
The main namespace for the PRES library.
void translate_user_notation(pres_system::pres &x)
std::string pp(const pres_system::supremum &x)
void replace_propositional_variables(T &x, const Substitution &sigma, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Applies a propositional variable substitution.
std::vector< pres_expression > pres_expression_vector
\brief vector of pres_expressions
T replace_propositional_variables(const T &x, const Substitution &sigma, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Applies a propositional variable substitution.
std::string pp(const pres_system::const_multiply &x)
std::set< data::variable > find_free_variables(const pres_system::pres &x)
void typecheck_pres(pres &presspec)
Type check a parsed mCRL2 pres specification. Throws an exception if something went wrong.
void replace_free_variables(T &x, const Substitution &sigma, const VariableContainer &bound_variables, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
void find_free_variables(const T &x, OutputIterator o)
std::vector< propositional_variable_instantiation > propositional_variable_instantiation_vector
\brief vector of propositional_variable_instantiations
void replace_propositional_variables(T &result, const T &x, const Substitution &sigma, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Applies a propositional variable substitution.
std::string pp(const pres_system::fixpoint_symbol &x)
bool is_well_typed_equation(const pres_equation &eqn, const std::set< data::sort_expression > &declared_sorts, const std::set< data::variable > &declared_global_variables, const data::data_specification &data_spec)
std::string pp(const pres_system::pres_expression &x)
std::string pp(const pres_system::infimum &x)
std::set< core::identifier_string > find_identifiers(const T &x)
void replace_variables_capture_avoiding(T &x, Substitution &sigma, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
T replace_pres_expressions(const T &x, const Substitution &sigma, bool innermost=true, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
void find_propositional_variable_instantiations(Container const &container, OutputIterator o)
Returns all data variables that occur in a range of expressions.
T replace_data_expressions(const T &x, const Substitution &sigma, bool innermost, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::string pp(const pres_system::pres_equation &x)
void replace_pres_expressions(T &x, const Substitution &sigma, bool innermost=true, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=0)
void find_sort_expressions(const T &x, OutputIterator o)
void normalize_sorts(pres_system::pres_equation_vector &x, const data::sort_specification &sortspec)
std::string pp(const pres_system::propositional_variable_list &x)
std::set< data::variable > find_free_variables_with_bound(const T &x, VariableContainer const &bound)
bool search_variable(const pres_system::pres_expression &x, const data::variable &v)
std::string pp(const pres_system::or_ &x)
std::set< propositional_variable_instantiation > find_propositional_variable_instantiations(Container const &container)
Returns all data variables that occur in a range of expressions.
void find_all_variables(const T &x, OutputIterator o)
std::string pp(const pres_system::const_multiply_alt &x)
void replace_variables_capture_avoiding(T &x, Substitution &sigma, data::set_identifier_generator &id_generator, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::vector< pres_equation > pres_equation_vector
\brief vector of pres_equations
std::set< pres_system::propositional_variable_instantiation > find_propositional_variable_instantiations(const pres_system::pres_expression &x)
void replace_sort_expressions(T &x, const Substitution &sigma, bool innermost, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::set< data::sort_expression > find_sort_expressions(const pres_system::pres &x)
std::set< data::function_symbol > find_function_symbols(const pres_system::pres &x)
std::set< data::variable > find_free_variables(const T &x)
void normalize_sorts(pres_system::pres &x, const data::sort_specification &)
std::set< data::variable > find_free_variables(const pres_system::pres_expression &x)
atermpp::term_list< pres_expression > pres_expression_list
\brief list of pres_expressions
void replace_free_variables(T &x, const Substitution &sigma, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::string pp(const pres_system::pres_expression_list &x)
std::string pp(const pres_system::sum &x)
bool is_well_typed_pres(const std::set< data::sort_expression > &declared_sorts, const std::set< data::variable > &declared_global_variables, const std::set< data::variable > &occurring_global_variables, const std::set< propositional_variable > &declared_variables, const std::set< propositional_variable_instantiation > &occ, const propositional_variable_instantiation &init, const data::data_specification &data_spec)
atermpp::term_list< pbes_system::propositional_variable > propositional_variable_list
\brief list of propositional_variables
std::set< data::variable > find_all_variables(const T &x)
std::set< data::variable > find_free_variables(const pres_system::pres_equation &x)
std::string pp(const pres_system::pres_equation_vector &x)
T replace_variables_capture_avoiding(const T &x, Substitution &sigma, data::set_identifier_generator &id_generator, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
void find_free_variables_with_bound(const T &x, OutputIterator o, const VariableContainer &bound)
T replace_free_variables(const T &x, const Substitution &sigma, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
void replace_variables(T &x, const Substitution &sigma, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::string pp(const pres_system::and_ &x)
pres_system::pres_expression translate_user_notation(const pres_system::pres_expression &x)
void find_function_symbols(const T &x, OutputIterator o)
T replace_free_variables(const T &x, const Substitution &sigma, const VariableContainer &bound_variables, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::set< core::identifier_string > find_identifiers(const pres_system::pres_expression &x)
std::set< data::function_symbol > find_function_symbols(const T &x)
bool search_variable(const T &x, const data::variable &v)
Returns true if the term has a given variable as subterm.
std::set< data::sort_expression > find_sort_expressions(const T &x)
void find_identifiers(const T &x, OutputIterator o)
std::string pp(const pres_system::pres &x)
std::string pp(const pres_system::imp &x)
std::vector< pbes_system::propositional_variable > propositional_variable_vector
\brief vector of propositional_variables
std::string pp(const pres_system::propositional_variable_instantiation &x)
void replace_data_expressions(T &x, const Substitution &sigma, bool innermost, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
T replace_sort_expressions(const T &x, const Substitution &sigma, bool innermost, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
T replace_variables(const T &x, const Substitution &sigma, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
void replace_all_variables(T &x, const Substitution &sigma, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::string pp(const pres_system::minus &x)
pres_system::pres_expression normalize_sorts(const pres_system::pres_expression &x, const data::sort_specification &sortspec)
T replace_variables_capture_avoiding(const T &x, Substitution &sigma, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::string pp(const pres_system::propositional_variable_instantiation_list &x)
void complete_data_specification(pres &)
Adds all sorts that appear in the PRES p to the data specification of p.
std::set< data::variable > find_all_variables(const pres_system::pres &x)
std::string pp(const pres_system::propositional_variable &x)
bool is_well_typed(const pres_equation &eqn)
atermpp::term_list< propositional_variable_instantiation > propositional_variable_instantiation_list
\brief list of propositional_variable_instantiations
T replace_all_variables(const T &x, const Substitution &sigma, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Wrapper for D_Parser and its corresponding D_ParserTables.
parse_node parse(const std::string &text, unsigned int start_symbol_index=0, bool partial_parses=false)
Parses a string. N.B. The user is responsible for destruction of the returned value by calling destro...
parser(D_ParserTables &tables, D_AmbiguityFn ambiguity_fn=nullptr, D_SyntaxErrorFn syntax_error_fn=nullptr, std::size_t max_error_message_count=1)
unsigned int start_symbol_index(const std::string &name) const
void apply(T &result, const infimum &x)
add_capture_avoiding_replacement(data::detail::capture_avoiding_substitution_updater< Substitution > &sigma)
void update(pres_equation &x)
void apply(T &result, const sum &x)
void apply(T &result, const supremum &x)
data::detail::add_capture_avoiding_replacement< Builder, Derived, Substitution > super
find_propositional_variables_traverser(OutputIterator out_)
void apply(const propositional_variable_instantiation &v)
Traverser< find_propositional_variables_traverser< Traverser, OutputIterator > > super
void apply(const data::data_expression &)
has_propositional_variables_traverser()
void enter(const propositional_variable_instantiation &)
pres_expression_traverser< has_propositional_variables_traverser > super
pres_system::pres_expression parse_PresExpr(const core::parse_node &node) const
pres_system::propositional_variable parse_PropVarDecl(const core::parse_node &node) const
pres_actions(const core::parser &parser_)
untyped_pres parse_PresSpec(const core::parse_node &node) const
std::size_t operator()(const atermpp::detail::reference_aterm< T > &t) const