atomic_prop.hh 2.34 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
39
    /// \brief Atomic propositions.
    /// \ingroup ltl_ast
40
    class atomic_prop : public ref_formula
41
42
    {
    public:
43
      /// Build an atomic proposition with name \a name in
44
      /// environment \a env.
45
      static atomic_prop* instance(const std::string& name, environment& env);
46
47
48
49

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

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

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

60
61
62
63
64
65
66
67
    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;

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

  }
}

#endif // SPOT_LTLAST_ATOMICPROP_HH