Awali
Another Weighted Automata library
ratexp.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_MODULES_RATEXP_HH
18 #define DYN_MODULES_RATEXP_HH
19 
20 #include <iostream>
21 #include <set>
22 #include <unordered_map>
23 #include <awali/dyn/core/ratexp.hh>
27 
28 namespace awali {
29  namespace dyn {
30 
31 
39 
40  namespace lift {
63  }
64 
69 
75 
80  unsigned star_height(ratexp_t exp);
81 
90  bool is_valid(ratexp_t exp);
91 
97 
103 
109 
124 
126  json_ast_t extra_metadata = json_ast::empty());
127 
128  namespace internal {
129  std::ostream& json(ratexp_t aut, std::ostream& out,
130  json_ast_t extra_metadata = json_ast::empty());
131  }
132 
133  }
134 }//end of ns awali::dyn
135 
136 #endif
An automaton_t is essentially a shared pointer to an abstract_automaton_t, but also contains static f...
Definition: automaton.hh:93
An options_t is a set of optional parameters that is passed on to called functions.
Definition: options.hh:86
Main class for representing rational expresson at the dynamical layer.
Definition: ratexp.hh:66
weightset_description weightset(const std::string &k)
std::ostream & json(automaton_t aut, std::ostream &out)
automaton_t lift(automaton_t aut)
Builds some kind of copy of aut with weights that are rational expressions with the context of aut,...
ratexp_t ratexp_support(ratexp_t exp)
Returns a Boolean rational expression where all weights of exp are removed.
ratexp_t ratexp_copy(ratexp_t exp)
Returns a copy of exp.
bool is_valid(automaton_t aut)
Tests whether epsilon removal is possible in aut.
unsigned star_height(ratexp_t exp)
Return the star height of exp.
weight_t constant_term(ratexp_t exp)
Returns the constant term of exp, that is the weight of epsilon.
ratexp_t expand(ratexp_t exp)
Expands a rational expression.
json_ast_t to_json_ast(automaton_t aut, json_ast_t extra_medata=json_ast::empty())
ratexp_t ratexp_characteristic(ratexp_t exp, std::string const &weightset)
Computes the characteristic of exp over weightset.
ratexp_t aut_to_exp(automaton_t aut, options_t opts={})
Computes a rational expression equivalent to aut.
ratexp_t star_normal_form(ratexp_t exp)
Builds an expression equivalent to exp that is in star normal form.
json_ast_t empty()
Builds an empty json_ast_t.
Definition: json_ast.hh:33
Main namespace of Awali.
Definition: ato.hh:22
std::shared_ptr< json::object_t > json_ast_t
Definition: json_ast.hh:27
Structure used to erase the type of labels/weights at the dyn layer.
Definition: any.hh:59