Vcsn
2.0
Be Rational
|
Read-write on an automaton, that hides all tapes but one. More...
#include <blind.hh>
Public Types | |
using | automaton_t = Aut |
The type of the wrapped automaton. More... | |
using | automaton_nocv_t = blind_automaton< Tape, typename automaton_t::element_type::automaton_nocv_t > |
The type of automata to produce this kind of automata. More... | |
using | state_t = state_t_of< automaton_t > |
This automaton's state and transition types are those of the wrapped automaton. More... | |
using | transition_t = transition_t_of< automaton_t > |
using | full_context_t = context_t_of< automaton_t > |
Underlying automaton context. More... | |
using | full_labelset_t = typename full_context_t::labelset_t |
Underlying automaton labelset. More... | |
using | full_label_t = typename full_labelset_t::value_t |
Underlying automaton label. More... | |
using | context_t = blind_context_t< full_context_t, Tape > |
Exposed context. More... | |
using | labelset_t = typename context_t::labelset_t |
Exposed labelset. More... | |
using | labelset_ptr = typename context_t::labelset_ptr |
using | label_t = typename labelset_t::value_t |
using | weightset_t = typename context_t::weightset_t |
Exposed weightset. More... | |
using | weightset_ptr = typename context_t::weightset_ptr |
using | weight_t = typename weightset_t::value_t |
using | hidden_indices_t = concat_sequence< typename make_index_range< 0, Tape >::type, typename make_index_range< Tape+1, std::tuple_size< full_label_t >::value-Tape-1 >::type > |
Indices of the remaining tapes. More... | |
using | res_labelset_t = typename hidden_label_type< Aut, hidden_indices_t >::type |
using | res_label_t = typename res_labelset_t::value_t |
using | super_t = automaton_decorator< automaton_t, context_t > |
Public Types inherited from vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > > | |
using | automaton_t = Aut |
The type of automaton to wrap. More... | |
using | automaton_nocv_t = typename automaton_t::element_type::automaton_nocv_t |
The (shared pointer) type to use it we have to create an automaton of the same (underlying) type. More... | |
using | context_t = blind_context_t< context_t_of< Aut >, Tape > |
using | kind_t = typename context_t::kind_t |
using | labelset_t = typename context_t::labelset_t |
using | labelset_ptr = typename context_t::labelset_ptr |
using | label_t = typename labelset_t::value_t |
using | weightset_t = typename context_t::weightset_t |
using | weightset_ptr = typename context_t::weightset_ptr |
using | weight_t = typename weightset_t::value_t |
using | state_t = state_t_of< automaton_t > |
using | transition_t = transition_t_of< automaton_t > |
using | transitions_output_t = typename Aut::element_type::transitions_output_t |
Public Member Functions | |
blind_automaton_impl (const full_context_t &ctx) | |
blind_automaton_impl (const automaton_t &aut) | |
std::string | vname (bool full=true) const |
full_context_t | full_context () const |
context_t | context () const |
res_label_t | hidden_label_of (transition_t t) const |
res_label_t | hidden_one () const |
res_labelset_t | res_labelset () const |
std::shared_ptr< labelset_t > | labelset () const |
Apparent labelset. More... | |
auto | label_of (transition_t t) const -> label_t |
Apparent label of a transition. More... | |
auto | out (state_t s) const -> decltype(aut_->out(s)) |
std::vector< transition_t > | out (state_t s, const label_t &l) const |
Indexes of all transitions leaving state s on label l. More... | |
std::vector< transition_t > | in (state_t s, const label_t &l) const |
transition_t | get_transition (state_t src, state_t dst, label_t l) const |
bool | has_transition (state_t src, state_t dst, label_t l) const |
Apparent label of a transition. More... | |
void | del_transition (state_t src, state_t dst, label_t l) |
Apparent label of a transition. More... | |
template<typename A > | |
transition_t | new_transition_copy (state_t src, state_t dst, const A &aut, typename A::element_type::transition_t t, bool transpose=false) |
Copy the full wrapped transition. More... | |
template<typename A > | |
weight_t | add_transition_copy (state_t src, state_t dst, const A &aut, typename A::element_type::transition_t t, bool transpose=false) |
Copy the full wrapped transition. More... | |
auto | add_transition (state_t, state_t, label_t, weight_t) -> weight_t |
auto | add_transition (state_t, state_t, label_t) -> weight_t |
auto | new_transition (state_t, state_t, label_t, weight_t) -> transition_t |
auto | new_transition (state_t, state_t, label_t) -> transition_t |
auto | set_transition (state_t, state_t, label_t, weight_t) -> transition_t |
Public Member Functions inherited from vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > > | |
automaton_decorator (automaton_t aut) | |
automaton_decorator (const automaton_decorator &aut) | |
automaton_decorator (const context_t &ctx) | |
automaton_decorator (automaton_decorator &&aut) | |
automaton_decorator & | operator= (automaton_decorator &&that) |
automaton_t | strip () |
auto | all_in (Args &&...args) const -> decltype(aut_-> all_in(std::forward< Args >(args)...)) |
auto | all_out (Args &&...args) const -> decltype(aut_-> all_out(std::forward< Args >(args)...)) |
auto | all_states (Args &&...args) const -> decltype(aut_-> all_states(std::forward< Args >(args)...)) |
auto | all_transitions (Args &&...args) const -> decltype(aut_-> all_transitions(std::forward< Args >(args)...)) |
auto | context (Args &&...args) const -> decltype(aut_-> context(std::forward< Args >(args)...)) |
auto | dst_of (Args &&...args) const -> decltype(aut_-> dst_of(std::forward< Args >(args)...)) |
auto | final_transitions (Args &&...args) const -> decltype(aut_-> final _transitions(std |
auto | get_final_weight (Args &&...args) const -> decltype(aut_-> get_ final _weight(std |
auto | get_initial_weight (Args &&...args) const -> decltype(aut_-> get_initial_weight(std::forward< Args >(args)...)) |
auto | get_transition (Args &&...args) const -> decltype(aut_-> get_transition(std::forward< Args >(args)...)) |
auto | has_transition (Args &&...args) const -> decltype(aut_-> has_transition(std::forward< Args >(args)...)) |
auto | has_state (Args &&...args) const -> decltype(aut_-> has_state(std::forward< Args >(args)...)) |
auto | in (Args &&...args) const -> decltype(aut_-> in(std::forward< Args >(args)...)) |
auto | initial_transitions (Args &&...args) const -> decltype(aut_-> initial_transitions(std::forward< Args >(args)...)) |
auto | is_final (Args &&...args) const -> decltype(aut_-> is_ final(std |
auto | is_initial (Args &&...args) const -> decltype(aut_-> is_initial(std::forward< Args >(args)...)) |
auto | label_of (Args &&...args) const -> decltype(aut_-> label_of(std::forward< Args >(args)...)) |
auto | labelset (Args &&...args) const -> decltype(aut_-> labelset(std::forward< Args >(args)...)) |
auto | num_all_states (Args &&...args) const -> decltype(aut_-> num_all_states(std::forward< Args >(args)...)) |
auto | num_finals (Args &&...args) const -> decltype(aut_-> num_ final s(std |
auto | num_initials (Args &&...args) const -> decltype(aut_-> num_initials(std::forward< Args >(args)...)) |
auto | num_states (Args &&...args) const -> decltype(aut_-> num_states(std::forward< Args >(args)...)) |
auto | num_transitions (Args &&...args) const -> decltype(aut_-> num_transitions(std::forward< Args >(args)...)) |
auto | out (Args &&...args) const -> decltype(aut_-> out(std::forward< Args >(args)...)) |
auto | outin (Args &&...args) const -> decltype(aut_-> outin(std::forward< Args >(args)...)) |
auto | print_state (Args &&...args) const -> decltype(aut_-> print_state(std::forward< Args >(args)...)) |
auto | print_state_name (Args &&...args) const -> decltype(aut_-> print_state_name(std::forward< Args >(args)...)) |
auto | src_of (Args &&...args) const -> decltype(aut_-> src_of(std::forward< Args >(args)...)) |
auto | state_has_name (Args &&...args) const -> decltype(aut_-> state_has_name(std::forward< Args >(args)...)) |
auto | states (Args &&...args) const -> decltype(aut_-> states(std::forward< Args >(args)...)) |
auto | transitions (Args &&...args) const -> decltype(aut_-> transitions(std::forward< Args >(args)...)) |
auto | vname (Args &&...args) const -> decltype(aut_-> vname(std::forward< Args >(args)...)) |
auto | weight_of (Args &&...args) const -> decltype(aut_-> weight_of(std::forward< Args >(args)...)) |
auto | weightset (Args &&...args) const -> decltype(aut_-> weightset(std::forward< Args >(args)...)) |
auto | add_final (Args &&...args) -> decltype(aut_-> add_ final(std |
auto | add_initial (Args &&...args) -> decltype(aut_-> add_initial(std::forward< Args >(args)...)) |
auto | add_transition (Args &&...args) -> decltype(aut_-> add_transition(std::forward< Args >(args)...)) |
auto | add_transition_copy (Args &&...args) -> decltype(aut_-> add_transition_copy(std::forward< Args >(args)...)) |
auto | add_weight (Args &&...args) -> decltype(aut_-> add_weight(std::forward< Args >(args)...)) |
auto | del_state (Args &&...args) -> decltype(aut_-> del_state(std::forward< Args >(args)...)) |
auto | del_transition (Args &&...args) -> decltype(aut_-> del_transition(std::forward< Args >(args)...)) |
auto | lmul_weight (Args &&...args) -> decltype(aut_-> lmul_weight(std::forward< Args >(args)...)) |
auto | new_state (Args &&...args) -> decltype(aut_-> new_state(std::forward< Args >(args)...)) |
auto | new_transition (Args &&...args) -> decltype(aut_-> new_transition(std::forward< Args >(args)...)) |
auto | new_transition_copy (Args &&...args) -> decltype(aut_-> new_transition_copy(std::forward< Args >(args)...)) |
auto | rmul_weight (Args &&...args) -> decltype(aut_-> rmul_weight(std::forward< Args >(args)...)) |
auto | set_final (Args &&...args) -> decltype(aut_-> set_ final(std |
auto | set_initial (Args &&...args) -> decltype(aut_-> set_initial(std::forward< Args >(args)...)) |
auto | set_transition (Args &&...args) -> decltype(aut_-> set_transition(std::forward< Args >(args)...)) |
auto | set_weight (Args &&...args) -> decltype(aut_-> set_weight(std::forward< Args >(args)...)) |
auto | unset_final (Args &&...args) -> decltype(aut_-> unset_ final(std |
auto | unset_initial (Args &&...args) -> decltype(aut_-> unset_initial(std::forward< Args >(args)...)) |
Static Public Member Functions | |
static std::string | sname () |
Static Public Member Functions inherited from vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > > | |
static constexpr auto | null_state (Args &&...args) -> decltype(automaton_t::element_type::null_state(std::forward< Args >(args)...)) |
static constexpr auto | null_transition (Args &&...args) -> decltype(automaton_t::element_type::null_transition(std::forward< Args >(args)...)) |
static constexpr auto | post (Args &&...args) -> decltype(automaton_t::element_type::post(std::forward< Args >(args)...)) |
static constexpr auto | pre (Args &&...args) -> decltype(automaton_t::element_type::pre(std::forward< Args >(args)...)) |
static constexpr auto | sname (Args &&...args) -> decltype(automaton_t::element_type::sname(std::forward< Args >(args)...)) |
Private Member Functions | |
template<std::size_t... I> | |
res_label_t | hidden_label_of_ (transition_t t, index_sequence< I...>) const |
template<typename L , std::size_t... I> | |
std::enable_if< L::has_one(), res_label_t >::type | hidden_one_ (index_sequence< I...>) const |
template<typename L , std::size_t... I> | |
std::enable_if<!L::has_one(), res_label_t >::type | hidden_one_ (index_sequence< I...>) const |
template<std::size_t... I> | |
res_labelset_t | res_labelset_ (index_sequence< I...>) const |
Static Private Member Functions | |
static label_t | hide_ (full_label_t l) |
Private Attributes | |
hidden_indices_t | hidden_indices {} |
context_t | context_ = blind_context<Tape>(full_context()) |
Our apparent context. More... | |
Additional Inherited Members | |
Protected Attributes inherited from vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > > | |
automaton_t | aut_ |
The wrapped automaton, possibly const. More... | |
Read-write on an automaton, that hides all tapes but one.
using vcsn::detail::blind_automaton_impl< Tape, Aut >::automaton_nocv_t = blind_automaton<Tape, typename automaton_t::element_type::automaton_nocv_t> |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::automaton_t = Aut |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::context_t = blind_context_t<full_context_t, Tape> |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::full_context_t = context_t_of<automaton_t> |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::full_label_t = typename full_labelset_t::value_t |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::full_labelset_t = typename full_context_t::labelset_t |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::hidden_indices_t = concat_sequence <typename make_index_range<0, Tape>::type, typename make_index_range<Tape + 1, std::tuple_size<full_label_t>::value - Tape - 1>::type> |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::label_t = typename labelset_t::value_t |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::labelset_ptr = typename context_t::labelset_ptr |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::labelset_t = typename context_t::labelset_t |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::res_label_t = typename res_labelset_t::value_t |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::res_labelset_t = typename hidden_label_type<Aut, hidden_indices_t>::type |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::state_t = state_t_of<automaton_t> |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::super_t = automaton_decorator<automaton_t, context_t> |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::transition_t = transition_t_of<automaton_t> |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::weight_t = typename weightset_t::value_t |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::weightset_ptr = typename context_t::weightset_ptr |
using vcsn::detail::blind_automaton_impl< Tape, Aut >::weightset_t = typename context_t::weightset_t |
|
inline |
|
inline |
|
inline |
|
inline |
Copy the full wrapped transition.
Definition at line 297 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_, and vcsn::transpose().
|
inline |
Definition at line 135 of file blind.hh.
References vcsn::detail::blind_automaton_impl< Tape, Aut >::context_.
|
inline |
Apparent label of a transition.
Definition at line 275 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_, and vcsn::detail::blind_automaton_impl< Tape, Aut >::get_transition().
|
inline |
Definition at line 130 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_.
|
inline |
Definition at line 257 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_, and vcsn::detail::blind_automaton_impl< Tape, Aut >::out().
Referenced by vcsn::detail::blind_automaton_impl< Tape, Aut >::del_transition(), and vcsn::detail::blind_automaton_impl< Tape, Aut >::has_transition().
|
inline |
Apparent label of a transition.
Definition at line 267 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_, and vcsn::detail::blind_automaton_impl< Tape, Aut >::get_transition().
|
inline |
Definition at line 141 of file blind.hh.
References vcsn::detail::blind_automaton_impl< Tape, Aut >::hidden_indices, and vcsn::detail::blind_automaton_impl< Tape, Aut >::hidden_label_of_().
|
inlineprivate |
Definition at line 176 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_.
Referenced by vcsn::detail::blind_automaton_impl< Tape, Aut >::hidden_label_of().
|
inline |
Definition at line 147 of file blind.hh.
References vcsn::detail::blind_automaton_impl< Tape, Aut >::hidden_indices.
|
inlineprivate |
Definition at line 184 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_.
|
inlineprivate |
|
inlinestaticprivate |
Definition at line 170 of file blind.hh.
Referenced by vcsn::detail::blind_automaton_impl< Tape, Aut >::label_of().
|
inline |
Definition at line 245 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_, vcsn::detail::blind_automaton_impl< Tape, Aut >::label_of(), and vcsn::detail::blind_automaton_impl< Tape, Aut >::labelset().
|
inline |
Apparent label of a transition.
Definition at line 210 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_, and vcsn::detail::blind_automaton_impl< Tape, Aut >::hide_().
Referenced by vcsn::detail::blind_automaton_impl< Tape, Aut >::in(), and vcsn::detail::blind_automaton_impl< Tape, Aut >::out().
|
inline |
Apparent labelset.
Definition at line 160 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_.
Referenced by vcsn::detail::blind_automaton_impl< Tape, Aut >::in(), and vcsn::detail::blind_automaton_impl< Tape, Aut >::out().
|
inline |
|
inline |
|
inline |
Copy the full wrapped transition.
Definition at line 285 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_, and vcsn::transpose().
|
inline |
Definition at line 219 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_.
Referenced by vcsn::detail::blind_automaton_impl< Tape, Aut >::get_transition().
|
inline |
Indexes of all transitions leaving state s on label l.
Invalidated by del_transition() and del_state().
FIXME: costly structure.
Definition at line 230 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_, vcsn::detail::blind_automaton_impl< Tape, Aut >::label_of(), and vcsn::detail::blind_automaton_impl< Tape, Aut >::labelset().
|
inline |
Definition at line 153 of file blind.hh.
References vcsn::detail::blind_automaton_impl< Tape, Aut >::hidden_indices, and vcsn::detail::blind_automaton_impl< Tape, Aut >::res_labelset_().
|
inlineprivate |
Definition at line 198 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_.
Referenced by vcsn::detail::blind_automaton_impl< Tape, Aut >::res_labelset().
|
inline |
|
inlinestatic |
Definition at line 118 of file blind.hh.
References vcsn::sname(), and vcsn::rat::to_string().
|
inline |
Definition at line 124 of file blind.hh.
References vcsn::detail::automaton_decorator< Aut, blind_context_t< context_t_of< Aut >, Tape > >::aut_, and vcsn::rat::to_string().
|
private |
Our apparent context.
This is not a luxury to cache it: benches show that in some cases, intensive (and admittedly wrong: they should have been cached on the caller side) calls to context() ruins the performances.
Definition at line 329 of file blind.hh.
Referenced by vcsn::detail::blind_automaton_impl< Tape, Aut >::context().
|
private |
Definition at line 168 of file blind.hh.
Referenced by vcsn::detail::blind_automaton_impl< Tape, Aut >::hidden_label_of(), vcsn::detail::blind_automaton_impl< Tape, Aut >::hidden_one(), and vcsn::detail::blind_automaton_impl< Tape, Aut >::res_labelset().