Any time we diverge to a new execution path, we should reset the
backtracking information (i.e., which threads have executed and which
still must be backtracked) for the last node in the stack. We cannot
retain the "explored children" state after we have performed different
read-from or future-value divergence in the same node.
return int_to_id(i);
}
+void Node::clear_backtracking()
+{
+ for (unsigned int i = 0; i < backtrack.size(); i++)
+ backtrack[i] = false;
+ for (unsigned int i = 0; i < explored_children.size(); i++)
+ explored_children[i] = false;
+}
+
bool Node::is_enabled(Thread *t) const
{
int thread_id = id_to_int(t->get_id());
for (unsigned int i = it; i < node_list.size(); i++)
delete node_list[i];
node_list.resize(it);
+ node_list.back()->clear_backtracking();
}
Node * NodeStack::get_head() const
/* return true = backtrack set is empty */
bool backtrack_empty() const;
+ void clear_backtracking();
void explore_child(ModelAction *act, enabled_type_t *is_enabled);
/* return false = thread was already in backtrack */
bool set_backtrack(thread_id_t id);