Vcsn  2.3
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  label 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 eval(const automaton& aut, const label& l);
256 
259  expression expand(const expression& e);
260 
262  expression expression_one(const context& c, identities ids);
263 
265  expression expression_zero(const context& c, identities ids);
266 
268  automaton factor(const automaton& aut);
269 
271  automaton filter(const automaton& aut, const std::vector<unsigned>& ss);
272 
274  automaton focus(const automaton& aut, unsigned tape);
275 
277  bool has_twins_property(const automaton& aut);
278 
280  bool has_lightening_cycle(const automaton& aut);
281 
283  bool has_bounded_lag(const automaton& aut);
284 
286  identities identities_of(const expression& exp);
287 
295  automaton inductive(const expression& e, const std::string& algo = "auto");
296 
299  automaton infiltrate(const automaton& lhs, const automaton& rhs);
300 
303  automaton infiltrate(const std::vector<automaton>& as);
304 
307  expression infiltrate(const expression& lhs, const expression& rhs);
308 
315  std::ostream& info(const automaton& aut, std::ostream& out = std::cout,
316  bool detailed = false);
317 
319  std::ostream& info(const expression& exp, std::ostream& out = std::cout);
320 
331  automaton insplit(const automaton& aut, bool lazy = false);
332 
334  bool is_accessible(const automaton& aut);
335 
339  bool is_ambiguous(const automaton& aut);
340 
342  bool is_coaccessible(const automaton& aut);
343 
347  bool is_codeterministic(const automaton& aut);
348 
352  bool is_complete(const automaton& aut);
353 
356  bool is_costandard(const automaton& aut);
357 
359  bool is_cycle_ambiguous(const automaton& aut);
360 
363  bool is_deterministic(const automaton& aut);
364 
366  bool is_empty(const automaton& aut);
367 
369  bool is_eps_acyclic(const automaton& aut);
370 
374  bool is_functional(const automaton& aut);
375 
377  bool is_letterized(const automaton& aut);
378 
382  bool is_partial_identity(const automaton& aut);
383 
386  bool is_normalized(const automaton& aut);
387 
389  bool is_out_sorted(const automaton& aut);
390 
392  bool is_proper(const automaton& aut);
393 
395  bool is_realtime(const automaton& aut);
396 
399  bool is_standard(const automaton& aut);
400 
402  bool is_synchronized(const automaton& aut);
403 
405  bool is_synchronized_by(const automaton& aut, const label& word);
406 
408  bool is_synchronizing(const automaton& aut);
409 
411  bool is_trim(const automaton& aut);
412 
414  bool is_useless(const automaton& aut);
415 
417  bool is_valid(const automaton& e);
418 
421  bool is_valid(const expression& e);
422 
424  context join(const context& lhs, const context& rhs);
425 
427  automaton ladybird(const context& ctx, unsigned n);
428 
430  automaton ldivide(const automaton& lhs, const automaton& rhs);
431 
433  polynomial ldivide(const polynomial& lhs, const polynomial& rhs);
434 
436  expression ldivide(const expression& lhs, const expression& rhs);
437 
439  polynomial lgcd(const polynomial& lhs, const polynomial& rhs);
440 
452  automaton lweight(const weight& w, const automaton& aut,
453  const std::string& algo = "auto");
454 
456  expansion lweight(const weight& w, const expansion& exp);
457 
459  expression lweight(const weight& w, const expression& exp);
460 
462  polynomial lweight(const weight& w, const polynomial& p);
463 
465  bool less_than(const expression& lhs, const expression& rhs);
466 
468  automaton letterize(const automaton& aut);
469 
471  automaton levenshtein(const context& ls);
472 
481  automaton lift(const automaton& aut,
482  const std::vector<unsigned>& tapes = {},
483  identities ids = {});
484 
486  expression lift(const expression& e);
487 
493  polynomial lightest(const automaton& aut, unsigned num = 1,
494  const std::string& algo = "auto");
495 
497  automaton lightest_automaton(const automaton& aut,
498  unsigned num = 1,
499  const std::string& algo = "auto");
500 
502  context make_context(const std::string& name);
503 
505  automaton_editor* make_automaton_editor(const context& ctx);
506 
508  context make_word_context(const context& ctx);
509 
521  automaton multiply(const automaton& lhs, const automaton& rhs,
522  const std::string& algo = "auto");
523 
538  automaton multiply(const automaton& aut, int min, int max = -2,
539  const std::string& algo = "auto");
540 
542  expression multiply(const expression& lhs, const expression& rhs);
543 
551  expression multiply(const expression& e, int min, int max = -2);
552 
554  label multiply(const label& lhs, const label& rhs);
555 
560  label multiply(const label& l, int num);
561 
563  polynomial multiply(const polynomial& lhs, const polynomial& rhs);
564 
566  weight multiply(const weight& lhs, const weight& rhs);
567 
575  weight multiply(const weight& e, int min, int max = -2);
576 
583  automaton minimize(const automaton& aut,
584  const std::string& algo = "auto");
585 
587  automaton normalize(const automaton& aut);
588 
590  std::size_t num_components(const automaton& aut);
591 
594  std::size_t num_tapes(const context& ctx);
595 
597  automaton pair(const automaton& aut, bool keep_initials = false);
598 
600  automaton partial_identity(const automaton& aut);
601 
603  automaton prefix(const automaton& aut);
604 
619  std::ostream& print(const automaton& aut, std::ostream& out = std::cout,
620  const std::string& format = "default");
621 
623  std::ostream& print(const context& c, std::ostream& out = std::cout,
624  const std::string& format = "default");
625 
627  std::ostream& print(const expansion& e, std::ostream& out = std::cout,
628  const std::string& format = "default");
629 
631  std::ostream& print(const expression& e, std::ostream& out = std::cout,
632  const std::string& format = "default");
633 
635  std::ostream& print(const label& l, std::ostream& out = std::cout,
636  const std::string& format = "default");
637 
639  std::ostream& print(const polynomial& p, std::ostream& out = std::cout,
640  const std::string& format = "default");
641 
643  std::ostream& print(const weight& w, std::ostream& out = std::cout,
644  const std::string& format = "default");
645 
648  automaton quotkbaseb(const context& ctx, unsigned divisor, unsigned base);
649 
651  void set_format(std::ostream& out, const std::string& format);
652 
654  std::string get_format(std::ostream& out);
655 
657  automaton project(const automaton& aut, unsigned tape);
658 
660  context project(const context& ctx, unsigned tape);
661 
663  expansion project(const expansion& xpn, unsigned tape);
664 
666  expression project(const expression& exp, unsigned tape);
667 
669  polynomial project(const polynomial& p, unsigned tape);
670 
672  label project(const label& p, unsigned tape);
673 
686  automaton proper(const automaton& aut,
688  bool prune = true, const std::string& algo = "auto");
689 
691  automaton push_weights(const automaton& aut);
692 
717  automaton random_automaton(const context& ctx,
718  unsigned num_states,
719  float density = 0.1,
720  unsigned num_initial = 1,
721  unsigned num_final = 1,
722  boost::optional<unsigned> max_labels = {},
723  float loop_chance = 0.0);
724 
731  automaton random_automaton_deterministic(const context& ctx,
732  unsigned num_states);
744  expression random_expression(const context& ctx, const std::string& param,
745  identities ids);
746 
748  automaton rdivide(const automaton& lhs, const automaton& rhs);
749 
751  expression rdivide(const expression& lhs, const expression& rhs);
752 
758  automaton read_automaton(std::istream& is,
759  const std::string& format = "default",
760  bool strip = true);
761 
768  expression read_expression(const context& ctx, identities ids,
769  std::istream& is,
770  const std::string& format = "default");
771 
777  label read_label(const context& ctx, std::istream& is,
778  const std::string& format = "default");
779 
784  polynomial read_polynomial(const context& ctx, std::istream& is);
785 
790  weight read_weight(const context& ctx, std::istream& is);
791 
793  automaton realtime(const automaton& aut);
794 
796  automaton reduce(const automaton& aut);
797 
815  automaton rweight(const automaton& aut, const weight& w,
816  const std::string& algo = "auto");
817 
819  expansion rweight(const expansion& aut, const weight& w);
820 
822  expression rweight(const expression& exp, const weight& w);
823 
825  polynomial rweight(const polynomial& p, const weight& w);
826 
832  automaton scc(const automaton& aut, const std::string& algo = "auto");
833 
839  polynomial shortest(const automaton& aut,
840  boost::optional<unsigned> num = {},
841  boost::optional<unsigned> len = {});
842 
845  automaton shuffle(const automaton& lhs, const automaton& rhs);
846 
849  automaton shuffle(const std::vector<automaton>& as);
850 
853  expression shuffle(const expression& lhs, const expression& rhs);
854 
856  automaton sort(const automaton& a);
857 
859  polynomial split(const expression& exp);
860 
862  polynomial split(const polynomial& p);
863 
865  automaton standard(const automaton& a);
866 
868  automaton standard(const expression& e);
869 
880  automaton star(const automaton& aut, const std::string& algo = "auto");
881 
883  unsigned star_height(const expression& rs);
884 
890 
892  automaton strip(const automaton& a);
893 
895  automaton suffix(const automaton& aut);
896 
901  automaton subword(const automaton& aut);
902 
913  automaton add(const automaton& lhs, const automaton& rhs,
914  const std::string& algo = "auto");
915 
917  expression add(const expression& lhs, const expression& rhs);
918 
920  expansion add(const expansion& lhs, const expansion& rhs);
921 
923  polynomial add(const polynomial& lhs, const polynomial& rhs);
924 
926  weight add(const weight& lhs, const weight& rhs);
927 
929  automaton synchronize(const automaton& aut);
930 
932  label synchronizing_word(const automaton& aut,
933  const std::string& algo = "greedy");
934 
936  automaton thompson(const expression& e);
937 
952  automaton to_automaton(const expression& exp,
953  const std::string& algo = "auto");
954 
958  expansion to_expansion(const expression& exp);
959 
965  expression to_expression(const automaton& aut,
966  identities ids = {},
967  const std::string& algo = "auto");
968 
970  expression to_expression(const context& ctx, identities ids,
971  const label& l);
972 
984  expression to_expression(const context& ctx, identities ids,
985  const letter_class_t& letters,
986  bool accept = true);
987 
989  automaton transpose(automaton& aut);
990 
992  expression transpose(const expression& e);
993 
996 
1001  automaton trie(const polynomial& p);
1002 
1009  automaton trie(const context& ctx, std::istream& is,
1010  const std::string& format = "default");
1011 
1013  automaton trim(const automaton& aut);
1014 
1019  automaton tuple(const automaton& lhs, const automaton& rhs);
1020 
1024  automaton tuple(const std::vector<automaton>& as);
1025 
1027  expansion tuple(const std::vector<expansion>& rs);
1028 
1030  expression tuple(const expression& lhs, const expression& rhs);
1031 
1033  expression tuple(const std::vector<expression>& rs);
1034 
1036  polynomial tuple(const std::vector<polynomial>& ps);
1037 
1039  std::string type(const automaton& a);
1040 
1042  automaton u(const context& ctx, unsigned n);
1043 
1045  automaton universal(const automaton& aut);
1046 
1048  weight weight_series(const automaton& aut);
1049 
1055  automaton zpc(const expression& exp, const std::string& algo = "auto");
1056 
1058  std::ostream& operator<<(std::ostream& o, const automaton& a);
1059 
1061  std::ostream& operator<<(std::ostream& o, const context& c);
1062 
1064  std::ostream& operator<<(std::ostream& o, const expansion& e);
1065 
1067  std::ostream& operator<<(std::ostream& o, const expression& r);
1068 
1070  std::ostream& operator<<(std::ostream& o, const label& l);
1071 
1073  std::ostream& operator<<(std::ostream& o, const polynomial& p);
1074 
1076  std::ostream& operator<<(std::ostream& o, const weight& w);
1077  }
1078 }
automaton difference(const automaton &lhs, const automaton &rhs)
An automaton whose behavior is that of lhs on words not accepted by rhs.
value_impl< detail::weight_tag > weight
Definition: fwd.hh:28
context make_context(const std::string &name)
Build a context from its name.
Definition: others.cc:97
std::ostream & operator<<(std::ostream &o, const automaton &a)
Output automaton a on o.
Definition: print.cc:178
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.
std::size_t num_tapes(const context &ctx)
The number of input tapes.
automaton thompson(const expression &e)
The Thompson automaton of e.
Definition: thompson.hh:215
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)
Produce a random automaton.
std::string type(const automaton &a)
The implementation type of a.
Definition: others.cc:231
bool is_synchronizing(const automaton &aut)
Whether is synchronizing.
automaton pair(const automaton &aut, bool keep_initials=false)
Build the pair automaton of the given automaton.
Definition: pair.hh:264
bool is_normalized(const automaton &aut)
Whether is normalized (in the Thompson sense), i.e., standard and co-standard.
Definition: normalize.hh:33
bool is_empty(const automaton &aut)
Whether has no state.
Definition: accessible.hh:269
automaton letterize(const automaton &aut)
The automaton with letter transitions instead of words.
Definition: letterize.hh:146
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 star(const automaton &aut, const std::string &algo="auto")
Star of an automaton.
Definition: star.hh:124
automaton conjunction(const automaton &lhs, const automaton &rhs, bool lazy=false)
The conjunction (aka synchronized product) of automata.
Definition: others.cc:24
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:108
automaton tuple(const automaton &lhs, const automaton &rhs)
Build a two-tape automaton from two automata.
Definition: others.cc:218
automaton complete(const automaton &aut)
A completed copy of aut.
Definition: complete.hh:76
bool is_realtime(const automaton &aut)
Whether has no spontaneous transition, and is letterized.
Definition: letterize.hh:259
automaton levenshtein(const context &ls)
The transducer representing the Levenshtein distance.
Definition: levenshtein.hh:63
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:53
automaton cominimize(const automaton &aut, const std::string &algo="auto")
The cominimized automaton.
Definition: minimize.hh:196
bool is_partial_identity(const automaton &aut)
Whether aut realizes a partial identity.
weight weight_series(const automaton &aut)
Compute weight of the series.
automaton subword(const automaton &aut)
Create a subword automaton from aut.
Definition: prefix.hh:174
automaton sort(const automaton &a)
A copy of a with normalized state numbers.
Definition: sort.hh:176
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
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 delay_automaton(const automaton &a)
The automaton with the delay of each state.
automaton lightest_automaton(const automaton &aut, unsigned num=1, const std::string &algo="auto")
The shortest path automaton using the given algorithm.
identities identities_of(const expression &exp)
The identities of expression exp.
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
Definition: automaton.hh:64
bool is_valid(const automaton &e)
Whether automaton is valid (epsilon-cycles converge).
Definition: is-valid.hh:150
automaton eliminate_state(const automaton &aut, int s=-1)
The LAO automaton aut with state s removed.
automaton transpose(automaton &aut)
Transpose aut.
Definition: transpose.hh:257
bool is_deterministic(const automaton &aut)
Whether aut is deterministic.
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 determinize(const automaton &aut, const std::string &algo="auto")
The determinized automaton.
Definition: determinize.hh:357
expression concatenate(const expression &lhs, const expression &rhs)
Concatenate two expressions.
automaton multiply(const automaton &lhs, const automaton &rhs, const std::string &algo="auto")
Multiply (concatenate) two automata.
Definition: multiply.hh:169
polynomial shortest(const automaton &aut, boost::optional< unsigned > num={}, boost::optional< unsigned > len={})
The approximated behavior of an automaton.
Definition: shortest.hh:280
automaton universal(const automaton &aut)
The universal automaton of aut.
Definition: universal.hh:148
automaton zpc(const expression &exp, const std::string &algo="auto")
The ZPC automaton of exp.
Definition: zpc.hh:376
automaton trim(const automaton &aut)
The trim subautomaton of aut.
Definition: accessible.hh:224
expression transposition(const expression &r)
Add the transposition operator to r.
direction
Orientation.
Definition: direction.hh:11
polynomial derivation(const expression &exp, const label &lbl, bool breaking=false)
Derive exp with respect to s.
Definition: derivation.hh:346
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
automaton costandard(const automaton &a)
A co-standardized a.
Definition: standard.hh:148
weight eval(const automaton &aut, const label &l)
Evaluate l on aut.
Definition: eval.hh:140
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
expression to_expression(const automaton &aut, identities ids={}, const std::string &algo="auto")
An expression denoting the language of aut.
bool is_proper(const automaton &aut)
Whether has no spontaneous transition.
Definition: is-proper.hh:58
bool is_trim(const automaton &aut)
Whether has no useless state.
Definition: accessible.hh:251
automaton add(const automaton &lhs, const automaton &rhs, const std::string &algo="auto")
Sum of two automata.
Definition: add.hh:124
std::string get_format(std::ostream &out)
Get the output format for out.
Definition: print.cc:171
value_impl< detail::label_tag > label
Definition: fwd.hh:26
automaton reduce(const automaton &aut)
Reduce aut.
Definition: reduce.hh:621
bool is_coaccessible(const automaton &aut)
Whether aut is coaccessible.
Definition: accessible.hh:242
expression expression_zero(const context &c, identities ids)
The expression for \z.
Definition: constant.hh:24
automaton factor(const automaton &aut)
Create a factor automaton from aut.
Definition: prefix.hh:121
Looking upstream.
auto rs
Definition: lift.hh:152
automaton u(const context &ctx, unsigned n)
The Brzozowski universal witness.
Definition: u.hh:68
automaton conjugate(const automaton &aut)
The conjugate of aut.
Definition: conjugate.hh:59
automaton inductive(const expression &e, const std::string &algo="auto")
The inductive translation of e in an automaton.
Definition: inductive.hh:326
Definition: a-star.hh:8
bool is_functional(const automaton &aut)
Whether aut is functional.
automaton partial_identity(const automaton &aut)
Create a partial identity transducer from aut.
bool is_synchronized(const automaton &aut)
Whether is synchronized.
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
automaton normalize(const automaton &aut)
Normalize automaton aut.
Definition: normalize.hh:41
bool is_synchronized_by(const automaton &aut, const label &word)
Whether the word synchronizes aut.
context make_word_context(const context &ctx)
The context for words.
value_impl< detail::polynomial_tag > polynomial
Definition: fwd.hh:27
automaton_editor * make_automaton_editor(const context &ctx)
Build an automatonset from its context.
bool has_twins_property(const automaton &aut)
Whether the automaton has the twins property.
automaton codeterminize(const automaton &aut, const std::string &algo="auto")
The codeterminized automaton.
Definition: determinize.hh:430
#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:297
bool are_isomorphic(const automaton &lhs, const automaton &rhs)
Whether there exists an isomorphism between the states of lhs and those of rhs.
automaton ldivide(const automaton &lhs, const automaton &rhs)
Left-division of two automata (lhs \ rhs).
Definition: conjunction.hh:728
automaton compose(const automaton &lhs, const automaton &rhs, bool lazy=false)
The composition of transducers lhs and rhs.
Definition: compose.hh:495
automaton infiltrate(const automaton &lhs, const automaton &rhs)
The infiltration of automata lhs and rhs.
Definition: others.cc:56
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
bool is_cycle_ambiguous(const automaton &aut)
Whether the automaton is cycle-ambiguous.
value_impl< detail::expansion_tag > expansion
Definition: fwd.hh:24
expansion to_expansion(const expression &exp)
First order development of a exp.
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 cotrie(const polynomial &p)
A reversed trie-like automaton (multiple initial states, single final state) automaton to accept p...
Definition: trie.hh:251
automaton coaccessible(const automaton &aut)
The coaccessible subautomaton of aut.
Definition: accessible.hh:215
expression expand(const expression &e)
Distribute product over addition recursively under the starred subexpressions and group the equal mon...
Definition: expand.hh:30
polynomial read_polynomial(const context &ctx, std::istream &is)
Read a polynomial from a stream.
Definition: read.hh:60
automaton component(const automaton &aut, unsigned num)
The automaton of a strongly connected component.
Definition: scc.hh:771
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).
polynomial split(const expression &exp)
Break exp.
Definition: split.hh:275
automaton realtime(const automaton &aut)
Create the realtime automaton (letterized and proper).
Definition: letterize.hh:231
bool has_bounded_lag(const automaton &aut)
Whether the transducer has bounded lag.
automaton synchronize(const automaton &aut)
Create a synchronized transducer from aut.
Definition: synchronize.hh:362
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
automaton shuffle(const automaton &lhs, const automaton &rhs)
The shuffle product of automata lhs and rhs.
Definition: others.cc:164
automaton project(const automaton &aut, unsigned tape)
Keep a single tape from a multiple-tape automaton.
Definition: others.cc:113
return exp min
Definition: multiply.hh:361
weight constant_term(const expression &e)
The weight associated to the empty word in e.
automaton derived_term(const expression &exp, const std::string &algo="auto")
The derived-term automaton of exp.
bool is_useless(const automaton &aut)
Whether has no useful state.
Definition: accessible.hh:260
automaton complement(const automaton &aut)
The complement of aut.
Definition: complement.hh:63
bool less_than(const expression &lhs, const expression &rhs)
Ordering between expressions.
expression random_expression(const context &ctx, const std::string &param, identities ids)
Produce a random expression.
automaton accessible(const automaton &aut)
The accessible subautomaton of aut.
Definition: accessible.hh:206
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
automaton push_weights(const automaton &aut)
The weight pushing automaton of aut.
Definition: push-weights.hh:71
std::ostream & info(const automaton &aut, std::ostream &out=std::cout, bool detailed=false)
Output various facts about an automaton.
Definition: info.hh:131
automaton ladybird(const context &ctx, unsigned n)
The ladybird automaton with n states.
Definition: ladybird.hh:54
automaton copy(const automaton &aut)
A copy of aut.
Definition: copy.hh:435
automaton cerny(const context &ctx, unsigned num_states)
Produce a Černý automaton of num_states states.
Definition: cerny.hh:64
expression read_expression(const context &ctx, identities ids, std::istream &is, const std::string &format="default")
Read an expression from a stream.
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
context join(const context &lhs, const context &rhs)
The join between two contexts, i.e., their lowest common supertype.
bool is_out_sorted(const automaton &aut)
Whether the outgoing transitions of each state have increasing labels.
Definition: sort.hh:75
bool are_equivalent(const automaton &lhs, const automaton &rhs)
Whether compute the same series.
automaton trie(const polynomial &p)
A trie-like automaton (single initial state, multiple final states) to accept p.
Definition: trie.hh:242
weight read_weight(const context &ctx, std::istream &is)
Read a weight from a stream.
Definition: read.hh:90
automaton insplit(const automaton &aut, bool lazy=false)
Split automaton on the incoming transition.
Definition: insplit.hh:303
bool has_lightening_cycle(const automaton &aut)
Whether the automaton has a cycle with lightening weight.
label synchronizing_word(const automaton &aut, const std::string &algo="greedy")
A synchronizing word, or raise if there is none.
automaton focus(const automaton &aut, unsigned tape)
Focus on a specific tape of a tupleset automaton.
Definition: others.cc:44
static identities ids(const driver &d)
Get the identities of the driver.
Definition: parse.cc:89
automaton condense(const automaton &aut)
The condensation of aut such that each state is a strongly connected component.
Definition: scc.hh:832
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 read_automaton(std::istream &is, const std::string &format="default", bool strip=true)
Read an automaton from a stream.
Definition: read.cc:34
bool is_complete(const automaton &aut)
Whether aut is complete.
Definition: is-complete.hh:48
automaton rdivide(const automaton &lhs, const automaton &rhs)
Right-division of two automata (lhs / rhs).
Definition: conjunction.hh:763
expression star_normal_form(const expression &e)
A normalized form where star is applied only to proper expressions.
expression expression_one(const context &c, identities ids)
The expression for \e.
Definition: constant.hh:15
value_impl< detail::expression_tag > expression
Definition: fwd.hh:25
automaton strip(const automaton &a)
The automaton in a with its metadata layers removed.
Definition: strip.hh:46
label ambiguous_word(const automaton &aut)
An ambiguous word, or raise if there is none.
Definition: is-ambiguous.hh:93
automaton de_bruijn(const context &ctx, unsigned n)
A simple NFA for (a+b)*a(a+b)^n.
Definition: de-bruijn.hh:57
automaton random_automaton_deterministic(const context &ctx, unsigned num_states)
Produce a random deterministic automaton.
bool is_costandard(const automaton &aut)
Whether is costandard (unique final state, with weight one, no outcoming transition).
Definition: standard.hh:63
void set_format(std::ostream &out, const std::string &format)
Specify the output format for out.
Definition: print.cc:164
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:233
weightset_mixin< detail::r_impl > r
Definition: fwd.hh:54
bool is_letterized(const automaton &aut)
Whether aut is letterized.
Definition: letterize.hh:201