add MC2_function call for assignments where RHS computed from loads; tweak tests
[satcheck.git] / cgoal.h
1 /*      Copyright (c) 2015 Regents of the University of California
2  *
3  *      Author: Brian Demsky <bdemsky@uci.edu>
4  *
5  *      This program is free software; you can redistribute it and/or
6  *      modify it under the terms of the GNU General Public License
7  *      version 2 as published by the Free Software Foundation.
8  */
9
10 #ifndef C_GOAL_H
11 #define C_GOAL_H
12 #include "classlist.h"
13 #include "mymemory.h"
14 #include "hashset.h"
15 #include <stdint.h>
16
17 class CGoal {
18  public:
19         CGoal(unsigned int num, uint64_t *vals);
20         ~CGoal();
21         unsigned int getNum() {return num;}
22         uint64_t getValue(unsigned int i) {return valarray[i];}
23         void setOutput(uint64_t _output) { outputvalue=_output;}
24         uint64_t getOutput() {return outputvalue;}
25         void print();
26
27         MEMALLOC;
28  private:
29         uint64_t * valarray;
30         uint64_t outputvalue;
31         unsigned int num;
32         unsigned int hash;
33         
34         friend bool CGoalEquals(CGoal *cg1, CGoal *cg2);
35         friend unsigned int CGoalHash(CGoal *cg);
36 };
37
38 bool CGoalEquals(CGoal *cg1, CGoal *cg2);
39 unsigned int CGoalHash(CGoal *cg);
40
41 typedef HashSet<CGoal *, uintptr_t, 0, model_malloc, model_calloc, model_free, CGoalHash, CGoalEquals> CGoalSet;
42 typedef HSIterator<CGoal *, uintptr_t, 0, model_malloc, model_calloc, model_free, CGoalHash, CGoalEquals> CGoalIterator;
43
44 #endif