spot
0.9.2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
tgba
bdddict.hh
Go to the documentation of this file.
1
// -*- coding: utf-8 -*-
2
// Copyright (C) 2011, 2012 Laboratoire de Recherche et Développement
3
// de l'Epita (LRDE).
4
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
5
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
6
// et Marie Curie.
7
//
8
// This file is part of Spot, a model checking library.
9
//
10
// Spot is free software; you can redistribute it and/or modify it
11
// under the terms of the GNU General Public License as published by
12
// the Free Software Foundation; either version 2 of the License, or
13
// (at your option) any later version.
14
//
15
// Spot is distributed in the hope that it will be useful, but WITHOUT
16
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18
// License for more details.
19
//
20
// You should have received a copy of the GNU General Public License
21
// along with Spot; see the file COPYING. If not, write to the Free
22
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23
// 02111-1307, USA.
24
25
#ifndef SPOT_TGBA_BDDDICT_HH
26
# define SPOT_TGBA_BDDDICT_HH
27
28
#include <list>
29
#include <set>
30
#include <map>
31
#include <iosfwd>
32
#include <bdd.h>
33
#include <vector>
34
#include "
ltlast/formula.hh
"
35
#include "
misc/bddalloc.hh
"
36
37
namespace
spot
38
{
39
49
class
bdd_dict
:
public
bdd_allocator
50
{
51
public
:
52
53
bdd_dict
();
54
~bdd_dict
();
55
57
typedef
std::map<const ltl::formula*, int>
fv_map
;
59
typedef
std::map<int, const ltl::formula*>
vf_map
;
60
61
fv_map
now_map
;
62
fv_map
var_map
;
63
fv_map
acc_map
;
64
66
typedef
std::set<const void*>
ref_set
;
67
68
enum
var_type
{
anon
= 0,
now
,
next
,
var
,
acc
};
69
struct
bdd_info
{
70
bdd_info
() :
type
(
anon
) {}
71
var_type
type
;
72
const
ltl::formula
*
f
;
// Used unless t==anon.
73
ref_set
refs
;
74
int
clone_counts
;
75
};
76
typedef
std::vector<bdd_info>
bdd_info_map
;
77
// Map BDD variables to their meaning.
78
bdd_info_map
bdd_map
;
79
83
bddPair*
next_to_now
;
87
bddPair*
now_to_next
;
88
99
int
register_proposition
(
const
ltl::formula
* f,
const
void
* for_me);
100
108
void
register_propositions
(bdd f,
const
void
* for_me);
109
121
int
register_state
(
const
ltl::formula
* f,
const
void
* for_me);
122
133
int
register_acceptance_variable
(
const
ltl::formula
* f,
const
void
* for_me);
134
140
int
register_clone_acc
(
int
var
,
const
void
* for_me);
141
149
void
register_acceptance_variables
(bdd f,
const
void
* for_me);
150
160
const
ltl::formula
*
oneacc_to_formula
(bdd oneacc)
const
;
161
170
const
ltl::formula
*
oneacc_to_formula
(
int
var
)
const
;
171
179
int
register_anonymous_variables
(
int
n,
const
void
* for_me);
180
187
void
register_all_variables_of
(
const
void
* from_other,
const
void
* for_me);
188
192
void
unregister_all_my_variables
(
const
void
* me);
193
195
void
unregister_variable
(
int
var
,
const
void
* me);
196
199
bool
is_registered_proposition
(
const
ltl::formula
* f,
const
void
* by_me);
200
bool
is_registered_state
(
const
ltl::formula
* f,
const
void
* by_me);
201
bool
is_registered_acceptance_variable
(
const
ltl::formula
* f,
202
const
void
* by_me);
204
207
std::ostream&
dump
(std::ostream& os)
const
;
208
213
void
assert_emptiness
()
const
;
214
215
protected
:
216
// SWIG does not grok the following definition, no idea why.
217
// It's not important for the Python interface anyway.
218
#ifndef SWIG
219
class
anon_free_list
:
public
spot::free_list
220
{
221
public
:
222
// WARNING: We need a default constructor so this can be used in
223
// a hash; but we should ensure that no object in the hash is
224
// constructed with d==0.
225
anon_free_list
(
bdd_dict
* d = 0);
226
virtual
int
extend
(
int
n);
227
private
:
228
bdd_dict
*
dict_
;
229
};
230
#endif
231
233
typedef
std::map<const void*, anon_free_list>
free_anonymous_list_of_type
;
234
free_anonymous_list_of_type
free_anonymous_list_of
;
235
236
private
:
237
// Disallow copy.
238
bdd_dict
(
const
bdd_dict
& other);
239
bdd_dict
&
operator=
(
const
bdd_dict
& other);
240
};
241
242
243
}
244
245
#endif // SPOT_TGBA_BDDDICT_HH
Please
comment
this page and
report errors
about it on
the RefDocComments page
.
Generated on Mon Jul 2 2012 17:35:47 for spot by
1.8.1.1