spot  1.2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
automatop.hh
Go to the documentation of this file.
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2008, 2009, 2012, 2013, 2014 Laboratoire de Recherche et
3 // Développement de l'Epita (LRDE)
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 3 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 this program. If not, see <http://www.gnu.org/licenses/>.
19 
22 #ifndef SPOT_LTLAST_AUTOMATOP_HH
23 # define SPOT_LTLAST_AUTOMATOP_HH
24 
25 # include "refformula.hh"
26 # include <vector>
27 # include <iosfwd>
28 # include <map>
29 # include "nfa.hh"
30 
31 namespace spot
32 {
33  namespace ltl
34  {
38  class SPOT_API automatop : public ref_formula
39  {
40  public:
42  typedef std::vector<const formula*> vec;
43 
50  static const automatop*
51  instance(const nfa::ptr nfa, vec* v, bool negated);
52 
53  virtual void accept(visitor& v) const;
54 
56  unsigned size() const
57  {
58  return children_->size();
59  }
60 
64  const formula* nth(unsigned n) const
65  {
66  return (*children_)[n];
67  }
68 
70  const spot::ltl::nfa::ptr get_nfa() const
71  {
72  return nfa_;
73  }
74 
76  bool is_negated() const
77  {
78  return negated_;
79  }
80 
82  std::string dump() const;
83 
85  static unsigned instance_count();
86 
88  static std::ostream& dump_instances(std::ostream& os);
89 
90 
91  protected:
92  typedef std::pair<std::pair<nfa::ptr, bool>, vec*> triplet;
94  struct tripletcmp
95  {
96  bool
97  operator()(const triplet& p1, const triplet& p2) const
98  {
99  if (p1.first.first != p2.first.first)
100  return p1.first.first < p2.first.first;
101  if (p1.first.second != p2.first.second)
102  return p1.first.second < p2.first.second;
103  return *p1.second < *p2.second;
104  }
105  };
106  typedef std::map<triplet, const automatop*, tripletcmp> map;
107  static map instances;
108 
109  automatop(const nfa::ptr, vec* v, bool negated);
110  virtual ~automatop();
111 
112  private:
113  const nfa::ptr nfa_;
114  vec* children_;
115  bool negated_;
116  };
117  }
118 }
119 
120 #endif // SPOT_LTLAST_AUTOMATOP_HH

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Thu May 15 2014 11:04:11 for spot by doxygen 1.8.4