atomic_prop.hh 2.31 KB
Newer Older
1
// Copyright (C) 2003, 2004  Laboratoire d'Informatique de Paris 6 (LIP6),
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Spot; see the file COPYING.  If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.

22
23
/// \file ltlast/atomic_prop.hh
/// \brief LTL atomic propositions
24
25
26
27
#ifndef SPOT_LTLAST_ATOMIC_PROP_HH
# define SPOT_LTLAST_ATOMIC_PROP_HH

#include <string>
28
#include <iosfwd>
29
30
#include <map>
#include "refformula.hh"
31
#include "ltlenv/environment.hh"
32
33
34
35
36

namespace spot
{
  namespace ltl
  {
37
38

    /// Atomic propositions.
39
    class atomic_prop : public ref_formula
40
41
    {
    public:
42
      /// Build an atomic proposition with name \a name in
43
      /// environment \a env.
44
      static atomic_prop* instance(const std::string& name, environment& env);
45
46
47
48

      virtual void accept(visitor& visitor);
      virtual void accept(const_visitor& visitor) const;

49
      /// Get the name of the atomic proposition.
50
      const std::string& name() const;
51
      /// Get the environment of the atomic proposition.
52
      environment& env() const;
53
54
55

      /// Number of instantiated atomic propositions.  For debugging.
      static unsigned instance_count();
56
57
      /// List all instances of atomic propositions.  For debugging.
      static std::ostream& dump_instances(std::ostream& os);
58

59
60
61
62
63
64
65
66
    protected:
      atomic_prop(const std::string& name, environment& env);
      virtual ~atomic_prop();

      typedef std::pair<std::string, environment*> pair;
      typedef std::map<pair, atomic_prop*> map;
      static map instances;

67
68
    private:
      std::string name_;
69
      environment* env_;
70
71
72
73
74
75
    };

  }
}

#endif // SPOT_LTLAST_ATOMICPROP_HH