12#ifndef MCRL2_MODAL_FORMULA_RESOLVE_NAME_CLASHES_H
13#define MCRL2_MODAL_FORMULA_RESOLVE_NAME_CLASHES_H
15#include "mcrl2/modal_formula/builder.h"
16#include "mcrl2/utilities/detail/container_utility.h"
38 auto i = m_substitutions.find(v);
39 if (i == m_substitutions.end())
43 return i->second.back();
47template <
typename Derived>
66 void pop(
const core::identifier_string& name)
68 m_names[name].pop_back();
74 std::vector<core::identifier_string>& names = m_names[name];
77 names.push_back(name);
81 names.emplace_back(m_generator(std::string(name) +
"_"));
113 core::identifier_string name = m_names[x.name()].back();
128 core::identifier_string name = m_names[x.name()].back();
139 result = variable(m_names[x.name()].back(), x.arguments());
162 if (utilities::detail::contains(bound_variables, v))
164 substitutions[v].emplace_back(generator(v.name()), v.sort());
166 bound_variables.insert(v);
172 std::multiset<data::variable>::const_iterator var_iter=bound_variables.find(v);
173 assert(var_iter!=bound_variables.end());
174 bound_variables.erase(var_iter);
176 auto i = substitutions.find(v);
177 if (i != substitutions.end())
179 i->second.pop_back();
180 if (i->second.empty())
182 substitutions.erase(i);
190 return data::assignment_list(x.begin(),
192 [&](
const data::assignment& a)
194 return data::assignment(atermpp::down_cast<data::variable>(sigma(a.lhs())), data::replace_free_variables(a.rhs(), sigma));
202 return data::variable_list(x.begin(), x.end(), [&](
const data::variable& v)
204 return atermpp::down_cast<data::variable>(sigma(v));
212 for (
const data::assignment& a: x.assignments())
217 result = mu(x.name(), apply_assignments(x.assignments()), result);
218 for (
const data::assignment& a: x.assignments())
227 for (
const data::assignment& a: x.assignments())
232 result = nu(x.name(), apply_assignments(x.assignments()), result);
233 for (
const data::assignment& a: x.assignments())
242 for (
const data::variable& v: x.variables())
247 result = forall(apply_variables(x.variables()), result);
248 for (
const data::variable& v: x.variables())
257 for (
const data::variable& v: x.variables())
262 result = exists(apply_variables(x.variables()), result);
263 for (
const data::variable& v: x.variables())
272 for (
const data::variable& v: x.variables())
278 result = atermpp::down_cast<T>(action_formulas::forall(apply_variables(x.variables()), body));
279 for (
const data::variable& v: x.variables())
288 for (
const data::variable& v: x.variables())
294 result = atermpp::down_cast<T>(action_formulas::exists(apply_variables(x.variables()), body));
295 for (
const data::variable& v: x.variables())
306 result=atermpp::down_cast<T>(data::replace_free_variables(x, sigma));
326 generator.add_identifiers(state_formulas::find_identifiers(x));
327 generator.add_identifiers(context_ids);
aterm_string(const aterm_string &t) noexcept=default
sort_expression sort() const
Returns the sort of the data expression.
data_specification()=default
Default constructor. Generate a data specification that contains only booleans and positive numbers.
data_type_checker(const data_specification &data_spec)
make a data type checker. Throws a mcrl2::runtime_error exception if the data_specification is not we...
data_specification operator()() const
Yields a type checked data specification, provided typechecking was successful. If not successful an ...
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
\brief An untyped parameter
Linear process specification.
Linear process specification.
stochastic_specification(const specification &other)
Constructor. This constructor is explicit as implicit conversions of this kind is a source of bugs.
\brief An untyped multi action or data application
D_ParserTables parser_tables_mcrl2
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
void warn_left_merge_merge(const parse_node &)
Prints a warning for each occurrence of 'x ||_ y || z' in the parse tree.
void warn_and_or(const parse_node &)
Prints a warning for each occurrence of 'x && y || z' in the parse tree.
Namespace for system defined sort bool_.
const basic_sort & bool_()
Constructor for sort expression Bool.
bool is_data_expression(const atermpp::aterm &x)
Test for a data_expression expression.
data_specification merge_data_specifications(const data_specification &dataspec1, const data_specification &dataspec2)
Merges two data specifications. Throws an exception if conflicts are detected.
bool is_untyped_data_parameter(const atermpp::aterm &x)
The main namespace for the LPS library.
specification remove_stochastic_operators(const stochastic_specification &spec)
Converts a stochastic specification to a specification. Throws an exception if non-empty distribution...
The main namespace for the Process library.
bool is_untyped_multi_action(const atermpp::aterm &x)
expression builder that visits all sub expressions
expression traverser that visits all sub expressions