19 #include <vcsn/dyn/fwd.hh> 33 template <Automaton Aut>
35 std::enable_if_t<!labelset_t_of<Aut>::has_one(),
size_t>
41 template <Automaton Aut>
42 std::enable_if_t<labelset_t_of<Aut>::has_one(),
size_t>
47 res += aut->labelset()->is_one(aut->label_of(t));
55 template <Automaton Aut>
60 for (
auto s: a->all_states())
71 template <Automaton Aut>
73 info(
const Aut& aut, std::ostream&
out = std::cout,
unsigned details = 2)
82 #define ECHO(Level, Name, Value) \ 84 if (Level <= details) \ 85 out << sep << Name ": " << Value; \ 89 #define VCSN_IF_FREE(Fun, Aut) \ 90 detail::static_if<labelset_t_of<decltype(Aut)>::is_free()> \ 91 ([](auto a) { return Fun(a); }, \ 92 [](auto) { return "N/A"; })(Aut) 94 ECHO(1,
"number of states", aut->num_states());
96 ECHO(1,
"number of initial states", aut->num_initials());
97 ECHO(1,
"number of final states", aut->num_finals());
101 ECHO(2,
"number of codeterministic states",
103 ECHO(2,
"number of deterministic states",
105 ECHO(1,
"number of transitions", aut->num_transitions());
106 ECHO(2,
"number of spontaneous transitions",
108 ECHO(3,
"number of strongly connected components",
135 template <Automaton Aut,
typename Ostream,
typename Bool>
139 info(aut->
as<Aut>(), out, details);
151 template <
typename ExpSet>
153 info(
const ExpSet& rs,
const typename ExpSet::value_t& e,
154 std::ostream& o = std::cout)
160 auto s = rat::size<ExpSet>(e);
162 <<
"\nlength: " << s;
164 auto info = rat::make_info<ExpSet>(e);
165 o <<
"\nwidth: " <<
info.atom;
167 o << "\n" #Type ": " << info.Type 194 template <
typename ExpSet,
typename Ostream>
197 const auto& e = exp->as<ExpSet>();
Print as a parsable type string.
bool is_valid(const Aut &aut)
bool is_proper(const Aut &aut)
Test whether an automaton is proper.
bool is_synchronizing(const Aut &aut)
Whether this automaton is synchronizing, i.e., has synchronizing words.
bool is_codeterministic(const Aut &aut)
Whether the transposed automaton is deterministic.
size_t num_useful_states(const Aut &a)
Number of accessible states, not counting pre() and post().
bool is_standard(const Aut &a)
Whether a is standard.
#define ECHO(Level, Name, Value)
auto tuple(const Auts &... as)
Build the (accessible part of the) tuple.
size_t num_codeterministic_states(const Aut &aut)
Number of non-deterministic states of transposed automaton.
std::size_t num_components(const scc_automaton< Aut > &aut)
Get number of strongly connected components.
ATTRIBUTE_CONST std::enable_if_t< context_t_of< Aut >::has_one(), bool > is_eps_acyclic(const Aut &aut)
Detect epsilon-circuits.
size_t num_deterministic_states(const Aut &aut)
Number of non-deterministic states.
bool is_useless(const Aut &a)
Whether all no state is useful.
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
bool is_ambiguous(const Aut &aut)
Whether an automaton is ambiguous.
scc_automaton< Aut > scc(const Aut &aut, const std::string &algo="auto")
Get scc_automaton from aut.
bool is_empty(const Aut &a) ATTRIBUTE_PURE
Whether has no states.
auto conjunction(const Aut &a, const Auts &... as)
Build the (accessible part of the) conjunction.
#define VCSN_IF_FREE(Fun, Aut)
auto & as()
Extract wrapped typed automaton.
bool is_cycle_ambiguous(const Aut &aut)
Whether aut is cycle-ambiguous.
size_t num_accessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
size_t num_coaccessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
size_t num_lazy_states(const Aut &a)
ATTRIBUTE_CONST std::enable_if_t<!labelset_t_of< Aut >::has_one(), size_t > num_spontaneous_transitions(const Aut &)
value_impl< detail::expression_tag > expression
bool is_trim(const Aut &a)
Whether all its states are useful.
std::ostream & info_expression(const expression &exp, std::ostream &o)
Bridge (info).
auto transitions(const Aut &aut) -> decltype(all_transitions(aut, is_special_t< Aut >
All the transition indexes between visible states.
bool is_normalized(const Aut &a)
Whether a is standard and co-standard.
std::ostream & info(const Aut &aut, std::ostream &out=std::cout, unsigned details=2)
Print info about an automaton.
bool is_complete(const Aut &aut)
Whether aut is complete.
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.