![]() |
Vcsn
2.3a
Be Rational
|
Classes | |
class | atom |
struct | braced_expression |
An expression that "remembers" whether it was in parentheses. More... | |
class | const_visitor |
class | constant |
class | constant_term_visitor |
A functor to compute the constant term of an expression. More... | |
class | copy_impl |
Functor to copy/convert a rational expression. More... | |
class | derivation_visitor |
Functor to compute the derivation of an expression. More... | |
class | dot_printer |
Pretty-printer for rational expressions. More... | |
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... | |
struct | expansionset |
class | expressionset_impl |
A typed expression set. More... | |
class | hash |
class | identities |
An expressionset can implement several different sets of identities on expressions. More... | |
class | inductive_visitor |
Build an automaton by induction from an expression. More... | |
class | info |
Gather information of the number of the different node types. More... | |
class | inner |
An inner node. More... | |
class | leaf |
The root from which to derive the final node types. More... | |
class | less |
A functor to check whether one rational expression is (strictly) less than another one. More... | |
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 | partial_identity_impl |
Functor to partial_identity/convert a rational expression. More... | |
class | position |
Abstract a position. More... | |
class | printer |
Pretty-printer for rational expressions. More... | |
class | project_impl |
Functor to project a rational expression. More... | |
class | sizer |
Functor to compute the size of a rational expression. More... | |
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 an expression. More... | |
class | star_normal_form_visitor |
class | thompson_visitor |
Build a Thompson automaton from an expression. More... | |
class | to_expansion_visitor |
Functor to compute the expansion of an expression. More... | |
class | tuple |
Implementation of nodes of tuple of rational expressions. More... | |
class | tuple< Context, false > |
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... | |
class | zpc_visitor |
Build a ZPC automaton from an expression. More... | |
Typedefs | |
template<typename ExpSet > | |
using | expression_polynomialset_t = polynomialset< context< ExpSet, weightset_t_of< ExpSet >>> |
Type of PolynomialSet of expressions from the ExpSet type. More... | |
template<typename ExpSet > | |
using | expression_polynomial_t = typename expression_polynomialset_t< ExpSet >::value_t |
Type of polynomials of expressions from the ExpSet 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 | compose = variadic< type_t::compose, Context > |
template<typename Context > | |
using | conjunction = variadic< type_t::conjunction, Context > |
template<typename Context > | |
using | infiltrate = variadic< type_t::infiltrate, Context > |
template<typename Context > | |
using | ldivide = variadic< type_t::ldivide, Context > |
template<typename Context > | |
using | mul = variadic< type_t::mul, Context > |
template<typename Context > | |
using | shuffle = variadic< type_t::shuffle, Context > |
template<typename Context > | |
using | add = variadic< type_t::add, 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 | expression = std::shared_ptr< const node< Context >> |
using | class_t = std::set< std::pair< std::string, std::string >> |
A set of label ranges. More... | |
using | irange_type = std::tuple< int, int > |
An integer range, for quantifiers/exponents. More... | |
Enumerations | |
enum | type_t { type_t::zero, type_t::one, type_t::atom, type_t::add, type_t::mul, type_t::ldivide, type_t::conjunction, type_t::shuffle, type_t::infiltrate, type_t::star, type_t::transposition, type_t::lweight, type_t::rweight, type_t::complement, type_t::tuple, type_t::compose } |
The possible types of expressions. More... | |
enum | precedence_t { precedence_t::add, precedence_t::compose, precedence_t::tuple, precedence_t::products, precedence_t::shuffle = products, precedence_t::conjunction = products, precedence_t::infiltrate = products, precedence_t::ldivide, precedence_t::mul, precedence_t::word = mul, precedence_t::lweight, precedence_t::rweight, precedence_t::unary, precedence_t::star = unary, precedence_t::complement = unary, precedence_t::transposition = unary, precedence_t::exponent = unary, precedence_t::zero, precedence_t::one, precedence_t::atom } |
The possible node precedence levels, increasing. More... | |
Functions | |
template<typename ExpSet > | |
expression_polynomialset_t< ExpSet > | make_expression_polynomialset (const ExpSet &rs) |
From a ExpSet to its polynomialset. More... | |
template<typename InExpSet , typename OutExpSet = InExpSet> | |
OutExpSet::value_t | copy (const InExpSet &in_rs, const OutExpSet &out_rs, const typename InExpSet::value_t &v) |
Copy/convert a rational expression. More... | |
template<typename ExpSet > | |
dot_printer< ExpSet > | make_dot_printer (const ExpSet &rs, std::ostream &out, bool physical=false) |
template<typename ExpSet > | |
info< ExpSet > | make_info (const typename ExpSet::value_t &r) |
template<typename ExpSet > | |
printer< ExpSet > | make_printer (const ExpSet &rs, std::ostream &out) |
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) |
Print a expression type. More... | |
template<typename ExpSet > | |
size_t | size (const ExpSet &rs, const typename ExpSet::value_t &r) |
std::string | to_string (identities i) |
Wrapper around operator<<. More... | |
std::istream & | operator>> (std::istream &is, identities &i) |
Read from string form. More... | |
std::ostream & | operator<< (std::ostream &os, identities i) |
Output in string form. More... | |
identities | meet (identities i1, identities i2) |
template<typename InExpSet , typename OutExpSet = InExpSet> | |
OutExpSet::value_t | partial_identity (const InExpSet &in_rs, const OutExpSet &out_rs, const typename InExpSet::value_t &v) |
Partial identity of a rational expression. More... | |
template<size_t Tape, typename InExpSet , typename OutExpSet > | |
auto | project (const InExpSet &in_rs, const OutExpSet &out_rs, const typename InExpSet::value_t &v) -> typename OutExpSet::value_t |
Project a rational expression. More... | |
template<size_t Tape, typename InExpSet > | |
auto | project (const InExpSet &in_rs, const typename InExpSet::value_t &v) -> typename InExpSet::template project_t< Tape >::value_t |
Project a rational expression. More... | |
template<typename ExpSet > | |
size_t | size (const typename ExpSet::value_t &r) |
static int | debug_level_ () |
The nesting limit for parser traces, as specified per $YYDEBUG. More... | |
location & | operator+= (location &res, const location &end) |
Join two locations, in place. More... | |
location | operator+ (location res, const location &end) |
Join two locations. More... | |
location & | operator+= (location &res, int width) |
Add width columns to the end position, in place. More... | |
location | operator+ (location res, int width) |
Add width columns to the end position. More... | |
location & | operator-= (location &res, int width) |
Subtract width columns to the end position, in place. More... | |
location | operator- (location res, int width) |
Subtract width columns to the 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 dyn::expression | prefer (const dyn::expression &e, const dyn::expression &f) |
Generate an expression for "e <+ f = e % f + f". More... | |
static dyn::context | ctx (const driver &d) |
Get the context of the driver. More... | |
static identities | ids (const driver &d) |
Get the identities of the driver. More... | |
static parser::symbol_type | yylex (driver &d) |
Use our local scanner object. More... | |
position & | operator+= (position &res, int width) |
Add width columns, in place. More... | |
position | operator+ (position res, int width) |
Add width columns. More... | |
position & | operator-= (position &res, int width) |
Subtract width columns, in place. More... | |
position | operator- (position res, int width) |
Subtract width columns. 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::expression | read (const dyn::context &ctx, rat::identities ids, std::istream &is, const location &l=location{}) |
The expression in stream is. More... | |
Variables | |
static constexpr const char *const | superscripts [] |
Exponents in UTF-8. More... | |
using vcsn::rat::add = typedef variadic<type_t::add, Context> |
using vcsn::rat::class_t = typedef std::set<std::pair<std::string, std::string>> |
using vcsn::rat::complement = typedef unary<type_t::complement, Context> |
using vcsn::rat::compose = typedef variadic<type_t::compose, Context> |
using vcsn::rat::conjunction = typedef variadic<type_t::conjunction, Context> |
using vcsn::rat::exp_t = typedef std::shared_ptr<const exp> |
using vcsn::rat::expression = typedef std::shared_ptr<const node<Context>> |
using vcsn::rat::expression_polynomial_t = typedef typename expression_polynomialset_t<ExpSet>::value_t |
using vcsn::rat::expression_polynomialset_t = typedef polynomialset<context<ExpSet, weightset_t_of<ExpSet>>> |
using vcsn::rat::infiltrate = typedef variadic<type_t::infiltrate, Context> |
using vcsn::rat::irange_type = typedef std::tuple<int, int> |
using vcsn::rat::ldivide = typedef variadic<type_t::ldivide, Context> |
using vcsn::rat::lweight = typedef weight_node<type_t::lweight, Context> |
using vcsn::rat::mul = typedef variadic<type_t::mul, Context> |
using vcsn::rat::one = typedef constant<type_t::one, Context> |
using vcsn::rat::rweight = typedef weight_node<type_t::rweight, Context> |
using vcsn::rat::shuffle = typedef variadic<type_t::shuffle, Context> |
using vcsn::rat::star = typedef unary<type_t::star, Context> |
using vcsn::rat::transposition = typedef unary<type_t::transposition, Context> |
using vcsn::rat::zero = typedef constant<type_t::zero, Context> |
|
strong |
The possible node precedence levels, increasing.
When printing a word (i.e., a label with several letters), beware that it may require parens. Think of star(atom(ab)): if we print it as 'ab*', it actually means 'a(b*)'. So give words a lower precedence than star. This is the role of 'word' below.
Was part of printer<ExpSet>, but it resulted in different incompatible types between, for instance, printer<lat<lal_char, lal_char>> and printer<lal_char>, which is a problem when the former calls print_child of the latter, passing an argument of type precedence_t.
Enumerator | |
---|---|
add | |
compose | |
tuple | |
products | |
shuffle | |
conjunction | |
infiltrate | |
ldivide | |
mul | |
word | |
lweight | |
rweight | |
unary | |
star | |
complement | |
transposition | |
exponent | |
zero | |
one | |
atom |
Definition at line 34 of file printer.hh.
|
strong |
The possible types of expressions.
They also code the order in which they are sorted by less, so that, for instance, polynomials always display \\e + a
, and never a + \\e
.
Enumerator | |
---|---|
zero | |
one | |
atom | |
add | |
mul | |
ldivide | |
conjunction | |
shuffle | |
infiltrate | |
star | |
transposition | |
lweight | |
rweight | |
complement | |
tuple | |
compose |
OutExpSet::value_t vcsn::rat::copy | ( | const InExpSet & | in_rs, |
const OutExpSet & | out_rs, | ||
const typename InExpSet::value_t & | v | ||
) |
Copy/convert a rational expression.
InExpSet | the input expressionset type. |
OutExpSet | the output expressionset type. |
Definition at line 174 of file copy.hh.
Referenced by vcsn::rat::expressionset_impl< Context >::conv(), vcsn::dyn::copy(), vcsn::dyn::detail::copy_expression(), and vcsn::rat::copy_impl< InExpSet, OutExpSet >::visit_tuple< Dummy >::work_().
|
inlinestatic |
Get the context of the driver.
Definition at line 82 of file parse.cc.
References vcsn::rat::driver::context().
Referenced by vcsn::rat::driver::context(), vcsn::rat::expressionset_impl< Context >::make(), vcsn::rat::parser::parse(), and read().
|
static |
The nesting limit for parser traces, as specified per $YYDEBUG.
Definition at line 89 of file driver.cc.
References vcsn::res.
Referenced by vcsn::rat::driver::parse().
|
inlinestatic |
Get the identities of the driver.
Definition at line 89 of file parse.cc.
References vcsn::rat::driver::identities().
Referenced by vcsn::ast::context_parser::expressionset_(), vcsn::dyn::detail::lift_automaton(), vcsn::rat::expressionset_impl< Context >::make(), vcsn::rat::parser::parse(), vcsn::dyn::read_expression(), vcsn::to_expression(), and vcsn::tuple_expressionset().
|
inline |
Whether is a constant (\\z
or \\e
).
Definition at line 60 of file fwd.hh.
Referenced by vcsn::rat::exp::is_leaf().
|
inline |
Whether star, complement.
Definition at line 67 of file fwd.hh.
References complement, star, and transposition.
Referenced by vcsn::rat::exp::is_unary().
|
inline |
Whether one of the variadic types.
Definition at line 75 of file fwd.hh.
References add, compose, conjunction, infiltrate, ldivide, mul, and shuffle.
dot_printer<ExpSet> vcsn::rat::make_dot_printer | ( | const ExpSet & | rs, |
std::ostream & | out, | ||
bool | physical = false |
||
) |
Definition at line 421 of file dot.hh.
References vcsn::detail::out(), and vcsn::detail::rs.
Referenced by vcsn::print().
expression_polynomialset_t<ExpSet> vcsn::rat::make_expression_polynomialset | ( | const ExpSet & | rs | ) |
From a ExpSet to its polynomialset.
Definition at line 31 of file split.hh.
References vcsn::detail::rs.
Referenced by vcsn::dyn::derivation(), vcsn::derivation(), vcsn::split(), and vcsn::dyn::split().
info< ExpSet > vcsn::rat::make_info | ( | const typename ExpSet::value_t & | r | ) |
printer< ExpSet > vcsn::rat::make_printer | ( | const ExpSet & | rs, |
std::ostream & | out | ||
) |
Definition at line 373 of file printer.hh.
References vcsn::detail::rs.
Referenced by vcsn::rat::expressionset_impl< Context >::print(), and vcsn::rat::printer< ExpSet >::visit_tuple< Dummy >::print_().
identities vcsn::rat::meet | ( | identities | i1, |
identities | i2 | ||
) |
Definition at line 76 of file identities.cc.
Referenced by vcsn::meet().
Compare two position objects.
Definition at line 159 of file position.hh.
Compare two location objects.
Definition at line 161 of file location.hh.
Join two locations.
Definition at line 122 of file location.hh.
Add width columns.
Definition at line 127 of file position.hh.
Add width columns to the end position.
Definition at line 135 of file location.hh.
Add width columns to the end position, in place.
Definition at line 128 of file location.hh.
References vcsn::res.
Subtract width columns.
Definition at line 141 of file position.hh.
Subtract width columns to the end position.
Definition at line 147 of file location.hh.
Subtract width columns, in place.
Definition at line 134 of file position.hh.
Subtract width columns to the end position, in place.
Definition at line 141 of file location.hh.
|
inline |
std::ostream & vcsn::rat::operator<< | ( | std::ostream & | os, |
identities | i | ||
) |
Output in string form.
Definition at line 62 of file identities.cc.
References to_string().
|
inline |
Intercept output stream redirection.
ostr | the destination output stream |
pos | a reference to the position to redirect |
Definition at line 170 of file position.hh.
References vcsn::rat::position::filename.
|
inline |
Intercept output stream redirection.
ostr | the destination output stream |
loc | a reference to the location to redirect |
Avoid duplicate information.
Definition at line 174 of file location.hh.
References vcsn::rat::position::column, vcsn::rat::location::end, and vcsn::if().
Compare two position objects.
Definition at line 148 of file position.hh.
Compare two location objects.
Definition at line 154 of file location.hh.
std::istream & vcsn::rat::operator>> | ( | std::istream & | is, |
identities & | i | ||
) |
Read from string form.
Definition at line 67 of file identities.cc.
OutExpSet::value_t vcsn::rat::partial_identity | ( | const InExpSet & | in_rs, |
const OutExpSet & | out_rs, | ||
const typename InExpSet::value_t & | v | ||
) |
Partial identity of a rational expression.
InExpSet | the input expressionset type. |
OutExpSet | the output expressionset type. |
InExpSet | the input expressionset type |
OutExpSet | the output expressionset type |
Definition at line 195 of file partial-identity.hh.
Referenced by vcsn::dyn::partial_identity(), and vcsn::rat::partial_identity_impl< InExpSet, OutExpSet >::visit_tuple< bool, Dummy >::work_().
|
inlinestatic |
Generate an expression for "e <+ f = e % f + f".
Definition at line 1483 of file parse.cc.
References add, complement, and conjunction.
Referenced by vcsn::rat::parser::parse().
auto vcsn::rat::project | ( | const InExpSet & | in_rs, |
const OutExpSet & | out_rs, | ||
const typename InExpSet::value_t & | v | ||
) | -> typename OutExpSet::value_t |
Project a rational expression.
Tape | the selected tape |
InExpSet | the input expressionset type |
OutExpSet | the output expressionset type |
Definition at line 163 of file project.hh.
References vcsn::v.
auto vcsn::rat::project | ( | const InExpSet & | in_rs, |
const typename InExpSet::value_t & | v | ||
) | -> typename InExpSet::template project_t<Tape>::value_t |
Project a rational expression.
Tape | the selected tape |
InExpSet | the expressionset type |
Definition at line 177 of file project.hh.
References vcsn::v.
dyn::expression vcsn::rat::read | ( | const dyn::context & | ctx, |
rat::identities | ids, | ||
std::istream & | is, | ||
const location & | l | ||
) |
The expression in stream is.
Definition at line 11 of file read.cc.
References ctx(), and vcsn::res.
Referenced by vcsn::dyn::read_expression().
size_t vcsn::rat::size | ( | const typename ExpSet::value_t & | r | ) |
size_t vcsn::rat::size | ( | const ExpSet & | rs, |
const typename ExpSet::value_t & | r | ||
) |
Referenced by vcsn::detail::bellman_ford_impl(), vcsn::detail::word_synchronizer< Aut >::dest_state(), vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_(), vcsn::are_isomorphicer< Aut1, Aut2 >::get_full_response_sequential(), vcsn::detail::synchronizer< Aut >::get_min_length_(), vcsn::detail::bounded_lag_checker< Aut >::get_size_tape(), vcsn::is_deterministic(), vcsn::is_synchronized_by(), vcsn::detail::tupleset_impl< ValueSets >::less(), vcsn::levenshtein(), vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::make_labelset_(), vcsn::minimize(), vcsn::num_tapes(), vcsn::detail::dijkstra_impl< Aut, ValueSet, Mul >::operator()(), vcsn::detail::a_star_impl< Aut >::operator()(), vcsn::nullableset< LabelSet >::size(), vcsn::detail::tupleset_impl< ValueSets >::size_(), vcsn::detail::epsilon_remover< Aut, has_one >::update_profile_(), and vcsn::rat::to_expansion_visitor< expressionset_t >::VCSN_RAT_VISIT().
std::string vcsn::rat::to_string | ( | identities | i | ) |
Wrapper around operator<<.
Definition at line 42 of file identities.cc.
References vcsn::rat::identities::agressive, vcsn::rat::identities::associative, BUILTIN_UNREACHABLE, vcsn::rat::identities::distributive, vcsn::rat::identities::ids(), vcsn::rat::identities::linear, vcsn::rat::identities::none, and vcsn::rat::identities::trivial.
Referenced by vcsn::rat::expansionset< expressionset_t >::complement_(), vcsn::rat::expansionset< ExpSet >::tuple_impl< Expansions >::denormalize_tape(), vcsn::rat::expressionset_impl< Context >::letter_class_(), vcsn::dyn::lift(), vcsn::snamer< std::integral_constant< T, Value > >::name(), vcsn::rat::constant_term_visitor< ExpSet >::operator()(), vcsn::rat::thompson_visitor< Aut, ExpSet >::operator()(), vcsn::rat::zpc_visitor< Aut, ExpSet >::operator()(), vcsn::rat::derivation_visitor< ExpSet >::operator()(), vcsn::rat::inductive_visitor< Aut, ExpSet, Tag >::operator()(), vcsn::rat::to_expansion_visitor< expressionset_t >::operator()(), vcsn::rat::standard_visitor< Aut, ExpSet >::operator()(), operator<<(), vcsn::rat::parser::parse(), vcsn::detail::focus_automaton_impl< Tape, Aut >::sname(), vcsn::dyn::to_integral_constant(), and vcsn::rat::expansionset< expressionset_t >::transpose().
|
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().
|
static |
Exponents in UTF-8.
Definition at line 59 of file printer.hh.