Vcsn
2.3
Be Rational
|
Eliminate states in an automaton. More...
#include <to-expression.hh>
Public Types | |
using | profiler_t = Profiler |
using | profile_t = typename profiler_t::state_profile |
using | automaton_t = std::remove_cv_t< Aut > |
using | state_t = state_t_of< automaton_t > |
Public Member Functions | |
state_eliminator (automaton_t &aut, profiler_t &profiler) | |
Prepare for state-elimination. More... | |
void | operator() (state_t s) |
Eliminate state s. More... | |
void | operator() () |
Eliminate all the states, in the order specified by next_state. More... | |
Private Types | |
using | heap_t = boost::heap::fibonacci_heap< profile_t > |
Max-heap to decide the order of state-elimination. More... | |
Private Member Functions | |
void | update_heap_ () |
void | show_heap_ () const |
Show the heap, for debugging. More... | |
template<typename Kind = typename context_t_of<automaton_t>::kind_t> | |
auto | eliminate_state_ (state_t s) -> std::enable_if_t< std::is_same< Kind, labels_are_one >::value, void > |
Eliminate state s in the case of labels are one. More... | |
template<typename Kind > | |
auto | eliminate_state_impl_ (state_t s) -> std::enable_if_t< std::is_same< Kind, labels_are_expressions >::value, void > |
Eliminate state s in the case of labels are expressions. More... | |
Private Attributes | |
automaton_t | aut_ |
The automaton we work on. More... | |
profiler_t & | profiler_ |
The profiler we work with. Corresponding to a specific heuristic. More... | |
heap_t | todo_ |
std::vector< typename heap_t::handle_type > | handles_ |
Map: state -> heap-handle. More... | |
std::unordered_set< state_t > | neighbors_ |
Eliminate states in an automaton.
Definition at line 227 of file to-expression.hh.
using vcsn::detail::state_eliminator< Aut, Profiler >::automaton_t = std::remove_cv_t<Aut> |
Definition at line 231 of file to-expression.hh.
|
private |
Max-heap to decide the order of state-elimination.
Definition at line 416 of file to-expression.hh.
using vcsn::detail::state_eliminator< Aut, Profiler >::profile_t = typename profiler_t::state_profile |
Definition at line 230 of file to-expression.hh.
using vcsn::detail::state_eliminator< Aut, Profiler >::profiler_t = Profiler |
Definition at line 229 of file to-expression.hh.
using vcsn::detail::state_eliminator< Aut, Profiler >::state_t = state_t_of<automaton_t> |
Definition at line 232 of file to-expression.hh.
|
inline |
Prepare for state-elimination.
aut | the input automaton |
profiler | the generator of state profiles. |
Definition at line 238 of file to-expression.hh.
References vcsn::detail::state_eliminator< Aut, Profiler >::aut_, vcsn::detail::state_eliminator< Aut, Profiler >::handles_, vcsn::detail::state_eliminator< Aut, Profiler >::profiler_, and vcsn::detail::state_eliminator< Aut, Profiler >::todo_.
|
inlineprivate |
Eliminate state s in the case of labels are one.
Definition at line 312 of file to-expression.hh.
References vcsn::detail::all_in(), vcsn::detail::all_out(), vcsn::detail::state_eliminator< Aut, Profiler >::aut_, vcsn::detail::in(), vcsn::detail::make_vector(), vcsn::detail::state_eliminator< Aut, Profiler >::neighbors_, vcsn::detail::out(), vcsn::detail::outin(), vcsn::detail::state_eliminator< Aut, Profiler >::profiler_, vcsn::rat::size(), and vcsn::detail::state_eliminator< Aut, Profiler >::update_heap_().
Referenced by vcsn::detail::state_eliminator< Aut, Profiler >::operator()().
|
inlineprivate |
Eliminate state s in the case of labels are expressions.
Definition at line 370 of file to-expression.hh.
References vcsn::detail::all_in(), vcsn::detail::all_out(), vcsn::detail::state_eliminator< Aut, Profiler >::aut_, vcsn::detail::in(), vcsn::detail::make_vector(), vcsn::detail::state_eliminator< Aut, Profiler >::neighbors_, vcsn::detail::out(), vcsn::detail::outin(), vcsn::detail::state_eliminator< Aut, Profiler >::profiler_, vcsn::detail::rs, and vcsn::detail::state_eliminator< Aut, Profiler >::update_heap_().
|
inline |
Eliminate state s.
Definition at line 248 of file to-expression.hh.
References vcsn::detail::state_eliminator< Aut, Profiler >::aut_, vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_(), vcsn::require(), and vcsn::detail::state_eliminator< Aut, Profiler >::todo_.
|
inline |
Eliminate all the states, in the order specified by next_state.
Definition at line 263 of file to-expression.hh.
References vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_(), and vcsn::detail::state_eliminator< Aut, Profiler >::todo_.
|
inlineprivate |
Show the heap, for debugging.
Definition at line 299 of file to-expression.hh.
References vcsn::detail::state_eliminator< Aut, Profiler >::todo_.
Referenced by vcsn::detail::state_eliminator< Aut, Profiler >::update_heap_().
|
inlineprivate |
Definition at line 278 of file to-expression.hh.
References vcsn::detail::state_eliminator< Aut, Profiler >::aut_, vcsn::detail::state_eliminator< Aut, Profiler >::handles_, vcsn::detail::state_eliminator< Aut, Profiler >::neighbors_, vcsn::detail::state_eliminator< Aut, Profiler >::profiler_, vcsn::detail::state_eliminator< Aut, Profiler >::show_heap_(), and vcsn::detail::state_eliminator< Aut, Profiler >::todo_.
Referenced by vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_(), and vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_impl_().
|
private |
The automaton we work on.
Definition at line 411 of file to-expression.hh.
Referenced by vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_(), vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_impl_(), vcsn::detail::state_eliminator< Aut, Profiler >::operator()(), vcsn::detail::state_eliminator< Aut, Profiler >::state_eliminator(), and vcsn::detail::state_eliminator< Aut, Profiler >::update_heap_().
|
private |
Map: state -> heap-handle.
Definition at line 419 of file to-expression.hh.
Referenced by vcsn::detail::state_eliminator< Aut, Profiler >::state_eliminator(), and vcsn::detail::state_eliminator< Aut, Profiler >::update_heap_().
|
private |
|
private |
The profiler we work with. Corresponding to a specific heuristic.
Definition at line 413 of file to-expression.hh.
Referenced by vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_(), vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_impl_(), vcsn::detail::state_eliminator< Aut, Profiler >::state_eliminator(), and vcsn::detail::state_eliminator< Aut, Profiler >::update_heap_().
|
private |
Definition at line 417 of file to-expression.hh.
Referenced by vcsn::detail::state_eliminator< Aut, Profiler >::operator()(), vcsn::detail::state_eliminator< Aut, Profiler >::show_heap_(), vcsn::detail::state_eliminator< Aut, Profiler >::state_eliminator(), and vcsn::detail::state_eliminator< Aut, Profiler >::update_heap_().