Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcsn::detail::derived_termer< RatExpSet > Struct Template Reference

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

#include <derived-term.hh>

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

Public Types

using ratexpset_t = RatExpSet
 
using ratexp_t = typename ratexpset_t::value_t
 
using context_t = context_t_of< ratexpset_t >
 
using weightset_t = weightset_t_of< context_t >
 
using automaton_t = ratexp_automaton< mutable_automaton< context_t >>
 
using state_t = state_t_of< automaton_t >
 
using polynomialset_t = rat::ratexp_polynomialset_t< ratexpset_t >
 Symbolic states: the derived terms are polynomials of ratexps. More...
 
using polynomial_t = typename polynomialset_t::value_t
 

Public Member Functions

 derived_termer (const ratexpset_t &rs, bool breaking=false)
 
automaton_t via_derivation (const ratexp_t &ratexp)
 Compute the derived-term automaton via derivation. More...
 
automaton_t via_expansion (const ratexp_t &ratexp)
 Compute the derived-term automaton via expansion. More...
 

Private Member Functions

void init_ (const ratexp_t &ratexp)
 

Private Attributes

ratexpset_t rs_
 The ratexp's set. More...
 
weightset_t ws_ = *rs_.weightset()
 Its weightset. More...
 
bool breaking_ = false
 Whether to break the polynomials. More...
 
automaton_t res_
 The resulting automaton. More...
 

Detailed Description

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

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 '' 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 that 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 neither case.

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

Member Typedef Documentation

template<typename RatExpSet >
using vcsn::detail::derived_termer< RatExpSet >::automaton_t = ratexp_automaton<mutable_automaton<context_t>>

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

template<typename RatExpSet >
using vcsn::detail::derived_termer< RatExpSet >::context_t = context_t_of<ratexpset_t>

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

template<typename RatExpSet >
using vcsn::detail::derived_termer< RatExpSet >::polynomial_t = typename polynomialset_t::value_t

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

template<typename RatExpSet >
using vcsn::detail::derived_termer< RatExpSet >::polynomialset_t = rat::ratexp_polynomialset_t<ratexpset_t>

Symbolic states: the derived terms are polynomials of ratexps.

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

template<typename RatExpSet >
using vcsn::detail::derived_termer< RatExpSet >::ratexp_t = typename ratexpset_t::value_t

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

template<typename RatExpSet >
using vcsn::detail::derived_termer< RatExpSet >::ratexpset_t = RatExpSet

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

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

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

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

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

Constructor & Destructor Documentation

template<typename RatExpSet >
vcsn::detail::derived_termer< RatExpSet >::derived_termer ( const ratexpset_t rs,
bool  breaking = false 
)
inline

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

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

Member Function Documentation

template<typename RatExpSet >
void vcsn::detail::derived_termer< RatExpSet >::init_ ( const ratexp_t ratexp)
inlineprivate
template<typename RatExpSet >
automaton_t vcsn::detail::derived_termer< RatExpSet >::via_derivation ( const ratexp_t ratexp)
inline

Compute the derived-term automaton via derivation.

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

References vcsn::detail::derived_termer< RatExpSet >::breaking_, vcsn::constant_term(), vcsn::derivation(), vcsn::detail::derived_termer< RatExpSet >::init_(), vcsn::detail::derived_termer< RatExpSet >::res_, and vcsn::detail::derived_termer< RatExpSet >::rs_.

Referenced by vcsn::derived_term_derivation().

Here is the call graph for this function:

template<typename RatExpSet >
automaton_t vcsn::detail::derived_termer< RatExpSet >::via_expansion ( const ratexp_t ratexp)
inline

Compute the derived-term automaton via expansion.

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

References vcsn::detail::derived_termer< RatExpSet >::breaking_, vcsn::expand(), vcsn::detail::derived_termer< RatExpSet >::init_(), vcsn::detail::derived_termer< RatExpSet >::res_, vcsn::detail::derived_termer< RatExpSet >::rs_, vcsn::split(), and vcsn::detail::derived_termer< RatExpSet >::ws_.

Referenced by vcsn::derived_term_expansion().

Here is the call graph for this function:

Member Data Documentation

template<typename RatExpSet >
bool vcsn::detail::derived_termer< RatExpSet >::breaking_ = false
private
template<typename RatExpSet >
weightset_t vcsn::detail::derived_termer< RatExpSet >::ws_ = *rs_.weightset()
private

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