spot  0.9.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 2 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 Spot; see the file COPYING. If not, write to the Free
19 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 // 02111-1307, USA.
21 
24 #ifndef SPOT_LTLAST_CONSTANT_HH
25 # define SPOT_LTLAST_CONSTANT_HH
26 
27 #include "formula.hh"
28 
29 namespace spot
30 {
31  namespace ltl
32  {
33 
36  class constant : public formula
37  {
38  public:
39  enum type { False, True, EmptyWord };
40  virtual void accept(visitor& v) const;
41 
43  type val() const;
45  const char* val_name() const;
46 
47  virtual std::string dump() const;
48 
50  static constant* true_instance() { return &true_instance_; }
52  static constant* false_instance() { return &false_instance_; }
55 
56  protected:
57  constant(type val);
58  virtual ~constant();
59 
60  private:
62 
66  // If you add new constants here, be sure to update the
67  // formula::formula() constructor.
68  };
69 
70 
75  inline
76  const constant*
77  is_constant(const formula* f)
78  {
79  if (f->kind() != formula::Constant)
80  return 0;
81  return static_cast<const constant*>(f);
82  }
83  }
84 }
85 
86 #endif // SPOT_LTLAST_CONSTANT_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 doxygen 1.8.1.1