Fix bug
[c11tester.git] / predicate.h
index 1600cc8a9f5f7e26d628ef17b155e775a40b657a..6a35fcc406f207e6c1daefe3a3992cdf34ab6e76 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __PREDICATE_H__
 #define __PREDICATE_H__
 
-#include "funcinst.h"
 #include "hashset.h"
 #include "predicatetypes.h"
 #include "classlist.h"
@@ -13,7 +12,7 @@ typedef HSIterator<struct pred_expr *, uintptr_t, 0, model_malloc, model_calloc,
 
 class Predicate {
 public:
-       Predicate(FuncInst * func_inst, bool is_entry = false);
+       Predicate(FuncInst * func_inst, bool is_entry = false, bool is_exit = false);
        ~Predicate();
 
        FuncInst * get_func_inst() { return func_inst; }
@@ -22,11 +21,13 @@ public:
        void add_predicate_expr(token_t token, FuncInst * func_inst, bool value);
        void add_child(Predicate * child);
        void set_parent(Predicate * parent_pred) { parent = parent_pred; }
+       void set_exit(Predicate * exit_pred) { exit = exit_pred; }
        void add_backedge(Predicate * back_pred) { backedges.add(back_pred); }
        void copy_predicate_expr(Predicate * other);
 
        ModelVector<Predicate *> * get_children() { return &children; }
        Predicate * get_parent() { return parent; }
+       Predicate * get_exit() { return exit; }
        PredSet * get_backedges() { return &backedges; }
 
        bool is_entry_predicate() { return entry_predicate; }
@@ -38,6 +39,11 @@ public:
 
        ConcretePredicate * evaluate(inst_act_map_t * inst_act_map, thread_id_t tid);
 
+       uint32_t get_expl_count() { return exploration_count; }
+       uint32_t get_fail_count() { return failure_count; }
+       void incr_expl_count() { exploration_count++; }
+       void incr_fail_count() { failure_count++; }
+
        void print_predicate();
        void print_pred_subtree();
 
@@ -45,7 +51,10 @@ public:
 private:
        FuncInst * func_inst;
        bool entry_predicate;
+       bool exit_predicate;
        bool does_write;
+       uint32_t exploration_count;
+       uint32_t failure_count;
 
        /* May have multiple predicate expressions */
        PredExprSet pred_expressions;
@@ -53,6 +62,7 @@ private:
 
        /* Only a single parent may exist */
        Predicate * parent;
+       Predicate * exit;
 
        /* May have multiple back edges, e.g. nested loops */
        PredSet backedges;