Vcsn  2.4
Be Rational
minimize-brzozowski.hh
Go to the documentation of this file.
1 #pragma once
2 
6 #include <vcsn/algos/strip.hh>
8 
9 namespace vcsn
10 {
11 
12  /*-------------------------------------------.
13  | minimization with Brzozowski's algorithm. |
14  `-------------------------------------------*/
15 
17  struct brzozowski_tag {};
18 
21  template <Automaton Aut>
24  <decltype(transpose(std::declval<Aut>())),
26 
28  template <Automaton Aut>
29  auto
30  minimize(const Aut& a, brzozowski_tag)
31  -> std::enable_if_t<is_free_boolean<Aut>(),
34  {
35  return determinize(codeterminize(a));
36  }
37 
38  namespace dyn
39  {
40  namespace detail
41  {
43  template <Automaton Aut>
44  ATTRIBUTE_NORETURN
45  std::enable_if_t<!is_free_boolean<Aut>(), Aut>
46  minimize(const Aut&, brzozowski_tag)
47  {
48  raise("minimize: invalid algorithm"
49  " (non-Boolean or non-free labelset):",
50  " brzozowski");
51  }
52  }
53  }
54 } // namespace vcsn
auto minimize(const Aut &a, brzozowski_tag) -> std::enable_if_t< is_free_boolean< Aut >(), determinized_automaton< codeterminized_automaton< Aut >, wet_kind_t::bitset >>
Brzozowski-based minimization.
Request for Brzozowski implementation of minimize (B and free).
std::shared_ptr< detail::transpose_automaton_impl< Aut >> transpose_automaton
An automaton wrapper that presents the transposed automaton.
Definition: fwd.hh:108
auto determinize(const Aut &a, Tag={}, bool_constant< Lazy >={})
Definition: determinize.hh:247
auto codeterminize(const Aut &aut, Tag tag={})
Definition: determinize.hh:371
Definition: a-star.hh:8
transpose_automaton< determinized_automaton< decltype(transpose(std::declval< Aut >())), wet_kind_t::bitset >> codeterminized_automaton
The type of the codeterminized automaton.
std::shared_ptr< detail::determinized_automaton_impl< Aut, Kind, Lazy >> determinized_automaton
A determinized automaton as a shared pointer.
Definition: determinize.hh:243
Request the bitset implementation (bool weights).
Aut transpose(const transpose_automaton< Aut > &aut)
The transpose of a transpose automaton is the original automaton.
Definition: transpose.hh:253
ATTRIBUTE_NORETURN std::enable_if_t<!is_free_boolean< Aut >), Aut > minimize(const Aut &, brzozowski_tag)
Handling of errors for dyn::minimize.