Vcsn  2.4
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>
10 #include <vcsn/ctx/fwd.hh>
11 #include <vcsn/dyn/fwd.hh>
12 #include <vcsn/dyn/types.hh>
13 #include <vcsn/misc/export.hh> // LIBVCSN_API
14 
15 namespace vcsn
16 {
17  namespace dyn LIBVCSN_API
18  {
20  automaton accessible(const automaton& aut);
21 
23  word ambiguous_word(const automaton& aut);
24 
28  bool are_equivalent(const automaton& lhs, const automaton& rhs);
29 
33  bool are_equivalent(const expression& lhs, const expression& rhs);
34 
37  bool are_isomorphic(const automaton& lhs, const automaton& rhs);
38 
40  automaton cerny(const context& ctx, unsigned num_states);
41 
43  automaton coaccessible(const automaton& aut);
44 
54  automaton codeterminize(const automaton& aut,
55  const std::string& algo = "auto");
56 
63  automaton cominimize(const automaton& aut,
64  const std::string& algo = "auto");
65 
72  automaton complement(const automaton& aut);
73 
75  expansion complement(const expansion& x);
76 
79 
82  automaton complete(const automaton& aut);
83 
88  automaton component(const automaton& aut, unsigned num);
89 
95  automaton compose(const automaton& lhs, const automaton& rhs,
96  bool lazy = false);
97 
99  expansion compose(const expansion& lhs, const expansion& rhs);
100 
102  expression compose(const expression& lhs, const expression& rhs);
103 
105  polynomial compose(const polynomial& lhs, const polynomial& rhs);
106 
110  expression concatenate(const expression& lhs, const expression& rhs);
111 
114  automaton condense(const automaton& aut);
115 
122  automaton conjunction(const automaton& lhs, const automaton& rhs,
123  bool lazy = false);
124 
130  automaton conjunction(const std::vector<automaton>& as,
131  bool lazy = false);
132 
134  automaton conjunction(const automaton& aut, unsigned n);
135 
137  expansion conjunction(const expansion& lhs, const expansion& rhs);
138 
140  expression conjunction(const expression& lhs, const expression& rhs);
141 
143  polynomial conjunction(const polynomial& lhs, const polynomial& rhs);
144 
146  automaton conjugate(const automaton& aut);
147 
149  weight constant_term(const expression& e);
150 
152  context context_of(const automaton& a);
153 
155  context context_of(const expansion& r);
156 
158  context context_of(const expression& r);
159 
161  context context_of(const polynomial& r);
162 
164  automaton copy(const automaton& aut);
165 
167  automaton copy(const automaton& aut, const context& ctx);
168 
170  expression copy(const expression& exp,
171  const context& ctx, identities ids);
172 
174  automaton costandard(const automaton& a);
175 
180  automaton cotrie(const polynomial& p);
181 
189  automaton cotrie(const context& ctx, std::istream& is,
190  const std::string& format = "default");
191 
193  automaton de_bruijn(const context& ctx, unsigned n);
194 
196  automaton delay_automaton(const automaton& a);
197 
204  polynomial derivation(const expression& exp, const label& lbl,
205  bool breaking = false);
206 
216  automaton derived_term(const expression& exp,
217  const std::string& algo = "auto");
218 
228  automaton determinize(const automaton& aut,
229  const std::string& algo = "auto");
230 
237  automaton difference(const automaton& lhs, const automaton& rhs);
238 
240  expression difference(const expression& lhs, const expression& rhs);
241 
244  automaton divkbaseb(const context& ctx, unsigned divisor, unsigned base);
245 
247  automaton double_ring(const context& ctx, unsigned n,
248  const std::vector<unsigned>& f);
249 
251  automaton eliminate_state(const automaton& aut,
252  int s = -1);
253 
255  weight evaluate(const automaton& aut, const word& l);
256 
258  weight evaluate(const automaton& aut, const polynomial& p);
259 
262  expression expand(const expression& e);
263 
265  expression expression_one(const context& c, identities ids);
266 
268  expression expression_zero(const context& c, identities ids);
269 
271  automaton factor(const automaton& aut);
272 
274  automaton filter(const automaton& aut, const std::vector<unsigned>& ss);
275 
277  automaton focus(const automaton& aut, unsigned tape);
278 
280  bool has_twins_property(const automaton& aut);
281 
283  bool has_lightening_cycle(const automaton& aut);
284 
286  bool has_bounded_lag(const automaton& aut);
287 
289  identities identities_of(const expression& exp);
290 
298  automaton inductive(const expression& e, const std::string& algo = "auto");
299 
302  automaton infiltrate(const automaton& lhs, const automaton& rhs);
303 
306  automaton infiltrate(const std::vector<automaton>& as);
307 
310  expression infiltrate(const expression& lhs, const expression& rhs);
311 
318  std::ostream& info(const automaton& aut, std::ostream& out = std::cout,
319  unsigned details = 2);
320 
322  std::ostream& info(const expression& exp, std::ostream& out = std::cout);
323 
334  automaton insplit(const automaton& aut, bool lazy = false);
335 
337  bool is_accessible(const automaton& aut);
338 
342  bool is_ambiguous(const automaton& aut);
343 
345  bool is_coaccessible(const automaton& aut);
346 
350  bool is_codeterministic(const automaton& aut);
351 
355  bool is_complete(const automaton& aut);
356 
359  bool is_costandard(const automaton& aut);
360 
362  bool is_cycle_ambiguous(const automaton& aut);
363 
366  bool is_deterministic(const automaton& aut);
367 
369  bool is_empty(const automaton& aut);
370 
372  bool is_eps_acyclic(const automaton& aut);
373 
377  bool is_functional(const automaton& aut);
378 
380  bool is_letterized(const automaton& aut);
381 
385  bool is_partial_identity(const automaton& aut);
386 
389  bool is_normalized(const automaton& aut);
390 
392  bool is_out_sorted(const automaton& aut);
393 
395  bool is_proper(const automaton& aut);
396 
398  bool is_realtime(const automaton& aut);
399 
402  bool is_standard(const automaton& aut);
403 
405  bool is_synchronized(const automaton& aut);
406 
408  bool is_synchronized_by(const automaton& aut, const word& word);
409 
411  bool is_synchronizing(const automaton& aut);
412 
414  bool is_trim(const automaton& aut);
415 
417  bool is_useless(const automaton& aut);
418 
420  bool is_valid(const automaton& e);
421 
424  bool is_valid(const expression& e);
425 
427  context join(const context& lhs, const context& rhs);
428 
430  automaton ladybird(const context& ctx, unsigned n);
431 
433  automaton ldivide(const automaton& lhs, const automaton& rhs);
434 
436  expansion ldivide(const expansion& lhs, const expansion& rhs);
437 
439  expression ldivide(const expression& lhs, const expression& rhs);
440 
442  label ldivide(const label& lhs, const label& rhs);
443 
445  polynomial ldivide(const polynomial& lhs, const polynomial& rhs);
446 
448  weight ldivide(const weight& lhs, const weight& rhs);
449 
451  polynomial lgcd(const polynomial& lhs, const polynomial& rhs);
452 
464  automaton lweight(const weight& w, const automaton& aut,
465  const std::string& algo = "auto");
466 
468  expansion lweight(const weight& w, const expansion& exp);
469 
471  expression lweight(const weight& w, const expression& exp);
472 
474  polynomial lweight(const weight& w, const polynomial& p);
475 
477  bool less_than(const expression& lhs, const expression& rhs);
478 
480  automaton letterize(const automaton& aut);
481 
483  automaton levenshtein(const context& ls);
484 
493  automaton lift(const automaton& aut,
494  const std::vector<unsigned>& tapes = {},
495  identities ids = {});
496 
498  expression lift(const expression& e);
499 
505  polynomial lightest(const automaton& aut, unsigned num = 1,
506  const std::string& algo = "auto");
507 
509  automaton lightest_automaton(const automaton& aut,
510  unsigned num = 1,
511  const std::string& algo = "auto");
512 
514  context make_context(const std::string& name);
515 
517  automaton_editor* make_automaton_editor(const context& ctx);
518 
520  context make_word_context(const context& ctx);
521 
533  automaton multiply(const automaton& lhs, const automaton& rhs,
534  const std::string& algo = "auto");
535 
550  automaton multiply(const automaton& aut, int min, int max = -2,
551  const std::string& algo = "auto");
552 
554  expression multiply(const expression& lhs, const expression& rhs);
555 
563  expression multiply(const expression& e, int min, int max = -2);
564 
566  label multiply(const label& lhs, const label& rhs);
567 
572  label multiply(const label& l, int num);
573 
575  polynomial multiply(const polynomial& lhs, const polynomial& rhs);
576 
578  weight multiply(const weight& lhs, const weight& rhs);
579 
587  weight multiply(const weight& e, int min, int max = -2);
588 
595  automaton minimize(const automaton& aut,
596  const std::string& algo = "auto");
597 
599  automaton normalize(const automaton& aut);
600 
602  std::size_t num_components(const automaton& aut);
603 
606  std::size_t num_tapes(const context& ctx);
607 
609  automaton pair(const automaton& aut, bool keep_initials = false);
610 
612  automaton partial_identity(const automaton& aut);
613 
616 
618  automaton prefix(const automaton& aut);
619 
634  std::ostream& print(const automaton& aut, std::ostream& out = std::cout,
635  const std::string& format = "default");
636 
638  std::ostream& print(const context& c, std::ostream& out = std::cout,
639  const std::string& format = "default");
640 
642  std::ostream& print(const expansion& e, std::ostream& out = std::cout,
643  const std::string& format = "default");
644 
646  std::ostream& print(const expression& e, std::ostream& out = std::cout,
647  const std::string& format = "default");
648 
650  std::ostream& print(const label& l, std::ostream& out = std::cout,
651  const std::string& format = "default");
652 
654  std::ostream& print(const polynomial& p, std::ostream& out = std::cout,
655  const std::string& format = "default");
656 
658  std::ostream& print(const weight& w, std::ostream& out = std::cout,
659  const std::string& format = "default");
660 
663  automaton quotkbaseb(const context& ctx, unsigned divisor, unsigned base);
664 
666  void set_format(std::ostream& out, const std::string& format);
667 
669  std::string get_format(std::ostream& out);
670 
672  automaton project(const automaton& aut, unsigned tape);
673 
675  context project(const context& ctx, unsigned tape);
676 
678  expansion project(const expansion& xpn, unsigned tape);
679 
681  expression project(const expression& exp, unsigned tape);
682 
684  polynomial project(const polynomial& p, unsigned tape);
685 
687  label project(const label& p, unsigned tape);
688 
701  automaton proper(const automaton& aut,
703  bool prune = true, const std::string& algo = "auto");
704 
706  automaton push_weights(const automaton& aut);
707 
735  automaton random_automaton(const context& ctx,
736  unsigned num_states,
737  float density = 0.1,
738  unsigned num_initial = 1,
739  unsigned num_final = 1,
740  boost::optional<unsigned> max_labels = {},
741  float loop_chance = 0.0,
742  const std::string& weights = "");
743 
750  automaton random_automaton_deterministic(const context& ctx,
751  unsigned num_states);
752 
764  expression
765  random_expression(const context& ctx,
766  const std::string& param = "+, ., *=.2, w., .w, length=10",
767  identities ids = {});
768 
777  weight random_weight(const context& ctx, const std::string& param);
778 
780  automaton rdivide(const automaton& lhs, const automaton& rhs);
781 
783  expression rdivide(const expression& lhs, const expression& rhs);
784 
786  label rdivide(const label& lhs, const label& rhs);
787 
789  weight rdivide(const weight& lhs, const weight& rhs);
790 
796  automaton read_automaton(std::istream& is,
797  const std::string& format = "default",
798  bool strip = true);
799 
806  expression read_expression(const context& ctx, identities ids,
807  std::istream& is,
808  const std::string& format = "default");
809 
815  label read_label(const context& ctx, std::istream& is,
816  const std::string& format = "default");
817 
822  polynomial read_polynomial(const context& ctx, std::istream& is);
823 
828  weight read_weight(const context& ctx, std::istream& is);
829 
831  automaton realtime(const automaton& aut);
832 
834  automaton reduce(const automaton& aut);
835 
853  automaton rweight(const automaton& aut, const weight& w,
854  const std::string& algo = "auto");
855 
857  expansion rweight(const expansion& aut, const weight& w);
858 
860  expression rweight(const expression& exp, const weight& w);
861 
863  polynomial rweight(const polynomial& p, const weight& w);
864 
870  automaton scc(const automaton& aut, const std::string& algo = "auto");
871 
877  polynomial shortest(const automaton& aut,
878  boost::optional<unsigned> num = {},
879  boost::optional<unsigned> len = {});
880 
883  automaton shuffle(const automaton& lhs, const automaton& rhs);
884 
887  automaton shuffle(const std::vector<automaton>& as);
888 
891  expression shuffle(const expression& lhs, const expression& rhs);
892 
894  automaton sort(const automaton& a);
895 
897  polynomial split(const expression& exp);
898 
900  polynomial split(const polynomial& p);
901 
903  automaton standard(const automaton& a);
904 
906  automaton standard(const expression& e);
907 
918  automaton star(const automaton& aut, const std::string& algo = "auto");
919 
921  unsigned star_height(const expression& rs);
922 
928 
930  automaton strip(const automaton& a);
931 
933  automaton suffix(const automaton& aut);
934 
939  automaton subword(const automaton& aut);
940 
951  automaton add(const automaton& lhs, const automaton& rhs,
952  const std::string& algo = "auto");
953 
955  expression add(const expression& lhs, const expression& rhs);
956 
958  expansion add(const expansion& lhs, const expansion& rhs);
959 
961  polynomial add(const polynomial& lhs, const polynomial& rhs);
962 
964  weight add(const weight& lhs, const weight& rhs);
965 
967  automaton synchronize(const automaton& aut);
968 
970  word synchronizing_word(const automaton& aut,
971  const std::string& algo = "greedy");
972 
974  automaton thompson(const expression& e);
975 
991  automaton to_automaton(const expression& exp,
992  const std::string& algo = "auto");
993 
997  expansion to_expansion(const expression& exp);
998 
1004  expression to_expression(const automaton& aut,
1005  identities ids = {},
1006  const std::string& algo = "auto");
1007 
1009  expression to_expression(const context& ctx, identities ids,
1010  const label& l);
1011 
1023  expression to_expression(const context& ctx, identities ids,
1024  const letter_class_t& letters,
1025  bool accept = true);
1026 
1028  automaton transpose(automaton& aut);
1029 
1031  expression transpose(const expression& e);
1032 
1035 
1040  automaton trie(const polynomial& p);
1041 
1048  automaton trie(const context& ctx, std::istream& is,
1049  const std::string& format = "default");
1050 
1052  automaton trim(const automaton& aut);
1053 
1058  automaton tuple(const automaton& lhs, const automaton& rhs);
1059 
1063  automaton tuple(const std::vector<automaton>& as);
1064 
1066  context tuple(const context& lhs, const context& rhs);
1067 
1071  context tuple(const std::vector<context>& ctxs);
1072 
1074  expansion tuple(const std::vector<expansion>& rs);
1075 
1077  expression tuple(const expression& lhs, const expression& rhs);
1078 
1080  expression tuple(const std::vector<expression>& rs);
1081 
1083  polynomial tuple(const std::vector<polynomial>& ps);
1084 
1086  std::string type(const automaton& a);
1087 
1089  automaton u(const context& ctx, unsigned n);
1090 
1092  automaton universal(const automaton& aut);
1093 
1095  weight weight_one(const context& c);
1096 
1098  weight weight_series(const automaton& aut);
1099 
1101  weight weight_zero(const context& c);
1102 
1108  automaton zpc(const expression& exp, const std::string& algo = "auto");
1109 
1111  std::ostream& operator<<(std::ostream& o, const automaton& a);
1112 
1114  std::ostream& operator<<(std::ostream& o, const context& c);
1115 
1117  std::ostream& operator<<(std::ostream& o, const expansion& e);
1118 
1120  std::ostream& operator<<(std::ostream& o, const expression& r);
1121 
1123  std::ostream& operator<<(std::ostream& o, const label& l);
1124 
1126  std::ostream& operator<<(std::ostream& o, const polynomial& p);
1127 
1129  std::ostream& operator<<(std::ostream& o, const weight& w);
1130  }
1131 }
bool is_valid(const automaton &e)
Whether automaton is valid (epsilon-cycles converge).
Definition: is-valid.hh:150
value_impl< detail::expansion_tag > expansion
Definition: fwd.hh:24
expansion to_expansion(const expression &exp)
First order development of a exp.
automaton eliminate_state(const automaton &aut, int s=-1)
The LAO automaton aut with state s removed.
std::ostream & print(const automaton &aut, std::ostream &out=std::cout, const std::string &format="default")
Print automaton a on out using format format.
Definition: print.hh:121
automaton condense(const automaton &aut)
The condensation of aut such that each state is a strongly connected component.
Definition: scc.hh:832
automaton tuple(const automaton &lhs, const automaton &rhs)
Build a two-tape automaton from two automata.
Definition: others.cc:219
weight evaluate(const automaton &aut, const word &l)
Evaluate l on aut.
Definition: evaluate.hh:212
std::size_t num_components(const automaton &aut)
The number of strongly connected components.
Definition: scc.hh:735
polynomial lgcd(const polynomial &lhs, const polynomial &rhs)
Left greatest common divisor of two polynomials (lhs \ rhs).
bool is_realtime(const automaton &aut)
Whether has no spontaneous transition, and is letterized.
Definition: letterize.hh:259
automaton determinize(const automaton &aut, const std::string &algo="auto")
The determinized automaton.
Definition: determinize.hh:357
Looking upstream.
automaton zpc(const expression &exp, const std::string &algo="auto")
The ZPC automaton of exp.
Definition: zpc.hh:376
automaton quotkbaseb(const context &ctx, unsigned divisor, unsigned base)
A transducer that computes the quotient of the division of a word n by k in base b iff k|n...
Definition: quotkbaseb.hh:76
expression transposition(const expression &r)
Add the transposition operator to r.
auto rs
Definition: lift.hh:152
automaton codeterminize(const automaton &aut, const std::string &algo="auto")
The codeterminized automaton.
Definition: determinize.hh:430
bool is_costandard(const automaton &aut)
Whether is costandard (unique final state, with weight one, no outcoming transition).
Definition: standard.hh:63
context make_word_context(const context &ctx)
The context for words.
word ambiguous_word(const automaton &aut)
An ambiguous word, or raise if there is none.
bool less_than(const expression &lhs, const expression &rhs)
Ordering between expressions.
static identities ids(const driver &d)
Get the identities of the driver.
Definition: parse.cc:89
expression random_expression(const context &ctx, const std::string &param="+, ., *=.2, w., .w, length=10", identities ids={})
A random expression.
automaton push_weights(const automaton &aut)
The weight pushing automaton of aut.
Definition: push-weights.hh:71
expression to_expression(const automaton &aut, identities ids={}, const std::string &algo="auto")
An expression denoting the language of aut.
expression read_expression(const context &ctx, identities ids, std::istream &is, const std::string &format="default")
Read an expression from a stream.
value_impl< detail::weight_tag > weight
Definition: fwd.hh:28
context join(const context &lhs, const context &rhs)
The join between two contexts, i.e., their lowest common supertype.
bool is_coaccessible(const automaton &aut)
Whether aut is coaccessible.
Definition: accessible.hh:242
bool are_isomorphic(const automaton &lhs, const automaton &rhs)
Whether there exists an isomorphism between the states of lhs and those of rhs.
expression expression_zero(const context &c, identities ids)
The expression for \\z.
Definition: constant.hh:24
automaton cotrie(const polynomial &p)
A reversed trie-like automaton (multiple initial states, single final state) automaton to accept p...
Definition: trie.hh:251
polynomial read_polynomial(const context &ctx, std::istream &is)
Read a polynomial from a stream.
Definition: read.hh:60
automaton coaccessible(const automaton &aut)
The coaccessible subautomaton of aut.
Definition: accessible.hh:215
automaton focus(const automaton &aut, unsigned tape)
Focus on a specific tape of a tupleset automaton.
Definition: others.cc:44
polynomial split(const expression &exp)
Break exp.
Definition: split.hh:275
bool is_functional(const automaton &aut)
Whether aut is functional.
bool is_normalized(const automaton &aut)
Whether is normalized (in the Thompson sense), i.e., standard and co-standard.
Definition: normalize.hh:33
automaton read_automaton(std::istream &is, const std::string &format="default", bool strip=true)
Read an automaton from a stream.
Definition: read.cc:34
label read_label(const context &ctx, std::istream &is, const std::string &format="default")
Read a label from a stream.
Definition: read.cc:85
automaton shuffle(const automaton &lhs, const automaton &rhs)
The shuffle product of automata lhs and rhs.
Definition: others.cc:164
bool is_synchronized(const automaton &aut)
Whether is synchronized.
automaton rdivide(const automaton &lhs, const automaton &rhs)
Right-division of two automata (lhs / rhs).
Definition: conjunction.hh:767
automaton normalize(const automaton &aut)
Normalize automaton aut.
Definition: normalize.hh:41
weight random_weight(const context &ctx, const std::string &param)
A random weight.
automaton strip(const automaton &a)
The automaton in a with its metadata layers removed.
Definition: strip.hh:46
automaton de_bruijn(const context &ctx, unsigned n)
A simple NFA for (a+b)*a(a+b)^n.
Definition: de-bruijn.hh:57
automaton derived_term(const expression &exp, const std::string &algo="auto")
The derived-term automaton of exp.
weightset_mixin< detail::r_impl > r
Definition: fwd.hh:54
automaton complement(const automaton &aut)
The complement of aut.
Definition: complement.hh:63
word synchronizing_word(const automaton &aut, const std::string &algo="greedy")
A synchronizing word, or raise if there is none.
#define LIBVCSN_API
Definition: export.hh:8
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:299
automaton copy(const automaton &aut)
A copy of aut.
Definition: copy.hh:435
std::string get_format(std::ostream &out)
Get the output format for out.
Definition: print.cc:171
automaton ldivide(const automaton &lhs, const automaton &rhs)
Left-division of two automata (lhs \ rhs).
Definition: conjunction.hh:732
automaton cerny(const context &ctx, unsigned num_states)
Produce a Černý automaton of num_states states.
Definition: cerny.hh:64
bool are_equivalent(const automaton &lhs, const automaton &rhs)
Whether compute the same series.
automaton rweight(const automaton &aut, const weight &w, const std::string &algo="auto")
The right-mult automaton with w as weight.
Definition: weight.hh:351
automaton compose(const automaton &lhs, const automaton &rhs, bool lazy=false)
The composition of transducers lhs and rhs.
Definition: compose.hh:495
bool is_cycle_ambiguous(const automaton &aut)
Whether the automaton is cycle-ambiguous.
automaton insplit(const automaton &aut, bool lazy=false)
Split automaton on the incoming transition.
Definition: insplit.hh:303
context make_context(const std::string &name)
Build a context from its name.
Definition: others.cc:97
automaton factor(const automaton &aut)
Create a factor automaton from aut.
Definition: prefix.hh:121
weight weight_series(const automaton &aut)
Compute weight of the series.
automaton lift(const automaton &aut, const std::vector< unsigned > &tapes={}, identities ids={})
Lift some tapes of the transducer, or turn an automaton into a spontaneous automaton.
automaton thompson(const expression &e)
The Thompson automaton of e.
Definition: thompson.hh:215
bool has_bounded_lag(const automaton &aut)
Whether the transducer has bounded lag.
automaton realtime(const automaton &aut)
Create the realtime automaton (letterized and proper).
Definition: letterize.hh:231
automaton conjugate(const automaton &aut)
The conjugate of aut.
Definition: conjugate.hh:59
std::string type(const automaton &a)
The implementation type of a.
Definition: others.cc:239
return exp min
Definition: multiply.hh:361
bool is_complete(const automaton &aut)
Whether aut is complete.
Definition: is-complete.hh:52
Definition: a-star.hh:8
automaton project(const automaton &aut, unsigned tape)
Keep a single tape from a multiple-tape automaton.
Definition: others.cc:113
weight constant_term(const expression &e)
The weight associated to the empty word in e.
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
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
Definition: automaton.hh:85
bool is_useless(const automaton &aut)
Whether has no useful state.
Definition: accessible.hh:260
automaton suffix(const automaton &aut)
Create a suffix automaton from aut.
Definition: prefix.hh:44
automaton conjunction(const automaton &lhs, const automaton &rhs, bool lazy=false)
The conjunction (aka synchronized product) of automata.
Definition: others.cc:24
bool is_deterministic(const automaton &aut)
Whether aut is deterministic.
weight weight_zero(const context &c)
The weight zero.
Definition: constant.hh:42
automaton ladybird(const context &ctx, unsigned n)
The ladybird automaton with n states.
Definition: ladybird.hh:54
automaton random_automaton(const context &ctx, unsigned num_states, float density=0.1, unsigned num_initial=1, unsigned num_final=1, boost::optional< unsigned > max_labels={}, float loop_chance=0.0, const std::string &weights="")
A random automaton.
bool is_synchronized_by(const automaton &aut, const word &word)
Whether the word synchronizes aut.
weight read_weight(const context &ctx, std::istream &is)
Read a weight from a stream.
Definition: read.hh:90
std::set< std::pair< std::string, std::string >> letter_class_t
A set of letter ranges.
Definition: fwd.hh:111
polynomial shortest(const automaton &aut, boost::optional< unsigned > num={}, boost::optional< unsigned > len={})
The approximated behavior of an automaton.
Definition: shortest.hh:318
automaton trie(const polynomial &p)
A trie-like automaton (single initial state, multiple final states) to accept p.
Definition: trie.hh:242
automaton infiltrate(const automaton &lhs, const automaton &rhs)
The infiltration of automata lhs and rhs.
Definition: others.cc:56
std::ostream & operator<<(std::ostream &o, const automaton &a)
Output automaton a on o.
Definition: print.cc:178
automaton lweight(const weight &w, const automaton &aut, const std::string &algo="auto")
The left-multiplication of an automaton with w as weight.
Definition: weight.hh:149
std::size_t num_tapes(const context &ctx)
The number of input tapes.
automaton minimize(const automaton &aut, const std::string &algo="auto")
The minimized automaton.
Definition: minimize.hh:158
bool is_eps_acyclic(const automaton &aut)
Whether has no cycle of spontaneous transitions.
Definition: is-acyclic.hh:145
expression expand(const expression &e)
Distribute product over addition recursively under the starred subexpressions and group the equal mon...
Definition: expand.hh:30
automaton costandard(const automaton &a)
A co-standardized a.
Definition: standard.hh:148
bool is_standard(const automaton &aut)
Whether is standard (unique initial state, with weight one, no incoming transition).
Definition: standard.hh:54
automaton component(const automaton &aut, unsigned num)
The automaton of a strongly connected component.
Definition: scc.hh:771
bool is_accessible(const automaton &aut)
Whether aut is accessible.
Definition: accessible.hh:233
automaton lightest_automaton(const automaton &aut, unsigned num=1, const std::string &algo="auto")
The shortest path automaton using the given algorithm.
bool is_synchronizing(const automaton &aut)
Whether is synchronizing.
expression star_normal_form(const expression &e)
A normalized form where star is applied only to proper expressions.
identities identities_of(const expression &exp)
The identities of expression exp.
expression expression_one(const context &c, identities ids)
The expression for \\e.
Definition: constant.hh:15
automaton filter(const automaton &aut, const std::vector< unsigned > &ss)
The subautomaton based on aut, with only states in ss visible.
Definition: filter.hh:322
automaton letterize(const automaton &aut)
The automaton with letter transitions instead of words.
Definition: letterize.hh:146
automaton star(const automaton &aut, const std::string &algo="auto")
Star of an automaton.
Definition: star.hh:124
automaton u(const context &ctx, unsigned n)
The Brzozowski universal witness.
Definition: u.hh:68
automaton random_automaton_deterministic(const context &ctx, unsigned num_states)
A random deterministic automaton.
bool is_letterized(const automaton &aut)
Whether aut is letterized.
Definition: letterize.hh:201
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:227
automaton difference(const automaton &lhs, const automaton &rhs)
An automaton whose behavior is that of lhs on words not accepted by rhs.
automaton partial_identity(const automaton &aut)
Create a partial identity transducer from aut.
automaton levenshtein(const context &ls)
The transducer representing the Levenshtein distance.
Definition: levenshtein.hh:63
automaton cominimize(const automaton &aut, const std::string &algo="auto")
The cominimized automaton.
Definition: minimize.hh:196
expression concatenate(const expression &lhs, const expression &rhs)
Concatenate two expressions.
bool is_out_sorted(const automaton &aut)
Whether the outgoing transitions of each state have increasing labels.
Definition: sort.hh:75
automaton multiply(const automaton &lhs, const automaton &rhs, const std::string &algo="auto")
Multiply (concatenate) two automata.
Definition: multiply.hh:169
direction
Orientation.
Definition: direction.hh:11
automaton trim(const automaton &aut)
The trim subautomaton of aut.
Definition: accessible.hh:224
automaton_editor * make_automaton_editor(const context &ctx)
Build an automatonset from its context.
automaton subword(const automaton &aut)
Create a subword automaton from aut.
Definition: prefix.hh:174
polynomial derivation(const expression &exp, const label &lbl, bool breaking=false)
Derive exp with respect to s.
Definition: derivation.hh:356
automaton add(const automaton &lhs, const automaton &rhs, const std::string &algo="auto")
Sum of two automata.
Definition: add.hh:124
context context_of(const automaton &a)
The context of this automaton.
Definition: make-context.hh:63
bool is_codeterministic(const automaton &aut)
Whether aut is codeterministic.
automaton to_automaton(const expression &exp, const std::string &algo="auto")
An automaton denoting the language of exp.
Definition: others.cc:176
value_impl< detail::label_tag > label
Definition: fwd.hh:26
value_impl< detail::expression_tag > expression
Definition: fwd.hh:25
automaton prefix(const automaton &aut)
Create a prefix automaton from aut.
Definition: prefix.hh:84
unsigned star_height(const expression &rs)
Star height of an expression.
Definition: star-height.hh:158
automaton transpose(automaton &aut)
Transpose aut.
Definition: transpose.hh:273
automaton complete(const automaton &aut)
A completed copy of aut.
Definition: complete.hh:80
void set_format(std::ostream &out, const std::string &format)
Specify the output format for out.
Definition: print.cc:164
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:75
automaton synchronize(const automaton &aut)
Create a synchronized transducer from aut.
Definition: synchronize.hh:362
std::ostream & info(const automaton &aut, std::ostream &out=std::cout, unsigned details=2)
Output various facts about an automaton.
Definition: info.hh:136
automaton standard(const automaton &a)
A standardized a.
Definition: standard.hh:139
bool is_ambiguous(const automaton &aut)
Whether aut is ambiguous.
Definition: is-ambiguous.hh:97
automaton inductive(const expression &e, const std::string &algo="auto")
The inductive translation of e in an automaton.
Definition: inductive.hh:326
label word
The type of a word.
Definition: types.hh:20
automaton universal(const automaton &aut)
The universal automaton of aut.
Definition: universal.hh:148
bool is_partial_identity(const automaton &aut)
Whether aut realizes a partial identity.
bool has_twins_property(const automaton &aut)
Whether the automaton has the twins property.
automaton accessible(const automaton &aut)
The accessible subautomaton of aut.
Definition: accessible.hh:206
value_impl< detail::polynomial_tag > polynomial
Definition: fwd.hh:27
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:69
automaton sort(const automaton &a)
A copy of a with normalized state numbers.
Definition: sort.hh:176
automaton delay_automaton(const automaton &a)
The automaton with the delay of each state.
bool is_trim(const automaton &aut)
Whether has no useless state.
Definition: accessible.hh:251
bool is_proper(const automaton &aut)
Whether has no spontaneous transition.
Definition: is-proper.hh:58
automaton pair(const automaton &aut, bool keep_initials=false)
Build the pair automaton of the given automaton.
Definition: pair.hh:264
bool is_empty(const automaton &aut)
Whether has no state.
Definition: accessible.hh:269
automaton reduce(const automaton &aut)
Reduce aut.
Definition: reduce.hh:621
bool has_lightening_cycle(const automaton &aut)
Whether the automaton has a cycle with lightening weight.
weight weight_one(const context &c)
The weight one.
Definition: constant.hh:33