Vcsn
2.2
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 | copier |
Functor to copy/convert a rational expression. More... | |
class | derivation_visitor |
Functor to compute the derivation of an expression. 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... | |
class | expand_visitor |
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 | 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 | position |
Abstract a position. More... | |
class | printer |
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 | prod = variadic< type_t::prod, Context > |
template<typename Context > | |
using | conjunction = variadic< type_t::conjunction, Context > |
template<typename Context > | |
using | infiltration = variadic< type_t::infiltration, 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 | 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::sum, type_t::prod, type_t::ldiv, type_t::conjunction, type_t::shuffle, type_t::infiltration, type_t::star, type_t::transposition, type_t::lweight, type_t::rweight, type_t::complement, type_t::tuple } |
The possible types of expressions. More... | |
enum | precedence_t { precedence_t::sum, precedence_t::tuple, precedence_t::products, precedence_t::shuffle = products, precedence_t::conjunction = products, precedence_t::infiltration = products, precedence_t::ldiv, precedence_t::prod, precedence_t::word = prod, 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 > | |
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) |
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 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... | |
static std::istream & | operator>> (std::istream &is, identities::ids_t &ids) |
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::class_t = typedef std::set<std::pair<std::string, std::string>> |
using vcsn::rat::complement = typedef unary<type_t::complement, 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::infiltration = typedef variadic<type_t::infiltration, Context> |
using vcsn::rat::irange_type = typedef std::tuple<int, int> |
using vcsn::rat::ldiv = typedef variadic<type_t::ldiv, Context> |
using vcsn::rat::lweight = typedef weight_node<type_t::lweight, Context> |
using vcsn::rat::one = typedef constant<type_t::one, Context> |
using vcsn::rat::prod = typedef variadic<type_t::prod, 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::sum = typedef variadic<type_t::sum, 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 | |
---|---|
sum | |
tuple | |
products | |
shuffle | |
conjunction | |
infiltration | |
ldiv | |
prod | |
word | |
lweight | |
rweight | |
unary | |
star | |
complement | |
transposition | |
exponent | |
zero | |
one | |
atom |
Definition at line 34 of file printer.hh.
|
strong |
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 183 of file copy.hh.
Referenced by vcsn::rat::expressionset_impl< Context >::conv(), vcsn::dyn::detail::copy_expression(), and vcsn::rat::copier< InExpSet, OutExpSet >::visit_tuple< bool, 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::cerny(), vcsn::rat::driver::context(), vcsn::de_bruijn(), vcsn::divkbaseb(), vcsn::double_ring(), vcsn::dyn::eval(), vcsn::join_weightset_expressionset(), vcsn::dyn::left_mult(), vcsn::rat::expressionset_impl< Context >::make(), vcsn::detail::polynomialset_impl< Context, Kind >::make(), vcsn::dyn::make_context(), vcsn::make_mutable_automaton(), vcsn::detail::make_proper_context(), vcsn::detail::make_word_polynomialset(), vcsn::minimize(), vcsn::detail::pair_automaton_impl< Aut >::pair_automaton_impl(), vcsn::rat::parser::parse(), vcsn::detail::project(), vcsn::random_automaton(), vcsn::random_automaton_deterministic(), read(), vcsn::dyn::read_efsm(), vcsn::dyn::read_expression(), vcsn::read_label(), vcsn::read_polynomial(), vcsn::read_weight(), vcsn::lazy_automaton_editor::result(), vcsn::dyn::right_mult(), vcsn::thompson(), vcsn::dyn::thompson(), vcsn::tuple_context(), vcsn::tuple_expressionset(), vcsn::u(), vcsn::detail::lifter_impl< Context, vcsn::detail::index_sequence<> >::value(), vcsn::dyn::weight_series(), vcsn::zpc(), and vcsn::dyn::zpc().
|
static |
The nesting limit for parser traces, as specified per $YYDEBUG.
Definition at line 88 of file driver.cc.
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::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 59 of file fwd.hh.
Referenced by vcsn::rat::exp::is_leaf().
|
inline |
Whether star, complement.
Definition at line 66 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 74 of file fwd.hh.
References conjunction, infiltration, ldiv, prod, shuffle, and sum.
|
inline |
From a ExpSet to its polynomialset.
Definition at line 33 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 367 of file printer.hh.
References vcsn::detail::rs.
Referenced by vcsn::rat::expressionset_impl< Context >::print(), and vcsn::rat::printer< ExpSet >::visit_tuple< bool, Dummy >::print_().
identities vcsn::rat::meet | ( | identities | i1, |
identities | i2 | ||
) |
Definition at line 72 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.
Join two locations, in place.
Definition at line 115 of file location.hh.
Add width columns, in place.
Definition at line 119 of file position.hh.
Add width columns to the end position, in place.
Definition at line 128 of file location.hh.
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 |
Definition at line 14 of file printer.hxx.
References CASE.
std::ostream & vcsn::rat::operator<< | ( | std::ostream & | os, |
identities | i | ||
) |
Output in string form.
Definition at line 35 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, and vcsn::rat::location::end.
Compare two position objects.
Definition at line 148 of file position.hh.
Compare two location objects.
Definition at line 154 of file location.hh.
|
static |
Definition at line 40 of file identities.cc.
References vcsn::rat::identities::associative, vcsn::rat::identities::deflt, vcsn::rat::identities::distributive, is, vcsn::rat::identities::linear, vcsn::rat::identities::none, and vcsn::rat::identities::trivial.
std::istream & vcsn::rat::operator>> | ( | std::istream & | is, |
identities & | i | ||
) |
|
inlinestatic |
Generate an expression for "e <+ f = e % f + f".
Definition at line 1461 of file parse.cc.
References complement, conjunction, and sum.
Referenced by vcsn::rat::parser::parse().
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().
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::detail::project(), 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 17 of file identities.cc.
References 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< ExpSet >::tuple_impl< Expansions >::denormalize_tape(), vcsn::rat::expressionset_impl< Context >::letter_class_(), vcsn::dyn::lift(), vcsn::snamer< std::integral_constant< T, Value > >::name(), operator<<(), vcsn::rat::parser::parse(), vcsn::detail::focus_automaton_impl< Tape, Aut >::sname(), and vcsn::dyn::to_integral_constant().
|
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 58 of file printer.hh.