12#include "mcrl2/pres/detail/has_propositional_variables.h"
13#include "mcrl2/pres/detail/instantiate_global_variables.h"
14#include "mcrl2/pres/detail/is_well_typed.h"
15#include "mcrl2/pres/detail/occurring_variable_visitor.h"
16#include "mcrl2/pres/is_res.h"
17#include "mcrl2/pres/parse_impl.h"
18#include "mcrl2/pres/print.h"
19#include "mcrl2/pres/translate_user_notation.h"
70 pres_system::detail::instantiate_global_variables(p);
86 const std::set<data::sort_expression>& declared_sorts,
87 const std::set<data::variable>& declared_global_variables,
91 return pres_system::detail::is_well_typed_equation(eqn, declared_sorts, declared_global_variables, data_spec);
95 const std::set<data::variable>& declared_global_variables,
96 const std::set<data::variable>& occurring_global_variables,
97 const std::set<propositional_variable>& declared_variables,
98 const std::set<propositional_variable_instantiation>& occ,
103 return pres_system::detail::is_well_typed_pres(declared_sorts, declared_global_variables, occurring_global_variables, declared_variables, occ, init, data_spec);
113 std::set<propositional_variable_instantiation> result;
114 for (
const pres_equation& eqn: equations())
116 detail::occurring_variable_visitor f;
117 f.apply(eqn.formula());
118 result.insert(f.variables.begin(), f.variables.end());
129 bool partial_parses =
false;
140 bool partial_parses =
false;
158 bool partial_parses =
false;
167 bool partial_parses =
false;
\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
\brief The not operator for pres expressions
\brief The or operator for pres expressions
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.
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
\brief The supremeum over a data type for pres expressions
D_ParserTables parser_tables_mcrl2
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.
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.
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.
propositional_variable parse_propositional_variable(const std::string &text)
bool has_propositional_variables(const pres_expression &x)
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)
std::vector< pres_expression > pres_expression_vector
\brief vector of pres_expressions
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.
std::vector< propositional_variable_instantiation > propositional_variable_instantiation_vector
\brief vector of propositional_variable_instantiations
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::string pp(const pres_system::pres_equation &x)
void normalize_sorts(pres_system::pres_equation_vector &x, const data::sort_specification &sortspec)
std::string pp(const pres_system::propositional_variable_list &x)
bool search_variable(const pres_system::pres_expression &x, const data::variable &v)
std::string pp(const pres_system::or_ &x)
std::string pp(const pres_system::const_multiply_alt &x)
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)
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)
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
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_free_variables(const pres_system::pres_equation &x)
std::string pp(const pres_system::pres_equation_vector &x)
std::string pp(const pres_system::and_ &x)
pres_system::pres_expression translate_user_notation(const pres_system::pres_expression &x)
std::set< core::identifier_string > find_identifiers(const pres_system::pres_expression &x)
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)
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)
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
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
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