Vcsn  2.1
Be Rational
vcsn::detail::derived_termer< ExpSet > Struct Template Reference

Compute the derived-term automaton from an expression. More...

#include <derived-term.hh>

Collaboration diagram for vcsn::detail::derived_termer< ExpSet >:

Public Types

using expressionset_t = ExpSet
 
using expression_t = typename expressionset_t::value_t
 
using context_t = context_t_of< expressionset_t >
 
using weightset_t = weightset_t_of< context_t >
 
using automaton_t = expression_automaton< mutable_automaton< context_t >>
 
using state_t = state_t_of< automaton_t >
 

Public Member Functions

 derived_termer (const expressionset_t &rs, derived_term_algo algo)
 
automaton_t operator() (const expression_t &expression)
 Compute the derived-term automaton. More...
 
automaton_t via_derivation (const expression_t &expression)
 Compute the derived-term automaton via derivation. More...
 
automaton_t via_expansion (const expression_t &expression)
 Compute the derived-term automaton via expansion. More...
 

Private Types

using polynomialset_t = rat::expression_polynomialset_t< expressionset_t >
 The polynomialset for expressions. More...
 

Private Member Functions

void init_ (const expression_t &expression)
 

Private Attributes

expressionset_t rs_
 The expression's set. More...
 
weightset_t ws_ = *rs_.weightset()
 Its weightset. More...
 
polynomialset_t ps_ = make_expression_polynomialset(rs_)
 
derived_term_algo algo_
 How derived terms are computed. More...
 
automaton_t res_
 The resulting automaton. More...
 

Detailed Description

template<typename ExpSet>
struct vcsn::detail::derived_termer< ExpSet >

Compute the derived-term automaton from an expression.

Supports derivation/expansion as its core computation, with breaking/non breaking flavors for both.

The handling of initial and final states can be simplified by working on a delimited rational expression ($r$ with $ being the special label), and mapping $r$ to pre(), and \e to post(). Then, there is no special treatment needed to handle the initial split in the case of a breaking derivation, and there is no special need to handle the final transitions.

However there are two problems.

One is that derivation loops over the alphabets, so we have to add $, the special label, to the alphabet. But then, the handling of complement starts making idiotic things by trying to add $-labels in inner transitions. This is a real problem, with no clear work-around.

But this is not an issue for expansion-based construction. However it means that the states are no longer labeled by the expressions as the user would expect them: there is always the terminating $. Not showing it does not address the issue, which is why we'd rather not have it at all.

So, after experimentation, as of 2014-10, I prefer not to use the pre/post based construct in either case.

Definition at line 102 of file derived-term.hh.

Member Typedef Documentation

Definition at line 110 of file derived-term.hh.

template<typename ExpSet >
using vcsn::detail::derived_termer< ExpSet >::context_t = context_t_of<expressionset_t>

Definition at line 107 of file derived-term.hh.

template<typename ExpSet >
using vcsn::detail::derived_termer< ExpSet >::expression_t = typename expressionset_t::value_t

Definition at line 105 of file derived-term.hh.

template<typename ExpSet >
using vcsn::detail::derived_termer< ExpSet >::expressionset_t = ExpSet

Definition at line 104 of file derived-term.hh.

template<typename ExpSet >
using vcsn::detail::derived_termer< ExpSet >::polynomialset_t = rat::expression_polynomialset_t<expressionset_t>
private

The polynomialset for expressions.

Definition at line 208 of file derived-term.hh.

template<typename ExpSet >
using vcsn::detail::derived_termer< ExpSet >::state_t = state_t_of<automaton_t>

Definition at line 111 of file derived-term.hh.

template<typename ExpSet >
using vcsn::detail::derived_termer< ExpSet >::weightset_t = weightset_t_of<context_t>

Definition at line 108 of file derived-term.hh.

Constructor & Destructor Documentation

template<typename ExpSet >
vcsn::detail::derived_termer< ExpSet >::derived_termer ( const expressionset_t rs,
derived_term_algo  algo 
)
inline

Definition at line 113 of file derived-term.hh.

References vcsn::detail::derived_termer< ExpSet >::rs_.

Member Function Documentation

template<typename ExpSet >
void vcsn::detail::derived_termer< ExpSet >::init_ ( const expression_t expression)
inlineprivate
template<typename ExpSet >
automaton_t vcsn::detail::derived_termer< ExpSet >::operator() ( const expression_t expression)
inline

Compute the derived-term automaton.

Definition at line 120 of file derived-term.hh.

References vcsn::detail::derived_term_algo::algo, vcsn::detail::derived_termer< ExpSet >::algo_, vcsn::detail::derived_term_algo::derivation, vcsn::detail::derived_termer< ExpSet >::via_derivation(), and vcsn::detail::derived_termer< ExpSet >::via_expansion().

Here is the call graph for this function:

template<typename ExpSet >
automaton_t vcsn::detail::derived_termer< ExpSet >::via_derivation ( const expression_t expression)
inline
template<typename ExpSet >
automaton_t vcsn::detail::derived_termer< ExpSet >::via_expansion ( const expression_t expression)
inline

Member Data Documentation

template<typename ExpSet >
polynomialset_t vcsn::detail::derived_termer< ExpSet >::ps_ = make_expression_polynomialset(rs_)
private
template<typename ExpSet >
weightset_t vcsn::detail::derived_termer< ExpSet >::ws_ = *rs_.weightset()
private

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