23 #include <spot/kripke/kripke.hh> 30 template<
typename State,
typename SuccIterator,
31 typename StateHash,
typename StateEqual,
38 sys_(sys), tid_(tid), stop_(stop)
41 visited.reserve(2000000);
53 return static_cast<Visitor&
>(*this);
59 State initial = sys_.initial(tid_);
60 if (SPOT_LIKELY(
self().push(initial, dfs_number)))
62 todo.push_back({initial, sys_.succ(initial, tid_)});
63 visited[initial] = ++dfs_number;
65 while (!todo.empty() && !stop_)
67 if (todo.back().it->done())
69 if (SPOT_LIKELY(
self().pop(todo.back().s)))
71 sys_.recycle(todo.back().it, tid_);
78 State dst = todo.back().it->state();
79 auto it = visited.insert({dst, dfs_number+1});
83 if (SPOT_LIKELY(
self().push(dst, dfs_number)))
85 todo.back().it->next();
86 todo.push_back({dst, sys_.succ(dst, tid_)});
91 self().edge(visited[todo.back().s], visited[dst]);
92 todo.back().it->next();
116 std::vector<todo_element> todo;
119 typedef std::unordered_map<
const State, int,
120 StateHash, StateEqual> visited_map;
122 unsigned int dfs_number = 0;
123 unsigned int transitions = 0;
Definition: reachability.hh:110
bool is_a_kripkecube(kripkecube< State, SuccIter > &)
This method allows to ensure (at compile time) if a given parameter is of type kripkecube. It also check if the iterator has the good interface.
Definition: kripke.hh:63
This class is a template representation of a Kripke structure. It is composed of two template paramet...
Definition: kripke.hh:37
This template class provide a sequential reachability of a kripkecube. The algorithm uses a single DF...
Definition: reachability.hh:33