spot  1.0.2
constant.hh
Go to the documentation of this file.
1 // Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et
2 // Développement de l'Epita (LRDE).
3 // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
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 
22 #ifndef SPOT_LTLAST_CONSTANT_HH
23 # define SPOT_LTLAST_CONSTANT_HH
24 
25 #include "formula.hh"
26 
27 namespace spot
28 {
29  namespace ltl
30  {
31 
34  class constant : public formula
35  {
36  public:
37  enum type { False, True, EmptyWord };
38  virtual void accept(visitor& v) const;
39 
41  type val() const;
43  const char* val_name() const;
44 
45  virtual std::string dump() const;
46 
48  static constant* true_instance() { return &true_instance_; }
50  static constant* false_instance() { return &false_instance_; }
53 
54  protected:
55  constant(type val);
56  virtual ~constant();
57 
58  private:
60 
64  // If you add new constants here, be sure to update the
65  // formula::formula() constructor.
66  };
67 
68 
73  inline
74  const constant*
75  is_constant(const formula* f)
76  {
77  if (f->kind() != formula::Constant)
78  return 0;
79  return static_cast<const constant*>(f);
80  }
81  }
82 }
83 
84 #endif // SPOT_LTLAST_CONSTANT_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Wed Mar 6 2013 09:25:14 for spot by doxygen 1.8.1.2