FuncNode * func_node = func_nodes[func_id];
func_node->add_inst(act);
- if (act->is_read()) {
- // Do nothing
- } else if (act->is_write()) {
- /*
- Predicate * curr_pred = func_node->get_predicate_tree_position(tid);
- FuncInst * curr_inst = func_node->get_inst(act);
-
- if (curr_pred) {
- // Follow child
- curr_pred = curr_pred->follow_write_child(curr_inst);
- }
- func_node->set_predicate_tree_position(tid, curr_pred);
- */
- }
-
func_node->update_tree(act);
last_action = act;
}
// Increment failure count
selected_branch->incr_fail_count();
+ func_node->add_predicate_to_trace(tid, selected_branch); // For updating predicate weight
//model_print("the %d read action of thread %d at %p is unsuccessful\n", read->get_seq_number(), read_thread->get_id(), read->get_location());
delete it;
}
-/* Follow the child if any child whose FuncInst matches with inst
- *
- * @param inst must be an ATOMIC_WRITE FuncInst
- * @return NULL if no such child is found.
- */
-Predicate * Predicate::follow_write_child(FuncInst * inst)
-{
- action_type type = inst->get_type();
- ASSERT(type == ATOMIC_WRITE || type == ATOMIC_INIT);
-
- for (uint i = 0;i < children.size();i++) {
- Predicate * child = children[i];
- if (child->get_func_inst() == inst)
- return child;
- }
-
- return NULL;
-}
-
/* Evaluate predicate expressions against the given inst_act_map */
ConcretePredicate * Predicate::evaluate(thread_id_t tid)
{