spot  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
atomic_prop.hh
Go to the documentation of this file.
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2009, 2012, 2013, 2014 Laboratoire de Recherche et
3 // Développement de l'Epita (LRDE).
4 // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
5 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
6 // et Marie Curie.
7 //
8 // This file is part of Spot, a model checking library.
9 //
10 // Spot is free software; you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation; either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Spot is distributed in the hope that it will be useful, but WITHOUT
16 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 // License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
25 #ifndef SPOT_LTLAST_ATOMIC_PROP_HH
26 # define SPOT_LTLAST_ATOMIC_PROP_HH
27 
28 #include "refformula.hh"
29 #include <string>
30 #include <iosfwd>
31 #include <map>
32 #include "ltlenv/environment.hh"
33 
34 namespace spot
35 {
36  namespace ltl
37  {
38 
41  class SPOT_API atomic_prop : public ref_formula
42  {
43  public:
46  static const atomic_prop*
47  instance(const std::string& name, environment& env);
48 
49  virtual void accept(visitor& visitor) const;
50 
52  const std::string& name() const
53  {
54  return name_;
55  }
56 
58  environment& env() const
59  {
60  return *env_;
61  }
62 
64  virtual std::string dump() const;
65 
67  static unsigned instance_count();
69  static std::ostream& dump_instances(std::ostream& os);
70 
71  protected:
72  atomic_prop(const std::string& name, environment& env);
73  virtual ~atomic_prop();
74 
75  typedef std::pair<std::string, environment*> pair;
76  typedef std::map<pair, const atomic_prop*> map;
77  static map instances;
78 
79  private:
80  std::string name_;
81  environment* env_;
82  };
83 
84  inline
85  const atomic_prop*
86  is_atomic_prop(const formula* f)
87  {
88  if (f->kind() != formula::AtomicProp)
89  return 0;
90  return static_cast<const atomic_prop*>(f);
91  }
92  }
93 }
94 
95 #endif // SPOT_LTLAST_ATOMICPROP_HH

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Sat Dec 6 2014 12:28:43 for spot by doxygen 1.8.4