22 #include <spot/twa/acc.hh> 23 #include <spot/mc/unionfind.hh> 24 #include <spot/mc/intersect.hh> 33 template<
typename State,
typename SuccIterator,
34 typename StateHash,
typename StateEqual>
36 StateHash, StateEqual,
37 ec_renault13lpar<State, SuccIterator,
38 StateHash, StateEqual>>
41 using typename intersect<State, SuccIterator, StateHash, StateEqual,
44 StateEqual>>::product_state;
48 twacube_ptr
twa,
unsigned tid,
bool stop)
49 :
intersect<State, SuccIterator, StateHash, StateEqual,
51 StateHash, StateEqual>>(sys, twa, tid, stop),
52 acc_(twa->acc()), sccs_(0
U)
75 roots_.push_back({dfsnum, cond, 0
U});
86 bool pop_state(product_state,
unsigned top_dfsnum,
bool,
87 product_state,
unsigned)
89 if (top_dfsnum == roots_.back().dfsnum)
93 uf_.markdead(top_dfsnum);
95 dfs_ = this->todo.size() > dfs_ ? this->todo.size() : dfs_;
102 product_state,
unsigned dst_dfsnum,
105 if (uf_.isdead(dst_dfsnum))
108 while (!uf_.sameset(dst_dfsnum, roots_.back().dfsnum))
110 auto& el = roots_.back();
112 uf_.unite(dst_dfsnum, el.dfsnum);
113 cond |= el.acc | el.ingoing;
115 roots_.back().acc |= cond;
116 found_ = acc_.accepting(roots_.back().acc);
117 if (SPOT_UNLIKELY(found_))
122 bool counterexample_found()
129 SPOT_ASSERT(counterexample_found());
130 std::string res =
"Prefix:\n";
133 for (
auto& s : this->todo)
134 res +=
" " + std::to_string(s.st.st_prop) +
135 +
"*" + this->sys_.to_string(s.st.st_kripke) +
"\n";
142 const product_state* prod_st;
143 ctrx_element* parent_st;
144 SuccIterator* it_kripke;
145 std::shared_ptr<trans_index> it_prop;
147 std::queue<ctrx_element*> bfs;
151 bfs.push(
new ctrx_element({&this->todo.back().st,
nullptr,
152 this->sys_.succ(this->todo.back().st.st_kripke, this->tid_),
153 this->twa_->succ(this->todo.back().st.st_prop)}));
157 auto* front = bfs.front();
160 while (!front->it_kripke->done())
162 while (!front->it_prop->done())
164 if (this->twa_->get_cubeset().intersect
165 (this->twa_->trans_data(front->it_prop, this->tid_).cube_,
166 front->it_kripke->condition()))
168 const product_state dst = {
169 front->it_kripke->state(),
170 this->twa_->trans_storage(front->it_prop).dst
174 auto it = this->map.find(dst);
175 if (it == this->map.end() ||
176 !uf_.sameset(it->second,
177 this->map[this->todo.back().st]))
179 front->it_prop->next();
186 auto mark = this->twa_->trans_data(front->it_prop,
190 ctrx_element* current = front;
191 while (current !=
nullptr)
195 std::to_string(current->prod_st->st_prop) +
197 this->sys_. to_string(current->prod_st
200 current = current->parent_st;
206 auto* e = bfs.front();
213 if (this->twa_->acc().accepting(acc))
216 const product_state* q = &(it->first);
217 ctrx_element* root =
new ctrx_element({
219 this->sys_.succ(q->st_kripke, this->tid_),
220 this->twa_->succ(q->st_prop)
227 const product_state* q = &(it->first);
228 ctrx_element* root =
new ctrx_element({
230 this->sys_.succ(q->st_kripke, this->tid_),
231 this->twa_->succ(q->st_prop)
235 front->it_prop->next();
237 front->it_prop->reset();
238 front->it_kripke->next();
246 virtual istats stats()
override 248 return {this->states(), this->trans(), sccs_,
249 (unsigned) roots_.size(), dfs_, found_};
256 struct root_element {
263 std::vector<root_element> roots_;
void setup()
This method is called at the begining of the exploration. here we do not need to setup any informatio...
Definition: ec.hh:63
bool update(product_state, unsigned, product_state, unsigned dst_dfsnum, acc_cond::mark_t cond)
This method is called for every closing, back, or forward edge. Return true if a counterexample has b...
Definition: ec.hh:101
A Transition-based ω-Automaton.
Definition: twa.hh:622
This class explores (with a DFS) a product between a system and a twa. This exploration is performed ...
Definition: intersect.hh:59
This class is a template representation of a Kripke structure. It is composed of two template paramet...
Definition: kripke.hh:37
bool pop_state(product_state, unsigned top_dfsnum, bool, product_state, unsigned)
This method is called to notify the emptiness checks that a state will be popped. If the method retur...
Definition: ec.hh:86
This Union-Find data structure is a particular union-find, dedicated for emptiness checks below...
Definition: unionfind.hh:33
This class implements the sequential emptiness check as presented in "Three SCC-based Emptiness Check...
Definition: ec.hh:35
Wrapper to accumulate results from intersection and emptiness checks.
Definition: intersect.hh:30
bool push_state(product_state, unsigned dfsnum, acc_cond::mark_t cond)
This method is called to notify the emptiness checks that a new state has been discovered. If this method return false, the state will not be explored. The parameter dfsnum specify an unique id for the state s. Parameter cond represents The value on the ingoing edge to s.
Definition: ec.hh:72