spot  1.2.1a
cube.hh
1 // Copyright (C) 2012 Laboratoire de Recherche et Developpement de
2 // l'Epita (LRDE).
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 #ifndef SPOT_FASTTGBA_CUBE_HH
21 # define SPOT_FASTTGBA_CUBE_HH
22 
23 #include <vector>
24 #include <string>
25 #include <boost/dynamic_bitset.hpp>
26 #include "ap_dict.hh"
27 
28 namespace spot
29 {
34  class SPOT_API cube
35  {
36  public:
40  cube (ap_dict& aps);
41 
43  cube (const spot::cube& c);
44 
48  bool operator==(const spot::cube& rhs);
49 
57  cube operator&(const cube& rhs) const;
58 
62  void set_true_var(size_t index);
63 
67  void set_false_var(size_t index);
68 
72  void set_free_var(size_t index);
73 
75  size_t size() const;
76 
79  bool is_valid() const;
80 
82  std::string dump();
83 
84  protected:
85 
86  // -----------------------------------------------------------
87  // This class is a wrapper for two bitsets :
88  // - true_var : a bitset representing variables that
89  // are set to true
90  // - false_var : a bitset representing variables that
91  // are set to false
92  //
93  // In the two vectors a bit set to 1 represent a variable set to
94  // true (resp. false) for the true_var (resp. false_var)
95  //
96  // The cube for (a & !b) will be repensented by :
97  // - true_var = 1 0
98  // - false_var = 0 1
99  //
100  // To represent free variables such as in (a & !b) | (a & b)
101  // (wich is equivalent to (a) with b free)
102  // - true_var : 1 0
103  // - false_var : 0 0
104  // This exemple shows that the representation of free variables
105  // is done by unsetting variable in both vector
106  //
107  // Warning : a variable cannot be set in both bitset at the
108  // same time (consistency! cannot be true and false)
109  // -----------------------------------------------------------
110 
111  boost::dynamic_bitset<> true_var;
112  boost::dynamic_bitset<> false_var;
114  mutable bool valid;
115  };
116 }
117 
118 #endif // SPOT_FASTTGBA_CUBE_HH
this class acts like a wrapper to the C code of the open_set.
Definition: public.hh:32
ap_dict & aps_
the reference over the atomic props
Definition: cube.hh:113
boost::dynamic_bitset true_var
the set of variables set to true
Definition: cube.hh:111
This class represents conjunction of variables.
Definition: cube.hh:34
This class is used to create a dictionary that will contain all atomic propositions that are needed b...
Definition: ap_dict.hh:41
SPOT_API std::ostream & dump(std::ostream &os, const formula *f)
Dump a formula tree.
boost::dynamic_bitset false_var
the set of variables set to false
Definition: cube.hh:112

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Jun 5 2015 11:31:18 for spot by doxygen 1.8.9.1