mCRL2
Loading...
Searching...
No Matches
pres_equation.h
Go to the documentation of this file.
1// Author(s): Jan Friso Groote. Based on pbes_equation.h by 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_PRES_PRES_EQUATION_H
13#define MCRL2_PRES_PRES_EQUATION_H
14
18
19namespace mcrl2
20{
21
22namespace pres_system
23{
24
26
27class pres_equation;
29bool is_well_typed(const pres_equation& eqn);
31
34{
35 protected:
38
41
44
45 public:
48
51
54
56 pres_equation() = default;
57
63 :
66 m_formula(expr)
67 {
68 }
69
72 const fixpoint_symbol& symbol() const
73 {
74 return m_symbol;
75 }
76
80 {
81 return m_symbol;
82 }
83
87 {
88 return m_variable;
89 }
90
94 {
95 return m_variable;
96 }
97
101 {
102 return m_formula;
103 }
104
108 {
109 return m_formula;
110 }
111
113 // (Comment Wieger: is_const would be a better name)
115 bool is_solved() const;
116
118 void swap(pres_equation& other)
119 {
120 using std::swap;
121 swap(m_symbol, other.m_symbol);
122 swap(m_variable, other.m_variable);
123 swap(m_formula, other.m_formula);
124 }
125
126 void mark(std::stack<std::reference_wrapper<atermpp::detail::_aterm>>& todo) const
127 {
128 mark_term(m_symbol, todo);
129 }
130};
131
132//--- start generated class pres_equation ---//
135
137typedef std::vector<pres_equation> pres_equation_vector;
138
139// prototype declaration
140std::string pp(const pres_equation& x);
141
146inline
147std::ostream& operator<<(std::ostream& out, const pres_equation& x)
148{
149 return out << pres_system::pp(x);
150}
151
153inline void swap(pres_equation& t1, pres_equation& t2)
154{
155 t1.swap(t2);
156}
157//--- end generated class pres_equation ---//
158
159inline bool
161{
162 return x.symbol() == y.symbol() &&
163 x.variable() == y.variable() &&
164 x.formula() == y.formula();
165}
166
167inline bool
169{
170 return !(x == y);
171}
172
175inline
177{
179}
180
181// Overload for pp for propositional variables.
182std::string pp(const propositional_variable& v);
183
184// template function overloads
185std::string pp(const pres_equation_vector& x);
187std::set<data::variable> find_free_variables(const pres_system::pres_equation& x);
188
189} // namespace pres_system
190
191} // namespace mcrl2
192
193#endif // MCRL2_PRES_PRES_EQUATION_H
A list of aterm objects.
Definition aterm_list.h:24
\brief A propositional variable declaration
pres_expression & formula()
Returns the predicate formula on the right hand side of the equation.
pres_expression m_formula
The expression on the right hand side of the equation.
fixpoint_symbol & symbol()
Returns the fixpoint symbol of the equation.
pres_equation()=default
Constructor.
bool is_solved() const
Returns true if the predicate formula on the right hand side contains no predicate variables.
Definition pres.cpp:106
const propositional_variable & variable() const
Returns the pres variable of the equation.
pres_expression term_type
The expression type of the equation.
propositional_variable & variable()
Returns the pres variable of the equation.
pres_equation(const fixpoint_symbol &symbol, const propositional_variable &variable, const pres_expression &expr)
Constructor.
propositional_variable variable_type
The variable type of the equation.
fixpoint_symbol symbol_type
The symbol type of the equation.
void swap(pres_equation &other)
Swaps the contents.
propositional_variable m_variable
The variable on the left hand side of the equation.
void mark(std::stack< std::reference_wrapper< atermpp::detail::_aterm > > &todo) const
fixpoint_symbol m_symbol
The fixpoint symbol of the equation.
const pres_expression & formula() const
Returns the predicate formula on the right hand side of the equation.
const fixpoint_symbol & symbol() const
Returns the fixpoint symbol of the equation.
The class fixpoint_symbol.
const atermpp::function_symbol & function_symbol_PREqn()
bool has_propositional_variables(const pres_expression &x)
atermpp::term_list< pres_equation > pres_equation_list
\brief list of pres_equations
bool operator==(const pres &p1, const pres &p2)
Equality operator on PRESs.
Definition pres.h:333
void find_free_variables(const T &x, OutputIterator o)
Definition find.h:87
atermpp::aterm pres_equation_to_aterm(const pres_equation &eqn)
Conversion to atermaPpl.
std::vector< pres_equation > pres_equation_vector
\brief vector of pres_equations
std::string pp(const pres &x)
Definition pres.cpp:45
void swap(pres_equation &t1, pres_equation &t2)
\brief swap overload
bool operator!=(const pres_equation &x, const pres_equation &y)
pbes_system::fixpoint_symbol fixpoint_symbol
void normalize_sorts(T &x, const data::sort_specification &sortspec, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
pbes_system::propositional_variable propositional_variable
The propositional variable is taken from a pbes_system.
bool is_well_typed(const pres_equation &eqn)
Definition pres.cpp:80
atermpp::aterm_ostream & operator<<(atermpp::aterm_ostream &stream, const pres &pres)
Writes the pres to a stream.
Definition io.cpp:225
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
void swap(atermpp::unprotected_aterm_core &t1, atermpp::unprotected_aterm_core &t2) noexcept
Swaps two aterms.
Definition aterm.h:462
The class pres_expression.
Add your file description here.