Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcsn::rat Namespace Reference

Classes

class  atom
 
struct  braced_ratexp
 
class  const_visitor
 
class  constant
 
class  constant_term_visitor
 
class  copier
 
class  derivation_visitor
 
class  driver
 State and public interface for rational expression parsing. More...
 
class  exp
 The abstract, non-parameterized, root for all rational expression node types. More...
 
class  expand_visitor
 
struct  expansionset
 
class  hash
 
class  info
 
class  inner
 An inner node. More...
 
class  leaf
 The root from which to derive the final node types. More...
 
class  less_than
 
class  location
 Abstract a location. More...
 
class  node
 The abstract parameterized, root for all rational expression types. More...
 
class  parser
 A Bison parser. More...
 
class  position
 Abstract a position. More...
 
class  printer
 
class  ratexpset_impl
 A typed ratexp set. More...
 
class  size
 
class  slice
 Present a slice of the top of a stack. More...
 
class  split_visitor
 Break a rational expression into a polynomial. More...
 
class  stack
 
class  standard_visitor
 Build a standard automaton from a ratexp. More...
 
class  star_normal_form_visitor
 
class  thompson_visitor
 Build a Thompson automaton from a ratexp. More...
 
class  to_expansion_visitor
 
class  unary
 
class  variadic
 An inner node with multiple children. More...
 
struct  variant
 A char[S] buffer to store and retrieve objects. More...
 
class  weight_node
 An inner node implementing a weight. More...
 

Typedefs

template<typename RatExpSet >
using ratexp_polynomialset_t = polynomialset< context< RatExpSet, weightset_t_of< RatExpSet >>>
 Type of PolynomialSet of RatExps from the RatExpSet type. More...
 
template<typename RatExpSet >
using ratexp_polynomial_t = typename ratexp_polynomialset_t< RatExpSet >::value_t
 Type of polynomials of ratexps from the RatExpSet type. More...
 
using exp_t = std::shared_ptr< const exp >
 
template<typename Context >
using zero = constant< type_t::zero, Context >
 
template<typename Context >
using one = constant< type_t::one, Context >
 
template<typename Context >
using complement = unary< type_t::complement, Context >
 
template<typename Context >
using star = unary< type_t::star, Context >
 
template<typename Context >
using transposition = unary< type_t::transposition, Context >
 
template<typename Context >
using prod = variadic< type_t::prod, Context >
 
template<typename Context >
using conjunction = variadic< type_t::conjunction, Context >
 
template<typename Context >
using ldiv = variadic< type_t::ldiv, Context >
 
template<typename Context >
using shuffle = variadic< type_t::shuffle, Context >
 
template<typename Context >
using sum = variadic< type_t::sum, Context >
 
template<typename Context >
using lweight = weight_node< type_t::lweight, Context >
 
template<typename Context >
using rweight = weight_node< type_t::rweight, Context >
 
template<typename Context >
using ratexp = std::shared_ptr< const node< Context >>
 
using irange_type = std::tuple< int, int >
 

Enumerations

enum  type_t {
  type_t::zero, type_t::one, type_t::atom, type_t::sum,
  type_t::prod, type_t::ldiv, type_t::conjunction, type_t::shuffle,
  type_t::star, type_t::transposition, type_t::lweight, type_t::rweight,
  type_t::complement
}
 The possible types of ratexps. More...
 
enum  identities { identities::trivial, identities::series }
 A ratexpset can implement several different sets of identities on expressions. More...
 

Functions

template<typename RatExpSet >
ratexp_polynomialset_t< RatExpSet > make_ratexp_polynomialset (const RatExpSet &rs)
 From a RatExpSet to its polynomialset. More...
 
template<typename InRatExpSet , typename OutRatExpSet = InRatExpSet>
OutRatExpSet::value_t copy (const InRatExpSet &in_rs, const OutRatExpSet &out_rs, const typename InRatExpSet::value_t &v)
 
constexpr bool is_constant (type_t t)
 Whether is a constant (\z or \e). More...
 
constexpr bool is_unary (type_t t)
 Whether star, complement. More...
 
constexpr bool is_variadic (type_t t)
 Whether one of the variadic types. More...
 
std::ostream & operator<< (std::ostream &o, type_t t)
 
std::string to_string (identities i)
 
std::istream & operator>> (std::istream &is, identities &i)
 
std::ostream & operator<< (std::ostream &os, identities i)
 
identities meet (identities i1, identities i2)
 
static int debug_level_ ()
 The nesting limit for parser traces, as specified per $YYDEBUG. More...
 
location operator+ (location res, const location &end)
 Join two location objects to create a location. More...
 
locationoperator+= (location &res, int width)
 Change end position in place. More...
 
location operator+ (location res, int width)
 Change end position. More...
 
locationoperator-= (location &res, int width)
 Change end position in place. More...
 
location operator- (const location &begin, int width)
 Change end position. More...
 
bool operator== (const location &loc1, const location &loc2)
 Compare two location objects. More...
 
bool operator!= (const location &loc1, const location &loc2)
 Compare two location objects. More...
 
template<typename YYChar >
std::basic_ostream< YYChar > & operator<< (std::basic_ostream< YYChar > &ostr, const location &loc)
 Intercept output stream redirection. More...
 
static exp_t power (const dyn::ratexpset &rs, exp_t e, std::tuple< int, int > range)
 Generate a ratexp for "e{range.first, range.second}". More...
 
static exp_t prefer (const dyn::ratexpset &rs, exp_t e, exp_t f)
 Generate a ratexp for "e <+ f = e % f + f". More...
 
static parser::symbol_type yylex (driver &driver_)
 Use our local scanner object. More...
 
static exp_t power (const dyn::ratexpset &es, exp_t e, int min, int max)
 
positionoperator+= (position &res, int width)
 Add and assign a position. More...
 
position operator+ (position res, int width)
 Add two position objects. More...
 
positionoperator-= (position &res, int width)
 Add and assign a position. More...
 
position operator- (position res, int width)
 Add two position objects. More...
 
bool operator== (const position &pos1, const position &pos2)
 Compare two position objects. More...
 
bool operator!= (const position &pos1, const position &pos2)
 Compare two position objects. More...
 
template<typename YYChar >
std::basic_ostream< YYChar > & operator<< (std::basic_ostream< YYChar > &ostr, const position &pos)
 Intercept output stream redirection. More...
 
dyn::ratexp read (std::istream &is, const dyn::ratexpset &rs, const location &l=location{})
 The ratexp in stream is, with rs as default ratexpset. More...
 

Typedef Documentation

template<typename Context >
using vcsn::rat::complement = typedef unary<type_t::complement, Context>

Definition at line 110 of file fwd.hh.

template<typename Context >
using vcsn::rat::conjunction = typedef variadic<type_t::conjunction, Context>

Definition at line 129 of file fwd.hh.

using vcsn::rat::exp_t = typedef std::shared_ptr<const exp>

Definition at line 16 of file fwd.hh.

using vcsn::rat::irange_type = typedef std::tuple<int, int>

Definition at line 72 of file parse.hh.

template<typename Context >
using vcsn::rat::ldiv = typedef variadic<type_t::ldiv, Context>

Definition at line 132 of file fwd.hh.

template<typename Context >
using vcsn::rat::lweight = typedef weight_node<type_t::lweight, Context>

Definition at line 148 of file fwd.hh.

template<typename Context >
using vcsn::rat::one = typedef constant<type_t::one, Context>

Definition at line 100 of file fwd.hh.

template<typename Context >
using vcsn::rat::prod = typedef variadic<type_t::prod, Context>

Definition at line 126 of file fwd.hh.

template<typename Context >
using vcsn::rat::ratexp = typedef std::shared_ptr<const node<Context>>

Definition at line 156 of file fwd.hh.

template<typename RatExpSet >
using vcsn::rat::ratexp_polynomial_t = typedef typename ratexp_polynomialset_t<RatExpSet>::value_t

Type of polynomials of ratexps from the RatExpSet type.

Definition at line 28 of file split.hh.

template<typename RatExpSet >
using vcsn::rat::ratexp_polynomialset_t = typedef polynomialset<context<RatExpSet, weightset_t_of<RatExpSet>>>

Type of PolynomialSet of RatExps from the RatExpSet type.

Definition at line 23 of file split.hh.

template<typename Context >
using vcsn::rat::rweight = typedef weight_node<type_t::rweight, Context>

Definition at line 151 of file fwd.hh.

template<typename Context >
using vcsn::rat::shuffle = typedef variadic<type_t::shuffle, Context>

Definition at line 135 of file fwd.hh.

template<typename Context >
using vcsn::rat::star = typedef unary<type_t::star, Context>

Definition at line 113 of file fwd.hh.

template<typename Context >
using vcsn::rat::sum = typedef variadic<type_t::sum, Context>

Definition at line 138 of file fwd.hh.

template<typename Context >
using vcsn::rat::transposition = typedef unary<type_t::transposition, Context>

Definition at line 116 of file fwd.hh.

template<typename Context >
using vcsn::rat::zero = typedef constant<type_t::zero, Context>

Definition at line 97 of file fwd.hh.

Enumeration Type Documentation

enum vcsn::rat::identities
strong

A ratexpset can implement several different sets of identities on expressions.

This type represents one of those sets.

Enumerator
trivial 

Trivial identities only.

series 

Trivial identities plus series identities.

Definition at line 17 of file identities.hh.

enum vcsn::rat::type_t
strong

The possible types of ratexps.

They also code the order in which they are sorted by less_than, so that, for instance, polynomials always display \e + a, and never a + \e.

Enumerator
zero 
one 
atom 
sum 
prod 
ldiv 
conjunction 
shuffle 
star 
transposition 
lweight 
rweight 
complement 

Definition at line 31 of file fwd.hh.

Function Documentation

template<typename InRatExpSet , typename OutRatExpSet = InRatExpSet>
OutRatExpSet::value_t vcsn::rat::copy ( const InRatExpSet &  in_rs,
const OutRatExpSet &  out_rs,
const typename InRatExpSet::value_t &  v 
)
static int vcsn::rat::debug_level_ ( )
static

The nesting limit for parser traces, as specified per $YYDEBUG.

Definition at line 54 of file driver.cc.

Referenced by vcsn::rat::driver::parse().

constexpr bool vcsn::rat::is_constant ( type_t  t)
inline

Whether is a constant (\z or \e).

Definition at line 49 of file fwd.hh.

References one, and zero.

Referenced by vcsn::rat::exp::is_leaf().

constexpr bool vcsn::rat::is_unary ( type_t  t)
inline

Whether star, complement.

Definition at line 56 of file fwd.hh.

References complement, star, and transposition.

Referenced by vcsn::rat::exp::is_unary().

constexpr bool vcsn::rat::is_variadic ( type_t  t)
inline

Whether one of the variadic types.

Definition at line 64 of file fwd.hh.

References conjunction, ldiv, prod, shuffle, and sum.

template<typename RatExpSet >
ratexp_polynomialset_t<RatExpSet> vcsn::rat::make_ratexp_polynomialset ( const RatExpSet &  rs)
inline

From a RatExpSet to its polynomialset.

Definition at line 34 of file split.hh.

References vcsn::context< LabelSet, WeightSet >::weightset().

Referenced by vcsn::derivation(), vcsn::dyn::detail::derivation(), vcsn::dyn::detail::split(), and vcsn::split().

Here is the call graph for this function:

identities vcsn::rat::meet ( identities  i1,
identities  i2 
)

Definition at line 48 of file identities.cc.

References series, and trivial.

bool vcsn::rat::operator!= ( const location &  loc1,
const location &  loc2 
)
inline

Compare two location objects.

Definition at line 155 of file location.hh.

bool vcsn::rat::operator!= ( const position &  pos1,
const position &  pos2 
)
inline

Compare two position objects.

Definition at line 159 of file position.hh.

location vcsn::rat::operator+ ( location  res,
const location &  end 
)
inline

Join two location objects to create a location.

Definition at line 115 of file location.hh.

position vcsn::rat::operator+ ( position  res,
int  width 
)
inline

Add two position objects.

Definition at line 127 of file position.hh.

location vcsn::rat::operator+ ( location  res,
int  width 
)
inline

Change end position.

Definition at line 129 of file location.hh.

position& vcsn::rat::operator+= ( position &  res,
int  width 
)
inline

Add and assign a position.

Definition at line 119 of file position.hh.

location& vcsn::rat::operator+= ( location &  res,
int  width 
)
inline

Change end position in place.

Definition at line 122 of file location.hh.

location vcsn::rat::operator- ( const location &  begin,
int  width 
)
inline

Change end position.

Definition at line 141 of file location.hh.

position vcsn::rat::operator- ( position  res,
int  width 
)
inline

Add two position objects.

Definition at line 141 of file position.hh.

position& vcsn::rat::operator-= ( position &  res,
int  width 
)
inline

Add and assign a position.

Definition at line 134 of file position.hh.

location& vcsn::rat::operator-= ( location &  res,
int  width 
)
inline

Change end position in place.

Definition at line 135 of file location.hh.

std::ostream & vcsn::rat::operator<< ( std::ostream &  os,
identities  i 
)

Definition at line 25 of file identities.cc.

References to_string().

Here is the call graph for this function:

std::ostream & vcsn::rat::operator<< ( std::ostream &  o,
type_t  t 
)
inline

Definition at line 16 of file printer.hxx.

References CASE.

template<typename YYChar >
std::basic_ostream<YYChar>& vcsn::rat::operator<< ( std::basic_ostream< YYChar > &  ostr,
const location &  loc 
)
inline

Intercept output stream redirection.

Parameters
ostrthe destination output stream
loca reference to the location to redirect

Avoid duplicate information.

Definition at line 168 of file location.hh.

References vcsn::rat::position::column, and vcsn::rat::location::end.

template<typename YYChar >
std::basic_ostream<YYChar>& vcsn::rat::operator<< ( std::basic_ostream< YYChar > &  ostr,
const position &  pos 
)
inline

Intercept output stream redirection.

Parameters
ostrthe destination output stream
posa reference to the position to redirect

Definition at line 170 of file position.hh.

References vcsn::rat::position::filename.

bool vcsn::rat::operator== ( const location &  loc1,
const location &  loc2 
)
inline

Compare two location objects.

Definition at line 148 of file location.hh.

bool vcsn::rat::operator== ( const position &  pos1,
const position &  pos2 
)
inline

Compare two position objects.

Definition at line 148 of file position.hh.

std::istream & vcsn::rat::operator>> ( std::istream &  is,
identities &  i 
)

Definition at line 30 of file identities.cc.

References vcsn::eat(), vcsn::fail_reading(), is, series, and trivial.

Here is the call graph for this function:

static exp_t vcsn::rat::power ( const dyn::ratexpset &  rs,
exp_t  e,
std::tuple< int, int >  range 
)
static

Generate a ratexp for "e{range.first, range.second}".

Definition at line 1348 of file parse.cc.

Referenced by vcsn::rat::parser::parse(), and power().

static exp_t vcsn::rat::power ( const dyn::ratexpset &  es,
exp_t  e,
int  min,
int  max 
)
static

Definition at line 1314 of file parse.cc.

References power().

Here is the call graph for this function:

static exp_t vcsn::rat::prefer ( const dyn::ratexpset &  rs,
exp_t  e,
exp_t  f 
)
static

Generate a ratexp for "e <+ f = e % f + f".

Definition at line 1355 of file parse.cc.

Referenced by vcsn::rat::parser::parse().

dyn::ratexp vcsn::rat::read ( std::istream &  is,
const dyn::ratexpset &  rs,
const location &  l 
)

The ratexp in stream is, with rs as default ratexpset.

Definition at line 12 of file read.cc.

References vcsn::rat::driver::errors, and vcsn::rat::driver::parse().

Referenced by vcsn::dyn::read_ratexp().

Here is the call graph for this function:

static parser::symbol_type vcsn::rat::yylex ( driver &  driver_)
inlinestatic

Use our local scanner object.

Definition at line 96 of file parse.cc.

References vcsn::rat::driver::scanner_.

Referenced by vcsn::rat::parser::parse().