Edits
[c11tester.git] / newfuzzer.h
index ea08b74171a3fcae302679aad8182cccc8d05bd0..45a7e8bbe91f44f867e22958502491ffb64b4fa6 100644 (file)
@@ -8,7 +8,7 @@
 #include "predicate.h"
 
 struct node_dist_info {
-       node_dist_info(thread_id_t tid, FuncNode * node, int distance) : 
+       node_dist_info(thread_id_t tid, FuncNode * node, int distance) :
                tid(tid),
                target(node),
                dist(distance)
@@ -34,7 +34,8 @@ public:
        bool shouldWake(const ModelAction * sleep);
        bool shouldWait(const ModelAction * wait);
 
-       void register_engine(ModelHistory * history, ModelExecution * execution);
+       void register_engine(ModelChecker * model, ModelExecution * execution);
+       Predicate * get_selected_child_branch(thread_id_t tid);
 
        SNAPSHOTALLOC
 private:
@@ -44,31 +45,26 @@ private:
        SnapVector<ModelAction *> thrd_last_read_act;
        SnapVector<FuncInst *> thrd_last_func_inst;
 
+       SnapVector<Predicate *> available_branches_tmp_storage;
        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);
+       bool check_branch_inst(Predicate * curr_pred, FuncInst * read_inst, 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);
-       int choose_index(SnapVector<Predicate *> * branches, uint32_t numerator);
+       bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector<ModelAction *> * rf_set);
+       int choose_branch_index(SnapVector<Predicate *> * branches);
 
        /* 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;
-       HashTable<Predicate *, bool, uintptr_t, 0> failed_predicates;
-
-       SnapVector<struct node_dist_info> dist_info_vec;
+       SnapVector<Thread *> paused_thread_list;        //-- (not in use)
+       HashTable<Thread *, int, uintptr_t, 0> paused_thread_table;     //--
 
-       void conditional_sleep(Thread * thread);
-       bool should_conditional_sleep(Predicate * predicate);
-       void wake_up_paused_threads(int * threadlist, int * numthreads);
+       SnapVector<struct node_dist_info> dist_info_vec;        //--
 
-       bool find_threads(ModelAction * pending_read);
-       /*-- void update_predicate_score(Predicate * predicate, sleep_result_t type); */
+       void conditional_sleep(Thread * thread);        //--
+       void wake_up_paused_threads(int * threadlist, int * numthreads);        //--
 
-       bool check_predicate_expressions(PredExprSet * pred_expressions, inst_act_map_t * inst_act_map, uint64_t write_val, bool * no_predicate);
+       bool find_threads(ModelAction * pending_read);  //--
 };
 
-#endif /* end of __NEWFUZZER_H__ */
+#endif /* end of __NEWFUZZER_H__ */