mCRL2
Loading...
Searching...
No Matches
make_timed_lps.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_DETAIL_MAKE_TIMED_LPS_H
13#define MCRL2_LPS_DETAIL_MAKE_TIMED_LPS_H
14
16
17namespace mcrl2 {
18
19namespace lps {
20
21namespace detail {
22
25template <typename IdentifierGenerator>
27{
28 IdentifierGenerator& m_generator;
29
30 make_timed_lps_summand(IdentifierGenerator& generator)
31 : m_generator(generator)
32 {}
33
37 {
38 if (!s.deadlock().has_time())
39 {
41 s.deadlock().time() = t;
42 s.summation_variables() = push_back(s.summation_variables(), t);
43 /* data::variable_vector v = data::variable_vector(s.summation_variables().begin(),s.summation_variables().end());
44 v.push_back(t);
45 s.summation_variables() = data::variable_list(v.begin(),v.end()); */
46 }
47 }
48
52 {
53 if (!s.multi_action().has_time())
54 {
57 s.summation_variables()=push_back(s.summation_variables(), t);
58 /* data::variable_vector v = data::variable_vector(s.summation_variables().begin(),s.summation_variables().end());
59 v.push_back(t);
60 s.summation_variables() = data::variable_list(v.begin(),v.end());
61 */
62 }
63 }
64};
65
71template <class LINEAR_PROCESS>
72void make_timed_lps(LINEAR_PROCESS& lps,
73 const std::set<core::identifier_string>& context,
74 typename std::enable_if<std::is_same<LINEAR_PROCESS, linear_process>::value ||
75 std::is_same<LINEAR_PROCESS, stochastic_linear_process>::value>::type* = nullptr)
76{
78 generator.add_identifiers(context);
80 for (action_summand& s: lps.action_summands())
81 {
82 f(s);
83 }
84 for (deadlock_summand& s: lps.deadlock_summands())
85 {
86 f(s);
87 }
88}
89
90} // namespace detail
91
92} // namespace lps
93
94} // namespace mcrl2
95
96#endif // MCRL2_LPS_DETAIL_MAKE_TIMED_LPS_H
void add_identifiers(const std::set< core::identifier_string > &ids)
Add a set of identifiers to the context.
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
\brief A data variable
Definition variable.h:28
LPS summand containing a multi-action.
const lps::multi_action & multi_action() const
Returns the multi-action of this summand.
LPS summand containing a deadlock.
const lps::deadlock & deadlock() const
Returns the deadlock of this summand.
bool has_time() const
Returns true if time is available.
Definition deadlock.h:42
const data::data_expression & time() const
Returns the time.
Definition deadlock.h:49
\brief A timed multi-action
bool has_time() const
Returns true if time is available.
const process::action_list & actions() const
data::variable_list & summation_variables()
Returns the sequence of summation variables.
Definition summand.h:46
The class linear_process.
const basic_sort & real_()
Constructor for sort expression Real.
Definition real1.h:48
void make_timed_lps(LINEAR_PROCESS &lps, const std::set< core::identifier_string > &context, typename std::enable_if< std::is_same< LINEAR_PROCESS, linear_process >::value||std::is_same< LINEAR_PROCESS, stochastic_linear_process >::value >::type *=nullptr)
Adds time parameters to the lps if needed and returns the result. The times are chosen such that they...
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
Adds a time parameter t to s if needed and returns the result. The time t is chosen such that it does...
void operator()(action_summand &s) const
Adds time to the summand s (either an action or a deadlock summand)
void operator()(deadlock_summand &s) const
Adds time to the summand s (either an action or a deadlock summand)
make_timed_lps_summand(IdentifierGenerator &generator)