X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=predicate.h;h=cc9f714d567208a743876a894fe276bff1aa1b60;hp=97e495de8a1024c6fe2d8e44dff7d93bbaa54d3a;hb=refs%2Fheads%2Fmaster;hpb=25b12680719a51fc81d1681a280e076920dcaabc diff --git a/predicate.h b/predicate.h deleted file mode 100644 index 97e495de..00000000 --- a/predicate.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef __PREDICATE_H__ -#define __PREDICATE_H__ - -#include "hashset.h" -#include "predicatetypes.h" -#include "classlist.h" - -#define MAX_DEPTH 0x7fffffff - -unsigned int pred_expr_hash (struct pred_expr *); -bool pred_expr_equal(struct pred_expr *, struct pred_expr *); -typedef HashSet PredExprSet; -typedef HSIterator PredExprSetIter; - -class Predicate { -public: - Predicate(FuncInst * func_inst, bool is_entry = false, bool is_exit = false); - ~Predicate(); - - FuncInst * get_func_inst() { return func_inst; } - PredExprSet * get_pred_expressions() { return &pred_expressions; } - - void add_predicate_expr(token_t token, FuncInst * func_inst, bool value); - void add_child(Predicate * child); - void set_parent(Predicate * 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); - - Predicate * get_single_child(FuncInst * inst); - ModelVector * 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; } - void set_entry_predicate() { entry_predicate = true; } - - /* Whether func_inst does write or not */ - bool is_write() { return does_write; } - void set_write(bool is_write) { does_write = is_write; } - - ConcretePredicate * evaluate(inst_act_map_t * inst_act_map, thread_id_t tid); - - uint32_t get_expl_count() { return exploration_count; } - uint32_t get_store_visible_count() { return store_visible_count; } - uint32_t get_total_checking_count() { return total_checking_count; } - - void incr_expl_count() { exploration_count++; } - void incr_store_visible_count() { store_visible_count++; } - void incr_total_checking_count() { total_checking_count++; } - - uint32_t get_depth() { return depth; } - void set_depth(uint32_t depth_) { depth = depth_; } - - void print_predicate(); - void print_pred_subtree(); - - MEMALLOC -private: - FuncInst * func_inst; - bool entry_predicate; - bool exit_predicate; - bool does_write; - - /* Height of this predicate node in the predicate tree */ - uint32_t depth; - - uint32_t exploration_count; - uint32_t store_visible_count; - uint32_t total_checking_count; /* The number of times the store visibility is checked */ - - /* May have multiple predicate expressions */ - PredExprSet pred_expressions; - ModelVector children; - - /* Only a single parent may exist */ - Predicate * parent; - Predicate * exit; - - /* May have multiple back edges, e.g. nested loops */ - PredSet backedges; -}; - -#endif /* __PREDICATE_H__ */