-
Notifications
You must be signed in to change notification settings - Fork 0
/
SmodelsBridge.h
27 lines (24 loc) · 985 Bytes
/
SmodelsBridge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef SMODELSBRIDGE_H
#define SMODELSBRIDGE_H
#include "Bridge.h"
class SmodelsBridge: public Bridge {
public:
SmodelsBridge(char* s) : maxLiteral(0), smodelsExecPath(s) {};
std::unordered_set<Literal> getAnswerSet(const Program &p);
bool existsAnswerSet(const Program &p);
private:
Literal nameToLiteral(const char *) const;
void countLiterals(const Program &p);
void countLiterals(const BasicRule *);
void countLiterals(const ChoiceRule *);
void countLiterals(const WeightRule *);
void countLiterals(const ConstraintRule *);
void createSmodelsProgram(stringstream &smodelsProgram, const Program &p);
void createSmodelsRule(stringstream &, const BasicRule *);
void createSmodelsRule(stringstream &, const ChoiceRule *);
void createSmodelsRule(stringstream &, const WeightRule *);
void createSmodelsRule(stringstream &, const ConstraintRule *);
Literal maxLiteral;
char *smodelsExecPath;
};
#endif //SMODELSBRIDGE_H