Version that finds the bug of iris
[c11tester.git] / newfuzzer.h
index e94de3387f471a981cb0e5a02fad59171919bbb7..63d88de7318dd96cdce6c9e10ac781e9294f54d9 100644 (file)
@@ -5,6 +5,21 @@
 #include "classlist.h"
 #include "mymemory.h"
 #include "stl-model.h"
+#include "predicate.h"
+
+struct node_dist_info {
+       node_dist_info(thread_id_t tid, FuncNode * node, int distance) : 
+               tid(tid),
+               target(node),
+               dist(distance)
+       {}
+
+       thread_id_t tid;
+       FuncNode * target;
+       int dist;
+
+       SNAPSHOTALLOC
+};
 
 class NewFuzzer : public Fuzzer {
 public:
@@ -32,22 +47,28 @@ private:
        SnapVector<Predicate *> thrd_selected_child_branch;
        SnapVector< SnapVector<ModelAction *> *> thrd_pruned_writes;
 
+       void check_store_visibility(Predicate * curr_pred, FuncInst * read_inst, inst_act_map_t * inst_act_map, SnapVector<ModelAction *> * rf_set);
+       Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst);
        Predicate * get_selected_child_branch(thread_id_t tid);
        bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector<ModelAction *> * rf_set, inst_act_map_t * inst_act_map);
-       Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst);
        int choose_index(SnapVector<Predicate *> * branches, uint32_t numerator);
 
        /* The set of Threads put to sleep by NewFuzzer because no writes in rf_set satisfies the selected predicate. Only used by selectWrite.
         */
-       SnapVector<Thread *> paused_thread_list;
-       HashTable<Thread *, int, uintptr_t, 0> paused_thread_table;
+       SnapVector<Thread *> paused_thread_list;        //-- (not in use)
+       HashTable<Thread *, int, uintptr_t, 0> paused_thread_table;     //--
        HashTable<Predicate *, bool, uintptr_t, 0> failed_predicates;
 
-       void conditional_sleep(Thread * thread);
-       void wake_up_paused_threads(int * threadlist, int * numthreads);
+       SnapVector<struct node_dist_info> dist_info_vec;        //--
+
+       void conditional_sleep(Thread * thread);        //--
+       bool should_conditional_sleep(Predicate * predicate);
+       void wake_up_paused_threads(int * threadlist, int * numthreads);        //--
+
+       bool find_threads(ModelAction * pending_read);  //--
+       /*-- void update_predicate_score(Predicate * predicate, sleep_result_t type); */
 
-       bool find_threads(ModelAction * pending_read);
-       void update_predicate_score(Predicate * predicate, int type);
+       bool check_predicate_expressions(PredExprSet * pred_expressions, inst_act_map_t * inst_act_map, uint64_t write_val, bool * no_predicate);
 };
 
 #endif /* end of __NEWFUZZER_H__ */