Awali
Another Weighted Automata library
automaton.hh
Go to the documentation of this file.
1 // This file is part of Awali.
2 // Copyright 2016-2021 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_AUTOMATON_HH
18 #define DYN_AUTOMATON_HH
19 
21 
22 namespace awali { namespace dyn {
23 
24 
93  class automaton_t : public std::shared_ptr<abstract_automaton_t> {
94  public:
95 
96 
100  automaton_t();
101 
109  template <class T>
111  const std::shared_ptr<T> &ptr,
112  typename std::enable_if<
114  >::type = 0
115  )
116  : std::shared_ptr<abstract_automaton_t>(ptr)
117  {}
118 
143  static automaton_t from_context(context_t ctx);
144 
145 
186 
206  static automaton_t from(std::string alphabet, std::string weightset = "B",
207  bool allow_eps_transitions = false);
208 
224  static automaton_t from(std::string alphabet, bool allow_eps_transitions,
225  std::string = "B");
226 
227 
232  static automaton_t from(std::string alphabet, char const* ws);
233 
256  private:
257  with_int_labels() {}
258  public:
259 
260 
272  static automaton_t from_range(int l, int u, std::string weightset = "B",
273  bool allow_eps_transitions = false);
274 
275 
289  static automaton_t from_range(int l, int u, bool allow_eps_transitions);
290 
291 
296  static automaton_t from_range(int l, int u, char const* ws);
297 
298 
313  static automaton_t from_size(unsigned n,
314  std::string weightset = "B",
315  bool allow_eps_transitions = false);
316 
328  static automaton_t from_size(unsigned n, bool allow_eps_transitions);
329 
334  static automaton_t from_size(unsigned n, char const* weightset);
335 
336  };
337  };
338 
339 
340 }}
341 
342 
343 #endif
awali
Main namespace of Awali.
Definition: ato.hh:22
awali::dyn::automaton_t::from_context
static automaton_t from_context(context_t ctx)
awali::dyn::automaton_t::with_int_labels::from_range
static automaton_t from_range(int l, int u, std::string weightset="B", bool allow_eps_transitions=false)
awali::dyn::automaton_t::automaton_t
automaton_t(const std::shared_ptr< T > &ptr, typename std::enable_if< std::is_base_of< abstract_automaton_t, T >::value, int >::type=0)
Builds a automaton from a shared pointer to a class derived of abstract_automaton_t; should generally...
Definition: automaton.hh:110
awali::dyn::context::weightset
weightset_description weightset(const std::string &k)
awali::dyn::automaton_t
An automaton_t is essentially a shared pointer to an abstract_automaton_t, but also contains static f...
Definition: automaton.hh:93
awali::dyn::automaton_t::with_int_labels
Helper class that contains convenience constructor for automata with int labels.
Definition: automaton.hh:255
awali::dyn::context_t
Dynamical wrapper for a context, that is a weightset and a labelset.
Definition: context.hh:41
awali::priority::value
static constexpr TOP< void > value
Definition: priority.hh:93
awali::dyn::automaton_t::from
static automaton_t from(std::string alphabet, std::string weightset="B", bool allow_eps_transitions=false)
awali::dyn::automaton_t::automaton_t
automaton_t()
Buils an automaton_t that is essentially a nullptr; should generally not be used.
awali::dyn::automaton_t::with_int_labels::from_size
static automaton_t from_size(unsigned n, std::string weightset="B", bool allow_eps_transitions=false)
awali::dyn::context::weightset_description
std::shared_ptr< weightset_description_impl > weightset_description
Definition: description_types.hh:33
awali::dyn::abstract_automaton_t
Abstract interface listing the services provided by automata at the dynamical layer.
Definition: abstract_automaton.hh:68
awali::dyn::context::labelset_description
std::shared_ptr< labelset_description_impl > labelset_description
Definition: description_types.hh:32
abstract_automaton.hh