spot 2.12.2
cube.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
20#pragma once
21
22#include <spot/misc/common.hh>
23#include <vector>
24#include <string>
25#include <climits>
26#include <sstream>
27
28namespace spot
29{
65 using cube = unsigned*;
66
67 class SPOT_API cubeset final
68 {
69 // \brief The total number of variables stored
70 size_t size_;
71
73 size_t uint_size_;
74
76 size_t nb_bits_;
77
78 public:
79 // Some default/deleted constructor/destructors
80 cubeset() = delete;
81 ~cubeset() = default;
82
84 cubeset(int aps);
85
87 cube alloc() const;
88
90 void set_true_var(cube c, unsigned int x) const;
91
93 void set_false_var(cube c, unsigned int x) const;
94
96 bool is_true_var(cube c, unsigned int x) const;
97
99 bool is_false_var(cube c, unsigned int x) const;
100
102 bool intersect(const cube lhs, const cube rhs) const;
103
105 cube intersection(const cube lhs, const cube rhs) const;
106
109 bool is_valid(const cube lhs) const;
110
112 size_t size() const;
113
115 void release(cube lhs) const;
116
118 void display(const cube c) const;
119
121 std::string dump(cube c, const std::vector<std::string>& aps) const;
122 };
123}
Definition: cube.hh:68
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:26
unsigned * cube
A cube is only a set of bits in memory.
Definition: cube.hh:65

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