1 #ifndef VCSN_CORE_PERMUTATION_DECORATOR_HH
2 # define VCSN_CORE_PERMUTATION_DECORATOR_HH
6 # include <unordered_map>
18 template <
typename Aut>
19 class permutation_automaton_impl
20 :
public automaton_decorator<typename Aut::element_type::automaton_nocv_t>
51 std::string
vname(
bool full =
true)
const
53 return "permutation_automaton<" +
input_->vname(full) +
">";
63 const std::string& fmt =
"text",
64 bool delimit =
false)
const
66 return input_->print_state_name(
origins().at(s), o, fmt, delimit);
75 auto i =
map_.find(s);
76 if (i == std::end(
map_))
95 for (
const auto& p:
map_)
100 using pair_t = std::pair<state_name_t, state_t>;
104 std::unordered_map<state_name_t, state_t>
map_;
114 #endif // ! VCSN_CORE_PERMUTATION_DECORATOR_HH
permutation_automaton_impl(const automaton_t &input)
std::map< state_t, state_name_t > origins_t
A map from each state to the origin state set it stands for.
std::string vname(bool full=true) const
Dynamic name.
state_t_of< automaton_t > state_name_t
Symbolic state name: input automaton state type.
Aut automaton_t
Input automaton type.
bool state_has_name(state_t s) const
std::queue< pair_t > todo_
static std::string sname()
Static name.
auto new_state(Args &&...args) -> decltype(aut_-> new_state(std::forward< Args >(args)...))
const origins_t & origins() const
Ordered map: state -> its derived term.
state_t_of< automaton_nocv_t > state_t
Sorted automaton state type.
Aggregate an automaton, and forward calls to it.
typename automaton_t::element_type::automaton_nocv_t automaton_nocv_t
Sorted automaton type.
std::ostream & print_state_name(state_t s, std::ostream &o, const std::string &fmt="text", bool delimit=false) const
const automaton_t input_
Input automaton.
auto real_context(const Aut &aut) -> decltype(real_context_impl< Aut >::context(aut))
std::pair< state_name_t, state_t > pair_t
static constexpr auto pre(Args &&...args) -> decltype(automaton_t::element_type::pre(std::forward< Args >(args)...))
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
SharedPtr make_shared_ptr(Args &&...args)
Same as std::make_shared, but parameterized by the shared_ptr type, not the (pointed to) element_type...
state_t state(state_name_t s)
std::unordered_map< state_name_t, state_t > map_
Input-state -> sorted-state.
static constexpr auto post(Args &&...args) -> decltype(automaton_t::element_type::post(std::forward< Args >(args)...))