move write_history to funcnode.cc and do experiment
[c11tester.git] / predicate.h
1 #include "funcinst.h"
2
3 typedef enum predicate_token {
4         EQUALITY, NULLITY
5 } token_t;
6
7 /* If token is EQUALITY, then the predicate asserts whether
8  * this load should read the same value as the last value 
9  * read at memory location specified in predicate_expr.
10  */
11 struct predicate_expr {
12         token_t token;
13         void * location;
14         bool value;
15 };
16
17 class Predicate {
18 public:
19         Predicate();
20         ~Predicate();
21
22         FuncInst * get_func_inst() { return func_inst; }
23         ModelList<predicate_expr> * get_predicates() { return &predicates; }
24         void add_predicate(predicate_expr predicate);
25
26         MEMALLOC
27 private:
28         FuncInst * func_inst;
29         /* may have multiple precicates */
30         ModelList<predicate_expr> predicates;
31 };