Vcsn
2.0
Be Rational
|
Format automaton to EFSM format, based on FSM format. More...
#include <efsm.hh>
Public Member Functions | |
void | operator() () |
Actually output aut_ on os_. More... | |
Public Member Functions inherited from vcsn::detail::outputter< Aut > | |
outputter (const automaton_t &aut, std::ostream &out) | |
Protected Types | |
using | automaton_t = Aut |
using | super_t = outputter< Aut > |
using | label_t = typename super_t::label_t |
using | state_t = typename super_t::state_t |
using | transition_t = typename super_t::transition_t |
Protected Types inherited from vcsn::detail::outputter< Aut > | |
using | automaton_t = Aut |
using | context_t = context_t_of< automaton_t > |
using | label_t = label_t_of< automaton_t > |
using | transition_t = transition_t_of< automaton_t > |
using | weightset_t = weightset_t_of< automaton_t > |
using | weight_t = weight_t_of< automaton_t > |
using | states_t = std::vector< state_t > |
A list of states. More... | |
Private Types | |
using | is_transducer_t = std::integral_constant< bool, 2<=rank< labelset_t_of< automaton_t >>::value > |
Whether is a transducer (two-tape automaton) as opposed to an acceptor. More... | |
Private Member Functions | |
template<typename LS > | |
void | output_label_ (const LS &ls, const typename LS::value_t &l) |
template<typename Label > | |
void | output_label_ (const Label &l, std::false_type) |
Acceptor. More... | |
template<typename Label > | |
void | output_label_ (const Label &l, std::true_type) |
Two-tape automaton. More... | |
void | output_transition_ (const transition_t t) |
void | output_transitions_ () |
Output all the transitions, and final states. More... | |
template<typename LabelSet , typename Labels , typename GetLabel > | |
auto | add_alphabet (const LabelSet &ls, Labels &labels, GetLabel get_label, int) -> decltype(ls.genset(), void()) |
template<typename LabelSet , typename Labels , typename GetLabel > | |
void | add_alphabet (const LabelSet &, Labels &, GetLabel, long) |
template<typename LabelSet , typename GetLabel > | |
void | output_symbols_ (const std::string &name, const LabelSet &ls, GetLabel get_label) |
Output the mapping from label name, to label number. More... | |
template<typename > | |
void | output_symbols_impl_ (std::false_type) |
Labels of an acceptor. More... | |
template<typename > | |
void | output_symbols_impl_ (std::true_type) |
Labels of a two-tape automaton. More... | |
void | output_symbols_ () |
Private Attributes | |
const is_transducer_t | is_transducer = {} |
const char * | isymbols_ |
File name for input tape symbols. More... | |
const char * | osymbols_ |
File name for output tape symbols. More... | |
Additional Inherited Members | |
Public Types inherited from vcsn::detail::outputter< Aut > | |
using | state_t = state_t_of< automaton_t > |
Protected Member Functions inherited from vcsn::detail::outputter< Aut > | |
virtual std::string | label_ (const label_t &l) |
Convert a label to its representation. More... | |
virtual void | output_transition_ (transition_t t) |
Output the transition t. More... | |
std::ostream & | print_entry_ (state_t src, state_t dst, std::ostream &os, const std::string &fmt="text") |
The labels and weights of transitions from src to dst. More... | |
void | output_state_ (const state_t s) |
Output transitions, sorted lexicographically on (Label, Dest). More... | |
void | output_transitions_ () |
Output transitions, sorted lexicographically. More... | |
void | list_states_ (const states_t &ss) |
List names of states in ss, preceded by ' '. More... | |
states_t | initials_ () |
The list of initial states, sorted. More... | |
states_t | finals_ () |
The list of final states, sorted. More... | |
Protected Attributes inherited from vcsn::detail::outputter< Aut > | |
const automaton_t & | aut_ |
The automaton we have to output. More... | |
std::ostream & | os_ |
Output stream. More... | |
const labelset_t_of < automaton_t > & | ls_ = *aut_->labelset() |
Short-hand to the labelset. More... | |
const weightset_t & | ws_ = *aut_->weightset() |
Short-hand to the weightset. More... | |
const polynomialset < context_t_of< automaton_t > > | ps_ {aut_->context()} |
Short-hand to the polynomialset used to print the entries. More... | |
Format automaton to EFSM format, based on FSM format.
Aut | an automaton type, not a pointer type. |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlineprivate |
Definition at line 184 of file efsm.hh.
Referenced by vcsn::detail::efsmer< Aut >::output_symbols_().
|
inlineprivate |
|
inline |
Actually output aut_ on os_.
Definition at line 59 of file efsm.hh.
References vcsn::detail::efsmer< Aut >::is_transducer, vcsn::detail::efsmer< Aut >::isymbols_, vcsn::detail::outputter< Aut >::os_, vcsn::detail::efsmer< Aut >::osymbols_, vcsn::detail::efsmer< Aut >::output_symbols_(), and vcsn::detail::efsmer< Aut >::output_transitions_().
|
inlineprivate |
Definition at line 101 of file efsm.hh.
References vcsn::detail::outputter< Aut >::os_.
Referenced by vcsn::detail::efsmer< Aut >::output_label_(), and vcsn::detail::efsmer< Aut >::output_transition_().
|
inlineprivate |
Acceptor.
Definition at line 111 of file efsm.hh.
References vcsn::detail::outputter< Aut >::ls_, and vcsn::detail::efsmer< Aut >::output_label_().
|
inlineprivate |
Two-tape automaton.
Definition at line 118 of file efsm.hh.
References vcsn::detail::outputter< Aut >::ls_, vcsn::detail::outputter< Aut >::os_, and vcsn::detail::efsmer< Aut >::output_label_().
|
inlineprivate |
Output the mapping from label name, to label number.
The FSM format uses integers for labels. Reserve 0 for epsilon (and the special symbol, that flags initial and final transitions).
Instead of directly printing the labels, use a projection function. So when printing transducers, this function is used twice, once for each tape, with a projection function from two-tape labels to either one.
LabelSet | the type of the labelset of the labels to declare. |
GetLabel | the type of the lambda to apply to project the labels. |
name | name of the files to create (e.g., "isymbols.txt"). |
ls | The LabelSet to use to print the labels. |
get_label | A projection from exact labels to the one we output. |
Definition at line 220 of file efsm.hh.
References vcsn::detail::efsmer< Aut >::add_alphabet(), vcsn::detail::outputter< Aut >::aut_, and vcsn::detail::outputter< Aut >::os_.
|
inlineprivate |
Definition at line 274 of file efsm.hh.
References vcsn::detail::efsmer< Aut >::is_transducer.
Referenced by vcsn::detail::efsmer< Aut >::operator()(), and vcsn::detail::efsmer< Aut >::output_symbols_impl_().
|
inlineprivate |
Labels of an acceptor.
Definition at line 253 of file efsm.hh.
References vcsn::detail::efsmer< Aut >::isymbols_, vcsn::detail::outputter< Aut >::ls_, and vcsn::detail::efsmer< Aut >::output_symbols_().
|
inlineprivate |
Labels of a two-tape automaton.
Definition at line 263 of file efsm.hh.
References vcsn::detail::efsmer< Aut >::isymbols_, vcsn::detail::outputter< Aut >::ls_, vcsn::detail::efsmer< Aut >::osymbols_, and vcsn::detail::efsmer< Aut >::output_symbols_().
|
inlineprivate |
Definition at line 125 of file efsm.hh.
References vcsn::detail::outputter< Aut >::aut_, vcsn::detail::efsmer< Aut >::is_transducer, vcsn::detail::outputter< Aut >::os_, vcsn::detail::efsmer< Aut >::output_label_(), and vcsn::detail::outputter< Aut >::ws_.
Referenced by vcsn::detail::efsmer< Aut >::output_transitions_().
|
inlineprivate |
Output all the transitions, and final states.
Definition at line 144 of file efsm.hh.
References vcsn::detail::outputter< Aut >::aut_, vcsn::detail::outputter< Aut >::os_, vcsn::detail::outputter< Aut >::output_state_(), vcsn::detail::efsmer< Aut >::output_transition_(), vcsn::sort(), and vcsn::detail::outputter< Aut >::ws_.
Referenced by vcsn::detail::efsmer< Aut >::operator()().
|
private |
Definition at line 284 of file efsm.hh.
Referenced by vcsn::detail::efsmer< Aut >::operator()(), vcsn::detail::efsmer< Aut >::output_symbols_(), and vcsn::detail::efsmer< Aut >::output_transition_().
|
private |
File name for input tape symbols.
Definition at line 287 of file efsm.hh.
Referenced by vcsn::detail::efsmer< Aut >::operator()(), and vcsn::detail::efsmer< Aut >::output_symbols_impl_().
|
private |
File name for output tape symbols.
Definition at line 290 of file efsm.hh.
Referenced by vcsn::detail::efsmer< Aut >::operator()(), and vcsn::detail::efsmer< Aut >::output_symbols_impl_().