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>();
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.
Print as a parsable type string.
size_t num_deterministic_states(const Aut &aut)
Number of non-deterministic states.
bool is_valid(const Aut &aut)
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.
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.
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
ATTRIBUTE_CONST std::enable_if_t<!labelset_t_of< Aut >::has_one(), size_t > num_spontaneous_transitions(const Aut &)
bool is_normalized(const Aut &a)
Whether a is standard and co-standard.
ValueSet::value_t compose(const ValueSet &vs, const typename ValueSet::value_t &lhs, const typename ValueSet::value_t &rhs)
Composition of values.
ValueSet::value_t tuple(const ValueSet &vs, const typename ValueSets::value_t &...v)
auto infiltrate(const A1 &a1, const A2 &a2) -> tuple_automaton< decltype(join_automata(a1, a2)), A1, A2 >
The (accessible part of the) infiltration product.
bool is_codeterministic(const Aut &aut)
Whether the transposed automaton is deterministic.
auto complement(const Aut &aut) -> decltype(copy(aut))
ATTRIBUTE_CONST std::enable_if_t< context_t_of< Aut >::has_one(), bool > is_eps_acyclic(const Aut &aut)
Detect epsilon-circuits.
#define VCSN_IF_FREE(Fun, Aut)
auto add(const Aut1 &lhs, const Aut2 &rhs, deterministic_tag)
bool is_proper(const Aut &aut)
Test whether an automaton is proper.
auto shuffle(const Auts &...as) -> tuple_automaton< decltype(join_automata(as...)), Auts... >
The (accessible part of the) shuffle product.
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.
auto conjunction(const Aut &aut, to exp) -> fresh_automaton_t_of< Aut >
Repeated conjunction of a automaton.
std::ostream & info_expression(const expression &exp, std::ostream &o)
Bridge (info).
bool is_ambiguous(const Aut &aut)
Whether an automaton is ambiguous.
size_t num_useful_states(const Aut &a)
Number of accessible states, not counting pre() and post().
scc_automaton< Aut > scc(const Aut &aut, const std::string &algo="auto")
Get scc_automaton from aut.
bool is_cycle_ambiguous(const Aut &aut)
Whether aut is cycle-ambiguous.
bool is_useless(const Aut &a)
Whether all no state is useful.
size_t num_codeterministic_states(const Aut &aut)
Number of non-deterministic states of transposed automaton.
size_t num_coaccessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
std::size_t num_components(const scc_automaton< Aut > &aut)
Get number of strongly connected components.
size_t num_accessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
bool is_standard(const Aut &a)
Whether a is standard.
bool is_empty(const Aut &a) ATTRIBUTE_PURE
Whether has no states.
#define ECHO(Level, Name, Value)
auto star(const Aut &aut, Tag tag={}) -> decltype(detail::make_join_automaton(tag, aut))
Star of an automaton.
std::ostream & info(const Aut &aut, std::ostream &out=std::cout, unsigned details=2)
Print info about an automaton.
value_impl< detail::expression_tag > expression
std::ostream & info(const automaton &aut, std::ostream &out, unsigned details)
Bridge.
size_t num_lazy_states(const Aut &a)
auto & as()
Extract wrapped typed automaton.
auto ldivide(const Aut1 &lhs, const Aut2 &rhs, auto_tag={})
Compute the left quotient.
bool is_trim(const Aut &a)
Whether all its states are useful.