spot  2.11.6
cube.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2015, 2016, 2018 Laboratoire de Recherche et Developpement de
3 // 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 
21 #pragma once
22 
23 #include <spot/misc/common.hh>
24 #include <vector>
25 #include <string>
26 #include <climits>
27 #include <sstream>
28 
29 namespace spot
30 {
66  using cube = unsigned*;
67 
68  class SPOT_API cubeset final
69  {
70  // \brief The total number of variables stored
71  size_t size_;
72 
74  size_t uint_size_;
75 
77  size_t nb_bits_;
78 
79  public:
80  // Some default/deleted constructor/destructors
81  cubeset() = delete;
82  ~cubeset() = default;
83 
85  cubeset(int aps);
86 
88  cube alloc() const;
89 
91  void set_true_var(cube c, unsigned int x) const;
92 
94  void set_false_var(cube c, unsigned int x) const;
95 
97  bool is_true_var(cube c, unsigned int x) const;
98 
100  bool is_false_var(cube c, unsigned int x) const;
101 
103  bool intersect(const cube lhs, const cube rhs) const;
104 
106  cube intersection(const cube lhs, const cube rhs) const;
107 
110  bool is_valid(const cube lhs) const;
111 
113  size_t size() const;
114 
116  void release(cube lhs) const;
117 
119  void display(const cube c) const;
120 
122  std::string dump(cube c, const std::vector<std::string>& aps) const;
123  };
124 }
Definition: cube.hh:69
cubeset(int aps)
Build the cubeset manager for aps variables.
void release(cube lhs) const
Release a cube.
size_t size() const
Return the size of each cube.
bool is_valid(const cube lhs) const
Check wether lhs is valid, is there is not variable that is true and false at the same time.
bool is_true_var(cube c, unsigned int x) const
Check if the variable at position x is true.
void set_false_var(cube c, unsigned int x) const
Set the variable at position x to false.
void set_true_var(cube c, unsigned int x) const
Set the variable at position x to true.
std::string dump(cube c, const std::vector< std::string > &aps) const
Return the cube binded with atomic proposition names.
void display(const cube c) const
Raw display cube.
bool is_false_var(cube c, unsigned int x) const
Check if the variable at position x is false.
cube intersection(const cube lhs, const cube rhs) const
return a cube resulting from the intersection of the two cubes
bool intersect(const cube lhs, const cube rhs) const
return true if two cube intersect, i.e synchronisables.
cube alloc() const
Allocate a new cube.
Definition: automata.hh:27
unsigned * cube
A cube is only a set of bits in memory.
Definition: cube.hh:66

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