97049e2fefdbb60e733287d5eca0a3a4f80fde32
[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         string encodeConstraint(BooleanEdge constraint);
23         int getResult();
24         string encodeBooleanLogic( BooleanLogic *bl);
25         string encodeBooleanVar( BooleanVar *bv);
26         string encodePredicate( BooleanPredicate *bp);
27         string encodeOperatorPredicate(BooleanPredicate *constraint);
28         string processElementFunction(ElementFunction *element, ElementSig *signature);
29         CSolver *csolver;
30         SignatureEnc sigEnc;
31         ofstream output;
32         static const char * alloyFileName;
33         static const char * solutionFile;
34 };
35
36 #endif