mCRL2
Loading...
Searching...
No Matches
position_count_traverser.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/detail/position_count_traverser.h
10/// \brief add your file description here.
11
12#ifndef MCRL2_PBES_DETAIL_POSITION_COUNT_TRAVERSER_H
13#define MCRL2_PBES_DETAIL_POSITION_COUNT_TRAVERSER_H
14
15#include "mcrl2/pbes/traverser.h"
16#include "mcrl2/utilities/detail/position_counter.h"
17
18namespace mcrl2::pbes_system::detail
19{
20
22{
24 using super::enter;
25 using super::leave;
26 using super::apply;
27
28 utilities::detail::position_counter counter;
29
30 template <typename T>
31 void visit(const T& x)
32 {
33 counter.increase();
34 super::apply(x);
35 counter.decrease();
36 }
37
38 void apply(const and_& x)
39 {
40 visit(x);
41 }
42
43 void apply(const or_& x)
44 {
45 visit(x);
46 }
47
48 void apply(const imp& x)
49 {
50 visit(x);
51 }
52
53 void apply(const exists& x)
54 {
55 visit(x);
56 }
57
58 void apply(const forall& x)
59 {
60 visit(x);
61 }
62
64 {
65 visit(x);
66 }
67
68 void apply(const data::data_expression& x)
69 {
70 visit(x);
71 }
72};
73
74inline
76{
78 f.apply(x);
79 return f.counter.ycounts;
80}
81
82} // namespace mcrl2::pbes_system::detail
83
84#endif // MCRL2_PBES_DETAIL_POSITION_COUNT_TRAVERSER_H
\brief The and operator for pbes expressions
\brief The existential quantification operator for pbes expressions
\brief The universal quantification operator for pbes expressions
\brief The implication operator for pbes expressions
\brief The or operator for pbes expressions
\brief A propositional variable instantiation
std::vector< std::size_t > position_counts(const pbes &x)
void apply(const propositional_variable_instantiation &x)