12#ifndef MCRL2_DATA_SUBSTITUTIONS_MUTABLE_MAP_SUBSTITUTION_H
13#define MCRL2_DATA_SUBSTITUTIONS_MUTABLE_MAP_SUBSTITUTION_H
32template <
typename AssociativeContainer = std::map<variable,data_expression> >
42 typedef typename AssociativeContainer::iterator
iterator;
56 assignment(
typename AssociativeContainer::key_type v, AssociativeContainer& m) :
60 template <
typename AssignableToExpression>
82 template <
typename VariableContainer,
typename ExpressionContainer>
85 assert(variables.size() == expressions.size());
86 auto j = expressions.begin();
87 for (
auto i = variables.begin(); i != variables.end(); ++i, ++j)
95 auto i =
m_map.find(v);
118 template <
typename Substitution>
128 return m_map.begin();
142 return this->m_map.begin();
149 return this->m_map.end();
155 return m_map.empty();
160 std::stringstream result;
162 for (
auto i =
begin(); i !=
end(); ++i)
164 result << (i ==
begin() ?
"" :
"; ") << i->first <<
":" << i->first.sort() <<
" := " << i->second;
173 return this->m_map.find(v);
179 return m_map.find(v);
184template <
typename VariableContainer,
typename ExpressionContainer,
typename MapContainer>
185mutable_map_substitution<MapContainer>
191template <
typename VariableContainer,
typename ExpressionContainer>
192mutable_map_substitution<std::map<typename VariableContainer::value_type, typename ExpressionContainer::value_type> >
198template <
typename AssociativeContainer>
201 return out <<
sigma.to_string();
206template <
typename AssociativeContainer>
209 for (
auto i =
sigma.begin(); i !=
sigma.end(); ++i)
Generic substitution function. The substitution is stored as a mapping of variables to expressions....
AssociativeContainer::key_type variable_type
AssociativeContainer::iterator iterator
bool operator==(const Substitution &) const
AssociativeContainer::const_iterator const_iterator
const_iterator find(variable_type const &v) const
Returns an iterator that references the expression associated with v or is equal to m_map....
void clear()
Resets the substitution by letting every variable yield itself. Cf. clear() of a map.
std::string to_string() const
variable_type argument_type
const_iterator begin() const
Returns an iterator pointing to the beginning of the sequence of assignments TODO: should become prot...
mutable_map_substitution(const AssociativeContainer &m)
mutable_map_substitution(VariableContainer const &variables, ExpressionContainer const &expressions)
mutable_map_substitution()=default
expression_type operator()(const variable_type &v) const
expression_type result_type
AssociativeContainer m_map
AssociativeContainer::mapped_type expression_type
const_iterator end() const
Returns an iterator pointing past the end of the sequence of assignments TODO: should become protecte...
bool empty() const
Returns true if the substitution is empty.
iterator end()
Returns an iterator pointing past the end of the sequence of assignments TODO: should become protecte...
assignment operator[](variable_type const &v)
iterator find(variable_type const &v)
Returns an iterator that references the expression associated with v or is equal to m_map....
iterator begin()
Returns an iterator pointing to the beginning of the sequence of assignments TODO: should become prot...
add your file description here.
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
std::set< data::variable > substitution_variables(const Substitution &)
Returns the variables appearing in the right hand sides of the substitution.
bool is_simple_substitution(const Substitution &)
Returns true if the substitution sigma satisfies the property that FV(sigma(x)) is included in {x} fo...
mutable_map_substitution< MapContainer > make_mutable_map_substitution(const VariableContainer &vc, const ExpressionContainer &ec)
Utility function for creating a mutable_map_substitution.
std::ostream & operator<<(std::ostream &out, const abstraction &x)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Wrapper class for internal storage and substitution updates using operator()
assignment(typename AssociativeContainer::key_type v, AssociativeContainer &m)
Constructor.
assignment & operator=(AssignableToExpression const &e)
AssociativeContainer::key_type m_variable
AssociativeContainer & m_map
add your file description here.