Adding timeout for Alloy interpreter
[satune.git] / src / AlloyEnc / alloyenc.h
1 #ifndef ALLOYENC_H
2 #define ALLOYENC_H
3
4 #include "classlist.h"
5 #include "signatureenc.h"
6 #include <iostream>
7 #include <fstream>
8 using namespace std;
9
10 class AlloyEnc{
11 public:
12         AlloyEnc(CSolver *solver);
13         void encode();
14         int solve();
15         void writeToFile(string str);
16         uint64_t getValue(Element *element);
17         bool getBooleanValue(Boolean *element);
18         ~AlloyEnc();
19 private:
20         void dumpAlloyFooter();
21         void dumpAlloyHeader();
22         inline uint getTimeout();
23         string encodeConstraint(BooleanEdge constraint);
24         int getResult();
25         string encodeBooleanLogic( BooleanLogic *bl);
26         string encodeBooleanVar( BooleanVar *bv);
27         string encodePredicate( BooleanPredicate *bp);
28         string encodeOperatorPredicate(BooleanPredicate *constraint);
29         string processElementFunction(ElementFunction *element, ElementSig *signature);
30         CSolver *csolver;
31         SignatureEnc sigEnc;
32         ofstream output;
33         static const char * alloyFileName;
34         static const char * solutionFile;
35 };
36
37 #endif