mCRL2
Loading...
Searching...
No Matches
find_equalities.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//
9/// \file mcrl2/pbes/find_equalities.h
10/// \brief add your file description here.
11
12#ifndef MCRL2_PBES_FIND_EQUALITIES_H
13#define MCRL2_PBES_FIND_EQUALITIES_H
14
15#include "mcrl2/data/find_equalities.h"
16#include "mcrl2/pbes/traverser.h"
17
18
19
20namespace mcrl2::pbes_system {
21
22namespace detail {
23
24template <template <class> class Traverser, class Derived>
26{
28 using super::enter;
29 using super::leave;
30 using super::apply;
31 using super::push;
32 using super::pop;
33 using super::top;
34 using super::below_top;
35
36 Derived& derived()
37 {
38 return static_cast<Derived&>(*this);
39 }
40
41 void leave(const and_&)
42 {
43 auto& left = below_top();
44 auto const& right = top();
45 left.join_and(right);
46 pop();
47 }
48
49 void leave(const or_&)
50 {
51 auto& left = below_top();
52 auto const& right = top();
53 left.join_or(right);
54 pop();
55 }
56
57 void leave(const imp&)
58 {
59 auto& left = below_top();
60 auto const& right = top();
61 left.swap();
62 left.join_or(right);
63 pop();
64 }
65
66 void leave(const not_&)
67 {
68 top().swap();
69 }
70
71 void leave(const forall& x)
72 {
73 top().delete_(x.variables());
74 }
75
76 void leave(const exists& x)
77 {
78 top().delete_(x.variables());
79 }
80
81 // N.B. Use apply here, to avoid going into the recursion
83 {
85 }
86
87#if BOOST_MSVC
88#include "mcrl2/core/detail/traverser_msvc.inc.h"
89#endif
90};
91
93{
96
97 using super::enter;
98 using super::leave;
99 using super::apply;
100};
101
102} // namespace detail
103
104inline
106{
108 f.apply(x);
109 assert(f.expression_stack.size() == 1);
110 f.top().close();
111 return f.top().equalities.assignments;
112}
113
114inline
116{
118 f.apply(x);
119 assert(f.expression_stack.size() == 1);
120 f.top().close();
121 return f.top().inequalities.assignments;
122}
123
124} // namespace mcrl2::pbes_system
125
126
127
128#endif // MCRL2_PBES_FIND_EQUALITIES_H
\brief The and operator for pbes expressions
\brief The existential quantification operator for pbes expressions
const data::variable_list & variables() const
\brief The universal quantification operator for pbes expressions
const data::variable_list & variables() const
\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
find_equalities_expression()=default
Creates (empty,empty)
void apply(const propositional_variable_instantiation &)