mCRL2
Loading...
Searching...
No Matches
count_fixpoints.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_MODAL_FORMULA_COUNT_FIXPOINTS_H
13#define MCRL2_MODAL_FORMULA_COUNT_FIXPOINTS_H
14
16
17namespace mcrl2 {
18
19namespace state_formulas {
20
22//
24namespace detail {
25
26struct count_fixpoints_traverser: public state_formula_traverser<count_fixpoints_traverser>
27{
28 typedef state_formula_traverser<count_fixpoints_traverser> super;
29 using super::enter;
30 using super::leave;
31 using super::apply;
32
33 std::size_t result;
34
35 count_fixpoints_traverser()
36 : result(0)
37 {}
38
39 void enter(const mu& /* x */)
40 {
41 result++;
42 }
43
44 void enter(const nu& /* x */)
45 {
46 result++;
47 }
48};
49
50} // namespace detail
52
56inline
57std::size_t count_fixpoints(const state_formula& x)
58{
59 detail::count_fixpoints_traverser f;
60 f.apply(x);
61 return f.result;
62}
63
64} // namespace state_formulas
65
66} // namespace mcrl2
67
68#endif // MCRL2_MODAL_FORMULA_COUNT_FIXPOINTS_H
add your file description here.
std::size_t count_fixpoints(const state_formula &x)
Counts the number of fixpoints in a state formula.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72