spot 2.16
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{
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>>*
57
65 SPOT_API void
67 const std::vector<std::pair<std::string, bdd>>& aliases);
68
71 class SPOT_API hoa_alias_formater final
72 {
73 public:
75 typedef std::vector<std::pair<std::string, bdd>> aliases_t;
76 private:
77 aliases_t* aliases_;
78 std::unordered_map<int, unsigned> aliases_map_;
79 std::vector<std::pair<bdd, unsigned>> alias_cubes_;
80 const char* false_str_;
81 const char* true_str_;
82 const char* or_str_;
83 const char* and_str_;
84 const char* not_str_;
85 const char* lpar_str_;
86 const char* rpar_str_;
87 std::function<std::string(int)> ap_printer_;
88 public:
105 const char* false_str,
106 const char* true_str,
107 const char* or_str,
108 const char* and_str,
109 const char* not_str,
110 const char* lpar_str,
111 const char* rpar_str,
112 std::function<std::string(int)> ap_printer);
113
152 std::string
153 encode_label(bdd label, unsigned aliases_start = 0);
154
165 {
166 return aliases_;
167 }
168 };
169
181 SPOT_API void
183
184}
Help printing BDDs as text, using aliases.
Definition hoa.hh:72
aliases_t * aliases()
Retrieve the list of aliases.
Definition hoa.hh:164
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 > > aliases_t
Type alias for a list of (name, BDD) alias pairs.
Definition hoa.hh:75
std::shared_ptr< twa > twa_ptr
Shared pointer to a mutable twa.
Definition fwd.hh:33
std::shared_ptr< const twa > const_twa_ptr
Shared pointer to a const twa.
Definition fwd.hh:36
void set_aliases(twa_ptr g, const std::vector< std::pair< std::string, bdd > > &aliases)
Define all aliases used in the HOA format.
std::vector< std::pair< std::string, bdd > > * get_aliases(const const_twa_ptr &g)
Obtain aliases used in the HOA format.
void create_alias_basis(const twa_graph_ptr &aut)
Create an alias basis.
std::ostream & print_hoa(std::ostream &os, const const_twa_ptr &g, const char *opt=nullptr)
Print reachable states in Hanoi Omega Automata format.
std::shared_ptr< twa_graph > twa_graph_ptr
Shared pointer to a mutable twa_graph.
Definition fwd.hh:44
std::shared_ptr< const twa_graph > const_twa_graph_ptr
Shared pointer to a const twa_graph.
Definition fwd.hh:41
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