23 #include <spot/kripke/kripke.hh> 24 #include <spot/graph/graph.hh> 65 virtual size_t hash()
const override 68 reinterpret_cast<const char*
>(
this) - static_cast<const char*>(
nullptr);
99 typedef typename Graph::edge edge;
100 typedef typename Graph::state_data_t state;
106 const typename Graph::state_storage_t* s):
117 void recycle(
const typename Graph::state_storage_t* s)
131 p_ = g_->edge_storage(p_).next_succ;
135 virtual bool done()
const override 142 SPOT_ASSERT(!done());
144 (&g_->state_data(g_->edge_storage(p_).dst));
158 mutable unsigned init_number_;
161 :
kripke(d), init_number_(0)
167 get_dict()->unregister_all_my_variables(
this);
170 unsigned num_states()
const 175 unsigned num_edges()
const 180 void set_init_state(graph_t::state s)
182 if (SPOT_UNLIKELY(s >= num_states()))
183 throw std::invalid_argument
184 (
"set_init_state() called with nonexisiting state");
188 graph_t::state get_init_state_number()
const 191 if (num_states() == 0)
192 throw std::runtime_error(
"kripke has no state at all");
198 return state_from_number(get_init_state_number());
209 if (this->iter_cache_)
214 this->iter_cache_ =
nullptr;
222 state_number(
const state* st)
const 229 state_from_number(graph_t::state n)
const 235 state_from_number(graph_t::state n)
240 std::string format_state(
unsigned n)
const 242 std::stringstream ss;
249 return format_state(state_number(st));
259 edge_storage_t& edge_storage(
unsigned t)
264 const edge_storage_t edge_storage(
unsigned t)
const 269 unsigned new_state(bdd cond)
274 unsigned new_states(
unsigned n, bdd cond)
279 unsigned new_edge(
unsigned src,
unsigned dst)
285 typedef std::shared_ptr<kripke_graph> kripke_graph_ptr;
287 inline kripke_graph_ptr
288 make_kripke_graph(
const bdd_dict_ptr& d)
290 return std::make_shared<kripke_graph>(d);
state new_states(unsigned n, Args &&... args)
Create n new states.
Definition: graph.hh:696
virtual bdd cond() const override
Get the condition on the edge leading to this successor.
Definition: automata.hh:26
virtual kripke_graph_state * clone() const override
Duplicate a state.
Definition: kripkegraph.hh:72
Kripke Structure.
Definition: kripkegraph.hh:151
virtual kripke_graph_state * dst() const override
Get the destination state of the current edge.
Definition: kripkegraph.hh:140
Interface for a Kripke structure.
Definition: kripke.hh:90
state new_state(Args &&... args)
Create a new states.
Definition: graph.hh:682
Abstract class for states.
Definition: twa.hh:50
Iterator code for Kripke structure.
Definition: kripke.hh:43
Concrete class for kripke_graph states.
Definition: kripkegraph.hh:30
virtual bool next() override
Jump to the next successor (if any).
Definition: kripkegraph.hh:129
edge_storage_t & edge_storage(edge s)
return a reference to the storage of an edge
Definition: graph.hh:747
edge new_edge(state src, state dst, Args &&... args)
Create a new edge.
Definition: graph.hh:784
state_storage_t::data_t & state_data(state s)
return the State_Data associated to a state
Definition: graph.hh:729
virtual size_t hash() const override
Hash a state.
Definition: kripkegraph.hh:65
state_storage_t & state_storage(state s)
return a reference to the storage of a state
Definition: graph.hh:711
virtual void destroy() const override
Release a state.
Definition: kripkegraph.hh:77
virtual bool first() override
Position the iterator on the first successor (if any).
Definition: kripkegraph.hh:123
unsigned num_states() const
The number of states in the automaton.
Definition: graph.hh:645
unsigned num_edges() const
The number of edges in the automaton.
Definition: graph.hh:653
bool is_valid_edge(edge t) const
Test whether the given edge is valid.
Definition: graph.hh:981
virtual bdd state_condition(const state *s) const override
Get the condition on the state.
Definition: kripkegraph.hh:253
virtual bool done() const override
Check whether the iteration is finished.
Definition: kripkegraph.hh:135
virtual kripke_graph_succ_iterator< graph_t > * succ_iter(const spot::state *st) const override
Allow to get an iterator on the state we passed in parameter.
Definition: kripkegraph.hh:204
virtual const kripke_graph_state * get_init_state() const override
Get the initial state of the automaton.
Definition: kripkegraph.hh:196
virtual int compare(const spot::state *other) const override
Compares two states (that come from the same automaton).
Definition: kripkegraph.hh:53
virtual std::string format_state(const state *st) const override
Format the state as a string for printing.
Definition: kripkegraph.hh:247
Definition: kripkegraph.hh:96