mCRL2
Loading...
Searching...
No Matches
mcrl2::data::maintain_variables_in_rhs< Substitution > Class Template Reference

Wrapper that extends any substitution to a substitution maintaining the vars in its rhs. More...

#include <maintain_variables_in_rhs.h>

Inheritance diagram for mcrl2::data::maintain_variables_in_rhs< Substitution >:

Classes

class  assignment
 Wrapper clas s for internal storage and substitution updates using operator() More...
 

Public Types

using super = Substitution
 
using variable_type = typename super::variable_type
 
using expression_type = typename super::expression_type
 

Public Member Functions

 maintain_variables_in_rhs ()=default
 Default constructor.
 
assignment operator[] (variable_type const &v)
 Assigment operator.
 
void clear ()
 Clear substitutions.
 
const std::multiset< variable > & variables_in_rhs ()
 Provides a set of variables that occur in the right hand sides of the assignments.
 
bool variable_occurs_in_a_rhs (const variable_type &v)
 Indicates whether a variable occurs in some rhs of this substitution.
 

Protected Attributes

std::multiset< variable_type > m_variables_in_rhs
 
std::set< variable_type > m_scratch_set
 

Detailed Description

template<IsSubstitution Substitution>
class mcrl2::data::maintain_variables_in_rhs< Substitution >

Wrapper that extends any substitution to a substitution maintaining the vars in its rhs.

This substitution assumes a function variable -> std::size_t, that, for each variable gives a unique index. The substitutions are stored internally as a vector, mapping std::size_t to expression. Provided that, given a variable, its index can be computed in O(1) time, insertion is O(1) amortized, and lookup is O(1). Memory required is O(n) where n is the largest index used.

Definition at line 33 of file maintain_variables_in_rhs.h.

Member Typedef Documentation

◆ expression_type

template<IsSubstitution Substitution>
using mcrl2::data::maintain_variables_in_rhs< Substitution >::expression_type = typename super::expression_type

Definition at line 38 of file maintain_variables_in_rhs.h.

◆ super

template<IsSubstitution Substitution>
using mcrl2::data::maintain_variables_in_rhs< Substitution >::super = Substitution

Definition at line 36 of file maintain_variables_in_rhs.h.

◆ variable_type

template<IsSubstitution Substitution>
using mcrl2::data::maintain_variables_in_rhs< Substitution >::variable_type = typename super::variable_type

Definition at line 37 of file maintain_variables_in_rhs.h.

Constructor & Destructor Documentation

◆ maintain_variables_in_rhs()

template<IsSubstitution Substitution>
mcrl2::data::maintain_variables_in_rhs< Substitution >::maintain_variables_in_rhs ( )
default

Default constructor.

Member Function Documentation

◆ clear()

template<IsSubstitution Substitution>
void mcrl2::data::maintain_variables_in_rhs< Substitution >::clear ( )
inline

Clear substitutions.

Definition at line 111 of file maintain_variables_in_rhs.h.

◆ operator[]()

template<IsSubstitution Substitution>
assignment mcrl2::data::maintain_variables_in_rhs< Substitution >::operator[] ( variable_type const &  v)
inline

Assigment operator.

Parameters
vThe variable to which the assignment is carried out.

Definition at line 105 of file maintain_variables_in_rhs.h.

◆ variable_occurs_in_a_rhs()

template<IsSubstitution Substitution>
bool mcrl2::data::maintain_variables_in_rhs< Substitution >::variable_occurs_in_a_rhs ( const variable_type &  v)
inline

Indicates whether a variable occurs in some rhs of this substitution.

Parameters
vThe variable for which occurrence in a rhs is checked.

Definition at line 125 of file maintain_variables_in_rhs.h.

◆ variables_in_rhs()

template<IsSubstitution Substitution>
const std::multiset< variable > & mcrl2::data::maintain_variables_in_rhs< Substitution >::variables_in_rhs ( )
inline

Provides a set of variables that occur in the right hand sides of the assignments.

Definition at line 118 of file maintain_variables_in_rhs.h.

Member Data Documentation

◆ m_scratch_set

template<IsSubstitution Substitution>
std::set<variable_type> mcrl2::data::maintain_variables_in_rhs< Substitution >::m_scratch_set
protected

Definition at line 43 of file maintain_variables_in_rhs.h.

◆ m_variables_in_rhs

template<IsSubstitution Substitution>
std::multiset<variable_type> mcrl2::data::maintain_variables_in_rhs< Substitution >::m_variables_in_rhs
protected

Definition at line 42 of file maintain_variables_in_rhs.h.


The documentation for this class was generated from the following file: