mCRL2
Loading...
Searching...
No Matches
is_stochastic.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_LPS_IS_STOCHASTIC_H
13#define MCRL2_LPS_IS_STOCHASTIC_H
14
15#include "mcrl2/lps/traverser.h"
16
17namespace mcrl2 {
18
19namespace lps {
20
21namespace detail {
22
23struct is_stochastic_traverser: public lps::data_expression_traverser<is_stochastic_traverser>
24{
26 using super::enter;
27 using super::leave;
28 using super::apply;
29
30 bool result;
31
33 : result(false)
34 {}
35
37 {
38 if (x.is_defined())
39 {
40 result = true;
41 }
42 }
43
44};
45
46} // namespace detail
47
49template <typename T>
50bool is_stochastic(const T& x)
51{
53 f.apply(x);
54 return f.result;
55}
56
57} // namespace lps
58
59} // namespace mcrl2
60
61#endif // MCRL2_LPS_IS_STOCHASTIC_H
\brief A stochastic distribution
bool is_defined() const
Returns true if the distribution is defined, i.e. it contains a valid distribution....
add your file description here.
bool is_stochastic(const T &x)
Returns true if the LPS object x contains a stochastic distribution in one of its attributes.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
void apply(const lps::deadlock &x)
Definition traverser.h:165
void apply(const lps::stochastic_distribution &x)
lps::data_expression_traverser< is_stochastic_traverser > super