Awali
Another Weighted Automata library
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
awali::sttc::nn< K > Class Template Reference

The semiring of natural numbers bounded by K. More...

#include <nn.hh>

Public Types

using finite_t = bool
 
using self_type = nn< K >
 
using value_t = unsigned int
 

Public Member Functions

 nn ()
 
std::ostream & print_set (std::ostream &o, const std::string &format="text") const
 
template<unsigned version = version::fsm_json>
json::node_tto_json () const
 
template<unsigned version = version::fsm_json>
json::node_tvalue_to_json (value_t v) const
 
std::string vname (bool=true) const
 

Static Public Member Functions

static value_t add (const value_t l, const value_t r)
 
static value_t conv (self_type, value_t v)
 
static value_t conv (std::istream &stream)
 
static bool equals (const value_t l, const value_t r)
 
static size_t hash (value_t v)
 
static constexpr bool is_commutative_semiring ()
 
static bool is_one (const value_t v)
 
constexpr static bool is_special (value_t)
 
static bool is_zero (const value_t v)
 
static value_t ldiv (const value_t l, const value_t r)
 
static bool less_than (value_t lhs, value_t rhs)
 Whether lhs < rhs. More...
 
static nn< K > make (std::istream &is)
 Build from the description in is. More...
 
static value_t mul (const value_t l, const value_t r)
 
static value_t one ()
 
static value_t parse (const std::string &s, size_t &p)
 
static std::ostream & print (value_t v, std::ostream &o, const std::string &="text")
 
static value_t rdiv (const value_t, const value_t)
 
static constexpr bool show_one ()
 
static std::string sname ()
 
static value_t star (const value_t v)
 
static constexpr star_status_t star_status ()
 
static value_t transpose (const value_t v)
 
template<unsigned version = version::fsm_json>
static value_t value_from_json (json::node_t const *p)
 
static value_t zero ()
 

Static Public Attributes

static const finite_t finite =true
 

Detailed Description

template<unsigned int K>
class awali::sttc::nn< K >

The semiring of natural numbers bounded by K.

The semiring has K+1 elements. The type of values is unsigned int

Template Parameters
Ka positive integer: the bound on the semiring

Member Typedef Documentation

◆ finite_t

template<unsigned int K>
using awali::sttc::nn< K >::finite_t = bool

◆ self_type

template<unsigned int K>
using awali::sttc::nn< K >::self_type = nn<K>

◆ value_t

template<unsigned int K>
using awali::sttc::nn< K >::value_t = unsigned int

Constructor & Destructor Documentation

◆ nn()

template<unsigned int K>
awali::sttc::nn< K >::nn ( )

Member Function Documentation

◆ add()

template<unsigned int K>
static value_t awali::sttc::nn< K >::add ( const value_t  l,
const value_t  r 
)
static

◆ conv() [1/2]

template<unsigned int K>
static value_t awali::sttc::nn< K >::conv ( self_type  ,
value_t  v 
)
static

◆ conv() [2/2]

template<unsigned int K>
static value_t awali::sttc::nn< K >::conv ( std::istream &  stream)
static

◆ equals()

template<unsigned int K>
static bool awali::sttc::nn< K >::equals ( const value_t  l,
const value_t  r 
)
static

◆ hash()

template<unsigned int K>
static size_t awali::sttc::nn< K >::hash ( value_t  v)
static

◆ is_commutative_semiring()

template<unsigned int K>
static constexpr bool awali::sttc::nn< K >::is_commutative_semiring ( )
staticconstexpr

◆ is_one()

template<unsigned int K>
static bool awali::sttc::nn< K >::is_one ( const value_t  v)
static

◆ is_special()

template<unsigned int K>
constexpr static bool awali::sttc::nn< K >::is_special ( value_t  )
staticconstexpr

◆ is_zero()

template<unsigned int K>
static bool awali::sttc::nn< K >::is_zero ( const value_t  v)
static

◆ ldiv()

template<unsigned int K>
static value_t awali::sttc::nn< K >::ldiv ( const value_t  l,
const value_t  r 
)
static

◆ less_than()

template<unsigned int K>
static bool awali::sttc::nn< K >::less_than ( value_t  lhs,
value_t  rhs 
)
static

Whether lhs < rhs.

◆ make()

template<unsigned int K>
static nn<K> awali::sttc::nn< K >::make ( std::istream &  is)
static

Build from the description in is.

◆ mul()

template<unsigned int K>
static value_t awali::sttc::nn< K >::mul ( const value_t  l,
const value_t  r 
)
static

◆ one()

template<unsigned int K>
static value_t awali::sttc::nn< K >::one ( )
static

◆ parse()

template<unsigned int K>
static value_t awali::sttc::nn< K >::parse ( const std::string &  s,
size_t &  p 
)
static

◆ print()

template<unsigned int K>
static std::ostream& awali::sttc::nn< K >::print ( value_t  v,
std::ostream &  o,
const std::string &  = "text" 
)
static

◆ print_set()

template<unsigned int K>
std::ostream& awali::sttc::nn< K >::print_set ( std::ostream &  o,
const std::string &  format = "text" 
) const

◆ rdiv()

template<unsigned int K>
static value_t awali::sttc::nn< K >::rdiv ( const  value_t,
const  value_t 
)
static

◆ show_one()

template<unsigned int K>
static constexpr bool awali::sttc::nn< K >::show_one ( )
staticconstexpr

◆ sname()

template<unsigned int K>
static std::string awali::sttc::nn< K >::sname ( )
static

◆ star()

template<unsigned int K>
static value_t awali::sttc::nn< K >::star ( const value_t  v)
static

◆ star_status()

template<unsigned int K>
static constexpr star_status_t awali::sttc::nn< K >::star_status ( )
staticconstexpr

◆ to_json()

template<unsigned int K>
template<unsigned version = version::fsm_json>
json::node_t* awali::sttc::nn< K >::to_json ( ) const

◆ transpose()

template<unsigned int K>
static value_t awali::sttc::nn< K >::transpose ( const value_t  v)
static

◆ value_from_json()

template<unsigned int K>
template<unsigned version = version::fsm_json>
static value_t awali::sttc::nn< K >::value_from_json ( json::node_t const *  p)
static

◆ value_to_json()

template<unsigned int K>
template<unsigned version = version::fsm_json>
json::node_t* awali::sttc::nn< K >::value_to_json ( value_t  v) const

◆ vname()

template<unsigned int K>
std::string awali::sttc::nn< K >::vname ( bool  = true) const

◆ zero()

template<unsigned int K>
static value_t awali::sttc::nn< K >::zero ( )
static

Field Documentation

◆ finite

template<unsigned int K>
const finite_t awali::sttc::nn< K >::finite =true
static

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