Vcsn  2.2
Be Rational
algos.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iosfwd>
4 #include <string>
5 #include <vector>
6 
7 #include <boost/optional.hpp>
8 
9 #include <vcsn/algos/fwd.hh>
11 #include <vcsn/ctx/fwd.hh>
12 #include <vcsn/dyn/fwd.hh>
13 #include <vcsn/misc/direction.hh>
14 #include <vcsn/misc/export.hh>
15 
16 namespace vcsn
17 {
18  namespace dyn LIBVCSN_API
19  {
21  automaton accessible(const automaton& aut);
22 
24  label ambiguous_word(const automaton& aut);
25 
29  bool are_equivalent(const automaton& lhs, const automaton& rhs);
30 
34  bool are_equivalent(const expression& lhs, const expression& rhs);
35 
38  bool are_isomorphic(const automaton& lhs, const automaton& rhs);
39 
41  automaton cerny(const context& ctx, unsigned num_states);
42 
44  automaton coaccessible(const automaton& aut);
45 
56  const std::string& algo = "auto");
57 
64  automaton cominimize(const automaton& aut,
65  const std::string& algo = "auto");
66 
73  automaton complement(const automaton& aut);
74 
76  expansion complement(const expansion& x);
77 
80 
83  automaton complete(const automaton& aut);
84 
89  automaton component(const automaton& aut, unsigned num);
90 
92  automaton compose(automaton& lhs, automaton& rhs, bool lazy = false);
93 
97  expression concatenate(const expression& lhs, const expression& rhs);
98 
101  automaton condense(const automaton& aut);
102 
105  automaton conjunction(const automaton& lhs, const automaton& rhs,
106  bool lazy = false);
107 
113  automaton conjunction(const std::vector<automaton>& as,
114  bool lazy = false);
115 
117  automaton conjunction(const automaton& aut, unsigned n);
118 
120  expression conjunction(const expression& lhs, const expression& rhs);
121 
123  polynomial conjunction(const polynomial& lhs, const polynomial& rhs);
124 
126  automaton conjugate(const automaton& aut);
127 
129  weight constant_term(const expression& e);
130 
132  context context_of(const automaton& a);
133 
135  context context_of(const expansion& r);
136 
138  context context_of(const expression& r);
139 
141  automaton copy(const automaton& aut);
142 
144  automaton copy(const automaton& aut, const context& ctx);
145 
147  expression copy(const expression& exp,
148  const context& ctx, rat::identities ids);
149 
151  automaton costandard(const automaton& a);
152 
157  automaton cotrie(const polynomial& p);
158 
166  automaton cotrie(const context& ctx, std::istream& is,
167  const std::string& format = "default");
168 
170  automaton de_bruijn(const context& ctx, unsigned n);
171 
174 
181  polynomial derivation(const expression& exp, const label& lbl,
182  bool breaking = false);
183 
193  automaton derived_term(const expression& exp,
194  const std::string& algo = "auto");
195 
205  automaton determinize(const automaton& aut,
206  const std::string& algo = "auto");
207 
214  automaton difference(const automaton& lhs, const automaton& rhs);
215 
217  expression difference(const expression& lhs, const expression& rhs);
218 
221  automaton divkbaseb(const context& ctx, unsigned divisor, unsigned base);
222 
224  automaton double_ring(const context& ctx, unsigned n,
225  const std::vector<unsigned>& f);
226 
229  int s = -1);
230 
232  weight eval(const automaton& aut, const label& l);
233 
236  expression expand(const expression& e);
237 
240 
243 
245  automaton factor(const automaton& aut);
246 
248  automaton filter(const automaton& aut, const std::vector<unsigned>& ss);
249 
251  automaton focus(const automaton& aut, unsigned tape);
252 
254  bool has_twins_property(const automaton& aut);
255 
257  bool has_lightening_cycle(const automaton& aut);
258 
260  bool has_bounded_lag(const automaton& aut);
261 
264 
267  automaton infiltration(const automaton& lhs, const automaton& rhs);
268 
271  automaton infiltration(const std::vector<automaton>& as);
272 
275  expression infiltration(const expression& lhs, const expression& rhs);
276 
283  std::ostream& info(const automaton& aut, std::ostream& out,
284  bool detailed = false);
285 
287  std::ostream& info(const expression& exp, std::ostream& out);
288 
294  automaton insplit(const automaton& aut, bool lazy = false);
295 
297  bool is_accessible(const automaton& aut);
298 
302  bool is_ambiguous(const automaton& aut);
303 
305  bool is_coaccessible(const automaton& aut);
306 
310  bool is_codeterministic(const automaton& aut);
311 
315  bool is_complete(const automaton& aut);
316 
319  bool is_costandard(const automaton& aut);
320 
322  bool is_cycle_ambiguous(const automaton& aut);
323 
326  bool is_deterministic(const automaton& aut);
327 
329  bool is_empty(const automaton& aut);
330 
332  bool is_eps_acyclic(const automaton& aut);
333 
337  bool is_functional(const automaton& aut);
338 
340  bool is_letterized(const automaton& aut);
341 
345  bool is_partial_identity(const automaton& aut);
346 
349  bool is_normalized(const automaton& aut);
350 
352  bool is_out_sorted(const automaton& aut);
353 
355  bool is_proper(const automaton& aut);
356 
358  bool is_realtime(const automaton& aut);
359 
362  bool is_standard(const automaton& aut);
363 
365  bool is_synchronized(const automaton& aut);
366 
368  bool is_synchronized_by(const automaton& aut, const label& word);
369 
371  bool is_synchronizing(const automaton& aut);
372 
374  bool is_trim(const automaton& aut);
375 
377  bool is_useless(const automaton& aut);
378 
380  bool is_valid(const automaton& e);
381 
384  bool is_valid(const expression& e);
385 
387  context join(const context& lhs, const context& rhs);
388 
390  automaton ladybird(const context& ctx, unsigned n);
391 
393  polynomial ldiv(const polynomial& lhs, const polynomial& rhs);
394 
396  expression ldiv(const expression& lhs, const expression& rhs);
397 
399  polynomial lgcd(const polynomial& lhs, const polynomial& rhs);
400 
412  automaton left_mult(const weight& w, const automaton& aut,
413  const std::string& algo = "auto");
414 
416  expansion left_mult(const weight& w, const expansion& exp);
417 
419  expression left_mult(const weight& w, const expression& exp);
420 
422  bool less_than(const expression& lhs, const expression& rhs);
423 
425  automaton letterize(const automaton& aut);
426 
428  automaton levenshtein(const context& ls);
429 
438  automaton lift(const automaton& aut,
439  const std::vector<unsigned>& tapes = {},
440  rat::identities ids = {});
441 
443  expression lift(const expression& e);
444 
450  polynomial lightest(const automaton& aut, unsigned num = 1,
451  const std::string& algo = "auto");
452 
455  const std::string& algo = "auto");
456 
458  context make_context(const std::string& name);
459 
461  automaton_editor* make_automaton_editor(const context& ctx);
462 
465 
477  automaton multiply(const automaton& lhs, const automaton& rhs,
478  const std::string& algo = "auto");
479 
492  automaton multiply(const automaton& aut, int min, int max,
493  const std::string& algo = "auto");
494 
496  expression multiply(const expression& lhs, const expression& rhs);
497 
503  expression multiply(const expression& e, int min, int max);
504 
506  label multiply(const label& lhs, const label& rhs);
507 
509  polynomial multiply(const polynomial& lhs, const polynomial& rhs);
510 
512  weight multiply(const weight& lhs, const weight& rhs);
513 
519  weight multiply(const weight& e, int min, int max);
520 
527  automaton minimize(const automaton& aut,
528  const std::string& algo = "auto");
529 
531  automaton normalize(const automaton& aut);
532 
534  std::size_t num_components(const automaton& aut);
535 
538  std::size_t num_tapes(const context& ctx);
539 
541  automaton pair(const automaton& aut, bool keep_initials = false);
542 
545 
547  automaton prefix(const automaton& aut);
548 
563  std::ostream& print(const automaton& aut, std::ostream& out,
564  const std::string& format = "default");
565 
567  std::ostream& print(const context& c, std::ostream& o,
568  const std::string& format = "default");
569 
571  std::ostream& print(const expansion& e, std::ostream& o,
572  const std::string& format = "default");
573 
575  std::ostream& print(const expression& e, std::ostream& o,
576  const std::string& format = "default");
577 
579  std::ostream& print(const label& l, std::ostream& o,
580  const std::string& format = "default");
581 
583  std::ostream& print(const polynomial& p, std::ostream& o,
584  const std::string& format = "default");
585 
587  std::ostream& print(const weight& w, std::ostream& o,
588  const std::string& format = "default");
589 
591  void set_format(std::ostream& o, const std::string& format);
592 
594  std::string get_format(std::ostream& o);
595 
597  automaton project(const automaton& aut, unsigned tape);
598 
600  context project(const context& ctx, unsigned tape);
601 
603  polynomial project(const polynomial& p, unsigned tape);
604 
606  label project(const label& p, unsigned tape);
607 
620  automaton proper(const automaton& aut,
622  bool prune = true, const std::string& algo = "auto");
623 
625  automaton push_weights(const automaton& aut);
626 
649  unsigned num_states,
650  float density = 0.1,
651  unsigned num_initial = 1,
652  unsigned num_final = 1,
653  float loop_chance = 0.0);
654 
662  unsigned num_states);
663 
665  expression rdiv(const expression& lhs, const expression& rhs);
666 
672  automaton read_automaton(std::istream& is,
673  const std::string& format = "default",
674  bool strip = true);
675 
683  std::istream& is,
684  const std::string& format = "default");
685 
691  label read_label(const context& ctx, std::istream& is,
692  const std::string& format = "default");
693 
698  polynomial read_polynomial(const context& ctx, std::istream& is);
699 
704  weight read_weight(const context& ctx, std::istream& is);
705 
707  automaton realtime(const automaton& aut);
708 
710  automaton reduce(const automaton& aut);
711 
729  automaton right_mult(const automaton& aut, const weight& w,
730  const std::string& algo = "auto");
731 
733  expansion right_mult(const expansion& aut, const weight& w);
734 
736  expression right_mult(const expression& aut, const weight& w);
737 
743  automaton scc(const automaton& aut, const std::string& algo = "auto");
744 
750  polynomial shortest(const automaton& aut,
751  boost::optional<unsigned> num = {},
752  boost::optional<unsigned> len = {});
753 
756  automaton shuffle(const automaton& lhs, const automaton& rhs);
757 
760  automaton shuffle(const std::vector<automaton>& as);
761 
764  expression shuffle(const expression& lhs, const expression& rhs);
765 
767  automaton sort(const automaton& a);
768 
770  polynomial split(const expression& exp);
771 
773  polynomial split(const polynomial& p);
774 
776  automaton standard(const automaton& a);
777 
779  automaton standard(const expression& e);
780 
791  automaton star(const automaton& aut, const std::string& algo = "auto");
792 
794  unsigned star_height(const expression& rs);
795 
801 
803  automaton strip(const automaton& a);
804 
806  automaton suffix(const automaton& aut);
807 
812  automaton subword(const automaton& aut);
813 
824  automaton sum(const automaton& lhs, const automaton& rhs,
825  const std::string& algo = "auto");
826 
828  expression sum(const expression& lhs, const expression& rhs);
829 
831  expansion sum(const expansion& lhs, const expansion& rhs);
832 
834  polynomial sum(const polynomial& lhs, const polynomial& rhs);
835 
837  weight sum(const weight& lhs, const weight& rhs);
838 
840  automaton synchronize(const automaton& aut);
841 
844  const std::string& algo = "greedy");
845 
847  automaton thompson(const expression& e);
848 
863  automaton to_automaton(const expression& exp,
864  const std::string& algo = "auto");
865 
869  expansion to_expansion(const expression& exp);
870 
877  rat::identities ids = {},
878  const std::string& algo = "auto");
879 
882  const label& l);
883 
896  const letter_class_t& letters,
897  bool accept = true);
898 
901 
903  expression transpose(const expression& e);
904 
907 
912  automaton trie(const polynomial& p);
913 
920  automaton trie(const context& ctx, std::istream& is,
921  const std::string& format = "default");
922 
924  automaton trim(const automaton& aut);
925 
927  expansion tuple(const std::vector<expansion>& rs);
928 
930  expression tuple(const expression& lhs, const expression& rhs);
931 
933  expression tuple(const std::vector<expression>& rs);
934 
936  std::string type(const automaton& a);
937 
939  automaton u(const context& ctx, unsigned n);
940 
942  automaton universal(const automaton& aut);
943 
945  weight weight_series(const automaton& aut);
946 
952  automaton zpc(const expression& exp, const std::string& algo = "auto");
953  }
954 }
955 
956 // dyn::automaton and the like are actually type aliases for
957 // std::shared_ptr, so for ADL to work properly, we need these
958 // operators to be defined in std.
959 namespace std LIBVCSN_API
960 {
962  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::automaton& a);
963 
965  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::context& c);
966 
968  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::expansion& e);
969 
971  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::expression& r);
972 
974  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::label& l);
975 
977  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::polynomial& p);
978 
980  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::weight& w);
981 }
label synchronizing_word(const automaton &aut, const std::string &algo="greedy")
A synchronizing word, or raise if there is none.
bool is_valid(const automaton &e)
Whether automaton is valid (epsilon-cycles converge).
Definition: is-valid.hh:152
bool are_equivalent(const automaton &lhs, const automaton &rhs)
Whether compute the same series.
rat::identities identities(const expression &exp)
The identities of expression exp.
Definition: identities.hh:19
expression expand(const expression &e)
Distribute product over addition recursively under the starred subexpressions and group the equal mon...
Definition: expand.hh:165
weight read_weight(const context &ctx, std::istream &is)
Read a weight from a stream.
Definition: read.hh:95
automaton universal(const automaton &aut)
The universal automaton of aut.
Definition: universal.hh:149
bool is_partial_identity(const automaton &aut)
Whether aut realizes a partial identity.
expression rdiv(const expression &lhs, const expression &rhs)
Right-division of two expressions (lhs \ rhs).
polynomial lgcd(const polynomial &lhs, const polynomial &rhs)
Left greatest common divisor of two polynomials (lhs \ rhs).
bool is_proper(const automaton &aut)
Whether has no spontaneous transition.
Definition: is-proper.hh:60
bool is_eps_acyclic(const automaton &aut)
Whether has no cycle of spontaneous transitions.
weight constant_term(const expression &e)
The weight associated to the empty word in e.
context make_word_context(const context &ctx)
The context for words.
Looking upstream.
automaton eliminate_state(const automaton &aut, int s=-1)
The LAO automaton aut with state s removed.
automaton normalize(const automaton &aut)
Normalize automaton aut.
Definition: normalize.hh:41
std::shared_ptr< const detail::polynomial_base > polynomial
Definition: fwd.hh:70
unsigned star_height(const expression &rs)
Star height of an expression.
Definition: star-height.hh:113
automaton accessible(const automaton &aut)
The accessible subautomaton of aut.
Definition: accessible.hh:206
expansion tuple(const std::vector< expansion > &rs)
Build a k-tape expansion from k expansions.
label ambiguous_word(const automaton &aut)
An ambiguous word, or raise if there is none.
Definition: is-ambiguous.hh:93
weight eval(const automaton &aut, const label &l)
Evaluate l on aut.
Definition: eval.hh:142
automaton lightest_automaton(const automaton &aut, const std::string &algo="auto")
The shortest path automaton using the given algorithm.
bool is_empty(const automaton &aut)
Whether has no state.
Definition: accessible.hh:269
automaton focus(const automaton &aut, unsigned tape)
Focus on a specific tape of a tupleset automaton.
Definition: others.cc:46
std::shared_ptr< const detail::weight_base > weight
Definition: fwd.hh:88
direction
Orientation.
Definition: direction.hh:9
bool has_twins_property(const automaton &aut)
Whether the automaton has the twins property.
weight weight_series(const automaton &aut)
Compute weight of the series.
automaton complement(const automaton &aut)
The complement of aut.
Definition: complement.hh:63
automaton subword(const automaton &aut)
Create a subword automaton from aut.
Definition: prefix.hh:174
std::size_t num_tapes(const context &ctx)
The number of input tapes.
Definition: a-star.hh:8
automaton sum(const automaton &lhs, const automaton &rhs, const std::string &algo="auto")
Sum of two automata.
Definition: sum.hh:111
bool is_synchronized_by(const automaton &aut, const label &word)
Whether the word synchronizes aut.
STL namespace.
automaton compose(automaton &lhs, automaton &rhs, bool lazy=false)
The composition of transducers lhs and rhs.
Definition: compose.hh:429
std::shared_ptr< const detail::expansion_base > expansion
Definition: expansion.hh:73
automaton difference(const automaton &lhs, const automaton &rhs)
An automaton whose behavior is that of lhs on words not accepted by rhs.
expression concatenate(const expression &lhs, const expression &rhs)
Concatenate two expressions.
automaton transpose(automaton &aut)
Transpose aut.
Definition: transpose.hh:247
automaton factor(const automaton &aut)
Create a factor automaton from aut.
Definition: prefix.hh:121
automaton minimize(const automaton &aut, const std::string &algo="auto")
The minimized automaton.
Definition: minimize.hh:157
automaton delay_automaton(const automaton &a)
The automaton with the delay of each state.
std::set< std::pair< std::string, std::string >> letter_class_t
A set of letter ranges.
Definition: fwd.hh:111
automaton suffix(const automaton &aut)
Create a suffix automaton from aut.
Definition: prefix.hh:44
std::string type(const automaton &a)
The implementation type of a.
Definition: others.cc:206
bool is_ambiguous(const automaton &aut)
Whether aut is ambiguous.
Definition: is-ambiguous.hh:53
weightset_mixin< detail::r_impl > r
Definition: fwd.hh:54
context context_of(const automaton &a)
The context of this automaton.
Definition: make-context.hh:64
automaton trie(const polynomial &p)
A trie-like automaton (single initial state, multiple final states) to accept p.
Definition: trie.hh:241
automaton de_bruijn(const context &ctx, unsigned n)
A simple NFA for (a+b)*a(a+b)^n.
Definition: de-bruijn.hh:59
std::string get_format(std::ostream &o)
Get the output format for o.
Definition: print.cc:173
automaton insplit(const automaton &aut, bool lazy=false)
Split automaton on the incoming transition.
Definition: insplit.hh:349
automaton read_automaton(std::istream &is, const std::string &format="default", bool strip=true)
Read an automaton from a stream.
Definition: read.cc:34
automaton right_mult(const automaton &aut, const weight &w, const std::string &algo="auto")
The right-mult automaton with w as weight.
Definition: left-mult.hh:323
automaton conjugate(const automaton &aut)
The conjugate of aut.
Definition: conjugate.hh:58
bool are_isomorphic(const automaton &lhs, const automaton &rhs)
Whether there exists an isomorphism between the states of lhs and those of rhs.
bool is_functional(const automaton &aut)
Whether aut is functional.
automaton scc(const automaton &aut, const std::string &algo="auto")
Build the SCC automaton whose states are labeled with number of the strongly-connected component they...
Definition: scc.hh:704
std::shared_ptr< const detail::label_base > label
Definition: fwd.hh:61
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
Definition: automaton.hh:56
automaton coaccessible(const automaton &aut)
The coaccessible subautomaton of aut.
Definition: accessible.hh:215
automaton zpc(const expression &exp, const std::string &algo="auto")
The ZPC automaton of exp.
Definition: zpc.hh:366
bool is_complete(const automaton &aut)
Whether aut is complete.
Definition: is-complete.hh:48
automaton trim(const automaton &aut)
The trim subautomaton of aut.
Definition: accessible.hh:224
automaton strip(const automaton &a)
The automaton in a with its metadata layers removed.
Definition: strip.hh:46
bool is_coaccessible(const automaton &aut)
Whether aut is coaccessible.
Definition: accessible.hh:242
automaton shuffle(const automaton &lhs, const automaton &rhs)
The shuffle product of automata lhs and rhs.
Definition: others.cc:150
std::ostream & operator<<(std::ostream &o, type_t t)
Definition: printer.hxx:14
bool is_codeterministic(const automaton &aut)
Whether aut is codeterministic.
expansion to_expansion(const expression &exp)
First order development of a exp.
polynomial shortest(const automaton &aut, boost::optional< unsigned > num={}, boost::optional< unsigned > len={})
The approximated behavior of an automaton.
Definition: shortest.hh:295
bool is_standard(const automaton &aut)
Whether is standard (unique initial state, with weight one, no incoming transition).
Definition: standard.hh:54
bool is_accessible(const automaton &aut)
Whether aut is accessible.
Definition: accessible.hh:233
automaton proper(const automaton &aut, direction dir=direction::backward, bool prune=true, const std::string &algo="auto")
An equivalent automaton without spontaneous transitions.
Definition: proper.hh:291
std::shared_ptr< const detail::context_base > context
A dyn::context.
Definition: fwd.hh:43
automaton partial_identity(const automaton &aut)
Create a partial identity transducer from aut.
#define LIBVCSN_API
Definition: export.hh:8
automaton project(const automaton &aut, unsigned tape)
Keep a single tape from a multiple-tape automaton.
Definition: others.cc:115
automaton costandard(const automaton &a)
A standardized transpositive a.
Definition: standard.hh:147
bool is_synchronized(const automaton &aut)
Whether is synchronized.
bool is_deterministic(const automaton &aut)
Whether aut is deterministic.
automaton realtime(const automaton &aut)
Create the realtime automaton (letterized and proper).
Definition: letterize.hh:232
std::shared_ptr< detail::automaton_base > automaton
Definition: automaton.hh:69
auto rs
Definition: lift.hh:151
bool has_bounded_lag(const automaton &aut)
Whether the transducer has bounded lag.
expression to_expression(const automaton &aut, rat::identities ids={}, const std::string &algo="auto")
An expression denoting the language of aut.
automaton random_automaton(const context &ctx, unsigned num_states, float density=0.1, unsigned num_initial=1, unsigned num_final=1, float loop_chance=0.0)
Produce a random automaton.
Definition: random.hh:259
automaton star(const automaton &aut, const std::string &algo="auto")
Star of an automaton.
Definition: star.hh:124
bool is_synchronizing(const automaton &aut)
Whether is synchronizing.
automaton conjunction(const automaton &lhs, const automaton &rhs, bool lazy=false)
The conjunction (aka synchronized product) of automata.
Definition: others.cc:26
bool is_normalized(const automaton &aut)
Whether is normalized (in the Thompson sense), i.e., standard and co-standard.
Definition: normalize.hh:33
std::ostream & print(const automaton &aut, std::ostream &out, const std::string &format="default")
Print automaton a on o using format format.
Definition: print.hh:109
automaton cotrie(const polynomial &p)
A reversed trie-like automaton (multiple initial states, single final state) automaton to accept p...
Definition: trie.hh:250
automaton thompson(const expression &e)
The Thompson automaton of e.
Definition: thompson.hh:208
automaton codeterminize(const automaton &aut, const std::string &algo="auto")
The codeterminized automaton.
Definition: determinize.hh:423
automaton_editor * make_automaton_editor(const context &ctx)
Build an automatonset from its context.
automaton pair(const automaton &aut, bool keep_initials=false)
Build the pair automaton of the given automaton.
Definition: pair.hh:263
bool is_useless(const automaton &aut)
Whether has no useful state.
Definition: accessible.hh:260
automaton left_mult(const weight &w, const automaton &aut, const std::string &algo="auto")
The left-multiplication of an automaton with w as weight.
Definition: left-mult.hh:151
std::istringstream is
The input stream: the specification to translate.
Definition: translate.cc:380
automaton cerny(const context &ctx, unsigned num_states)
Produce a Černý automaton of num_states states.
Definition: cerny.hh:64
automaton lift(const automaton &aut, const std::vector< unsigned > &tapes={}, rat::identities ids={})
Lift some tapes of the transducer, or turn an automaton into a spontaneous automaton.
Definition: others.cc:71
automaton divkbaseb(const context &ctx, unsigned divisor, unsigned base)
An automaton which accepts a word n representing a number in base b iff k|n.
Definition: divkbaseb.hh:71
expression star_normal_form(const expression &e)
A normalized form where star is applied only to proper expressions.
context make_context(const std::string &name)
Build a context from its name.
Definition: others.cc:99
polynomial derivation(const expression &exp, const label &lbl, bool breaking=false)
Derive exp with respect to s.
Definition: derivation.hh:337
automaton levenshtein(const context &ls)
The transducer representing the Levenshtein distance.
Definition: levenshtein.hh:66
automaton push_weights(const automaton &aut)
The weight pushing automaton of aut.
Definition: push-weights.hh:71
void set_format(std::ostream &o, const std::string &format)
Specify the output format for o.
Definition: print.cc:165
automaton complete(const automaton &aut)
A completed copy of aut.
Definition: complete.hh:76
automaton random_automaton_deterministic(const context &ctx, unsigned num_states)
Produce a random deterministic automaton.
Definition: random.hh:318
static dyn::context ctx(const driver &d)
Get the context of the driver.
Definition: parse.cc:82
automaton multiply(const automaton &lhs, const automaton &rhs, const std::string &algo="auto")
Multiply (concatenate) two automata.
Definition: multiply.hh:168
automaton condense(const automaton &aut)
The condensation of aut such that each state is a strongly connected component.
Definition: scc.hh:832
bool is_costandard(const automaton &aut)
Whether is costandard (unique final state, with weight one, no outcoming transition).
Definition: standard.hh:63
bool is_out_sorted(const automaton &aut)
Whether the outgoing transitions of each state have increasing labels.
Definition: sort.hh:76
automaton cominimize(const automaton &aut, const std::string &algo="auto")
The cominimized automaton.
Definition: minimize.hh:195
polynomial ldiv(const polynomial &lhs, const polynomial &rhs)
Left-division of two polynomials (lhs \ rhs).
automaton letterize(const automaton &aut)
The automaton with letter transitions instead of words.
Definition: letterize.hh:147
automaton component(const automaton &aut, unsigned num)
The automaton of a strongly connected component.
Definition: scc.hh:771
polynomial read_polynomial(const context &ctx, std::istream &is)
Read a polynomial from a stream.
Definition: read.hh:64
expression read_expression(const context &ctx, rat::identities ids, std::istream &is, const std::string &format="default")
Read an expression from a stream.
Definition: read.cc:59
bool is_trim(const automaton &aut)
Whether has no useless state.
Definition: accessible.hh:251
bool is_letterized(const automaton &aut)
Whether aut is letterized.
Definition: letterize.hh:202
automaton infiltration(const automaton &lhs, const automaton &rhs)
The infiltration of automata lhs and rhs.
Definition: others.cc:58
automaton standard(const automaton &a)
A standardized a.
Definition: standard.hh:138
polynomial lightest(const automaton &aut, unsigned num=1, const std::string &algo="auto")
The approximated behavior of an automaton with smallest weights.
Definition: lightest.hh:215
context join(const context &lhs, const context &rhs)
The join between two contexts, i.e., their lowest common supertype.
polynomial split(const expression &exp)
Break exp.
Definition: split.hh:277
automaton derived_term(const expression &exp, const std::string &algo="auto")
The derived-term automaton of exp.
expression expression_zero(const context &c, rat::identities ids)
The expression for \z.
Definition: constant.hh:24
automaton reduce(const automaton &aut)
Reduce aut.
Definition: reduce.hh:621
automaton prefix(const automaton &aut)
Create a prefix automaton from aut.
Definition: prefix.hh:84
std::shared_ptr< detail::expression_base > expression
Definition: expression.hh:92
bool has_lightening_cycle(const automaton &aut)
Whether the automaton has a cycle with lightening weight.
automaton u(const context &ctx, unsigned n)
The Brzozowski universal witness.
Definition: u.hh:70
expression transposition(const expression &r)
Add the transposition operator to r.
static identities ids(const driver &d)
Get the identities of the driver.
Definition: parse.cc:89
bool is_cycle_ambiguous(const automaton &aut)
Whether the automaton is cycle-ambiguous.
automaton synchronize(const automaton &aut)
Create a synchronized transducer from aut.
Definition: synchronize.hh:362
bool less_than(const expression &lhs, const expression &rhs)
Ordering between expressions.
bool is_realtime(const automaton &aut)
Whether has no spontaneous transition, and is letterized.
Definition: letterize.hh:260
automaton determinize(const automaton &aut, const std::string &algo="auto")
The determinized automaton.
Definition: determinize.hh:350
std::ostream & info(const automaton &aut, std::ostream &out, bool detailed=false)
Output various facts about an automaton.
Definition: info.hh:130
expression expression_one(const context &c, rat::identities ids)
The expression for \e.
Definition: constant.hh:15
automaton to_automaton(const expression &exp, const std::string &algo="auto")
An automaton denoting the language of exp.
Definition: others.cc:162
automaton double_ring(const context &ctx, unsigned n, const std::vector< unsigned > &f)
The double_ring automaton with n states and f the list of finals.
Definition: double-ring.hh:77
automaton filter(const automaton &aut, const std::vector< unsigned > &ss)
The subautomaton based on aut, with only states in ss visible.
Definition: filter.hh:184
label read_label(const context &ctx, std::istream &is, const std::string &format="default")
Read a label from a stream.
Definition: read.cc:84
automaton copy(const automaton &aut)
A copy of aut.
Definition: copy.hh:421
automaton ladybird(const context &ctx, unsigned n)
The ladybird automaton with n states.
Definition: ladybird.hh:56
std::size_t num_components(const automaton &aut)
The number of strongly connected components.
Definition: scc.hh:735
automaton sort(const automaton &a)
A copy of a with normalized state numbers.
Definition: sort.hh:178