12#ifndef MCRL2_PBES_PARSE_IMPL_H
13#define MCRL2_PBES_PARSE_IMPL_H
15#include "mcrl2/data/detail/parse_substitution.h"
16#include "mcrl2/data/parse_impl.h"
17#include "mcrl2/pbes/typecheck.h"
18#include "mcrl2/pbes/untyped_pbes.h"
47 else if ((node
.child_count() == 2) && (
symbol_name(node
.child(0
)) ==
"Id")) {
return data::untyped_data_parameter(parse_Id(node.child(0)), parse_DataExprList(node.child(1))); }
53 return pbes_system::propositional_variable(parse_Id(node.child(0)), parse_VarsDeclList(node.child(1)));
58 return pbes_system::propositional_variable_instantiation(parse_Id(node.child(0)), parse_DataExprList(node.child(1)));
85 return parse_PbesEqnDeclList(node.child(1));
92 result.global_variables = parse_GlobVarSpec(node.child(1));
93 result.equations = parse_PbesEqnSpec(node.child(2));
bool operator!=(const unprotected_aterm_core &t) const
Inequality operator on two unprotected aterms.
parse_node_unexpected_exception(const parser &p, const parse_node &node)
Components for generating an arbitrary element of a sort.
representative_generator(const data_specification &specification)
Constructor with data specification as context.
logger(const log_level_t l)
Default constructor.
\brief The and operator for pbes expressions
and_(const pbes_expression &left, const pbes_expression &right)
\brief Constructor Z14.
\brief The existential quantification operator for pbes expressions
const data::variable_list & variables() const
static fixpoint_symbol nu()
Returns the nu symbol.
static fixpoint_symbol mu()
Returns the mu symbol.
\brief The universal quantification operator for pbes expressions
const data::variable_list & variables() const
\brief The implication operator for pbes expressions
imp(const pbes_expression &left, const pbes_expression &right)
\brief Constructor Z14.
\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.
const pbes_expression & formula() const
Returns the predicate formula on the right hand side of the equation.
pbes_equation(const fixpoint_symbol &symbol, const propositional_variable &variable, const pbes_expression &expr)
Constructor.
bool is_solved() const
Returns true if the predicate formula on the right hand side contains no predicate variables.
const propositional_variable & variable() const
Returns the pbes variable 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 pbes. This is the set of va...
\brief A propositional variable instantiation
const data::data_expression_list & parameters() const
const core::identifier_string & name() const
propositional_variable_instantiation & operator=(propositional_variable_instantiation &&) noexcept=default
\brief A propositional variable declaration
const data::variable_list & parameters() const
const core::identifier_string & name() 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.
atermpp::aterm_string identifier_string
String type of the LPS library. Identifier strings are represented internally as ATerms.
void warn_and_or(const parse_node &)
Prints a warning for each occurrence of 'x && y || z' in the parse tree.
bool equal_sorts(const data::variable_list &v, const data::data_expression_list &w, const data::data_specification &data_spec)
Checks if the sorts of the variables/expressions in both lists are equal.
Namespace for all data library functionality.
const data_expression & false_()
const data_expression & true_()
atermpp::term_list< variable > variable_list
\brief list of variables
void instantiate_global_variables(pbes &p)
Attempts to eliminate the free variables of a PBES, by substituting a constant value for them....
bool is_bes(const pbes &x)
Returns true if a PBES is in BES form.
untyped_pbes parse_pbes_new(const std::string &text)
bool has_quantifier_name_clashes(const pbes_expression &x)
void replace_global_variables(pbes &p, const data::mutable_map_substitution<> &sigma)
Applies a global variable substitution to a PBES.
void complete_pbes(pbes &x)
data::mutable_map_substitution instantiate_global_variables(pbes &p)
Eliminates the global variables of a PBES, by substituting a constant value for them....
bool is_well_typed_pbes(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)
bool has_conflicting_type(Iter first, Iter last, const propositional_variable_instantiation &v, const data::data_specification &data_spec)
Checks if the propositional variable instantiation v has a conflict with the sequence of propositiona...
bool has_propositional_variables(const pbes_expression &x)
propositional_variable parse_propositional_variable(const std::string &text)
std::set< data::variable > find_quantifier_variables(const pbes_expression &x)
pbes_expression parse_pbes_expression(const std::string &text)
bool is_well_typed(const pbes_equation &eqn)
Checks if the equation is well typed.
bool is_well_typed_equation(const pbes_equation &eqn, const std::set< data::sort_expression > &declared_sorts, const std::set< data::variable > &declared_global_variables, const data::data_specification &data_spec)
pbes_expression parse_pbes_expression_new(const std::string &text)
The main namespace for the PBES library.
atermpp::term_list< pbes_expression > pbes_expression_list
\brief list of pbes_expressions
std::string pp(const pbes_system::forall &x)
std::set< data::variable > find_free_variables(const pbes_system::pbes_equation &x)
bool is_bes(const T &x)
Returns true if a PBES object is in BES form.
std::string pp(const pbes_system::pbes_equation &x)
std::string pp(const pbes_system::and_ &x)
std::set< data::variable > find_free_variables(const pbes_system::pbes &x)
void normalize_sorts(pbes_system::pbes_equation_vector &x, const data::sort_specification &sortspec)
pbes_system::pbes_expression normalize_sorts(const pbes_system::pbes_expression &x, const data::sort_specification &sortspec)
std::set< data::sort_expression > find_sort_expressions(const pbes_system::pbes &x)
const pbes_expression & true_()
std::string pp(const pbes_system::propositional_variable_instantiation_list &x)
std::string pp(const pbes_system::pbes_expression_list &x)
std::string pp(const pbes_system::or_ &x)
std::set< pbes_system::propositional_variable_instantiation > find_propositional_variable_instantiations(const pbes_system::pbes_expression &x)
std::vector< propositional_variable_instantiation > propositional_variable_instantiation_vector
\brief vector of propositional_variable_instantiations
std::string pp(const pbes_system::propositional_variable &x)
std::vector< propositional_variable > propositional_variable_vector
\brief vector of propositional_variables
void normalize_sorts(pbes_system::pbes &x, const data::sort_specification &)
std::string pp(const pbes_system::propositional_variable_instantiation &x)
atermpp::term_list< propositional_variable_instantiation > propositional_variable_instantiation_list
\brief list of propositional_variable_instantiations
std::string pp(const pbes_system::fixpoint_symbol &x)
bool is_well_typed_pbes(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)
std::string pp(const pbes_system::pbes_equation_vector &x)
std::set< data::function_symbol > find_function_symbols(const pbes_system::pbes &x)
std::vector< pbes_equation > pbes_equation_vector
\brief vector of pbes_equations
void typecheck_pbes(pbes &pbesspec)
Type check a parsed mCRL2 pbes specification. Throws an exception if something went wrong.
std::string pp(const pbes_system::pbes_expression &x)
bool is_well_typed(const pbes_equation &eqn)
std::set< data::variable > find_free_variables(const pbes_system::pbes_expression &x)
pbes_system::pbes_expression translate_user_notation(const pbes_system::pbes_expression &x)
std::vector< pbes_expression > pbes_expression_vector
\brief vector of pbes_expressions
std::string pp(const pbes_system::pbes &x)
bool search_variable(const pbes_system::pbes_expression &x, const data::variable &v)
std::string pp(const pbes_system::imp &x)
std::set< data::variable > find_all_variables(const pbes_system::pbes &x)
std::string pp(const pbes_system::exists &x)
atermpp::term_list< propositional_variable > propositional_variable_list
\brief list of propositional_variables
void complete_data_specification(pbes &)
Adds all sorts that appear in the PBES p to the data specification of p.
std::set< core::identifier_string > find_identifiers(const pbes_system::pbes_expression &x)
bool is_well_typed_equation(const pbes_equation &eqn, const std::set< data::sort_expression > &declared_sorts, const std::set< data::variable > &declared_global_variables, const data::data_specification &data_spec)
void translate_user_notation(pbes_system::pbes &x)
std::string pp(const pbes_system::not_ &x)
std::string pp(const pbes_system::propositional_variable_list &x)
const pbes_expression & false_()
parse_node child(int i) const
std::string symbol_name(const parse_node &node) const
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
data::data_expression parse_DataValExpr(const core::parse_node &node) const
data::data_expression parse_DataExpr(const core::parse_node &node) const
data_specification_actions(const core::parser &parser_)
untyped_data_specification parse_DataSpec(const core::parse_node &node) const
Visitor for collecting the quantifier variables that occur in a pbes expression.
void enter(const forall &x)
std::set< data::variable > result
pbes_expression_traverser< find_quantifier_variables_traverser > super
void enter(const exists &x)
has_propositional_variables_traverser()
void enter(const propositional_variable_instantiation &)
pbes_expression_traverser< has_propositional_variables_traverser > super
Visitor for determining if within the scope of a quantifier there are quantifier variables of free va...
void push(const data::variable_list &variables)
Adds variables to the quantifier stack, and adds replacements for the name clashes to replacements.
void pop()
Pops the quantifier stack.
void leave(const forall &)
pbes_expression_traverser< has_quantifier_name_clashes_traverser > super
void enter(const exists &x)
void leave(const exists &)
data::variable name_clash
void enter(const forall &x)
std::vector< data::variable_list > quantifier_stack
bool is_in_quantifier_stack(const core::identifier_string &name) const
Returns true if the quantifier_stack contains a data variable with the given name.
has_quantifier_name_clashes_traverser()
std::set< propositional_variable_instantiation > variables
pbes_expression_traverser< occurring_variable_visitor > super
void apply(const propositional_variable_instantiation &x)
pbes_system::propositional_variable_instantiation parse_PropVarInst(const core::parse_node &node) const
pbes_system::propositional_variable parse_PropVarDecl(const core::parse_node &node) const
pbes_system::propositional_variable_instantiation parse_PbesInit(const core::parse_node &node) const
std::vector< pbes_equation > parse_PbesEqnSpec(const core::parse_node &node) const
pbes_system::fixpoint_symbol parse_FixedPointOperator(const core::parse_node &node) const
pbes_actions(const core::parser &parser_)
untyped_pbes parse_PbesSpec(const core::parse_node &node) const
std::vector< pbes_equation > parse_PbesEqnDeclList(const core::parse_node &node) const
pbes_equation parse_PbesEqnDecl(const core::parse_node &node) const
pbes_system::pbes_expression parse_PbesExpr(const core::parse_node &node) const
propositional_variable_instantiation initial_state
std::size_t operator()(const atermpp::detail::reference_aterm< T > &t) const