spot  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
constant.hh
Go to the documentation of this file.
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2009, 2010, 2012, 2013 Laboratoire de Recherche et
3 // Développement de l'Epita (LRDE).
4 // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
5 //
6 // This file is part of Spot, a model checking library.
7 //
8 // Spot is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // Spot is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 // License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
23 #ifndef SPOT_LTLAST_CONSTANT_HH
24 # define SPOT_LTLAST_CONSTANT_HH
25 
26 #include "formula.hh"
27 
28 namespace spot
29 {
30  namespace ltl
31  {
32 
35  class SPOT_API constant : public formula
36  {
37  public:
38  enum type { False, True, EmptyWord };
39  virtual void accept(visitor& v) const;
40 
42  type val() const;
44  const char* val_name() const;
45 
46  virtual std::string dump() const;
47 
49  static constant* true_instance() { return &true_instance_; }
51  static constant* false_instance() { return &false_instance_; }
53  static constant* empty_word_instance() { return &empty_word_instance_; }
54 
55  protected:
56  constant(type val);
57  virtual ~constant();
58 
59  private:
60  type val_;
61 
62  static constant true_instance_;
63  static constant false_instance_;
64  static constant empty_word_instance_;
65  // If you add new constants here, be sure to update the
66  // formula::formula() constructor.
67  };
68 
69 
74  inline
75  const constant*
76  is_constant(const formula* f)
77  {
78  if (f->kind() != formula::Constant)
79  return 0;
80  return static_cast<const constant*>(f);
81  }
82  }
83 }
84 
85 #endif // SPOT_LTLAST_CONSTANT_HH

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Wed Dec 11 2013 10:35:46 for spot by doxygen 1.8.4