Vcsn  2.1
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 
77 
80  automaton complete(const automaton& aut);
81 
86  automaton component(const automaton& aut, unsigned num);
87 
90 
94  expression concatenate(const expression& lhs, const expression& rhs);
95 
98  automaton condense(const automaton& aut);
99 
102  automaton conjunction(const automaton& lhs, const automaton& rhs,
103  bool lazy = false);
104 
110  automaton conjunction(const std::vector<automaton>& as,
111  bool lazy = false);
112 
114  automaton conjunction(const automaton& aut, unsigned n);
115 
117  expression conjunction(const expression& lhs, const expression& rhs);
118 
120  weight constant_term(const expression& e);
121 
123  context context_of(const automaton& a);
124 
126  context context_of(const expression& r);
127 
129  automaton copy(const automaton& aut);
130 
132  automaton copy(const automaton& aut, const context& ctx);
133 
135  expression copy(const expression& exp,
136  const context& ctx, rat::identities ids);
137 
139  automaton costandard(const automaton& a);
140 
145  automaton cotrie(const polynomial& p);
146 
153  automaton cotrie(const context& ctx, std::istream& is);
154 
156  automaton de_bruijn(const context& ctx, unsigned n);
157 
160 
167  polynomial derivation(const expression& exp, const label& lbl,
168  bool breaking = false);
169 
179  automaton derived_term(const expression& exp,
180  const std::string& algo = "auto");
181 
191  automaton determinize(const automaton& aut,
192  const std::string& algo = "auto");
193 
200  automaton difference(const automaton& lhs, const automaton& rhs);
201 
203  expression difference(const expression& lhs, const expression& rhs);
204 
207  automaton divkbaseb(const context& ctx, unsigned divisor, unsigned base);
208 
210  automaton double_ring(const context& ctx, unsigned n,
211  const std::vector<unsigned>& f);
212 
215  int s = -1);
216 
218  weight eval(const automaton& aut, const label& l);
219 
222  expression expand(const expression& e);
223 
226 
229 
231  automaton factor(const automaton& aut);
232 
234  automaton filter(const automaton& aut, const std::vector<unsigned>& ss);
235 
237  automaton focus(const automaton& aut, unsigned tape);
238 
240  bool has_twins_property(const automaton& aut);
241 
243  bool has_bounded_lag(const automaton& aut);
244 
247 
250  automaton infiltration(const automaton& lhs, const automaton& rhs);
251 
254  automaton infiltration(const std::vector<automaton>& as);
255 
258  expression infiltration(const expression& lhs, const expression& rhs);
259 
266  std::ostream& info(const automaton& aut, std::ostream& out,
267  bool detailed = false);
268 
270  std::ostream& info(const expression& exp, std::ostream& out);
271 
277  automaton insplit(const automaton& aut);
278 
280  bool is_accessible(const automaton& aut);
281 
285  bool is_ambiguous(const automaton& aut);
286 
288  bool is_coaccessible(const automaton& aut);
289 
293  bool is_codeterministic(const automaton& aut);
294 
298  bool is_complete(const automaton& aut);
299 
302  bool is_costandard(const automaton& aut);
303 
305  bool is_cycle_ambiguous(const automaton& aut);
306 
309  bool is_deterministic(const automaton& aut);
310 
312  bool is_empty(const automaton& aut);
313 
315  bool is_eps_acyclic(const automaton& aut);
316 
320  bool is_functional(const automaton& aut);
321 
323  bool is_letterized(const automaton& aut);
324 
328  bool is_partial_identity(const automaton& aut);
329 
332  bool is_normalized(const automaton& aut);
333 
335  bool is_out_sorted(const automaton& aut);
336 
338  bool is_proper(const automaton& aut);
339 
341  bool is_realtime(const automaton& aut);
342 
345  bool is_standard(const automaton& aut);
346 
348  bool is_synchronized(const automaton& aut);
349 
351  bool is_synchronized_by(const automaton& aut, const label& word);
352 
354  bool is_synchronizing(const automaton& aut);
355 
357  bool is_trim(const automaton& aut);
358 
360  bool is_useless(const automaton& aut);
361 
363  bool is_valid(const automaton& e);
364 
367  bool is_valid(const expression& e);
368 
370  context join(const context& lhs, const context& rhs);
371 
373  automaton ladybird(const context& ctx, unsigned n);
374 
376  polynomial ldiv(const polynomial& lhs, const polynomial& rhs);
377 
379  expression ldiv(const expression& lhs, const expression& rhs);
380 
382  polynomial lgcd(const polynomial& lhs, const polynomial& rhs);
383 
387  automaton left_mult(const weight& w, const automaton& aut);
388 
390  expression left_mult(const weight& w, const expression& exp);
391 
393  bool less_than(const expression& lhs, const expression& rhs);
394 
396  automaton letterize(const automaton& aut);
397 
399  automaton levenshtein(const context& ls);
400 
409  automaton lift(const automaton& aut,
410  const std::vector<unsigned>& tapes = {},
411  rat::identities ids = {});
412 
414  expression lift(const expression& e);
415 
420  polynomial lightest(const automaton& aut,
421  boost::optional<unsigned> num = {});
422 
424  context make_context(const std::string& name);
425 
427  automaton_editor* make_automaton_editor(const context& ctx);
428 
431 
433  automaton multiply(const automaton& lhs, const automaton& rhs);
434 
440  automaton multiply(const automaton& aut, int min, int max);
441 
443  expression multiply(const expression& lhs, const expression& rhs);
444 
450  expression multiply(const expression& e, int min, int max);
451 
453  label multiply(const label& lhs, const label& rhs);
454 
456  polynomial multiply(const polynomial& lhs, const polynomial& rhs);
457 
459  weight multiply(const weight& lhs, const weight& rhs);
460 
466  weight multiply(const weight& e, int min, int max);
467 
474  automaton minimize(const automaton& aut,
475  const std::string& algo = "auto");
476 
478  automaton normalize(const automaton& aut);
479 
481  std::size_t num_components(const automaton& aut);
482 
485  std::size_t num_tapes(const context& ctx);
486 
488  automaton pair(const automaton& aut, bool keep_initials = false);
489 
492 
494  automaton prefix(const automaton& aut);
495 
508  std::ostream& print(const automaton& aut, std::ostream& out,
509  const std::string& format = "default");
510 
512  std::ostream& print(const context& c, std::ostream& o,
513  const std::string& format = "default");
514 
516  std::ostream& print(const expansion& e, std::ostream& o,
517  const std::string& format = "default");
518 
520  std::ostream& print(const expression& e, std::ostream& o,
521  const std::string& format = "default");
522 
524  std::ostream& print(const label& l, std::ostream& o,
525  const std::string& format = "default");
526 
528  std::ostream& print(const polynomial& p, std::ostream& o,
529  const std::string& format = "default");
530 
532  std::ostream& print(const weight& w, std::ostream& o,
533  const std::string& format = "default");
534 
536  void set_format(std::ostream& o, const std::string& format);
537 
539  std::string get_format(std::ostream& o);
540 
542  automaton project(const automaton& aut, unsigned tape);
543 
545  context project(const context& ctx, unsigned tape);
546 
559  automaton proper(const automaton& aut,
561  bool prune = true, const std::string& algo = "auto");
562 
564  automaton push_weights(const automaton& aut);
565 
588  unsigned num_states,
589  float density = 0.1,
590  unsigned num_initial = 1,
591  unsigned num_final = 1,
592  float loop_chance = 0.0);
593 
601  unsigned num_states);
602 
604  expression rdiv(const expression& lhs, const expression& rhs);
605 
611  automaton read_automaton(std::istream& is,
612  const std::string& format = "default",
613  bool strip = true);
614 
622  std::istream& is,
623  const std::string& format = "default");
624 
630  label read_label(const context& ctx, std::istream& is,
631  const std::string& format = "default");
632 
637  polynomial read_polynomial(const context& ctx, std::istream& is);
638 
643  weight read_weight(const context& ctx, std::istream& is);
644 
646  automaton realtime(const automaton& aut);
647 
649  automaton reduce(const automaton& aut);
650 
653  automaton right_mult(const automaton& aut, const weight& w);
654 
656  expression right_mult(const expression& aut, const weight& w);
657 
663  automaton scc(const automaton& aut, const std::string& algo = "auto");
664 
670  polynomial shortest(const automaton& aut,
671  boost::optional<unsigned> num = {},
672  boost::optional<unsigned> len = {});
673 
676  automaton shuffle(const automaton& lhs, const automaton& rhs);
677 
680  automaton shuffle(const std::vector<automaton>& as);
681 
684  expression shuffle(const expression& lhs, const expression& rhs);
685 
687  automaton sort(const automaton& a);
688 
690  polynomial split(const expression& exp);
691 
693  polynomial split(const polynomial& p);
694 
696  automaton standard(const automaton& a);
697 
699  automaton standard(const expression& e);
700 
702  automaton star(const automaton& aut);
703 
705  unsigned star_height(const expression& rs);
706 
712 
714  automaton strip(const automaton& a);
715 
717  automaton suffix(const automaton& aut);
718 
723  automaton subword(const automaton& aut);
724 
726  automaton sum(const automaton& lhs, const automaton& rhs);
727 
729  expression sum(const expression& lhs, const expression& rhs);
730 
732  polynomial sum(const polynomial& lhs, const polynomial& rhs);
733 
735  weight sum(const weight& lhs, const weight& rhs);
736 
738  automaton synchronize(const automaton& aut);
739 
742  const std::string& algo = "greedy");
743 
745  automaton thompson(const expression& e);
746 
761  automaton to_automaton(const expression& exp,
762  const std::string& algo = "auto");
763 
767  expansion to_expansion(const expression& exp);
768 
775  rat::identities ids = {},
776  const std::string& algo = "auto");
777 
780  const label& l);
781 
794  const letter_class_t& letters,
795  bool accept = true);
796 
799 
801  expression transpose(const expression& e);
802 
805 
810  automaton trie(const polynomial& p);
811 
817  automaton trie(const context& ctx, std::istream& is);
818 
820  automaton trim(const automaton& aut);
821 
823  expression tuple(const expression& lhs, const expression& rhs);
824 
826  expression tuple(const std::vector<expression>& rs);
827 
829  std::string type(const automaton& a);
830 
832  automaton u(const context& ctx, unsigned n);
833 
836  automaton union_a(const automaton& lhs, const automaton& rhs);
837 
839  automaton universal(const automaton& aut);
840 
842  weight weight_series(const automaton& aut);
843 
849  automaton zpc(const expression& exp, const std::string& algo = "auto");
850  }
851 }
852 
853 // dyn::automaton and the like are actually type aliases for
854 // std::shared_ptr, so for ADL to work properly, we need these
855 // operators to be defined in std.
856 namespace std LIBVCSN_API
857 {
859  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::automaton& a);
860 
862  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::context& c);
863 
865  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::expansion& e);
866 
868  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::expression& r);
869 
871  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::label& l);
872 
874  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::polynomial& p);
875 
877  std::ostream& operator<<(std::ostream& o, const vcsn::dyn::weight& w);
878 }
STL namespace.
automaton complete(const automaton &aut)
A completed copy of aut.
Definition: complete.hh:76
polynomial lightest(const automaton &aut, boost::optional< unsigned > num={})
The approximated behavior of an automaton with smallest weights.
Definition: lightest.hh:193
bool is_realtime(const automaton &aut)
Whether has no spontaneous transition, and is letterized.
Definition: letterize.hh:260
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.
expression expression_one(const context &c, rat::identities ids)
The expression for \e.
Definition: constant.hh:15
automaton random_automaton_deterministic(const context &ctx, unsigned num_states)
Produce a random deterministic automaton.
Definition: random.hh:298
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:165
automaton project(const automaton &aut, unsigned tape)
Keep a single tape from a multiple-tape automaton.
Definition: others.cc:113
bool has_bounded_lag(const automaton &aut)
Whether the transducer has bounded lag.
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 component(const automaton &aut, unsigned num)
The automaton of a strongly connected component.
Definition: scc.hh:718
std::shared_ptr< const detail::label_base > label
Definition: fwd.hh:59
automaton condense(const automaton &aut)
The condensation of aut such that each state is a strongly connected component.
Definition: scc.hh:782
weightset_mixin< detail::r_impl > r
Definition: fwd.hh:54
automaton strip(const automaton &a)
The automaton in a with its metadata layers removed.
Definition: strip.hh:51
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_out_sorted(const automaton &aut)
Whether the outgoing transitions of each state have increasing labels.
Definition: sort.hh:76
automaton standard(const automaton &a)
A standardized a.
Definition: standard.hh:141
polynomial ldiv(const polynomial &lhs, const polynomial &rhs)
Left-division of two polynomials (lhs \ rhs).
std::shared_ptr< const detail::context_base > context
A dyn::context.
Definition: fwd.hh:41
automaton codeterminize(const automaton &aut, const std::string &algo="auto")
The codeterminized automaton.
Definition: determinize.hh:623
polynomial shortest(const automaton &aut, boost::optional< unsigned > num={}, boost::optional< unsigned > len={})
The approximated behavior of an automaton.
Definition: shortest.hh:275
automaton universal(const automaton &aut)
The universal automaton of aut.
Definition: universal.hh:137
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:62
automaton trim(const automaton &aut)
The trim subautomaton of aut.
Definition: accessible.hh:224
bool is_partial_identity(const automaton &aut)
Whether aut realizes a partial identity.
polynomial derivation(const expression &exp, const label &lbl, bool breaking=false)
Derive exp with respect to s.
Definition: derivation.hh:337
bool is_trim(const automaton &aut)
Whether has no useless state.
Definition: accessible.hh:251
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:69
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
std::string type(const automaton &a)
The implementation type of a.
Definition: others.cc:197
bool is_standard(const automaton &aut)
Whether is standard (unique initial state, with weight one, no incoming transition).
Definition: standard.hh:54
automaton partial_identity(const automaton &aut)
Create a partial identity transducer from aut.
expression expression_zero(const context &c, rat::identities ids)
The expression for \z.
Definition: constant.hh:24
bool is_complete(const automaton &aut)
Whether aut is complete.
Definition: is-complete.hh:48
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:104
std::istringstream is
The input stream: the specification to translate.
Definition: translate.cc:372
automaton cotrie(const polynomial &p)
A reversed trie-like automaton (multiple initial states, single final state) automaton to accept p...
Definition: trie.hh:191
automaton de_bruijn(const context &ctx, unsigned n)
A simple NFA for (a+b)*a(a+b)^n.
Definition: de-bruijn.hh:59
automaton_editor * make_automaton_editor(const context &ctx)
Build an automatonset from its context.
Looking upstream.
expression transposition(const expression &r)
Add the transposition operator to r.
bool is_useless(const automaton &aut)
Whether has no useful state.
Definition: accessible.hh:260
automaton synchronize(const automaton &aut)
Create a synchronized transducer from aut.
Definition: synchronize.hh:364
std::set< std::pair< std::string, std::string >> letter_class_t
A set of letter ranges.
Definition: fwd.hh:103
automaton reduce(const automaton &aut)
Reduce aut.
Definition: reduce.hh:621
expression star_normal_form(const expression &e)
A normalized form where star is applied only to proper expressions.
automaton determinize(const automaton &aut, const std::string &algo="auto")
The determinized automaton.
Definition: determinize.hh:572
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 & info(const automaton &aut, std::ostream &out, bool detailed=false)
Output various facts about an automaton.
Definition: info.hh:258
direction
Orientation.
Definition: direction.hh:9
automaton compose(automaton &lhs, automaton &rhs)
The composition of transducers lhs and rhs.
Definition: compose.hh:307
weight read_weight(const context &ctx, std::istream &is)
Read a weight from a stream.
Definition: read.hh:95
automaton sort(const automaton &a)
A copy of a with normalized state numbers.
Definition: sort.hh:178
automaton filter(const automaton &aut, const std::vector< unsigned > &ss)
The subautomaton based on aut, with only states in ss visible.
Definition: filter.hh:341
label synchronizing_word(const automaton &aut, const std::string &algo="greedy")
A synchronizing word, or raise if there is none.
automaton left_mult(const weight &w, const automaton &aut)
The left-multiplication of an automaton with w as weight.
Definition: left-mult.hh:104
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:24
bool is_empty(const automaton &aut)
Whether has no state.
Definition: accessible.hh:269
automaton normalize(const automaton &aut)
Normalize automaton aut.
Definition: normalize.hh:41
automaton union_a(const automaton &lhs, const automaton &rhs)
Union of two automata (plain graph union).
Definition: union.hh:49
automaton derived_term(const expression &exp, const std::string &algo="auto")
The derived-term automaton of exp.
automaton prefix(const automaton &aut)
Create a prefix automaton from aut.
Definition: prefix.hh:84
automaton letterize(const automaton &aut)
The automaton with letter transitions instead of words.
Definition: letterize.hh:147
automaton complement(const automaton &aut)
The complement of aut.
Definition: complement.hh:62
automaton factor(const automaton &aut)
Create a factor automaton from aut.
Definition: prefix.hh:121
automaton subword(const automaton &aut)
Create a subword automaton from aut.
Definition: prefix.hh:178
bool is_deterministic(const automaton &aut)
Whether aut is deterministic.
automaton push_weights(const automaton &aut)
The weight pushing automaton of aut.
Definition: push-weights.hh:71
std::ostream & operator<<(std::ostream &o, type_t t)
Definition: printer.hxx:13
std::size_t num_components(const automaton &aut)
The number of strongly connected components.
Definition: scc.hh:679
static dyn::context ctx(const driver &d)
Get the context of the driver.
Definition: parse.cc:80
std::shared_ptr< const detail::weight_base > weight
Definition: fwd.hh:86
bool is_cycle_ambiguous(const automaton &aut)
Whether the automaton is cycle-ambiguous.
automaton difference(const automaton &lhs, const automaton &rhs)
An automaton whose behavior is that of lhs on words not accepted by rhs.
automaton shuffle(const automaton &lhs, const automaton &rhs)
The shuffle product of automata lhs and rhs.
Definition: others.cc:133
bool has_twins_property(const automaton &aut)
Whether the automaton has the twins property.
automaton costandard(const automaton &a)
A standardized transpositive a.
Definition: standard.hh:151
automaton cerny(const context &ctx, unsigned num_states)
Produce a Černý automaton of num_states states.
Definition: cerny.hh:64
std::shared_ptr< detail::automaton_base > automaton
Definition: automaton.hh:69
std::shared_ptr< const detail::expansion_base > expansion
Definition: expansion.hh:73
automaton delay_automaton(const automaton &a)
The automaton with the delay of each state.
context join(const context &lhs, const context &rhs)
The join between two contexts, i.e., their lowest common supertype.
Definition: make-context.hh:92
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
expression to_expression(const automaton &aut, rat::identities ids={}, const std::string &algo="auto")
An expression denoting the language of aut.
polynomial split(const expression &exp)
Break exp.
Definition: split.hh:277
static identities ids(const driver &d)
Get the identities of the driver.
Definition: parse.cc:87
expression rdiv(const expression &lhs, const expression &rhs)
Right-division of two expressions (lhs \ rhs).
bool is_ambiguous(const automaton &aut)
Whether aut is ambiguous.
Definition: is-ambiguous.hh:52
automaton ladybird(const context &ctx, unsigned n)
The ladybird automaton with n states.
Definition: ladybird.hh:56
automaton sum(const automaton &lhs, const automaton &rhs)
Sum of two standard automata.
Definition: sum.hh:82
weight constant_term(const expression &e)
The weight associated to the empty word in e.
automaton thompson(const expression &e)
The Thompson automaton of e.
Definition: thompson.hh:208
bool is_costandard(const automaton &aut)
Whether is costandard (unique final state, with weight one, no outcoming transition).
Definition: standard.hh:64
automaton suffix(const automaton &aut)
Create a suffix automaton from aut.
Definition: prefix.hh:44
automaton focus(const automaton &aut, unsigned tape)
Focus on a specific tape of a tupleset automaton.
Definition: others.cc:44
#define LIBVCSN_API
Definition: export.hh:8
automaton to_automaton(const expression &exp, const std::string &algo="auto")
An automaton denoting the language of exp.
Definition: others.cc:145
label read_label(const context &ctx, std::istream &is, const std::string &format="default")
Read a label from a stream.
Definition: read.cc:88
automaton copy(const automaton &aut)
A copy of aut.
Definition: copy.hh:337
context make_context(const std::string &name)
Build a context from its name.
Definition: others.cc:97
auto rs
Definition: lift.hh:151
automaton levenshtein(const context &ls)
The transducer representing the Levenshtein distance.
Definition: levenshtein.hh:63
automaton multiply(const automaton &lhs, const automaton &rhs)
Multiply (concatenate) two standard automata.
Definition: multiply.hh:104
std::string get_format(std::ostream &o)
Get the output format for o.
Definition: print.cc:173
automaton zpc(const expression &exp, const std::string &algo="auto")
The ZPC automaton of exp.
Definition: zpc.hh:358
automaton insplit(const automaton &aut)
Split automaton on the incoming transition.
Definition: insplit.hh:120
std::shared_ptr< const detail::polynomial_base > polynomial
Definition: fwd.hh:68
automaton eliminate_state(const automaton &aut, int s=-1)
The LAO automaton aut with state s removed.
automaton u(const context &ctx, unsigned n)
The Brzozowski universal witness.
Definition: u.hh:70
bool is_eps_acyclic(const automaton &aut)
Whether has no cycle of spontaneous transitions.
expression concatenate(const expression &lhs, const expression &rhs)
Concatenate two expressions.
bool is_coaccessible(const automaton &aut)
Whether aut is coaccessible.
Definition: accessible.hh:242
weight eval(const automaton &aut, const label &l)
Evaluate l on aut.
Definition: eval.hh:113
polynomial lgcd(const polynomial &lhs, const polynomial &rhs)
Left greatest common divisor of two polynomials (lhs \ rhs).
bool is_letterized(const automaton &aut)
Whether aut is letterized.
Definition: letterize.hh:202
automaton realtime(const automaton &aut)
Create the realtime automaton (letterized and proper).
Definition: letterize.hh:232
bool is_proper(const automaton &aut)
Whether has no spontaneous transition.
Definition: is-proper.hh:60
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:187
bool is_functional(const automaton &aut)
Whether aut is functional.
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:239
std::shared_ptr< detail::expression_base > expression
Definition: expression.hh:78
automaton read_automaton(std::istream &is, const std::string &format="default", bool strip=true)
Read an automaton from a stream.
Definition: read.cc:35
automaton cominimize(const automaton &aut, const std::string &algo="auto")
The cominimized automaton.
Definition: minimize.hh:156
weight weight_series(const automaton &aut)
Compute weight of the series.
bool less_than(const expression &lhs, const expression &rhs)
Ordering between expressions.
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 to_expansion(const expression &exp)
First order development of a exp.
label ambiguous_word(const automaton &aut)
An ambiguous word, or raise if there is none.
Definition: is-ambiguous.hh:97
automaton right_mult(const automaton &aut, const weight &w)
The right-mult automaton with w as weight.
Definition: left-mult.hh:218
bool is_synchronized_by(const automaton &aut, const label &word)
Whether the word synchronizes aut.
automaton transpose(automaton &aut)
Transpose aut.
Definition: transpose.hh:255
bool is_accessible(const automaton &aut)
Whether aut is accessible.
Definition: accessible.hh:233
rat::identities identities(const expression &exp)
The identities of expression exp.
Definition: identities.hh:19
automaton infiltration(const automaton &lhs, const automaton &rhs)
The infiltration of automata lhs and rhs.
Definition: others.cc:56
automaton star(const automaton &aut)
Star of a standard automaton.
Definition: star.hh:74
automaton pair(const automaton &aut, bool keep_initials=false)
Build the pair automaton of the given automaton.
Definition: pair.hh:255
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:645
automaton trie(const polynomial &p)
A trie-like automaton (single initial state, multiple final states) to accept p.
Definition: trie.hh:182
context make_word_context(const context &ctx)
The context for words.
std::size_t num_tapes(const context &ctx)
The number of input tapes.
bool is_synchronized(const automaton &aut)
Whether is synchronized.
automaton minimize(const automaton &aut, const std::string &algo="auto")
The minimized automaton.
Definition: minimize.hh:115
expression tuple(const expression &lhs, const expression &rhs)
Build a two-tape expression from two expressions.
Definition: others.cc:191
polynomial read_polynomial(const context &ctx, std::istream &is)
Read a polynomial from a stream.
Definition: read.hh:64
void set_format(std::ostream &o, const std::string &format)
Specify the output format for o.
Definition: print.cc:165