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//
9/// \file mcrl2/lps/is_stochastic.h
10/// \brief Function is_stochastic for detecting stochastic elements in an LPS.
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::lps
18{
19
20namespace detail {
21
23{
25 using super::enter;
26 using super::leave;
27 using super::apply;
28
29 bool result = false;
30
32 {
33 if (x.is_defined())
34 {
35 result = true;
36 }
37 }
38
39};
40
41} // namespace detail
42
43/// \brief Returns true if the LPS object x contains a stochastic distribution in one of its attributes.
44template <typename T>
45bool is_stochastic(const T& x)
46{
48 f.apply(x);
49 return f.result;
50}
51
52} // namespace mcrl2::lps
53
54#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....
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
The main namespace for the LPS library.
Definition constelm.h:18
bool is_stochastic(const T &x)
Returns true if the LPS object x contains a stochastic distribution in one of its attributes.
void apply(const lps::stochastic_distribution &x)