-#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<struct pred_expr *, uintptr_t, 0, model_malloc, model_calloc, model_free, pred_expr_hash, pred_expr_equal> PredExprSet;
typedef HSIterator<struct pred_expr *, uintptr_t, 0, model_malloc, model_calloc, model_free, pred_expr_hash, pred_expr_equal> PredExprSetIter;
-typedef enum predicate_token {
- NOPREDICATE, 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
-};
-
-/* Used by predicate generator */
-struct half_pred_expr {
- half_pred_expr(token_t token, FuncInst * inst) :
- token(token),
- func_inst(inst)
- {}
-
- token_t token;
- FuncInst * func_inst;
-
- SNAPSHOTALLOC
-};
-
-struct concrete_pred_expr {
- concrete_pred_expr(token_t token, uint64_t value, bool equality) :
- token(token),
- value(value),
- equality(equality)
- {}
-
- token_t token;
- uint64_t value;
- bool equality;
-
- SNAPSHOTALLOC
-};
-
class Predicate {
public:
Predicate(FuncInst * func_inst, bool is_entry = false);
bool is_write() { return does_write; }
void set_write(bool is_write) { does_write = is_write; }
- SnapVector<struct concrete_pred_expr> evaluate(inst_act_map_t * inst_act_map);
+ ConcretePredicate * evaluate(inst_act_map_t * inst_act_map, thread_id_t tid);
void print_predicate();
void print_pred_subtree();