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,
bool detailed =
false)
77 #define ECHO(Name, Value) \
78 out << Name ": " << Value << '\n'
79 #define VCSN_IF_FREE(Fun, Aut) \
80 detail::static_if<labelset_t_of<decltype(Aut)>::is_free()> \
81 ([](auto a) { return Fun(a); }, \
82 [](auto) { return "N/A"; })(Aut)
84 ECHO(
"number of states", aut->num_states());
86 ECHO(
"number of initial states", aut->num_initials());
87 ECHO(
"number of final states", aut->num_finals());
91 ECHO(
"number of codeterministic states",
93 ECHO(
"number of deterministic states",
95 ECHO(
"number of transitions", aut->num_transitions());
96 ECHO(
"number of spontaneous transitions",
99 ECHO(
"number of strongly connected components",
130 template <Automaton Aut,
typename Ostream,
typename Bool>
134 info(aut->
as<Aut>(), out, detailed);
146 template <
typename ExpSet>
148 info(
const ExpSet&
rs,
const typename ExpSet::value_t& e,
149 std::ostream& o = std::cout)
155 auto s = rat::size<ExpSet>(e);
157 <<
"\nlength: " << s;
159 auto info = rat::make_info<ExpSet>(e);
160 o <<
"\nwidth: " <<
info.atom;
162 o << "\n" #Type ": " << info.Type
189 template <
typename ExpSet,
typename Ostream>
192 const auto& e = exp->as<ExpSet>();
size_t num_codeterministic_states(const Aut &aut)
Number of non-deterministic states of transposed automaton.
bool is_complete(const Aut &aut)
Whether aut is complete.
auto ldivide(const Aut1 &lhs, const Aut2 &rhs, auto_tag={})
Compute the left quotient.
ATTRIBUTE_CONST std::enable_if_t<!labelset_t_of< Aut >::has_one(), size_t > num_spontaneous_transitions(const Aut &)
bool is_synchronizing(const Aut &aut)
Whether this automaton is synchronizing, i.e., has synchronizing words.
auto transitions(const Aut &aut) -> decltype(all_transitions(aut, is_special_t< Aut >
All the transition indexes between visible states.
bool is_empty(const Aut &a) ATTRIBUTE_PURE
Whether has no states.
bool is_useless(const Aut &a)
Whether all no state is useful.
size_t num_lazy_states(const Aut &a)
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
Print as a parsable type string.
bool is_ambiguous(const Aut &aut)
scc_automaton< Aut > scc(const Aut &aut, const std::string &algo="auto")
Get scc_automaton from aut.
ValueSet::value_t tuple(const ValueSet &vs, const typename ValueSets::value_t &...v)
fresh_automaton_t_of< Aut > rweight(const Aut &aut, const weight_t_of< Aut > &w, Tag tag={})
Right-multiplication of an automaton by a weight.
bool is_standard(const Aut &a)
Whether a is standard.
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
auto shuffle(const Auts &...as) -> tuple_automaton< decltype(join_automata(as...)), Auts... >
The (accessible part of the) shuffle product.
auto add(const Aut1 &lhs, const Aut2 &rhs, deterministic_tag)
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_accessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
auto infiltrate(const A1 &a1, const A2 &a2) -> tuple_automaton< decltype(join_automata(a1, a2)), A1, A2 >
The (accessible part of the) infiltration product.
auto lweight(const weight_t_of< Aut > &w, const Aut &aut, Tag tag={}) -> fresh_automaton_t_of< Aut >
Left-multiplication of an automaton by a weight.
std::size_t num_components(const scc_automaton< Aut > &aut)
Get number of strongly connected components.
#define ECHO(Name, Value)
bool is_valid(const Aut &aut)
bool is_proper(const Aut &aut)
Test whether an automaton is proper.
auto conjunction(const Aut &aut, to exp) -> fresh_automaton_t_of< Aut >
Repeated conjunction of a automaton.
ValueSet::value_t compose(const ValueSet &vs, const typename ValueSet::value_t &lhs, const typename ValueSet::value_t &rhs)
Composition of values.
bool is_normalized(const Aut &a)
Whether a is standard and co-standard.
size_t num_coaccessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
bool is_cycle_ambiguous(const Aut &aut)
Whether aut is cycle-ambiguous.
std::ostream & info_expression(const expression &exp, std::ostream &o)
Bridge (info).
bool is_codeterministic(const Aut &aut)
Whether the transposed automaton is deterministic.
auto & as()
Extract wrapped typed automaton.
std::ostream & info(const Aut &aut, std::ostream &out=std::cout, bool detailed=false)
Print info about an automaton.
#define VCSN_IF_FREE(Fun, Aut)
std::ostream & info(const automaton &aut, std::ostream &out, bool detailed)
Bridge.
value_impl< detail::expression_tag > expression
bool is_trim(const Aut &a)
Whether all its states are useful.
size_t num_deterministic_states(const Aut &aut)
Number of non-deterministic states.
auto star(const Aut &aut, Tag tag={}) -> decltype(detail::make_join_automaton(tag, aut))
Star of an automaton.
auto complement(const Aut &aut) -> decltype(copy(aut))
size_t num_useful_states(const Aut &a)
Number of accessible states, not counting pre() and post().