--- /dev/null
+/**
+ * @file predicatetypes.h
+ * @brief Define common predicate expression types
+ */
+
+#ifndef __PREDICATE_TYPES_H__
+#define __PREDICATE_TYPES_H__
+
+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 FuncNode to generate Predicates */
+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
+};
+
+#endif /* __PREDICATE_TYPES_H__ */
+
#include "execution.h"
#include "funcnode.h"
#include "schedule.h"
+#include "concretepredicate.h"
NewFuzzer::NewFuzzer() :
thrd_last_read_act(),
/* Notify one of conditional sleeping threads if the desired write is available */
bool NewFuzzer::notify_conditional_sleep(Thread * thread)
{
-
+
}
bool NewFuzzer::shouldWait(const ModelAction * act)
-#ifndef __PREDICTAE_H__
+#ifndef __PREDICATE_H__
#define __PREDICATE_H__
#include "funcinst.h"
#include "hashset.h"
+#include "predicatetypes.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);