Awali
Another Weighted Automata library
factories.hh
Go to the documentation of this file.
1 // This file is part of Awali.
2 // Copyright 2016-2022 Sylvain Lombardy, Victor Marsault, Jacques Sakarovitch
3 //
4 // Awali is a free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef DYN_FACTORIES_HH
18 #define DYN_FACTORIES_HH
19 
22 #include <vector>
23 
24 namespace awali {
25  namespace dyn {
26  namespace factory {
48  automaton_t n_ultimate(unsigned n, const std::string& alphabet, const std::string& semiring="B");
49 
74  automaton_t divkbaseb(unsigned k, unsigned b, const std::string& alphabet="auto", const std::string& semiring="B");
75 
98  automaton_t double_ring(unsigned n, const std::vector<unsigned>& finals, const std::string& alphabet, const std::string& semiring="B");
99 
124  automaton_t ladybird(unsigned n, const std::string& alphabet, const std::string& semiring="B");
125 
149  automaton_t cerny(unsigned n, const std::string& alphabet, const std::string& semiring="B");
150 
185  automaton_t witness(unsigned n, const std::string& alphabet, const std::string& semiring="B");
186 
187  /*,------------------.
188  | with int letters |
189  `------------------'*/
190 
212  automaton_t n_ultimate(unsigned n, int a, int b, const std::string& semiring="B");
213 
214 
229  automaton_t int_divkbaseb(unsigned k, unsigned b, const std::string& semiring="B");
230 
249  automaton_t double_ring(unsigned n, const std::vector<unsigned>& finals, int a, const std::string& semiring="B");
250 
251 
275  automaton_t ladybird(unsigned n, int a, const std::string& semiring="B");
276 
277 
303  automaton_t cerny(unsigned n, int a, int b, const std::string& semiring="B");
304 
339  automaton_t witness(unsigned n, int a, const std::string& semiring="B");
340  }// end of ns awali::dyn::factory
341  } // end of ns awali::dyn
342 }//end of ns awali
343 
344 #endif
An automaton_t is essentially a shared pointer to an abstract_automaton_t, but also contains static f...
Definition: automaton.hh:93
automaton_t cerny(unsigned n, const std::string &alphabet, const std::string &semiring="B")
Returns an automaton with n states.
automaton_t divkbaseb(unsigned k, unsigned b, const std::string &alphabet="auto", const std::string &semiring="B")
Returns an automaton which recognizes numbers in base b which are multiple of k.
automaton_t n_ultimate(unsigned n, const std::string &alphabet, const std::string &semiring="B")
Returns an automaton which recognizes words with a specific n-ultimate letter.
automaton_t double_ring(unsigned n, const std::vector< unsigned > &finals, const std::string &alphabet, const std::string &semiring="B")
Returns a double ring automaton with n states.
automaton_t witness(unsigned n, const std::string &alphabet, const std::string &semiring="B")
Returns an automaton with n states.
automaton_t ladybird(unsigned n, const std::string &alphabet, const std::string &semiring="B")
Returns a "ladybird" automaton with n states.
automaton_t int_divkbaseb(unsigned k, unsigned b, const std::string &semiring="B")
returns an automaton which recognizes numbers in base b which are multiple of k
Main namespace of Awali.
Definition: ato.hh:22