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

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.8