Vcsn
2.0
Be Rational
|
Compute the derived-term automaton from an expression. More...
#include <derived-term.hh>
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... | |
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.
using vcsn::detail::derived_termer< RatExpSet >::automaton_t = ratexp_automaton<mutable_automaton<context_t>> |
Definition at line 62 of file derived-term.hh.
using vcsn::detail::derived_termer< RatExpSet >::context_t = context_t_of<ratexpset_t> |
Definition at line 59 of file derived-term.hh.
using vcsn::detail::derived_termer< RatExpSet >::polynomial_t = typename polynomialset_t::value_t |
Definition at line 67 of file derived-term.hh.
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.
using vcsn::detail::derived_termer< RatExpSet >::ratexp_t = typename ratexpset_t::value_t |
Definition at line 57 of file derived-term.hh.
using vcsn::detail::derived_termer< RatExpSet >::ratexpset_t = RatExpSet |
Definition at line 56 of file derived-term.hh.
using vcsn::detail::derived_termer< RatExpSet >::state_t = state_t_of<automaton_t> |
Definition at line 63 of file derived-term.hh.
using vcsn::detail::derived_termer< RatExpSet >::weightset_t = weightset_t_of<context_t> |
Definition at line 60 of file derived-term.hh.
|
inline |
Definition at line 69 of file derived-term.hh.
References vcsn::detail::derived_termer< RatExpSet >::rs_.
|
inlineprivate |
Definition at line 122 of file derived-term.hh.
References vcsn::detail::derived_termer< RatExpSet >::breaking_, vcsn::detail::derived_termer< RatExpSet >::res_, vcsn::detail::derived_termer< RatExpSet >::rs_, vcsn::split(), and vcsn::detail::derived_termer< RatExpSet >::ws_.
Referenced by vcsn::detail::derived_termer< RatExpSet >::via_derivation(), and vcsn::detail::derived_termer< RatExpSet >::via_expansion().
|
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().
|
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().
|
private |
Whether to break the polynomials.
Definition at line 136 of file derived-term.hh.
Referenced by vcsn::detail::derived_termer< RatExpSet >::init_(), vcsn::detail::derived_termer< RatExpSet >::via_derivation(), and vcsn::detail::derived_termer< RatExpSet >::via_expansion().
|
private |
The resulting automaton.
Definition at line 138 of file derived-term.hh.
Referenced by vcsn::detail::derived_termer< RatExpSet >::init_(), vcsn::detail::derived_termer< RatExpSet >::via_derivation(), and vcsn::detail::derived_termer< RatExpSet >::via_expansion().
|
private |
The ratexp's set.
Definition at line 132 of file derived-term.hh.
Referenced by vcsn::detail::derived_termer< RatExpSet >::derived_termer(), vcsn::detail::derived_termer< RatExpSet >::init_(), vcsn::detail::derived_termer< RatExpSet >::via_derivation(), and vcsn::detail::derived_termer< RatExpSet >::via_expansion().
|
private |
Its weightset.
Definition at line 134 of file derived-term.hh.
Referenced by vcsn::detail::derived_termer< RatExpSet >::init_(), and vcsn::detail::derived_termer< RatExpSet >::via_expansion().