12#ifndef MCRL2_PBES_RESOLVE_NAME_CLASHES_H
13#define MCRL2_PBES_RESOLVE_NAME_CLASHES_H
15#include "mcrl2/lps/resolve_name_clashes.h"
16#include "mcrl2/pbes/replace.h"
17#include "mcrl2/pbes/srf_pbes.h"
25template<
bool allow_ce>
29 const data::variable_list& summation_variables = summand.parameters();
30 std::set<core::identifier_string> names = lps::detail::variable_name_clashes(summation_variables, process_parameter_names);
33 data::mutable_map_substitution<> sigma;
34 for (
const data::variable& v: summation_variables)
36 if (process_parameter_names.find(v.name()) != process_parameter_names.end())
38 sigma[v] = data::variable(generator(v.name()), v.sort());
42 summand.parameters() = lps::replace_all_variables(summand.parameters(), sigma);
44 if constexpr (allow_ce)
47 summand.condition() = pbes_system::replace_all_variables(summand.condition(), sigma);
52 summand.condition() = lps::replace_all_variables(summand.condition(), sigma);
55 summand.variable() = pbes_system::replace_all_variables(summand.variable(), sigma);
62template<
bool allow_ce>
66 std::set<core::identifier_string> process_parameter_names = lps::detail::variable_names(process_parameters);
73 generator.add_identifiers(
pbes_system::find_identifiers(eq.to_pbes()));
75 generator.add_identifiers(
pbes_system::find_identifiers(pbesspec.initial_state()));
76 generator.add_identifiers(data::function_and_mapping_identifiers(pbesspec.data()));
78 for (
auto& equation: pbesspec.equations())
80 for (
auto& summand: equation.summands())
82 detail::resolve_summand_variable_name_clashes(summand, process_parameter_names, generator);
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
void resolve_summand_variable_name_clashes(pre_srf_summand< allow_ce > &summand, const std::set< core::identifier_string > &process_parameter_names, data::set_identifier_generator &generator)
void resolve_summand_variable_name_clashes(detail::pre_srf_pbes< allow_ce > &pbesspec, const data::variable_list &process_parameters)
Renames summand variables such that there are no name clashes between summand variables and process p...