X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=predicate.cc;h=714ebbbbb762748ed50c0ba9a1feba753dd90e6c;hp=09e4739b0882aadc5f7cd5aa9d2aa01383fbeee2;hb=064db08aed92a31adbf00497f4dc4608f5b99857;hpb=cbcd5a166532cd048a90f1ed3eb70adab4a1cfdc;ds=sidebyside diff --git a/predicate.cc b/predicate.cc index 09e4739b..714ebbbb 100644 --- a/predicate.cc +++ b/predicate.cc @@ -9,6 +9,7 @@ Predicate::Predicate(FuncInst * func_inst, bool is_entry, bool is_exit) : does_write(false), exploration_count(0), failure_count(0), + sleep_score(0), pred_expressions(16), children(), parent(NULL), @@ -97,6 +98,32 @@ ConcretePredicate * Predicate::evaluate(inst_act_map_t * inst_act_map, thread_id return concrete; } +void Predicate::incr_expl_count() +{ + exploration_count++; +} + +void Predicate::incr_fail_count() +{ + failure_count++; +} + +void Predicate::incr_sleep_score(uint32_t amount) +{ + if (sleep_score + amount > 100) + sleep_score = 100; + else + sleep_score += amount; +} + +void Predicate::decr_sleep_score(uint32_t amount) +{ + if (sleep_score > amount) + sleep_score -= amount; + else + sleep_score = 0; +} + void Predicate::print_predicate() { model_print("\"%p\" [shape=box, label=\"\n", this);