mCRL2
Loading...
Searching...
No Matches
parse_impl.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
11
12#ifndef MCRL2_PBES_PARSE_IMPL_H
13#define MCRL2_PBES_PARSE_IMPL_H
14
19
20namespace mcrl2 {
21
22namespace pbes_system {
23
24namespace detail
25{
26
28{
29 explicit pbes_actions(const core::parser& parser_)
30 : data::detail::data_specification_actions(parser_)
31 {}
32
34 {
35 if ((node.child_count() == 1) && (symbol_name(node.child(0)) == "DataValExpr")) { return parse_DataValExpr(node.child(0)); }
36 else if ((node.child_count() == 1) && (symbol_name(node.child(0)) == "DataExpr")) { return parse_DataExpr(node.child(0)); }
37 else if ((node.child_count() == 1) && (symbol_name(node.child(0)) == "true")) { return pbes_system::true_(); }
38 else if ((node.child_count() == 1) && (symbol_name(node.child(0)) == "false")) { return pbes_system::false_(); }
39 else if ((node.child_count() == 4) && (symbol_name(node.child(0)) == "forall") && (symbol_name(node.child(1)) == "VarsDeclList") && (symbol_name(node.child(2)) == ".") && (symbol_name(node.child(3)) == "PbesExpr")) { return pbes_system::forall(parse_VarsDeclList(node.child(1)), parse_PbesExpr(node.child(3))); }
40 else if ((node.child_count() == 4) && (symbol_name(node.child(0)) == "exists") && (symbol_name(node.child(1)) == "VarsDeclList") && (symbol_name(node.child(2)) == ".") && (symbol_name(node.child(3)) == "PbesExpr")) { return pbes_system::exists(parse_VarsDeclList(node.child(1)), parse_PbesExpr(node.child(3))); }
41 else if ((node.child_count() == 2) && (symbol_name(node.child(0)) == "!") && (symbol_name(node.child(1)) == "PbesExpr")) { return pbes_system::not_(parse_PbesExpr(node.child(1))); }
42 else if ((node.child_count() == 3) && (symbol_name(node.child(0)) == "PbesExpr") && (node.child(1).string() == "=>") && (symbol_name(node.child(2)) == "PbesExpr")) { return pbes_system::imp(parse_PbesExpr(node.child(0)), parse_PbesExpr(node.child(2))); }
43 else if ((node.child_count() == 3) && (symbol_name(node.child(0)) == "PbesExpr") && (node.child(1).string() == "&&") && (symbol_name(node.child(2)) == "PbesExpr")) { return pbes_system::and_(parse_PbesExpr(node.child(0)), parse_PbesExpr(node.child(2))); }
44 else if ((node.child_count() == 3) && (symbol_name(node.child(0)) == "PbesExpr") && (node.child(1).string() == "||") && (symbol_name(node.child(2)) == "PbesExpr")) { return pbes_system::or_(parse_PbesExpr(node.child(0)), parse_PbesExpr(node.child(2))); }
45 else if ((node.child_count() == 3) && (symbol_name(node.child(0)) == "(") && (symbol_name(node.child(1)) == "PbesExpr") && (symbol_name(node.child(2)) == ")")) { return parse_PbesExpr(node.child(1)); }
46 else if ((node.child_count() == 1) && (symbol_name(node.child(0)) == "PropVarInst")) { return parse_PropVarInst(node.child(0)); }
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))); }
49 }
50
52 {
54 }
55
57 {
59 }
60
62 {
63 return parse_PropVarInst(node.child(1));
64 }
65
67 {
68 if ((node.child_count() == 1) && (symbol_name(node.child(0)) == "mu")) { return fixpoint_symbol::mu(); }
69 else if ((node.child_count() == 1) && (symbol_name(node.child(0)) == "nu")) { return fixpoint_symbol::nu(); }
71 }
72
74 {
76 }
77
78 std::vector<pbes_equation> parse_PbesEqnDeclList(const core::parse_node& node) const
79 {
80 return parse_vector<pbes_equation>(node, "PbesEqnDecl", [&](const core::parse_node& node) { return parse_PbesEqnDecl(node); });
81 }
82
83 std::vector<pbes_equation> parse_PbesEqnSpec(const core::parse_node& node) const
84 {
85 return parse_PbesEqnDeclList(node.child(1));
86 }
87
89 {
90 untyped_pbes result;
91 result.dataspec = parse_DataSpec(node.child(0));
93 result.equations = parse_PbesEqnSpec(node.child(2));
94 result.initial_state = parse_PbesInit(node.child(3));
95 return result;
96 }
97};
98
99} // namespace detail
100
101} // namespace pbes_system
102
103} // namespace mcrl2
104
105#endif // MCRL2_PBES_PARSE_IMPL_H
\brief The and operator for pbes expressions
\brief The existential quantification operator for pbes expressions
static fixpoint_symbol nu()
Returns the nu symbol.
static fixpoint_symbol mu()
Returns the mu symbol.
\brief The universal quantification operator for pbes expressions
\brief The implication operator for pbes expressions
\brief The not operator for pbes expressions
\brief The or operator for pbes expressions
\brief A propositional variable instantiation
\brief A propositional variable declaration
add your file description here.
const pbes_expression & true_()
const pbes_expression & false_()
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
Add your file description here.
add your file description here.
core::identifier_string parse_Id(const parse_node &node) const
Definition parse.h:233
Wrapper for D_ParseNode.
Definition dparser.h:86
parse_node child(int i) const
Definition dparser.cpp:43
int child_count() const
Definition dparser.cpp:37
std::string string() const
Definition dparser.cpp:53
std::string symbol_name(const parse_node &node) const
Definition parse.h:205
const parser & m_parser
Definition parse.h:85
Wrapper for D_Parser and its corresponding D_ParserTables.
Definition dparser.h:148
data::variable_list parse_VarsDeclList(const core::parse_node &node) const
Definition parse_impl.h:204
data::data_expression_list parse_DataExprList(const core::parse_node &node) const
Definition parse_impl.h:287
data::data_expression parse_DataValExpr(const core::parse_node &node) const
Definition parse_impl.h:272
data::data_expression parse_DataExpr(const core::parse_node &node) const
Definition parse_impl.h:211
data::variable_list parse_GlobVarSpec(const core::parse_node &node) const
Definition parse_impl.h:373
data_specification_actions(const core::parser &parser_)
Definition parse_impl.h:300
untyped_data_specification parse_DataSpec(const core::parse_node &node) const
Definition parse_impl.h:461
pbes_system::propositional_variable_instantiation parse_PropVarInst(const core::parse_node &node) const
Definition parse_impl.h:56
pbes_system::propositional_variable parse_PropVarDecl(const core::parse_node &node) const
Definition parse_impl.h:51
pbes_system::propositional_variable_instantiation parse_PbesInit(const core::parse_node &node) const
Definition parse_impl.h:61
std::vector< pbes_equation > parse_PbesEqnSpec(const core::parse_node &node) const
Definition parse_impl.h:83
pbes_system::fixpoint_symbol parse_FixedPointOperator(const core::parse_node &node) const
Definition parse_impl.h:66
pbes_actions(const core::parser &parser_)
Definition parse_impl.h:29
untyped_pbes parse_PbesSpec(const core::parse_node &node) const
Definition parse_impl.h:88
std::vector< pbes_equation > parse_PbesEqnDeclList(const core::parse_node &node) const
Definition parse_impl.h:78
pbes_equation parse_PbesEqnDecl(const core::parse_node &node) const
Definition parse_impl.h:73
pbes_system::pbes_expression parse_PbesExpr(const core::parse_node &node) const
Definition parse_impl.h:33
std::vector< pbes_equation > equations
data::untyped_data_specification dataspec
data::variable_list global_variables
propositional_variable_instantiation initial_state
add your file description here.