X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=predicate.h;h=4c26a9ddb8bace0986dbb54abda505d8090b3969;hb=644f5fcbc3a95a02db9ace6386f782c9d1e6f94d;hp=f787983ff6417d7785be83f42d92be773d2bc27b;hpb=41757c6c33945d547c0afa3b9456009e941540f3;p=c11tester.git diff --git a/predicate.h b/predicate.h index f787983f..4c26a9dd 100644 --- a/predicate.h +++ b/predicate.h @@ -1,37 +1,15 @@ -#ifndef __PREDICTAE_H__ +#ifndef __PREDICATE_H__ #define __PREDICATE_H__ -#include "funcinst.h" #include "hashset.h" +#include "predicatetypes.h" +#include "classlist.h" unsigned int pred_expr_hash (struct pred_expr *); bool pred_expr_equal(struct pred_expr *, struct pred_expr *); typedef HashSet PredExprSet; typedef HSIterator PredExprSetIter; -typedef enum predicate_token { - NOPREDICATE, UNSET, EQUALITY, NULLITY -} token_t; - -/* If token is EQUALITY, then the predicate asserts whether - * this load should read the same value as the last value - * read at memory location specified in predicate_expr. - */ -struct pred_expr { - pred_expr(token_t token, FuncInst * inst, bool value) : - token(token), - func_inst(inst), - value(value) - {} - - token_t token; - FuncInst * func_inst; - bool value; - - MEMALLOC -}; - - class Predicate { public: Predicate(FuncInst * func_inst, bool is_entry = false); @@ -53,6 +31,12 @@ public: 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); + void print_predicate(); void print_pred_subtree(); @@ -60,15 +44,16 @@ public: private: FuncInst * func_inst; bool entry_predicate; + bool does_write; - /* may have multiple predicate expressions */ + /* May have multiple predicate expressions */ PredExprSet pred_expressions; ModelVector children; - /* only a single parent may exist */ + /* Only a single parent may exist */ Predicate * parent; - /* may have multiple back edges, e.g. nested loops */ + /* May have multiple back edges, e.g. nested loops */ PredSet backedges; };