spot  1.99.3
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
kripkeexplicit.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 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 
20 #pragma once
21 
22 #include <iosfwd>
23 #include "kripke.hh"
24 #include "ltlast/formula.hh"
25 #include "kripkeprint.hh"
26 
27 namespace spot
28 {
30  class SPOT_API state_kripke : public state
31  {
32  friend class kripke_explicit;
33  friend class kripke_explicit_succ_iterator;
34  private:
35  state_kripke();
36 
45  virtual int compare (const state* other) const;
46 
48  virtual size_t hash() const;
49 
51  virtual state_kripke* clone() const;
52 
55  void add_conditions(bdd f);
56 
59  void add_succ(state_kripke* succ);
60 
61  virtual bdd
62  as_bdd() const
63  {
64  return bdd_;
65  }
66 
69  virtual void
70  destroy() const
71  {
72  }
73 
74  virtual
75  ~state_kripke ()
76  {
77  }
78 
80  // Management for succ_iterator
81 
82  const std::list<state_kripke*>& get_succ() const;
83 
84  bdd bdd_;
85  std::list<state_kripke*> succ_;
86  };
87 
88 
92  {
93  public:
95 
97 
98  virtual bool first();
99  virtual bool next();
100  virtual bool done() const;
101 
102  virtual state_kripke* current_state() const;
103 
104  private:
105  const state_kripke* s_;
106  std::list<state_kripke*>::const_iterator it_;
107  };
108 
109 
112  class SPOT_API kripke_explicit : public kripke
113  {
114  public:
115  kripke_explicit(const bdd_dict_ptr&, state_kripke* = nullptr);
116  ~kripke_explicit();
117 
118  state_kripke* get_init_state() const;
119 
123  succ_iter(const spot::state* state) const;
124 
126  bdd state_condition(const state* s) const;
128  bdd state_condition(const std::string&) const;
129 
131  std::string format_state(const state*) const;
132 
133 
137  void add_state(std::string);
138 
140  void add_transition(std::string source,
141  std::string dest);
142 
147  void add_conditions(bdd add,
148  std::string on_me);
149 
154  void add_condition(const ltl::formula* f,
155  std::string on_me);
156 
158  const std::map<const state_kripke*, std::string>&
159  sn_get() const;
160 
161  private:
163  void add_state(std::string, state_kripke*);
164 
165  void add_conditions(bdd add,
166  state_kripke* on_me);
167 
168  void add_transition(std::string source,
169  const state_kripke* dest);
170 
171  void add_transition(state_kripke* source,
172  const state_kripke* dest);
173 
174  state_kripke* init_;
175  std::map<const std::string, state_kripke*> ns_nodes_;
176  std::map<const state_kripke*, std::string> sn_nodes_;
177  };
178 
179  inline kripke_explicit_ptr
180  make_kripke_explicit(const bdd_dict_ptr& d,
181  state_kripke* init = nullptr)
182  {
183  return std::make_shared<kripke_explicit>(d, init);
184  }
185 }
Definition: public.hh:31
Interface for a Kripke structure.
Definition: kripke.hh:91
Concrete class for kripke states.
Definition: kripkeexplicit.hh:30
LTL formula interface.
Abstract class for states.
Definition: twa.hh:40
Iterator code for Kripke structure.
Definition: kripke.hh:43
Kripke Structure.
Definition: kripkeexplicit.hh:112
Implement iterator pattern on successor of a state_kripke.
Definition: kripkeexplicit.hh:91
An LTL formula.
Definition: formula.hh:71

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Wed Aug 26 2015 08:42:37 for spot by doxygen 1.8.8