17 #ifndef AWALI_CORE_PERMUTATION_DECORATOR_HH
18 # define AWALI_CORE_PERMUTATION_DECORATOR_HH
22 # include <unordered_map>
26 namespace awali {
namespace sttc {
31 template <
typename Aut>
55 return "permutation_automaton<" + automaton_t::element_type::sname() +
">";
60 return "permutation_automaton<" +
input_->vname(
full) +
">";
65 const std::string& fmt =
"text")
const
76 auto i =
map_.find(s);
77 if (i == std::end(
map_))
96 for (
const auto& p:
map_)
101 using pair_t = std::pair<state_t, state_t>;
105 std::unordered_map<state_t, state_t>
map_;
115 template <
typename Aut>
117 = std::shared_ptr<internal::permutation_automaton_impl<Aut>>;
Aggregate an automaton, and forward calls to it.
Definition: automaton_decorator.hh:36
static constexpr auto post(Args &&... args) -> decltype(automaton_t::element_type::post(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:110
static constexpr auto pre(Args &&... args) -> decltype(automaton_t::element_type::pre(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:111
auto add_state(Args &&... args) -> decltype(aut_-> add_state(std::forward< Args >(args)...))
Definition: automaton_decorator.hh:187
Definition: permutation_automaton.hh:34
std::queue< pair_t > todo_
Definition: permutation_automaton.hh:102
Aut automaton_t
Input automaton type.
Definition: permutation_automaton.hh:37
std::map< state_t, state_t > origins_t
A map from each state to the origin state set it stands for.
Definition: permutation_automaton.hh:89
context_t_of< Aut > full_context_t
Definition: permutation_automaton.hh:41
std::unordered_map< state_t, state_t > map_
Input-state -> sorted-state.
Definition: permutation_automaton.hh:105
std::string vname(bool full=true) const
Definition: permutation_automaton.hh:58
typename automaton_t::element_type::automaton_nocv_t automaton_nocv_t
Sorted automaton type.
Definition: permutation_automaton.hh:39
const origins_t & origins() const
Ordered map: state -> its derived term.
Definition: permutation_automaton.hh:93
std::ostream & print_state_name(state_t s, std::ostream &o, const std::string &fmt="text") const
Definition: permutation_automaton.hh:64
const automaton_t input_
Input automaton.
Definition: permutation_automaton.hh:110
std::pair< state_t, state_t > pair_t
Definition: permutation_automaton.hh:101
state_t state(state_t s)
Definition: permutation_automaton.hh:71
static std::string sname()
Definition: permutation_automaton.hh:53
permutation_automaton_impl(const automaton_t &input)
Definition: permutation_automaton.hh:44
origins_t origins_
Definition: permutation_automaton.hh:107
std::shared_ptr< internal::permutation_automaton_impl< Aut > > permutation_automaton
A permutation automaton as a shared pointer.
Definition: permutation_automaton.hh:117
SharedPtr make_shared_ptr(Args &&... args)
Same as std::make_shared, but parameterized by the shared_ptr type, not the (pointed to) element_type...
Definition: memory.hh:29
typename internal::context_t_of_impl< internal::base_t< ValueSet > >::type context_t_of
Helper to retrieve the type of the context of a value set.
Definition: traits.hh:66
static const std::string full
Completely version of Awali as a std::string.
Definition: version.hh:42
Main namespace of Awali.
Definition: ato.hh:22
unsigned state_t
Definition: types.hh:21