Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SPOT_SABAALGOS_SABAREACHITER_HH
00022 # define SPOT_SABAALGOS_SABAREACHITER_HH
00023
00024 #include "misc/hash.hh"
00025 #include "saba/saba.hh"
00026 #include <stack>
00027 #include <deque>
00028
00029 namespace spot
00030 {
00033 class saba_reachable_iterator
00034 {
00035 public:
00036 saba_reachable_iterator(const saba* a);
00037 virtual ~saba_reachable_iterator();
00038
00044 void run();
00045
00053 virtual void add_state(const saba_state* s) = 0;
00055 virtual const saba_state* next_state() = 0;
00057
00060 virtual bool want_state(const saba_state* s) const;
00061
00063 virtual void start();
00065 virtual void end();
00066
00071 virtual void process_state(const saba_state* s, int n);
00072
00082 virtual void
00083 process_state_conjunction(const saba_state* in_s, int in,
00084 const saba_state_conjunction* sc,
00085 int sc_id,
00086 const saba_succ_iterator* si);
00102 virtual void
00103 process_link(const saba_state* in_s, int in,
00104 const saba_state* out_s, int out,
00105 const saba_state_conjunction* sc,
00106 int sc_id,
00107 const saba_succ_iterator* si);
00108
00109 protected:
00110 const saba* automata_;
00111
00112 typedef Sgi::hash_map<const saba_state*, int,
00113 saba_state_ptr_hash, saba_state_ptr_equal> seen_map;
00114 seen_map seen;
00115 };
00116
00120 class saba_reachable_iterator_depth_first : public saba_reachable_iterator
00121 {
00122 public:
00123 saba_reachable_iterator_depth_first(const saba* a);
00124
00125 virtual void add_state(const saba_state* s);
00126 virtual const saba_state* next_state();
00127
00128 protected:
00129 std::stack<const saba_state*> todo;
00130 };
00131
00135 class saba_reachable_iterator_breadth_first : public saba_reachable_iterator
00136 {
00137 public:
00138 saba_reachable_iterator_breadth_first(const saba* a);
00139
00140 virtual void add_state(const saba_state* s);
00141 virtual const saba_state* next_state();
00142
00143 protected:
00144 std::deque<const saba_state*> todo;
00145 };
00146
00147
00148 }
00149
00150
00151 #endif // SPOT_SABAALGOS_SABAREACHITER_HH