X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=predicate.h;h=42511c609cb5a8907b7bda7d740047c4f3b0387d;hp=e2412d186705e079e60dabe68762b085af1245b8;hb=e9e6aaed0177ca95f216a59a284464262c835c3c;hpb=729acbffd2562f10dd1864b010c3623faa485513;ds=inline diff --git a/predicate.h b/predicate.h index e2412d18..42511c60 100644 --- a/predicate.h +++ b/predicate.h @@ -1,5 +1,12 @@ +#ifndef __PREDICTAE_H__ +#define __PREDICATE_H__ + #include "funcinst.h" +unsigned int pred_expr_hash (struct pred_expr *); +bool pred_expr_equal(struct pred_expr *, struct pred_expr *); +typedef HashSet PredicateSet; + typedef enum predicate_token { EQUALITY, NULLITY } token_t; @@ -8,24 +15,28 @@ typedef enum predicate_token { * this load should read the same value as the last value * read at memory location specified in predicate_expr. */ -struct predicate_expr { +struct pred_expr { token_t token; void * location; bool value; }; + class Predicate { public: - Predicate(); + Predicate(FuncInst * func_inst); ~Predicate(); FuncInst * get_func_inst() { return func_inst; } - ModelList * get_predicates() { return &predicates; } - void add_predicate(predicate_expr predicate); + PredicateSet * get_predicates() { return &predicates; } + void add_predicate(token_t token, void * location, bool value); MEMALLOC private: FuncInst * func_inst; /* may have multiple precicates */ - ModelList predicates; + PredicateSet predicates; + ModelVector children; }; + +#endif /* __PREDICATE_H__ */