mCRL2
Loading...
Searching...
No Matches
instantiate_global_variables.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_INSTANTIATE_GLOBAL_VARIABLES_H
13#define MCRL2_LPS_DETAIL_INSTANTIATE_GLOBAL_VARIABLES_H
14
16#include "mcrl2/lps/remove.h"
17
18namespace mcrl2
19{
20
21namespace lps
22{
23
24namespace detail
25{
26
28template <typename Specification>
30{
31 lps::replace_free_variables(lpsspec.process(), sigma);
32 lpsspec.initial_process() = lps::replace_free_variables(lpsspec.initial_process(), sigma);
33 lpsspec.global_variables().clear();
34}
35
39template <typename Specification>
41{
43
44 mCRL2log(log::verbose) << "Replacing global variables with dummy values." << std::endl;
46 for (const data::variable& v : lpsspec.global_variables())
47 {
49 if (!d.defined())
50 {
51 throw mcrl2::runtime_error("Error in lps::instantiate_global_variables: could not instantiate " + data::pp(v) + ". ");
52 }
53 sigma[v] = d;
54 }
55
56 mCRL2log(log::debug) << "instantiating global LPS variables " << sigma << std::endl;
58
59 return sigma;
60}
61
62} // namespace detail
63
64} // namespace lps
65
66} // namespace mcrl2
67
68#endif // MCRL2_LPS_DETAIL_INSTANTIATE_GLOBAL_VARIABLES_H
bool defined() const
Returns true if this term is not equal to the term assigned by the default constructor of aterms,...
Definition aterm_core.h:143
Expression generator that caches values.
Generic substitution function. The substitution is stored as a mapping of variables to expressions....
Components for generating an arbitrary element of a sort.
\brief A data variable
Definition variable.h:28
Standard exception class for reporting runtime errors.
Definition exception.h:27
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:391
std::string pp(const abstraction &x)
Definition data.cpp:39
@ verbose
Definition logger.h:37
void replace_global_variables(Specification &lpsspec, const data::mutable_map_substitution<> &sigma)
Applies a global variable substitution to an LPS.
data::mutable_map_substitution instantiate_global_variables(Specification &lpsspec)
Eliminates the global variables of an LPS, by substituting a constant value for them....
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
add your file description here.
Component for generating representatives of sorts.