spot  2.11.6
hoa.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2014, 2015, 2022 Laboratoire de Recherche et Développement
3 // de l'Epita (LRDE).
4 //
5 // This file is part of Spot, a model checking library.
6 //
7 // Spot is free software; you can redistribute it and/or modify it
8 // under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // Spot is distributed in the hope that it will be useful, but WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 
20 #pragma once
21 
22 #include <iosfwd>
23 #include <spot/misc/common.hh>
24 #include <spot/twa/fwd.hh>
25 #include <vector>
26 #include <unordered_map>
27 #include <utility>
28 #include <functional>
29 #include <bddx.h>
30 
31 namespace spot
32 {
45  SPOT_API std::ostream&
46  print_hoa(std::ostream& os,
47  const const_twa_ptr& g,
48  const char* opt = nullptr);
49 
55  SPOT_API std::vector<std::pair<std::string, bdd>>*
56  get_aliases(const const_twa_ptr& g);
57 
65  SPOT_API void
66  set_aliases(twa_ptr g, std::vector<std::pair<std::string, bdd>> aliases);
67 
70  class SPOT_API hoa_alias_formater final
71  {
72  public:
73  typedef std::vector<std::pair<std::string, bdd>> aliases_t;
74  private:
75  aliases_t* aliases_;
76  std::unordered_map<int, unsigned> aliases_map_;
77  std::vector<std::pair<bdd, unsigned>> alias_cubes_;
78  const char* false_str_;
79  const char* true_str_;
80  const char* or_str_;
81  const char* and_str_;
82  const char* not_str_;
83  const char* lpar_str_;
84  const char* rpar_str_;
85  std::function<std::string(int)> ap_printer_;
86  public:
102  hoa_alias_formater(const const_twa_graph_ptr& aut,
103  const char* false_str,
104  const char* true_str,
105  const char* or_str,
106  const char* and_str,
107  const char* not_str,
108  const char* lpar_str,
109  const char* rpar_str,
110  std::function<std::string(int)> ap_printer);
111 
150  std::string
151  encode_label(bdd label, unsigned aliases_start = 0);
152 
162  aliases_t* aliases()
163  {
164  return aliases_;
165  }
166  };
167 
168 }
Help printing BDDs as text, using aliases.
Definition: hoa.hh:71
std::string encode_label(bdd label, unsigned aliases_start=0)
Attempt to format a BDD label using aliases.
hoa_alias_formater(const const_twa_graph_ptr &aut, const char *false_str, const char *true_str, const char *or_str, const char *and_str, const char *not_str, const char *lpar_str, const char *rpar_str, std::function< std::string(int)> ap_printer)
Initialize this class from the aliases defined for an automaton.
aliases_t * aliases()
Retrieve the list of aliases.
Definition: hoa.hh:162
std::vector< std::pair< std::string, bdd > > * get_aliases(const const_twa_ptr &g)
Obtain aliases used in the HOA format.
void set_aliases(twa_ptr g, std::vector< std::pair< std::string, bdd >> aliases)
Define all aliases used in the HOA format.
std::ostream & print_hoa(std::ostream &os, const const_twa_ptr &g, const char *opt=nullptr)
Print reachable states in Hanoi Omega Automata format.
Definition: automata.hh:27

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.1