Vcsn
2.0
Be Rational
|
The weighted determinization of weighted automaton. More...
#include <determinize.hh>
Classes | |
struct | stateset |
An output state is a list of weighted input states. More... | |
Public Types | |
using | automaton_t = Aut |
using | automaton_nocv_t = typename Aut::element_type::automaton_nocv_t |
using | super_t = automaton_decorator< automaton_nocv_t > |
using | label_t = label_t_of< automaton_t > |
using | labelset_t = labelset_t_of< automaton_t > |
using | weightset_t = weightset_t_of< automaton_t > |
using | state_t = state_t_of< automaton_t > |
using | weight_t = weight_t_of< automaton_t > |
using | state_nameset_t = polynomialset< context< stateset, weightset_t >> |
using | state_name_t = typename state_nameset_t::value_t |
using | origins_t = std::map< state_t, state_name_t > |
A map from determinized states to sets of original states. More... | |
Public Types inherited from vcsn::detail::automaton_decorator< Aut::element_type::automaton_nocv_t > | |
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 = Context |
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 | |
detweighted_automaton_impl (const automaton_t &a) | |
Build the weighted determinizer. More... | |
std::string | vname (bool full=true) const |
void | operator() () |
The determinization of weighted automaton with the idea based on Mohri's algorithm. More... | |
bool | state_has_name (state_t s) const |
std::ostream & | print_state_name (state_t ss, std::ostream &o, const std::string &fmt="text") const |
const origins_t & | origins () const |
Public Member Functions inherited from vcsn::detail::automaton_decorator< Aut::element_type::automaton_nocv_t > | |
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::element_type::automaton_nocv_t > | |
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)...)) |
Public Attributes | |
origins_t | origins_ |
Private Types | |
using | map_t = std::unordered_map< state_name_t, state_t, vcsn::hash< state_nameset_t >, vcsn::equal_to< state_nameset_t >> |
Map from state name to state number. More... | |
using | queue = std::queue< state_name_t > |
The sets of (input) states waiting to be processed. More... | |
Private Member Functions | |
state_t | state_ (const state_name_t &name) |
The state for set of states ss. More... | |
Private Attributes | |
map_t | map_ |
automaton_t | input_ |
Input automaton. More... | |
weightset_t | ws_ = *input_->weightset() |
Its weightset. More... | |
state_nameset_t | ns_ = {{stateset(input_), ws_}} |
(Nameset) The polynomialset that stores weighted states. More... | |
queue | todo_ |
Additional Inherited Members | |
Protected Attributes inherited from vcsn::detail::automaton_decorator< Aut::element_type::automaton_nocv_t > | |
automaton_t | aut_ |
The wrapped automaton, possibly const. More... | |
The weighted determinization of weighted automaton.
Aut | an weighted automaton type. |
Definition at line 272 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::automaton_nocv_t = typename Aut::element_type::automaton_nocv_t |
Definition at line 280 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::automaton_t = Aut |
Definition at line 279 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::label_t = label_t_of<automaton_t> |
Definition at line 283 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::labelset_t = labelset_t_of<automaton_t> |
Definition at line 284 of file determinize.hh.
|
private |
Map from state name to state number.
Definition at line 452 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::origins_t = std::map<state_t, state_name_t> |
A map from determinized states to sets of original states.
Definition at line 418 of file determinize.hh.
|
private |
The sets of (input) states waiting to be processed.
Definition at line 465 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::state_name_t = typename state_nameset_t::value_t |
Definition at line 325 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::state_nameset_t = polynomialset<context<stateset, weightset_t>> |
Definition at line 324 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::state_t = state_t_of<automaton_t> |
Definition at line 287 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::super_t = automaton_decorator<automaton_nocv_t> |
Definition at line 281 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::weight_t = weight_t_of<automaton_t> |
Definition at line 288 of file determinize.hh.
using vcsn::detail::detweighted_automaton_impl< Aut >::weightset_t = weightset_t_of<automaton_t> |
Definition at line 285 of file determinize.hh.
|
inline |
Build the weighted determinizer.
a | the weighted automaton to determinize |
Definition at line 329 of file determinize.hh.
References vcsn::detail::detweighted_automaton_impl< Aut >::input_, vcsn::detail::detweighted_automaton_impl< Aut >::map_, vcsn::detail::automaton_decorator< Aut, Context >::post(), vcsn::detail::automaton_decorator< Aut, Context >::pre(), vcsn::detail::detweighted_automaton_impl< Aut >::todo_, and vcsn::detail::detweighted_automaton_impl< Aut >::ws_.
|
inline |
The determinization of weighted automaton with the idea based on Mohri's algorithm.
Definition at line 357 of file determinize.hh.
References vcsn::has(), vcsn::detail::detweighted_automaton_impl< Aut >::input_, vcsn::detail::map(), vcsn::detail::detweighted_automaton_impl< Aut >::map_, vcsn::detail::automaton_decorator< Aut::element_type::automaton_nocv_t >::new_transition(), vcsn::detail::detweighted_automaton_impl< Aut >::ns_, vcsn::detail::detweighted_automaton_impl< Aut >::state_(), vcsn::detail::detweighted_automaton_impl< Aut >::todo_, and vcsn::detail::detweighted_automaton_impl< Aut >::ws_.
|
inline |
Definition at line 421 of file determinize.hh.
References vcsn::detail::detweighted_automaton_impl< Aut >::map_, and vcsn::detail::detweighted_automaton_impl< Aut >::origins_.
Referenced by vcsn::detail::detweighted_automaton_impl< Aut >::print_state_name(), and vcsn::detail::detweighted_automaton_impl< Aut >::state_has_name().
|
inline |
Definition at line 406 of file determinize.hh.
References vcsn::detail::detweighted_automaton_impl< Aut >::ns_, vcsn::detail::detweighted_automaton_impl< Aut >::origins(), and vcsn::detail::automaton_decorator< Aut::element_type::automaton_nocv_t >::print_state().
|
inlinestatic |
Definition at line 345 of file determinize.hh.
References vcsn::sname().
|
inlineprivate |
The state for set of states ss.
If this is a new state, schedule it for visit.
Definition at line 432 of file determinize.hh.
References vcsn::detail::detweighted_automaton_impl< Aut >::map_, vcsn::detail::automaton_decorator< Aut::element_type::automaton_nocv_t >::new_state(), and vcsn::detail::detweighted_automaton_impl< Aut >::todo_.
Referenced by vcsn::detail::detweighted_automaton_impl< Aut >::operator()().
|
inline |
Definition at line 398 of file determinize.hh.
References vcsn::has(), vcsn::detail::detweighted_automaton_impl< Aut >::origins(), vcsn::detail::automaton_decorator< Aut, Context >::post(), and vcsn::detail::automaton_decorator< Aut, Context >::pre().
|
inline |
Definition at line 350 of file determinize.hh.
References vcsn::detail::detweighted_automaton_impl< Aut >::input_.
|
private |
Input automaton.
Definition at line 456 of file determinize.hh.
Referenced by vcsn::detail::detweighted_automaton_impl< Aut >::detweighted_automaton_impl(), vcsn::detail::detweighted_automaton_impl< Aut >::operator()(), and vcsn::detail::detweighted_automaton_impl< Aut >::vname().
|
private |
Definition at line 453 of file determinize.hh.
Referenced by vcsn::detail::detweighted_automaton_impl< Aut >::detweighted_automaton_impl(), vcsn::detail::detweighted_automaton_impl< Aut >::operator()(), vcsn::detail::detweighted_automaton_impl< Aut >::origins(), and vcsn::detail::detweighted_automaton_impl< Aut >::state_().
|
private |
(Nameset) The polynomialset that stores weighted states.
Definition at line 462 of file determinize.hh.
Referenced by vcsn::detail::detweighted_automaton_impl< Aut >::operator()(), and vcsn::detail::detweighted_automaton_impl< Aut >::print_state_name().
|
mutable |
Definition at line 419 of file determinize.hh.
Referenced by vcsn::detail::detweighted_automaton_impl< Aut >::origins().
|
private |
Definition at line 466 of file determinize.hh.
Referenced by vcsn::detail::detweighted_automaton_impl< Aut >::detweighted_automaton_impl(), vcsn::detail::detweighted_automaton_impl< Aut >::operator()(), and vcsn::detail::detweighted_automaton_impl< Aut >::state_().
|
private |
Its weightset.
Definition at line 459 of file determinize.hh.
Referenced by vcsn::detail::detweighted_automaton_impl< Aut >::detweighted_automaton_impl(), and vcsn::detail::detweighted_automaton_impl< Aut >::operator()().