spot  1.99.4
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
kripkeexplicit.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 2012, 2013, 2014, 2015 Laboratoire de Recherche
3 // et 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 "tl/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(formula f, std::string on_me);
155 
157  const std::map<const state_kripke*, std::string>&
158  sn_get() const;
159 
160  private:
162  void add_state(std::string, state_kripke*);
163 
164  void add_conditions(bdd add,
165  state_kripke* on_me);
166 
167  void add_transition(std::string source,
168  const state_kripke* dest);
169 
170  void add_transition(state_kripke* source,
171  const state_kripke* dest);
172 
173  state_kripke* init_;
174  std::map<const std::string, state_kripke*> ns_nodes_;
175  std::map<const state_kripke*, std::string> sn_nodes_;
176  };
177 
178  inline kripke_explicit_ptr
179  make_kripke_explicit(const bdd_dict_ptr& d,
180  state_kripke* init = nullptr)
181  {
182  return std::make_shared<kripke_explicit>(d, init);
183  }
184 }
Definition: graph.hh:31
Interface for a Kripke structure.
Definition: kripke.hh:91
Concrete class for kripke states.
Definition: kripkeexplicit.hh:30
LTL/PSL formula interface.
Abstract class for states.
Definition: twa.hh:42
Iterator code for Kripke structure.
Definition: kripke.hh:43
Main class for temporal logic formula.
Definition: formula.hh:574
Kripke Structure.
Definition: kripkeexplicit.hh:112
Implement iterator pattern on successor of a state_kripke.
Definition: kripkeexplicit.hh:91

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Thu Oct 1 2015 05:49:14 for spot by doxygen 1.8.8