souffle  2.0.2-371-g6315b36
Public Types | Public Member Functions | Private Types | Private Attributes | Friends
souffle::ast::analysis::Assignment< Var > Class Template Reference

An assignment maps a list of variables to values of their respective property space. More...

#include <ConstraintSystem.h>

Collaboration diagram for souffle::ast::analysis::Assignment< Var >:
Collaboration graph

Public Types

using iterator = typename data_type::const_iterator
 

Public Member Functions

 Assignment ()
 Creates a new, empty assignment. More...
 
iterator begin () const
 Allows to iterate over the maplets defining this assignment. More...
 
iterator end () const
 Allows to iterate over the maplets defining this assignment. More...
 
value_typeoperator[] (const Var &var)
 Looks up the value associated to the given variable. More...
 
const value_typeoperator[] (const Var &var) const
 Looks up the value associated to the given variable. More...
 
void print (std::ostream &out) const
 Adds print support. More...
 

Private Types

using bottom_factory_type = typename property_space::bottom_factory_type
 
using data_type = typename std::map< Var, value_type >
 
using property_space = typename Var::property_space
 
using value_type = typename property_space::value_type
 

Private Attributes

value_type bottom
 a copy of the value assigned to all unmapped variables More...
 
data_type data
 the actual mapping of variables to values More...
 

Friends

std::ostream & operator<< (std::ostream &out, const Assignment &ass)
 Adds print support. More...
 

Detailed Description

template<typename Var>
class souffle::ast::analysis::Assignment< Var >

An assignment maps a list of variables to values of their respective property space.

Template Parameters
Varthe kind of variable forming the domain of this assignment

Definition at line 47 of file ConstraintSystem.h.

Member Typedef Documentation

◆ bottom_factory_type

template<typename Var >
using souffle::ast::analysis::Assignment< Var >::bottom_factory_type = typename property_space::bottom_factory_type
private

Definition at line 293 of file ConstraintSystem.h.

◆ data_type

template<typename Var >
using souffle::ast::analysis::Assignment< Var >::data_type = typename std::map<Var, value_type>
private

Definition at line 295 of file ConstraintSystem.h.

◆ iterator

template<typename Var >
using souffle::ast::analysis::Assignment< Var >::iterator = typename data_type::const_iterator

Definition at line 304 of file ConstraintSystem.h.

◆ property_space

template<typename Var >
using souffle::ast::analysis::Assignment< Var >::property_space = typename Var::property_space
private

Definition at line 291 of file ConstraintSystem.h.

◆ value_type

template<typename Var >
using souffle::ast::analysis::Assignment< Var >::value_type = typename property_space::value_type
private

Definition at line 292 of file ConstraintSystem.h.

Constructor & Destructor Documentation

◆ Assignment()

template<typename Var >
souffle::ast::analysis::Assignment< Var >::Assignment ( )
inline

Creates a new, empty assignment.

Definition at line 307 of file ConstraintSystem.h.

312 {

Member Function Documentation

◆ begin()

template<typename Var >
iterator souffle::ast::analysis::Assignment< Var >::begin ( ) const
inline

Allows to iterate over the maplets defining this assignment.

Definition at line 352 of file ConstraintSystem.h.

366  {

◆ end()

template<typename Var >
iterator souffle::ast::analysis::Assignment< Var >::end ( ) const
inline

Allows to iterate over the maplets defining this assignment.

Definition at line 357 of file ConstraintSystem.h.

366  {

◆ operator[]() [1/2]

template<typename Var >
value_type& souffle::ast::analysis::Assignment< Var >::operator[] ( const Var &  var)
inline

Looks up the value associated to the given variable.

Every Assignment is a total mapping assigning each variable in the domain of type {Var} a value of its property space. If not defined earlier, it will be bound to the bottom value.

Parameters
varthe variable whose value is required
Returns
a mutable reference to the associated value

Definition at line 332 of file ConstraintSystem.h.

335  {
336  out << data;
337  }
338 

◆ operator[]() [2/2]

template<typename Var >
const value_type& souffle::ast::analysis::Assignment< Var >::operator[] ( const Var &  var) const
inline

Looks up the value associated to the given variable.

Every Assignment is a total mapping assigning each variable in the domain of type {Var} a value of its property space. If not defined earlier, it will be the bottom value.

Parameters
varthe variable whose value is required
Returns
a const reference to the associated value

Definition at line 318 of file ConstraintSystem.h.

320  {Var} a value of its property space. If
321  * not defined earlier, it will be bound to the bottom value.

◆ print()

template<typename Var >
void souffle::ast::analysis::Assignment< Var >::print ( std::ostream &  out) const
inline

Adds print support.

Definition at line 341 of file ConstraintSystem.h.

346  {

Friends And Related Function Documentation

◆ operator<<

template<typename Var >
std::ostream& operator<< ( std::ostream &  out,
const Assignment< Var > &  ass 
)
friend

Adds print support.

Definition at line 346 of file ConstraintSystem.h.

346  {
347  return data.begin();
348  }
349 

Field Documentation

◆ bottom

template<typename Var >
value_type souffle::ast::analysis::Assignment< Var >::bottom
private

a copy of the value assigned to all unmapped variables

Definition at line 298 of file ConstraintSystem.h.

Referenced by souffle::ast::analysis::Assignment< TypeVar >::Assignment(), and souffle::ast::analysis::Assignment< TypeVar >::operator[]().

◆ data

template<typename Var >
data_type souffle::ast::analysis::Assignment< Var >::data
private

the actual mapping of variables to values

Definition at line 301 of file ConstraintSystem.h.

Referenced by souffle::ast::analysis::Assignment< TypeVar >::Assignment(), and souffle::ast::analysis::Assignment< TypeVar >::operator[]().


The documentation for this class was generated from the following file:
souffle::ast::analysis::Assignment::bottom
value_type bottom
a copy of the value assigned to all unmapped variables
Definition: ConstraintSystem.h:298
souffle::ast::analysis::Assignment::data
data_type data
the actual mapping of variables to values
Definition: ConstraintSystem.h:301